Skip to main content
POST
/
api
/
v0
/
service-accounts
/
{serviceAccountId}
/
api-keys
Create a service account API key
curl --request POST \
  --url https://api.factory.ai/api/v0/service-accounts/{serviceAccountId}/api-keys \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "<string>",
  "expiresAt": 1
}
'
{
  "apiKey": {
    "id": "<string>",
    "value": "<string>",
    "fingerprint": "<string>",
    "name": "<string>",
    "expiresAt": 123
  }
}

Authorizations

Authorization
string
header
required

Factory API key or JWT token for authentication

Path Parameters

serviceAccountId
string
required

Service account ID

Minimum string length: 1

Body

application/json
name
string
required
Required string length: 1 - 128
expiresAt
integer
Required range: x > 0

Response

Response for status 201

apiKey
object
required