API references
Search documentation... ⌘K
API references
Merchant API

Revoke an API key

Permanently revoke an API key to prevent it from being used for authentication. Once revoked, any requests made with this key will be rejected. This is useful when:

  • An API key has been compromised
  • You're rotating old API keys as part of security best practices
  • An employee with access to the key leaves your organization

The revocation takes effect immediately and cannot be undone. If you need to restore access, you'll need to create a new API key.

The endpoint returns true if the key was successfully revoked.

Endpoint signature
This endpoint requires an API key. Read our authentication guide for more information.
POST https://api.reservepay.com/merchants/revoke-key HTTP/1.1
Content-Type: application/json
Accept: application/json
Authorization: Bearer <token>
{
key_id: string,
}
Returns: boolean
New to Reservepay? Read our guide on how to call endpoints to get started.
Request arguments
key_id string

Required. The unique identifier of the API key to revoke. This is the key_id value returned when the key was created.

Errors specific to this endpoint
NOT_FOUND

The API key with the provided ID could not be found in your merchant account. Verify that you're using the correct key_id.

ALREADY_REVOKED

The API key has already been revoked. No action is needed.

Errors common to all endpoints
UNHANDLED_ERROR

This error occurs when the server encounters an unexpected internal error that it cannot handle gracefully. This typically happens due to bugs, infrastructure issues, or edge cases that weren't anticipated during development.

INVALID_ARGUMENTS

This error occurs when the request contains invalid or missing parameters. Common cases include missing required fields, or values that don't match the expected format or type.

BAD_VERSION

This error occurs when making requests to an API version that does not exist. This commonly happens when using an outdated SDK or when the API version specified in the request URL is incorrect.

CODE SAMPLES
curl
curl "https://api.reservepay.com/merchants/revoke-key" \
  -X POST
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -H "Authorization: Bearer $(RESERVEPAY_API_KEY)" \
  -d '{
        "key_id": "key_OtjnE29kU1"
      }'

Learn how to run these code samples in your terminal by reading our guide.