---
updatedAt: 2026-08-06T09:23:15.000Z
agentTools:
  projectIndex: https://developers.alcmeon.com/llms.txt
---

# Upload an attachment

Upload a picture or a video to be sent later with an answer. The endpoint returns a short-lived access token that must be provided in the send answer payload as `attachment.access_token`.  Allowed extensions are: 'aac', 'amr', 'aspx', 'avi', 'avif', 'bmp', 'c',  'css', 'dng', 'doc', 'docx', 'eml', 'gif', 'heic', 'html', 'ics', 'jfif', 'jpeg', 'jpg', 'keynote', 'm4a', 'mag', 'mhtml', 'mov', 'mp', 'mp3', 'mp4',  'msg', 'numbers', 'odt', 'ods', 'ogg', 'opus', 'pages', 'pdf', 'php', 'png',  'ppt', 'pptx', 'psd', 'rtf', 'sdocx', 'svg', 'tiff', 'txt', 'vcf', 'wav', 'webp', 'xls', 'xlsx', 'xml' .

# OpenAPI definition

```json
{
  "openapi": "3.0.0",
  "info": {
    "title": "Send Answer API",
    "version": "1.0"
  },
  "servers": [
    {
      "url": "https://api.alcmeon.com",
      "description": "Alcmeon production API server"
    }
  ],
  "x-readme": {
    "explorer-enabled": false
  },
  "components": {
    "securitySchemes": {
      "basic_auth": {
        "description": "Basic authentication using your environment Instance ID as username and Application Secret as password.\n",
        "type": "http",
        "scheme": "basic"
      },
      "bearer_token": {
        "description": "OAuth 2.0 Bearer token authentication.  Obtain a token by calling the /v1/oauth2/token endpoint with your credentials. The token is valid for one hour.\n",
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT"
      }
    },
    "schemas": {
      "ResponseError": {
        "type": "object",
        "properties": {
          "error": {
            "type": "string",
            "description": "A short string explaining the reason of the error."
          },
          "details": {
            "type": "string",
            "description": "Additional details about the error (optional)."
          }
        }
      },
      "AttachmentUploadResponse": {
        "type": "object",
        "properties": {
          "access_token": {
            "type": "string",
            "description": "Short-lived token to be used in the send answer call as attachment.access_token",
            "example": "abC123..."
          }
        }
      },
      "RateLimitResponseError": {
        "type": "object",
        "properties": {
          "error": {
            "type": "string",
            "description": "Rate limit reached"
          },
          "details": {
            "type": "string",
            "description": "A string showing the time when the rate limit will be reset. Example: {'rate_limited_until': '2024-01-22T13:05:41Z'}\n"
          }
        }
      }
    }
  },
  "security": [
    {
      "basic_auth": []
    },
    {
      "bearer_token": []
    }
  ],
  "paths": {
    "/v1/answer/attachment": {
      "post": {
        "tags": [
          "Attachment"
        ],
        "summary": "Upload an attachment",
        "description": "Upload a picture or a video to be sent later with an answer. The endpoint returns a short-lived access token that must be provided in the send answer payload as `attachment.access_token`.  Allowed extensions are: 'aac', 'amr', 'aspx', 'avi', 'avif', 'bmp', 'c',  'css', 'dng', 'doc', 'docx', 'eml', 'gif', 'heic', 'html', 'ics', 'jfif', 'jpeg', 'jpg', 'keynote', 'm4a', 'mag', 'mhtml', 'mov', 'mp', 'mp3', 'mp4',  'msg', 'numbers', 'odt', 'ods', 'ogg', 'opus', 'pages', 'pdf', 'php', 'png',  'ppt', 'pptx', 'psd', 'rtf', 'sdocx', 'svg', 'tiff', 'txt', 'vcf', 'wav', 'webp', 'xls', 'xlsx', 'xml' .",
        "security": [
          {
            "basic_auth": []
          },
          {
            "bearer_token": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "site_id": {
                    "type": "integer",
                    "description": "The site ID where the media belongs.",
                    "example": 123
                  },
                  "file_name": {
                    "type": "string",
                    "description": "Original filename including extension.",
                    "example": "photo.png"
                  },
                  "file_content": {
                    "type": "string",
                    "format": "binary",
                    "description": "The file content to upload."
                  }
                },
                "required": [
                  "site_id",
                  "file_name",
                  "file_content"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Media uploaded successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AttachmentUploadResponse"
                }
              }
            }
          },
          "400": {
            "description": "Empty file content",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ResponseError"
                },
                "examples": {
                  "empty_file": {
                    "value": {
                      "error": "empty-file-content"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Site not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ResponseError"
                },
                "examples": {
                  "site_not_found": {
                    "value": {
                      "error": "site-not-found"
                    }
                  }
                }
              }
            }
          },
          "412": {
            "description": "File too large",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ResponseError"
                },
                "examples": {
                  "too_big": {
                    "value": {
                      "error": "media/upload/too-big. Maximum allowed size is 10485760 bytes"
                    }
                  }
                }
              }
            }
          },
          "415": {
            "description": "Unsupported media type (by extension or content)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ResponseError"
                },
                "examples": {
                  "unsupported_extension": {
                    "value": {
                      "error": "Unsupported file extension. Allowed extensions are: 'aac', 'amr', 'aspx', 'avi', 'avif', 'bmp', 'c', 'css', 'dng', 'doc', 'docx', 'eml', 'gif', 'heic', 'html', 'ics', 'jfif', 'jpeg', 'jpg', 'keynote', 'm4a', 'mag', 'mhtml', 'mov', 'mp', 'mp3', 'mp4', 'msg', 'numbers', 'odt', 'ods', 'ogg', 'opus', 'pages', 'pdf', 'php', 'png', 'ppt', 'pptx', 'psd', 'rtf', 'sdocx', 'svg', 'tiff', 'txt', 'vcf', 'wav', 'webp', 'xls', 'xlsx', 'xml'"
                    }
                  },
                  "unsupported_from_content": {
                    "value": {
                      "error": "Unsupported extension from file content, allowed extensions are ['aac', 'amr', 'aspx', 'avi', 'avif', 'bmp', 'c', 'css', 'dng', 'doc', 'docx', 'eml', 'gif', 'heic', 'html', 'ics', 'jfif', 'jpeg', 'jpg', 'keynote', 'm4a', 'mag', 'mhtml', 'mov', 'mp', 'mp3', 'mp4', 'msg', 'numbers', 'odt', 'ods', 'ogg', 'opus', 'pages', 'pdf', 'php', 'png', 'ppt', 'pptx', 'psd', 'rtf', 'sdocx', 'svg', 'tiff', 'txt', 'vcf', 'wav', 'webp', 'xls', 'xlsx', 'xml']"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limit reached. Default limit is set to 15 requests per minute.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitResponseError"
                }
              }
            }
          }
        }
      }
    }
  }
}
```