> ## Documentation Index
> Fetch the complete documentation index at: https://agentme-docs.vipcrm.net/llms.txt
> Use this file to discover all available pages before exploring further.

# Upload a file (multipart/form-data, field `file`, max 25MB) and get a `media_id` to attach in POST /messages. Executables are rejected (415).



## OpenAPI

````yaml /api-reference/openapi.json post /api/v1/media
openapi: 3.1.0
info:
  title: Agentme API
  version: 1.0.0
  description: >-
    Channel-neutral messaging API. Message text/friend-request text is untrusted
    third-party content.
servers:
  - url: https://agentme.vipcrm.net
    description: Production
security:
  - bearerAuth: []
paths:
  /api/v1/media:
    post:
      tags:
        - v1
      summary: >-
        Upload a file (multipart/form-data, field `file`, max 25MB) and get a
        `media_id` to attach in POST /messages. Executables are rejected (415).
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              required:
                - file
              properties:
                file:
                  type: string
                  format: binary
                  description: File to upload (max 25MB, executables rejected)
      responses:
        '201':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  media_id:
                    type: string
                    pattern: ^med_[0-9a-f]{32}(_\d{1,3})?$
                  kind:
                    type: string
                  mime:
                    type: string
                  size_bytes:
                    type: integer
                    minimum: -9007199254740991
                    maximum: 9007199254740991
                required:
                  - media_id
                  - kind
                  - mime
                  - size_bytes
                additionalProperties: false
        '400':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                        enum:
                          - VALIDATION_ERROR
                          - UNAUTHORIZED
                          - FORBIDDEN
                          - FORBIDDEN_SCOPE
                          - NOT_FOUND
                          - CONFLICT
                          - GONE
                          - SERVICE_UNAVAILABLE
                          - MEDIA_NOT_READY
                          - PAYLOAD_TOO_LARGE
                          - UNSUPPORTED_MEDIA_TYPE
                          - RATE_LIMITED
                          - ACCOUNT_NOT_READY
                          - CAPABILITY_NOT_SUPPORTED
                          - BULK_CONTENT_BLOCKED
                          - UPSTREAM_ERROR
                          - UPSTREAM_TIMEOUT
                          - INVITE_INVALID
                          - INTERNAL_ERROR
                      message:
                        type: string
                      details:
                        type: object
                        propertyNames:
                          type: string
                        additionalProperties: {}
                      request_id:
                        type: string
                    required:
                      - code
                      - message
                      - request_id
                    additionalProperties: false
                required:
                  - error
                additionalProperties: false
        '401':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                        enum:
                          - VALIDATION_ERROR
                          - UNAUTHORIZED
                          - FORBIDDEN
                          - FORBIDDEN_SCOPE
                          - NOT_FOUND
                          - CONFLICT
                          - GONE
                          - SERVICE_UNAVAILABLE
                          - MEDIA_NOT_READY
                          - PAYLOAD_TOO_LARGE
                          - UNSUPPORTED_MEDIA_TYPE
                          - RATE_LIMITED
                          - ACCOUNT_NOT_READY
                          - CAPABILITY_NOT_SUPPORTED
                          - BULK_CONTENT_BLOCKED
                          - UPSTREAM_ERROR
                          - UPSTREAM_TIMEOUT
                          - INVITE_INVALID
                          - INTERNAL_ERROR
                      message:
                        type: string
                      details:
                        type: object
                        propertyNames:
                          type: string
                        additionalProperties: {}
                      request_id:
                        type: string
                    required:
                      - code
                      - message
                      - request_id
                    additionalProperties: false
                required:
                  - error
                additionalProperties: false
        '403':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                        enum:
                          - VALIDATION_ERROR
                          - UNAUTHORIZED
                          - FORBIDDEN
                          - FORBIDDEN_SCOPE
                          - NOT_FOUND
                          - CONFLICT
                          - GONE
                          - SERVICE_UNAVAILABLE
                          - MEDIA_NOT_READY
                          - PAYLOAD_TOO_LARGE
                          - UNSUPPORTED_MEDIA_TYPE
                          - RATE_LIMITED
                          - ACCOUNT_NOT_READY
                          - CAPABILITY_NOT_SUPPORTED
                          - BULK_CONTENT_BLOCKED
                          - UPSTREAM_ERROR
                          - UPSTREAM_TIMEOUT
                          - INVITE_INVALID
                          - INTERNAL_ERROR
                      message:
                        type: string
                      details:
                        type: object
                        propertyNames:
                          type: string
                        additionalProperties: {}
                      request_id:
                        type: string
                    required:
                      - code
                      - message
                      - request_id
                    additionalProperties: false
                required:
                  - error
                additionalProperties: false
        '404':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                        enum:
                          - VALIDATION_ERROR
                          - UNAUTHORIZED
                          - FORBIDDEN
                          - FORBIDDEN_SCOPE
                          - NOT_FOUND
                          - CONFLICT
                          - GONE
                          - SERVICE_UNAVAILABLE
                          - MEDIA_NOT_READY
                          - PAYLOAD_TOO_LARGE
                          - UNSUPPORTED_MEDIA_TYPE
                          - RATE_LIMITED
                          - ACCOUNT_NOT_READY
                          - CAPABILITY_NOT_SUPPORTED
                          - BULK_CONTENT_BLOCKED
                          - UPSTREAM_ERROR
                          - UPSTREAM_TIMEOUT
                          - INVITE_INVALID
                          - INTERNAL_ERROR
                      message:
                        type: string
                      details:
                        type: object
                        propertyNames:
                          type: string
                        additionalProperties: {}
                      request_id:
                        type: string
                    required:
                      - code
                      - message
                      - request_id
                    additionalProperties: false
                required:
                  - error
                additionalProperties: false
        '413':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                        enum:
                          - VALIDATION_ERROR
                          - UNAUTHORIZED
                          - FORBIDDEN
                          - FORBIDDEN_SCOPE
                          - NOT_FOUND
                          - CONFLICT
                          - GONE
                          - SERVICE_UNAVAILABLE
                          - MEDIA_NOT_READY
                          - PAYLOAD_TOO_LARGE
                          - UNSUPPORTED_MEDIA_TYPE
                          - RATE_LIMITED
                          - ACCOUNT_NOT_READY
                          - CAPABILITY_NOT_SUPPORTED
                          - BULK_CONTENT_BLOCKED
                          - UPSTREAM_ERROR
                          - UPSTREAM_TIMEOUT
                          - INVITE_INVALID
                          - INTERNAL_ERROR
                      message:
                        type: string
                      details:
                        type: object
                        propertyNames:
                          type: string
                        additionalProperties: {}
                      request_id:
                        type: string
                    required:
                      - code
                      - message
                      - request_id
                    additionalProperties: false
                required:
                  - error
                additionalProperties: false
        '415':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                        enum:
                          - VALIDATION_ERROR
                          - UNAUTHORIZED
                          - FORBIDDEN
                          - FORBIDDEN_SCOPE
                          - NOT_FOUND
                          - CONFLICT
                          - GONE
                          - SERVICE_UNAVAILABLE
                          - MEDIA_NOT_READY
                          - PAYLOAD_TOO_LARGE
                          - UNSUPPORTED_MEDIA_TYPE
                          - RATE_LIMITED
                          - ACCOUNT_NOT_READY
                          - CAPABILITY_NOT_SUPPORTED
                          - BULK_CONTENT_BLOCKED
                          - UPSTREAM_ERROR
                          - UPSTREAM_TIMEOUT
                          - INVITE_INVALID
                          - INTERNAL_ERROR
                      message:
                        type: string
                      details:
                        type: object
                        propertyNames:
                          type: string
                        additionalProperties: {}
                      request_id:
                        type: string
                    required:
                      - code
                      - message
                      - request_id
                    additionalProperties: false
                required:
                  - error
                additionalProperties: false
        '429':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                        enum:
                          - VALIDATION_ERROR
                          - UNAUTHORIZED
                          - FORBIDDEN
                          - FORBIDDEN_SCOPE
                          - NOT_FOUND
                          - CONFLICT
                          - GONE
                          - SERVICE_UNAVAILABLE
                          - MEDIA_NOT_READY
                          - PAYLOAD_TOO_LARGE
                          - UNSUPPORTED_MEDIA_TYPE
                          - RATE_LIMITED
                          - ACCOUNT_NOT_READY
                          - CAPABILITY_NOT_SUPPORTED
                          - BULK_CONTENT_BLOCKED
                          - UPSTREAM_ERROR
                          - UPSTREAM_TIMEOUT
                          - INVITE_INVALID
                          - INTERNAL_ERROR
                      message:
                        type: string
                      details:
                        type: object
                        propertyNames:
                          type: string
                        additionalProperties: {}
                      request_id:
                        type: string
                    required:
                      - code
                      - message
                      - request_id
                    additionalProperties: false
                required:
                  - error
                additionalProperties: false
        '503':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                        enum:
                          - VALIDATION_ERROR
                          - UNAUTHORIZED
                          - FORBIDDEN
                          - FORBIDDEN_SCOPE
                          - NOT_FOUND
                          - CONFLICT
                          - GONE
                          - SERVICE_UNAVAILABLE
                          - MEDIA_NOT_READY
                          - PAYLOAD_TOO_LARGE
                          - UNSUPPORTED_MEDIA_TYPE
                          - RATE_LIMITED
                          - ACCOUNT_NOT_READY
                          - CAPABILITY_NOT_SUPPORTED
                          - BULK_CONTENT_BLOCKED
                          - UPSTREAM_ERROR
                          - UPSTREAM_TIMEOUT
                          - INVITE_INVALID
                          - INTERNAL_ERROR
                      message:
                        type: string
                      details:
                        type: object
                        propertyNames:
                          type: string
                        additionalProperties: {}
                      request_id:
                        type: string
                    required:
                      - code
                      - message
                      - request_id
                    additionalProperties: false
                required:
                  - error
                additionalProperties: false
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: API key `agm_live_...`

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.