Skip to content

Update API Credential

Update the name or description of an existing API credential.

Request

http
PATCH /v1/admin/credentials/:id
Authorization: Bearer {admin_key}
Content-Type: application/json

Path Parameters

ParameterTypeDescription
idUUIDCredential ID

Body Parameters

ParameterTypeRequiredDescription
namestringNoNew credential name (max 255 chars)
descriptionstring | nullNoNew description (set to null to clear)

At least one field must be provided.

Example Request

bash
curl -X PATCH "https://api.insight.iagon.com/v1/admin/credentials/660e8400-e29b-41d4-a716-446655440001" \
  -H "Authorization: Bearer YOUR_ADMIN_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name": "Acme Production Key - Renamed", "description": "Updated description"}'

Response

Success (200 OK)

json
{
  "success": true,
  "data": {
    "id": "660e8400-e29b-41d4-a716-446655440001",
    "name": "Acme Production Key - Renamed",
    "description": "Updated description",
    "api_key_prefix": "iiak_a1b2c3d4",
    "created_at": "2026-01-26T12:00:00Z",
    "user_account_id": "550e8400-e29b-41d4-a716-446655440000",
    "user_account_name": "Acme Corporation",
    "user_external_id": "cust_abc123",
    "admin_key_id": "770e8400-e29b-41d4-a716-446655440002",
    "admin_entity_name": "YourCompany",
    "network_id": 0,
    "last_used_at": "2026-01-26T15:30:00Z",
    "expires_at": null,
    "revoked": false,
    "revoked_at": null,
    "rate_limit_per_minute": 60,
    "metadata": {}
  },
  "message": "Credential updated successfully"
}

Error Responses

400 Bad Request - No fields provided:

json
{
  "success": false,
  "error": "At least one field (name or description) must be provided"
}

400 Bad Request - Name too long:

json
{
  "success": false,
  "error": "Name must be 255 characters or less"
}

404 Not Found - Credential doesn't exist or already revoked:

json
{
  "success": false,
  "error": "Credential not found or already revoked"
}

Notes

  • Only name and description can be updated
  • Updates are logged in the audit trail
  • Cannot update credentials owned by other admin keys
  • Cannot update revoked credentials

Permission Required

Requires the manage_credentials permission.