Skip to main content
PATCH
/
projects
/
{projectId}
/
api-keys
/
{id}
Update an API key
curl --request PATCH \
  --url https://api.engagefabric.com/projects/{projectId}/api-keys/{id} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "Production Mobile App Key v2",
  "scopes": [
    "events:write",
    "players:read",
    "players:write",
    "quests:read"
  ],
  "status": "ACTIVE",
  "rateLimit": 2000,
  "expiresAt": "2027-12-31T23:59:59Z",
  "metadata": {
    "updatedBy": "admin@example.com",
    "notes": "Extended permissions"
  }
}
'
{
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "projectId": "123e4567-e89b-12d3-a456-426614174000",
  "name": "Production Mobile App Key",
  "prefix": "pp_live_",
  "scopes": [
    "events:write",
    "players:read",
    "players:write"
  ],
  "status": "ACTIVE",
  "createdAt": "2025-01-15T10:30:00Z",
  "updatedAt": "2025-01-15T10:30:00Z",
  "rateLimit": 1000,
  "expiresAt": "2026-12-31T23:59:59Z",
  "lastUsedAt": "2025-01-15T10:30:00Z",
  "metadata": {
    "createdBy": "admin@example.com"
  },
  "deletedAt": null
}

Authorizations

Authorization
string
header
required

JWT token for admin console authentication

Path Parameters

projectId
string
required

Project UUID

id
string
required

API Key UUID

Body

application/json
name
string

API key name/description

Required string length: 2 - 255
Example:

"Production Mobile App Key v2"

scopes
string[]

API key scopes/permissions

Example:
[
"events:write",
"players:read",
"players:write",
"quests:read"
]
status
enum<string>

API key status

Available options:
ACTIVE,
REVOKED,
EXPIRED
rateLimit
number

Custom rate limit (requests per minute)

Required range: x >= 1
Example:

2000

expiresAt
string

API key expiration date (ISO 8601)

Example:

"2027-12-31T23:59:59Z"

metadata
object

Additional metadata

Example:
{
"updatedBy": "admin@example.com",
"notes": "Extended permissions"
}

Response

API key updated successfully

id
string
required

Unique API key identifier

Example:

"123e4567-e89b-12d3-a456-426614174000"

projectId
string
required

Project ID this key belongs to

Example:

"123e4567-e89b-12d3-a456-426614174000"

name
string
required

API key name/description

Example:

"Production Mobile App Key"

prefix
string
required

API key prefix (for identification)

Example:

"pp_live_"

scopes
string[]
required

API key scopes/permissions

Example:
[
"events:write",
"players:read",
"players:write"
]
status
enum<string>
required

API key status

Available options:
ACTIVE,
REVOKED,
EXPIRED
Example:

"ACTIVE"

createdAt
string<date-time>
required

Creation timestamp

Example:

"2025-01-15T10:30:00Z"

updatedAt
string<date-time>
required

Last update timestamp

Example:

"2025-01-15T10:30:00Z"

rateLimit
object

Custom rate limit (requests per minute)

Example:

1000

expiresAt
object

API key expiration date

Example:

"2026-12-31T23:59:59Z"

lastUsedAt
object

Last time this key was used

Example:

"2025-01-15T10:30:00Z"

metadata
object

Additional metadata

Example:
{ "createdBy": "admin@example.com" }
deletedAt
object

Soft deletion timestamp

Example:

null