Skip to main content
POST
/
v3beta1
/
enterprise
/
service-users
/
{service_user_id}
/
api-keys
Create API key for service user
curl --request POST \
  --url https://api.devin.ai/v3beta1/enterprise/service-users/{service_user_id}/api-keys \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "<string>",
  "expires_at": 123
}
'
{
  "api_key_id": "<string>",
  "api_key_name": "<string>",
  "token": "<string>"
}

Permissions

Requires a service user with the ManageServiceUsers permission at the enterprise level.

Authorizations

Authorization
string
header
required

Service User credential (prefix: cog_)

Path Parameters

service_user_id
string
required

Service user ID (prefix: service-user-)

Example:

"service-user-abc123def456"

Body

application/json
name
string
required
Required string length: 1 - 256
expires_at
integer | null

Optional expiration as a UNIX timestamp in seconds. Must be in the future if provided.

Response

Successful Response

Shared response model for API key creation/rotation (includes one-time token).

api_key_id
string
required
api_key_name
string
required
token
string
required

The raw API token. This is only shown once at creation/rotation time.