Cognition Labs Attachments API

Upload and download files for Devin to work with.

Operations 4

POST /attachments Upload a file for Devin to work with #
GET /attachments/{attachment_id} Download an attachment file #
POST /v1/attachments Upload files for Devin #
GET /v1/attachments/{uuid}/{name} Download attachment files #

Documentation

📖
Documentation
https://docs.devin.ai/api-reference/overview
📖
APIReference
https://docs.devin.ai/api-reference/v1/sessions/create-a-new-devin-session
📖
APIReference
https://docs.devin.ai/api-reference/v1/sessions/send-a-message-to-an-existing-devin-session
📖
APIReference
https://docs.devin.ai/api-reference/v3/sessions/post-organizations-sessions-messages
📖
APIReference
https://docs.devin.ai/api-reference/v1/attachments/upload-files-for-devin-to-work-with
📖
APIReference
https://docs.devin.ai/api-reference/v1/attachments/download-attachment-files
📖
APIReference
https://docs.devin.ai/api-reference/v1/knowledge/list-knowledge
📖
APIReference
https://docs.devin.ai/api-reference/v1/knowledge/create-knowledge
📖
APIReference
https://docs.devin.ai/api-reference/v1/playbooks/list-playbooks
📖
APIReference
https://docs.devin.ai/api-reference/v1/playbooks/create-playbook
📖
APIReference
https://docs.devin.ai/api-reference/v1/secrets/list-secrets
📖
APIReference
https://docs.devin.ai/api-reference/v1/secrets/create-secret
📖
Documentation
https://docs.devin.ai/admin/security
📖
Documentation
https://docs.devin.ai/api-reference/v3/overview
📖
Documentation
https://docs.devin.ai/api-reference/getting-started/teams-quickstart
📖
APIReference
https://docs.devin.ai/api-reference/v3/users/members-users
📖
Documentation
https://docs.devin.ai/api-reference/getting-started/enterprise-quickstart
📖
APIReference
https://docs.devin.ai/api-reference/v2/organizations/list-organizations
📖
APIReference
https://docs.devin.ai/api-reference/v2/api-keys/list-enterprise-api-keys
📖
Documentation
https://docs.devin.ai/admin/billing/usage
📖
Documentation
https://docs.devin.ai/admin/billing/enterprise
📖
APIReference
https://docs.devin.ai/api-reference/v3/consumption/consumption-daily

Specifications

Other Resources

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/cognition-labs-attachments-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

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. See our Privacy Policy and Terms.

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

OpenAPI Specification

cognition-labs-attachments-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Cognition Labs Attachments API
  version: '1.0'
  description: 'Operations tagged Attachments across 2 of this provider''s published API definitions: cognition-labs-openapi.yml, cognition-labs-openapi.yaml. Each path carries the servers of the definition it was published in.'
servers:
- url: https://api.devin.ai/v1
  description: Legacy v1 API (apk_user_*/apk_* keys)
- url: https://api.devin.ai/v3
  description: Current v3 organizations/enterprise API (cog_ keys)
- url: https://api.devin.ai
  description: Devin Production Server
security:
- bearerAuth: []
tags:
- name: Attachments
  description: Upload and download files for Devin to work with.
paths:
  /attachments:
    post:
      operationId: uploadAttachment
      tags:
      - Attachments
      summary: Upload a file for Devin to work with
      description: Uploads a file and returns its URL. Reference the returned URL in a session prompt as ATTACHMENT:"{file_url}" on its own line.
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              required:
              - file
              properties:
                file:
                  type: string
                  format: binary
      responses:
        '200':
          description: The uploaded file's URL.
          content:
            application/json:
              schema:
                type: string
        '422':
          $ref: '#/components/responses/ValidationError'
    servers:
    - url: https://api.devin.ai/v1
      description: Legacy v1 API (apk_user_*/apk_* keys)
    - url: https://api.devin.ai/v3
      description: Current v3 organizations/enterprise API (cog_ keys)
  /attachments/{attachment_id}:
    parameters:
    - name: attachment_id
      in: path
      required: true
      schema:
        type: string
    get:
      operationId: downloadAttachment
      tags:
      - Attachments
      summary: Download an attachment file
      responses:
        '200':
          description: The raw attachment file contents.
          content:
            application/octet-stream:
              schema:
                type: string
                format: binary
        '422':
          $ref: '#/components/responses/ValidationError'
    servers:
    - url: https://api.devin.ai/v1
      description: Legacy v1 API (apk_user_*/apk_* keys)
    - url: https://api.devin.ai/v3
      description: Current v3 organizations/enterprise API (cog_ keys)
  /v1/attachments:
    post:
      tags:
      - Attachments
      summary: Upload files for Devin
      description: 'Upload files via multipart/form-data. This endpoint returns a URL

        that can be referenced in session prompts or other requests.'
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                file:
                  type: string
                  format: binary
                  description: The file to upload
            encoding:
              file:
                contentType: application/octet-stream
      responses:
        '200':
          description: File successfully uploaded
          content:
            text/plain:
              schema:
                type: string
                description: A string URL where the uploaded file can be accessed
              example: https://storage.devin.ai/attachments/xxx/file.py
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '500':
          $ref: '#/components/responses/InternalServerError'
      operationId: postV1Attachments
      x-operation-id-source: derived
    servers:
    - url: https://api.devin.ai
      description: Devin Production Server
  /v1/attachments/{uuid}/{name}:
    get:
      tags:
      - Attachments
      summary: Download attachment files
      description: 'Download a previously uploaded attachment file using its UUID and filename.

        This endpoint returns a redirect to a presigned URL for the file.


        **Note for curl users**: Use the `-L` flag to follow the redirect automatically.'
      parameters:
      - name: uuid
        in: path
        required: true
        description: The UUID of the attachment
        schema:
          type: string
      - name: name
        in: path
        required: true
        description: The filename of the attachment
        schema:
          type: string
      responses:
        '307':
          description: Temporary redirect to presigned URL for file download
          headers:
            Location:
              description: The presigned URL for downloading the file
              schema:
                type: string
                format: uri
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '404':
          description: Attachment not found
          content:
            application/json:
              schema:
                type: object
                properties:
                  detail:
                    type: string
                    example: Attachment not found
        '500':
          $ref: '#/components/responses/InternalServerError'
      x-codeSamples:
      - lang: curl
        source: "# Note: -L flag is required to follow the 307 redirect\ncurl -L -X GET \"https://api.devin.ai/v1/attachments/{uuid}/{name}\" \\\n  -H \"Authorization: Bearer YOUR_API_KEY\" \\\n  -o \"downloaded_file.ext\"\n"
      operationId: getV1AttachmentsByUuidByName
      x-operation-id-source: derived
    servers:
    - url: https://api.devin.ai
      description: Devin Production Server
components:
  schemas:
    ValidationErrorBody:
      type: object
      properties:
        detail:
          type: array
          items:
            type: object
            properties:
              loc:
                type: array
                items:
                  type: string
              msg:
                type: string
              type:
                type: string
  responses:
    ValidationError:
      description: The request payload failed validation.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ValidationErrorBody'
    UnauthorizedError:
      description: Unauthorized - Invalid or missing API key
      content:
        application/json:
          schema:
            type: object
            properties:
              detail:
                type: string
                example: Missing or invalid Authorization header
    InternalServerError:
      description: Internal Server Error
      content:
        application/json:
          schema:
            type: object
            properties:
              detail:
                type: string
                example: Something went wrong
    BadRequestError:
      description: Bad Request
      content:
        application/json:
          schema:
            type: object
            properties:
              detail:
                type: string
                example: Invalid input or request
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: 'v1/v2 keys are prefixed apk_user_* (personal) or apk_* (service). The current v3 API uses service-user or personal access tokens prefixed cog_. Passed as `Authorization: Bearer YOUR_API_KEY`.'
externalDocs:
  description: Visit Devin's documentation page for more info
  url: https://docs.devin.ai
x-refined-from:
- cognition-labs-openapi.yml
- cognition-labs-openapi.yaml