Skip to main content
This guide helps you migrate existing integrations from API v1 or v2 to the current Organization and Enterprise APIs. The legacy APIs (v1 and v2) will continue to work during the deprecation period, but all new features are only available in the current API.

What’s changing

Areav1/v2 (Legacy)Current API
AuthenticationAPI keys (starts with apk_user_ or apk_)Service user tokens (starts with cog_)
Base URL/v1/*, /v2/*/v3/organizations/*, /v3/enterprise/*
PaginationOffset-based (offset + limit)Cursor-based (first + after)
ScopingFlat — all endpoints at one levelOrg-scoped and enterprise-scoped
PermissionsKey-level (all or nothing)Role-based with granular permissions

Step 1: Create a service user

Replace your legacy API key with a service user:
  1. Go to Settings > Service users
  2. Create a service user with an appropriate role
  3. Generate an API key (starts with cog_)
  4. Update your integration to use the new key
# Before (legacy API key)
curl -H "Authorization: Bearer apk_user_YOUR_LEGACY_KEY" ...

# After (service user token)
curl -H "Authorization: Bearer cog_YOUR_SERVICE_USER_KEY" ...
Your legacy API keys will continue to work during the deprecation period. You can migrate incrementally.

Step 2: Update endpoint URLs

Session endpoints

Operationv1 endpointCurrent endpoint
Create sessionPOST /v1/sessionsPOST /v3/organizations/sessions
List sessionsGET /v1/sessionsGET /v3/organizations/sessions
Get sessionGET /v1/session/{session_id}GET /v3/organizations/sessions/{devin_id}
Send messagePOST /v1/session/{session_id}/messagePOST /v3/organizations/sessions/{devin_id}/messages
Archive sessionPOST /v3/organizations/sessions/{devin_id}/archive
Delete sessionDELETE /v3/organizations/sessions/{devin_id}

Knowledge endpoints

Operationv1 endpointCurrent endpoint
List knowledgeGET /v1/knowledgeGET /v3/organizations/knowledge/notes
Create knowledgePOST /v1/knowledgePOST /v3/organizations/knowledge/notes
Update knowledgePUT /v1/knowledge/{note_id}PUT /v3/organizations/knowledge/notes/{note_id}
Delete knowledgeDELETE /v1/knowledge/{note_id}DELETE /v3/organizations/knowledge/notes/{note_id}

Playbook endpoints

Operationv1/v2 endpointCurrent endpoint
List playbooksGET /v1/playbooksGET /v3/organizations/playbooks
Create playbookPOST /v1/playbooksPOST /v3/organizations/playbooks
Get playbookGET /v1/playbooks/{playbook_id}GET /v3/organizations/playbooks/{playbook_id}
Update playbookPUT /v1/playbooks/{playbook_id}PUT /v3/organizations/playbooks/{playbook_id}
Delete playbookDELETE /v1/playbooks/{playbook_id}DELETE /v3/organizations/playbooks/{playbook_id}

Secret endpoints

Operationv1 endpointCurrent endpoint
List secretsGET /v1/secretsGET /v3/organizations/secrets
Create secretPOST /v1/secretsPOST /v3/organizations/secrets
Delete secretDELETE /v1/secrets/{secret_id}DELETE /v3/organizations/secrets/{secret_id}

Enterprise-only endpoints (new)

These endpoints have no v1/v2 equivalent — they are only available in the current API:
  • GET /v3/enterprise/organizations — List organizations
  • GET /v3/enterprise/audit-logs — Audit logs
  • GET /v3/enterprise/consumption/* — Usage and billing data
  • GET /v3/enterprise/metrics/* — Usage metrics
  • GET /v3/enterprise/members/users — User management
  • GET /v3/enterprise/roles — Role management
  • Service user provisioning, IP access lists, ACU limits, and more

Step 3: Update pagination

The current API uses cursor-based pagination instead of offset-based:
# Before (v1/v2 offset-based)
curl "https://api.devin.ai/v1/sessions?offset=0&limit=25"

# After (cursor-based)
curl "https://api.devin.ai/v3/organizations/sessions?first=25"
# Then use `end_cursor` from the response for the next page:
curl "https://api.devin.ai/v3/organizations/sessions?first=25&after=CURSOR_VALUE"
See Pagination for details.

Step 4: Handle response format changes

Session status values

The current API returns more detailed status information. See the endpoint reference for the full schema.

Error responses

Error format remains consistent: HTTP status code + JSON body with error details.

Deprecation timeline

Legacy API keys show a deprecation banner in the Devin settings UI. During the transition period:
  • Now: Legacy API keys continue to work. New organizations may not have access to legacy key creation.
  • Deprecation period: Both legacy keys and service user tokens work side-by-side.
  • End of life: Legacy API keys will be removed soon. Monitor your Devin settings for announcements.
We recommend migrating to service users as soon as possible to take advantage of role-based access control, session attribution, and new features.

Need help?

If you encounter issues during migration, reach out through your usual Devin support channel or contact us at support@cognition.ai.