Rename api_key.deleted event type to api_key.revoked (#1476)
## Description The SDK currently defines the API key event type as `api_key.deleted`, but the actual WorkOS API expects `api_key.revoked`. This mismatch causes a 400 error when passing `api_key.deleted` to `listEvents()`: ``` GenericServerException: Invalid name parameter, received: 'api_key.deleted'. You must pass in valid event names ``` The [WorkOS Events documentation](https://workos.com/docs/events) lists this event as **"API key revoked event"** with the type `api_key.revoked`. ### Changes **`src/common/interfaces/event.interface.ts`** - `ApiKeyDeletedEvent` → `ApiKeyRevokedEvent` - `ApiKeyDeletedEventResponse` → `ApiKeyRevokedEventResponse` - Event literal `'api_key.deleted'` → `'api_key.revoked'` - Updated `Event` and `EventResponse` union types **`src/common/serializers/event.serializer.ts`** - Deserialisation case `'api_key.deleted'` → `'api_key.revoked'` This is consistent with other revocable resources in the SDK that already use `revoked` (e.g. `invitation.revoked`, `session.revoked`). Closes #1475 ## Documentation Does this require changes to the WorkOS Docs? E.g. the [API Reference](https://workos.com/docs/reference) or code snippets need updates. - [ ] Yes The [Events documentation](https://workos.com/docs/events) already lists the correct event name `api_key.revoked`. No documentation changes are required.
S
Sora Morimoto committed
bbabf18507927ae463ce8314bbdb1401671dfaaa
Parent: adf4280
Committed by GitHub <noreply@github.com>
on 2/11/2026, 6:16:09 PM