Skip to content

api_key.deleted event type should be api_key.revoked #1475

@smorimoto

Description

@smorimoto

Problem

The SDK defines api_key.deleted as an event type (introduced in PR #1437), but the actual WorkOS API event name is api_key.revoked.

Passing api_key.deleted to listEvents() results in a 400 error:

GenericServerException: Invalid name parameter, received: 'api_key.deleted'. You must pass in valid event names

The WorkOS Events documentation lists the event as "API key revoked event" with the type api_key.revoked, not api_key.deleted.

Expected behaviour

The SDK should define the event type as api_key.revoked to match the actual API and documentation.

Affected files

  • src/common/interfaces/event.interface.tsApiKeyDeletedEvent / ApiKeyDeletedEventResponse (lines 681–689, 751–752, 814–815)
  • src/common/serializers/event.serializer.ts — deserialisation case (lines 210–216)

Additional context

This is consistent with the naming convention used by other revocable resources in the SDK: invitation.revoked and session.revoked both use "revoked" rather than "deleted".

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions