Skip to main content
POST
/
v1beta
/
api-keys
/
{api_key_id}
/
revoke
TypeScript
import { Factify } from "@factify/sdk";

const factify = new Factify({
  bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const result = await factify.apiKeys.revoke({
    apiKeyId: "<id>",
    body: {},
  });

  console.log(result);
}

run();
{
  "api_key": {
    "created_at": "2023-11-07T05:31:56Z",
    "id": "key_01jd4h5mck9gq6zrp8bn2t4w3x",
    "is_active": true,
    "key_prefix": "ffy_prod_01jd4h5...",
    "name": "Production",
    "organization_id": "org_01h2xcejqtf2nbrexx3vqjhp41",
    "expires_at": "2023-11-07T05:31:56Z",
    "revoked_at": "2023-11-07T05:31:56Z"
  }
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer , where is your auth token.

Path Parameters

api_key_id
string
required

API key ID to revoke. Pattern: key_[0-9a-hjkmnp-tv-z]{26}

Pattern: ^key_[0-9a-hjkmnp-tv-z]{26}$

Body

application/json

RevokeApiKeyRequest identifies an API key to revoke.

reason
string | null

Optional reason for revocation (for audit purposes). The revoking user's identity and timestamp are captured in audit logs separately.

Required string length: 1 - 500

Response

Success

RevokeApiKeyResponse contains the revoked API key.

api_key
api_key · object
required

The revoked API key with updated revoked_at timestamp.