PUT
/
api
/
v2
/
keys
/
{keyId}
curl --request PUT \
  --url https://api.buena.ai/api/v2/keys/{keyId} \
  --header 'Content-Type: <content-type>' \
  --header 'x-api-key: <api-key>' \
  --data '{
  "description": "<string>",
  "permissions": [
    {
      "keys:create": "<string>",
      "keys:read": "<string>",
      "keys:manage": "<string>",
      "leads:read": "<string>",
      "leads:write": "<string>",
      "leads:enrich": "<string>",
      "linkedin:schedule": "<string>",
      "prospecting:search": "<string>",
      "campaigns:manage": "<string>"
    }
  ],
  "expiresAt": "<string>"
}'
{
  "success": true,
  "data": {
    "id": "key_123abc",
    "description": "Updated marketing automation key",
    "permissions": [
      "leads:read",
      "leads:write",
      "leads:enrich",
      "linkedin:schedule"
    ],
    "createdAt": "2024-01-15T10:30:00Z",
    "updatedAt": "2024-01-20T15:30:00Z",
    "lastUsed": "2024-01-20T14:25:00Z",
    "expiresAt": null
  }
}

Modify an existing API key’s permissions, description, or other metadata. You can change permissions, update descriptions, and modify expiration dates.

Requires the keys:manage permission. You can only update keys that you have created or have been granted access to.

Request

keyId
string
required

The unique identifier of the API key to update

x-api-key
string
required

Your API key with keys:manage permission

Content-Type
string
required

Must be application/json

Body Parameters

description
string

Updated description for the API key

permissions
array

Array of permission strings to grant to this key

expiresAt
string

ISO 8601 timestamp when the key should expire (optional)

Examples

Update Key Permissions

curl -X PUT "https://api.buena.ai/api/v2/keys/key_123abc" \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "description": "Updated marketing automation key",
    "permissions": [
      "leads:read",
      "leads:write",
      "leads:enrich",
      "linkedin:schedule"
    ]
  }'

Response

success
boolean

Always true for successful requests

data
object

Updated API key information

{
  "success": true,
  "data": {
    "id": "key_123abc",
    "description": "Updated marketing automation key",
    "permissions": [
      "leads:read",
      "leads:write",
      "leads:enrich",
      "linkedin:schedule"
    ],
    "createdAt": "2024-01-15T10:30:00Z",
    "updatedAt": "2024-01-20T15:30:00Z",
    "lastUsed": "2024-01-20T14:25:00Z",
    "expiresAt": null
  }
}

Next Steps