Composio Upload API

The Upload API from Composio — 1 operation(s) for upload.

OpenAPI Specification

composio-upload-api-openapi.yml Raw ↑
openapi: 3.0.0
info:
  version: 3.0.0
  title: Composio Platform Account Management Upload API
  description: ''
  contact:
    name: Composio Support
    url: https://composio.dev/support
    email: support@composio.dev
  license:
    name: Proprietary
    url: https://composio.dev/terms
servers:
- url: https://backend.composio.dev
  description: PRODUCTION API
tags:
- name: Upload
paths:
  /api/v3/files/upload/request:
    post:
      summary: Create presigned URL for request file upload to S3
      description: Generates a presigned URL for uploading a file to S3. This endpoint handles deduplication by checking if a file with the same MD5 hash already exists.
      tags:
      - Upload
      operationId: postFilesUploadRequest
      security:
      - ApiKeyAuth: []
      - UserApiKeyAuth: []
      - CookieAuth: []
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                toolkit_slug:
                  type: string
                  description: 'Slug of the app where this file belongs to. Example: "gmail", "slack", "github"'
                tool_slug:
                  type: string
                  description: 'Slug of the action where this file belongs to. Example: "GMAIL_SEND_EMAIL", "SLACK_UPLOAD_FILE"'
                filename:
                  type: string
                  description: 'Name of the original file. Example: "quarterly_report.pdf"'
                mimetype:
                  type: string
                  description: 'Mime type of the original file. Example: "application/pdf", "image/png"'
                md5:
                  type: string
                  description: 'MD5 hash of the file for deduplication and integrity verification. Example: "a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6"'
              required:
              - toolkit_slug
              - tool_slug
              - filename
              - mimetype
              - md5
            examples:
              Gmail Email Attachment:
                value:
                  toolkit_slug: gmail
                  tool_slug: GMAIL_SEND_EMAIL
                  filename: quarterly_report.pdf
                  mimetype: application/pdf
                  md5: a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6
              Slack File Upload:
                value:
                  toolkit_slug: slack
                  tool_slug: SLACK_SEND_MESSAGE
                  filename: meeting_notes.docx
                  mimetype: application/vnd.openxmlformats-officedocument.wordprocessingml.document
                  md5: b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7
              GitHub Issue Screenshot:
                value:
                  toolkit_slug: github
                  tool_slug: GITHUB_CREATE_AN_ISSUE
                  filename: bug_screenshot.png
                  mimetype: image/png
                  md5: c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8
              Notion Page Image:
                value:
                  toolkit_slug: notion
                  tool_slug: NOTION_ADD_PAGE_CONTENT
                  filename: diagram.svg
                  mimetype: image/svg+xml
                  md5: d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9
              Jira Attachment:
                value:
                  toolkit_slug: jira
                  tool_slug: JIRA_ADD_ATTACHMENT_TO_ISSUE
                  filename: error_logs.txt
                  mimetype: text/plain
                  md5: e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0
      responses:
        '200':
          description: Successfully created upload URL for request file
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                    description: 'ID of the request file. Example: "req_file_9mZn4qR8sXwT"'
                  key:
                    type: string
                    description: 'Object storage upload location. Example: "projects/pr_1a2b3c4d5e6f/requests/slack/SLACK_UPLOAD_FILE/document_9mZn4q.docx"'
                  new_presigned_url:
                    type: string
                    description: 'Presigned URL for upload. Example: "https://storage.composio.dev/projects/pr_1a2b3c4d5e6f/requests/slack/document_9mZn4q.docx?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Expires=3600..."'
                  newPresignedUrl:
                    type: string
                    description: '[DEPRECATED] Use new_presigned_url instead. Presigned URL for upload. Example: "https://storage.composio.dev/projects/pr_1a2b3c4d5e6f/requests/slack/document_9mZn4q.docx?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Expires=3600..."'
                    deprecated: true
                  type:
                    type: string
                    enum:
                    - new
                    description: '[DEPRECATED] Indicates this is a new file that needs to be uploaded'
                    deprecated: true
                  metadata:
                    type: object
                    properties:
                      storage_backend:
                        type: string
                        enum:
                        - s3
                        - azure_blob_storage
                        description: Storage backend used for the file. If this is azure, use `x-ms-blob-type` header to set the blob type to `BlockBlob` while uploading the file
                    required:
                    - storage_backend
                required:
                - id
                - key
                - new_presigned_url
                - newPresignedUrl
                - type
                - metadata
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '410':
          description: Gone
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '501':
          description: Not Implemented
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    Error:
      type: object
      properties:
        error:
          type: object
          properties:
            message:
              type: string
            code:
              type: number
            slug:
              type: string
            status:
              type: number
            request_id:
              type: string
            suggested_fix:
              type: string
            errors:
              type: array
              items:
                type: string
          required:
          - message
          - code
          - slug
          - status
      required:
      - error
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: Project API key authentication
    UserApiKeyAuth:
      type: apiKey
      in: header
      name: x-user-api-key
      description: User API key authentication
    CookieAuth:
      type: apiKey
      in: cookie
      name: authToken
      description: Cookie-based session authentication
    OrgApiKeyAuth:
      type: apiKey
      in: header
      name: x-org-api-key
      description: Organization API key authentication