Rename api_key.deleted event type to api_key.revoked#1476
Merged
stanleyphu merged 1 commit intoworkos:mainfrom Feb 11, 2026
Merged
Rename api_key.deleted event type to api_key.revoked#1476stanleyphu merged 1 commit intoworkos:mainfrom
stanleyphu merged 1 commit intoworkos:mainfrom
Conversation
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'. This commit renames in two files: - 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 workos#1475
Contributor
Greptile OverviewGreptile SummaryThis PR aligns the SDK’s API key event typing and deserialization logic with the WorkOS API by renaming the event from Net effect: callers using Confidence Score: 5/5
Important Files Changed
Sequence DiagramsequenceDiagram
autonumber
participant U as SDK user
participant E as Events API (listEvents)
participant S as deserializeEvent()
U->>E: listEvents({ name: 'api_key.revoked' })
E-->>U: EventResponse[] (event: 'api_key.revoked')
U->>S: deserializeEvent(EventResponse)
S-->>U: Event (event: 'api_key.revoked', data: ApiKey)
Note over U,E: Previously, SDK types encouraged 'api_key.deleted' which the API rejects (400).
|
stanleyphu
approved these changes
Feb 11, 2026
Contributor
stanleyphu
left a comment
There was a problem hiding this comment.
Thanks for the fix @smorimoto! I'll get this merged and get a new release out.
Merged
stanleyphu
added a commit
that referenced
this pull request
Feb 11, 2026
## Description This releases includes: - #1476 ## 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 ``` If yes, link a related docs PR and add a docs maintainer as a reviewer. Their approval is required.
Contributor
Author
|
Thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
The SDK currently defines the API key event type as
api_key.deleted, but the actual WorkOS API expectsapi_key.revoked. This mismatch causes a 400 error when passingapi_key.deletedtolistEvents():The WorkOS Events documentation lists this event as "API key revoked event" with the type
api_key.revoked.Changes
src/common/interfaces/event.interface.tsApiKeyDeletedEvent→ApiKeyRevokedEventApiKeyDeletedEventResponse→ApiKeyRevokedEventResponse'api_key.deleted'→'api_key.revoked'EventandEventResponseunion typessrc/common/serializers/event.serializer.ts'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 or code snippets need updates.
The Events documentation already lists the correct event name
api_key.revoked. No documentation changes are required.