Skip to main content
PATCH
/
api-keys
/
{id}
Rename an API key
curl --request PATCH \
  --url https://api.dialnexa.com/v1/api-keys/{id} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "Staging Environment"
}
'
{
  "id": "YOUR_API_KEY",
  "name": "Production Server",
  "last_used_at": "2024-03-10T08:00:00.000Z",
  "is_expired": false,
  "created_at": "2024-03-01T10:00:00.000Z"
}
Updates the display name of an existing API key. The secret value is not regenerated and the key’s permissions are unchanged, only the human-readable label is updated. Use this when teams, environments, or downstream services are renamed and you want the key list to keep showing the right context at a glance.

When to use this

API keys are typically named for the system or environment that owns them (for example Production Server, Staging Worker, Acme CRM Integration). Rename a key when:
  • A consumer service is renamed and the existing label no longer matches.
  • Ownership moves between teams and the new owner needs the key list to reflect the handover.
  • A key was created with a placeholder name (temp, test) and should be relabelled before going to production.
If you want to rotate the secret instead of just the label, you must create a new key with Create API Key, update all consumers, then revoke the old one with Revoke API Key.

Behavior

  • The id and secret value are unchanged.
  • The last_used_at timestamp is unaffected.
  • The key remains active throughout the rename.

Path parameters

ParameterDescription
idThe API key ID, for example abcgvvzzlrbnqy.

Body parameters

FieldDescription
nameThe new display name. Keep it descriptive and unique within the workspace.

Errors

  • 404 Not Found is returned when the API key does not exist or has been revoked.
  • 400 Bad Request is returned when the name field is missing or empty.

Request

curl -X PATCH "https://api.dialnexa.com/v1/api-keys/abcgvvzzlrbnqy" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name": "Production Server"}'

Response

{
  "id": "abcgvvzzlrbnqy",
  "name": "Production Server",
  "created_at": "2024-03-01T10:00:00.000Z",
  "last_used_at": "2024-05-13T18:00:00.000Z"
}

Authorizations

Authorization
string
header
required

Pass your API key as a Bearer token in the Authorization header.

Path Parameters

id
string
required

Body

application/json
name
string
required
Example:

"Staging Environment"

Response

Success.

id
string
Example:

"YOUR_API_KEY"

name
string
Example:

"Production Server"

last_used_at
string<date-time> | null
Example:

"2024-03-10T08:00:00.000Z"

is_expired
boolean
Example:

false

created_at
string<date-time>
Example:

"2024-03-01T10:00:00.000Z"