Uprails
API Keys/Update

Update API Key

Update an API key's name, permissions, or expiration.

POSThttps://api.uprails.com/api-keys/:key_id

Updates the specified API key. You can change the name, permissions, or expiration date.

Path Parameters

ParameterTypeDescription
key_idstringRequired. The ID of the API key.

Request Example

curl -X POST https://api.uprails.com/api-keys/key_1234567890abcdef \
  -H "Content-Type: application/json" \
  -H "api-key: snd_YOUR_API_KEY" \
  -d '{
    "name": "Updated Key Name",
    "permissions": ["payments:read"],
    "expires_at": "2024-12-31T23:59:59Z"
  }'

Request Body

namestring

Updated name for the API key

permissionsarray

Updated list of permissions

expires_atstring

Updated expiration date (ISO 8601)

Response

200OK
{
  "key_id": "key_1234567890abcdef",
  "merchant_id": "mer_xyz789",
  "name": "Updated Key Name",
  "prefix": "snd_",
  "type": "secret",
  "permissions": [
    "payments:read"
  ],
  "created": "2024-01-15T10:00:00Z",
  "expires_at": "2024-12-31T23:59:59Z"
}