openapi: 3.0.3 info: title: Devin API (Cognition Labs) Attachments Secrets API description: The Devin API lets you create and drive Devin, Cognition's autonomous AI software engineer, programmatically. This document models the legacy v1 surface (api.devin.ai/v1, still live and documented, authenticated with apk_user_*/apk_* keys) in full - sessions, messages, attachments, knowledge, playbooks, and secrets - plus representative endpoints from the current v3 organizations/enterprise surface (api.devin.ai/v3, authenticated with cog_ service-user or personal access tokens) and the v2/v3 consumption (ACU usage) endpoints. The v2/v3 enterprise surface has additional organization, member, and API-key management endpoints not exhaustively modeled here; see the humanURL/APIReference links in apis.yml for the full documented set. All endpoints are transcribed from Cognition's public documentation at https://docs.devin.ai and have not been exercised against production credentials, which require an active paid Devin plan or Enterprise contract. version: '1.0' contact: name: Cognition url: https://cognition.ai license: name: Proprietary url: https://docs.devin.ai/admin/security 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) security: - bearerAuth: [] tags: - name: Secrets description: Encrypted credentials Devin can use inside sessions. paths: /secrets: get: operationId: listSecrets tags: - Secrets summary: List all secrets description: Returns secret metadata only, never secret values. responses: '200': description: The organization's secret metadata. content: application/json: schema: type: array items: $ref: '#/components/schemas/SecretMetadata' post: operationId: createSecret tags: - Secrets summary: Create a secret requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/SecretInput' responses: '200': description: The created secret's identifier. content: application/json: schema: type: object properties: id: type: string '422': $ref: '#/components/responses/ValidationError' /secrets/{secret_id}: parameters: - name: secret_id in: path required: true schema: type: string delete: operationId: deleteSecret tags: - Secrets summary: Delete a secret responses: '200': description: Deletion confirmation. content: application/json: schema: type: object properties: detail: type: string '422': $ref: '#/components/responses/ValidationError' components: schemas: SecretMetadata: type: object properties: id: type: string type: type: string enum: - cookie - key-value - dictionary - totp key: type: string nullable: true created_at: type: string format: date-time nullable: true ValidationErrorBody: type: object properties: detail: type: array items: type: object properties: loc: type: array items: type: string msg: type: string type: type: string SecretInput: type: object required: - type - key - value properties: type: type: string enum: - cookie - key-value - dictionary - totp key: type: string description: Unique name for the secret within the organization. value: type: string description: The secret value to store. Encrypted at rest. sensitive: type: boolean description: Whether the value is redacted in logs. note: type: string responses: ValidationError: description: The request payload failed validation. content: application/json: schema: $ref: '#/components/schemas/ValidationErrorBody' 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`.'