ReplyLayer Attachments API

The attachments API from ReplyLayer — 4 operation(s) for attachments.

GitHub OpenAPI

Operations 5

POST /v1/attachments Stage an outbound attachment #
DELETE /v1/attachments/{id} Delete a staged attachment handle #
GET /v1/attachments/{id} Get a staged attachment handle #
GET /v1/messages/{id}/attachments/{idx} Get inbound attachment metadata #
GET /v1/messages/{id}/attachments/{idx}/preview Get a derived attachment preview #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/replylayer-ai:replylayer-ai-attachments-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

replylayer-ai-attachments-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  description: 'The ReplyLayer REST API for AI agents — send, receive, read, and reply to email with built-in security scanning. Authenticate with an API key (`Authorization: Bearer rly_live_.`). This is the customer contract only; operator/admin endpoints and the session-cookie dashboard surface are not part of this spec.'
  title: ReplyLayer Attachments API
  version: 1.0.0
servers:
- description: Production
  url: https://api.replylayer.ai
security:
- BearerApiKey: []
tags:
- name: Attachments
paths:
  /v1/attachments:
    post:
      operationId: postV1Attachments
      requestBody:
        content:
          multipart/form-data:
            schema:
              properties:
                file:
                  description: The attachment bytes.
                  format: binary
                  type: string
                mailbox_id:
                  description: Target mailbox name or id.
                  type: string
              required:
              - mailbox_id
              - file
              type: object
        required: true
      responses:
        '201':
          content:
            application/json:
              schema:
                properties:
                  content_scan_status:
                    enum:
                    - pending
                    - clean
                    - flagged
                    - error
                    type: string
                  content_type:
                    type: string
                  filename:
                    type: string
                  hash:
                    type: string
                  id:
                    type: string
                  scan:
                    properties:
                      categories:
                        items:
                          properties:
                            category:
                              type: string
                            decision:
                              enum:
                              - allow
                              - allow_with_warning
                              - quarantine
                              - require_human_approval
                              - block
                              type: string
                          required:
                          - category
                          - decision
                          type: object
                        type: array
                      findings:
                        items:
                          properties:
                            agent_instructions:
                              items:
                                type: string
                              type: array
                            attachment_filename:
                              type: string
                            attachment_index:
                              minimum: 0
                              type: integer
                            attachment_policy_action:
                              enum:
                              - quarantine_message
                              - metadata_only_after_rewrite
                              - derived_text_finding
                              type: string
                            category:
                              type: string
                            decision:
                              enum:
                              - allow
                              - allow_with_warning
                              - quarantine
                              - require_human_approval
                              - block
                              type: string
                            expires_at:
                              format: date-time
                              type: string
                            failure_class:
                              enum:
                              - inference_error
                              - model_judgment
                              type: string
                            pii_type:
                              enum:
                              - ssn
                              - credit_card
                              - phone_number
                              type: string
                            reason:
                              type:
                              - string
                              - 'null'
                            retryable:
                              type: boolean
                            subtype:
                              type: string
                            warning:
                              properties:
                                affected_urls:
                                  items:
                                    type: string
                                  type: array
                                attribution_text:
                                  type: string
                                attribution_url:
                                  type: string
                                learn_more:
                                  items:
                                    properties:
                                      threat_type:
                                        enum:
                                        - MALWARE
                                        - SOCIAL_ENGINEERING
                                        - UNWANTED_SOFTWARE
                                        - SOCIAL_ENGINEERING_EXTENDED_COVERAGE
                                        type: string
                                      url:
                                        type: string
                                    required:
                                    - threat_type
                                    - url
                                    type: object
                                  type: array
                                qualified_wording:
                                  type: string
                              required:
                              - qualified_wording
                              - attribution_text
                              - attribution_url
                              - learn_more
                              - affected_urls
                              type: object
                          required:
                          - category
                          - decision
                          - reason
                          type: object
                        type: array
                      verdict:
                        enum:
                        - clean
                        - warning
                        - review_required
                        - blocked
                        - quarantined
                        type: string
                    required:
                    - verdict
                    - categories
                    - findings
                    type:
                    - object
                    - 'null'
                  size:
                    type: integer
                required:
                - id
                - filename
                - content_type
                - size
                - hash
                - content_scan_status
                type: object
          description: Created
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: Validation error
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Missing or invalid API key (code: UNAUTHORIZED)'
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: Forbidden
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: Not found
        '429':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: Rate limited
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Internal error (code: INTERNAL_ERROR)'
      summary: Stage an outbound attachment
      tags:
      - Attachments
  /v1/attachments/{id}:
    delete:
      operationId: deleteV1AttachmentsById
      parameters:
      - in: path
        name: id
        required: true
        schema:
          format: uuid
          type: string
      responses:
        '204':
          description: No content
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: Validation error
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Missing or invalid API key (code: UNAUTHORIZED)'
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: Not found
        '409':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: Conflict
        '429':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Rate limited (code: RATE_LIMITED)'
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Internal error (code: INTERNAL_ERROR)'
      summary: Delete a staged attachment handle
      tags:
      - Attachments
    get:
      operationId: getV1AttachmentsById
      parameters:
      - in: path
        name: id
        required: true
        schema:
          format: uuid
          type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                properties:
                  consumed_at:
                    type: string
                  consumed_message_id:
                    type:
                    - string
                    - 'null'
                  content_scan_status:
                    enum:
                    - pending
                    - clean
                    - flagged
                    - error
                    type: string
                  content_type:
                    type: string
                  filename:
                    type: string
                  hash:
                    type: string
                  id:
                    type: string
                  scan:
                    properties:
                      categories:
                        items:
                          properties:
                            category:
                              type: string
                            decision:
                              enum:
                              - allow
                              - allow_with_warning
                              - quarantine
                              - require_human_approval
                              - block
                              type: string
                          required:
                          - category
                          - decision
                          type: object
                        type: array
                      findings:
                        items:
                          properties:
                            agent_instructions:
                              items:
                                type: string
                              type: array
                            attachment_filename:
                              type: string
                            attachment_index:
                              minimum: 0
                              type: integer
                            attachment_policy_action:
                              enum:
                              - quarantine_message
                              - metadata_only_after_rewrite
                              - derived_text_finding
                              type: string
                            category:
                              type: string
                            decision:
                              enum:
                              - allow
                              - allow_with_warning
                              - quarantine
                              - require_human_approval
                              - block
                              type: string
                            expires_at:
                              format: date-time
                              type: string
                            failure_class:
                              enum:
                              - inference_error
                              - model_judgment
                              type: string
                            pii_type:
                              enum:
                              - ssn
                              - credit_card
                              - phone_number
                              type: string
                            reason:
                              type:
                              - string
                              - 'null'
                            retryable:
                              type: boolean
                            subtype:
                              type: string
                            warning:
                              properties:
                                affected_urls:
                                  items:
                                    type: string
                                  type: array
                                attribution_text:
                                  type: string
                                attribution_url:
                                  type: string
                                learn_more:
                                  items:
                                    properties:
                                      threat_type:
                                        enum:
                                        - MALWARE
                                        - SOCIAL_ENGINEERING
                                        - UNWANTED_SOFTWARE
                                        - SOCIAL_ENGINEERING_EXTENDED_COVERAGE
                                        type: string
                                      url:
                                        type: string
                                    required:
                                    - threat_type
                                    - url
                                    type: object
                                  type: array
                                qualified_wording:
                                  type: string
                              required:
                              - qualified_wording
                              - attribution_text
                              - attribution_url
                              - learn_more
                              - affected_urls
                              type: object
                          required:
                          - category
                          - decision
                          - reason
                          type: object
                        type: array
                      verdict:
                        enum:
                        - clean
                        - warning
                        - review_required
                        - blocked
                        - quarantined
                        type: string
                    required:
                    - verdict
                    - categories
                    - findings
                    type:
                    - object
                    - 'null'
                  size:
                    type: integer
                  status:
                    enum:
                    - consumed
                    type: string
                required:
                - id
                type: object
          description: Success
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: Validation error
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Missing or invalid API key (code: UNAUTHORIZED)'
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: Not found
        '429':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Rate limited (code: RATE_LIMITED)'
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Internal error (code: INTERNAL_ERROR)'
      summary: Get a staged attachment handle
      tags:
      - Attachments
  /v1/messages/{id}/attachments/{idx}:
    get:
      operationId: getV1MessagesByIdAttachmentsByIdx
      parameters:
      - in: path
        name: id
        required: true
        schema:
          pattern: ^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$
          type: string
      - in: path
        name: idx
        required: true
        schema:
          pattern: ^[0-9]+$
          type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                properties:
                  av_verdict:
                    type:
                    - string
                    - 'null'
                  content_type:
                    type: string
                  expires_at:
                    format: date-time
                    type: string
                  filename:
                    type: string
                  size:
                    type: integer
                  url:
                    type: string
                required:
                - url
                - expires_at
                - content_type
                - filename
                - size
                type: object
          description: Success
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: Validation error
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Missing or invalid API key (code: UNAUTHORIZED)'
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: Forbidden
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: Not found
        '429':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Rate limited (code: RATE_LIMITED)'
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Internal error (code: INTERNAL_ERROR)'
      summary: Get inbound attachment metadata
      tags:
      - Attachments
  /v1/messages/{id}/attachments/{idx}/preview:
    get:
      operationId: getV1MessagesByIdAttachmentsByIdxPreview
      parameters:
      - in: path
        name: id
        required: true
        schema:
          pattern: ^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$
          type: string
      - in: path
        name: idx
        required: true
        schema:
          pattern: ^[0-9]+$
          type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                additionalProperties: false
                properties:
                  attachment:
                    additionalProperties: false
                    properties:
                      content_type:
                        type: string
                      filename:
                        type: string
                      hash:
                        type: string
                      size:
                        type: integer
                    required:
                    - filename
                    - content_type
                    - size
                    - hash
                    type: object
                  preview:
                    additionalProperties: false
                    properties:
                      char_count:
                        type:
                        - integer
                        - 'null'
                      content:
                        maxLength: 20000
                        type: string
                      extractor:
                        type: string
                      generated_at:
                        format: date-time
                        type: string
                      kind:
                        enum:
                        - text
                        type: string
                      page_count:
                        type:
                        - integer
                        - 'null'
                      truncated:
                        type: boolean
                    required:
                    - kind
                    - content
                    - truncated
                    - char_count
                    - page_count
                    - extractor
                    - generated_at
                    type: object
                required:
                - attachment
                - preview
                type: object
          description: Success
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: Validation error
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Missing or invalid API key (code: UNAUTHORIZED)'
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: Forbidden
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: Not found
        '409':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: Conflict
        '429':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: 'Rate limited (code: RATE_LIMITED)'
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: Internal error
      summary: Get a derived attachment preview
      tags:
      - Attachments
components:
  schemas:
    Error:
      description: Standard error envelope. `code` is a stable machine-readable string.
      properties:
        code:
          type: string
        details:
          additionalProperties: true
          type: object
        error:
          type: string
      required:
      - error
      - code
      type: object
  securitySchemes:
    BearerApiKey:
      description: 'ReplyLayer API key: `Authorization: Bearer rly_live_<public_id>.<secret>`.'
      scheme: bearer
      type: http