WorkOS events API

Query events and event streams.

Operations 1

GET /events List Events #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/workos-events-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

workos-events-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: WorkOS admin-portal Events API
  description: WorkOS REST API
  version: '1.0'
  contact:
    name: WorkOS
    url: https://workos.com
    email: support@workos.com
  license:
    name: MIT
    url: https://opensource.org/license/MIT
servers:
- url: https://api.workos.com
  description: Production
- url: https://api.workos-test.com
  description: Staging
security:
- bearer: []
tags:
- name: events
  description: Query events and event streams.
  x-displayName: Events
paths:
  /events:
    get:
      description: List events for the current environment.
      operationId: EventsController_list
      parameters:
      - name: before
        required: false
        in: query
        description: An object ID that defines your place in the list. When the ID is not present, you are at the end of the list. For example, if you make a list request and receive 100 objects, ending with `"obj_123"`, your subsequent call can include `before="obj_123"` to fetch a new batch of objects before `"obj_123"`.
        schema:
          example: xxx_01HXYZ123456789ABCDEFGHIJ
          type: string
      - name: after
        required: false
        in: query
        description: An object ID that defines your place in the list. When the ID is not present, you are at the end of the list. For example, if you make a list request and receive 100 objects, ending with `"obj_123"`, your subsequent call can include `after="obj_123"` to fetch a new batch of objects after `"obj_123"`.
        schema:
          example: xxx_01HXYZ987654321KJIHGFEDCBA
          type: string
      - name: limit
        required: false
        in: query
        description: Upper limit on the number of objects to return, between `1` and `100`.
        schema:
          minimum: 1
          maximum: 100
          default: 10
          example: 10
          type: integer
      - name: order
        required: false
        in: query
        description: Order the results by the creation time. Supported values are `"asc"` (ascending), `"desc"` (descending), and `"normal"` (descending with reversed cursor semantics where `before` fetches older records and `after` fetches newer records). Defaults to descending.
        schema:
          $ref: '#/components/schemas/PaginationOrder'
      - name: events
        required: false
        in: query
        description: Filter events by one or more event types (e.g. `dsync.user.created`).
        style: form
        explode: false
        schema:
          example:
          - dsync.user.created
          - dsync.user.updated
          type: array
          items:
            type: string
      - name: range_start
        required: false
        in: query
        description: ISO-8601 date string to filter events created after this date.
        schema:
          example: '2025-01-01T00:00:00Z'
          type: string
      - name: range_end
        required: false
        in: query
        description: ISO-8601 date string to filter events created before this date.
        schema:
          example: '2025-12-31T23:59:59Z'
          type: string
      - name: organization_id
        required: false
        in: query
        description: Filter events by the [Organization](/reference/organization) that the event is associated with.
        schema:
          example: org_01EHQMYV6MBK39QC5PZXHY59C3
          type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EventList'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: A human-readable description of the error.
                    example: 'Organization not found: ''org_01EHQMYV6MBK39QC5PZXHY59C3''.'
                required:
                - message
        '422':
          description: Unprocessable Entity
          content:
            application/json:
              schema:
                type: object
                properties:
                  errors:
                    type: array
                    items:
                      type: object
                      properties:
                        code:
                          type: string
                          description: The validation error code.
                          example: required
                        field:
                          type: string
                          description: The field that failed validation.
                          example: events
                      required:
                      - code
                      - field
                    description: The list of validation errors.
                  message:
                    type: string
                    description: A human-readable description of the error.
                    example: Validation failed.
                required:
                - errors
                - message
      summary: List Events
      tags:
      - events
components:
  schemas:
    EventContextActorDto:
      type: object
      properties:
        id:
          type: string
          description: Unique identifier of the actor.
          example: user_01EHWNCE74X7JSDV0X3SZ3KJNY
        source:
          type: string
          enum:
          - api
          - dashboard
          - admin_portal
          - system
          description: The source of the actor that performed the action.
        name:
          type:
          - string
          - 'null'
          description: The name of the actor.
          example: Jane Doe
      required:
      - id
      - source
      - name
      description: The actor who performed the action.
    WaitlistUser:
      type: object
      properties:
        object:
          type: string
          description: Distinguishes the Waitlist User object.
          const: waitlist_user
        id:
          type: string
          description: The unique ID of the Waitlist User.
          example: wl_user_01E4ZCR3C56J083X43JQXF3JK5
        email:
          type: string
          description: The email address of the Waitlist User.
          example: marcelina.davis@example.com
        state:
          type: string
          enum:
          - pending
          - approved
          - denied
          description: The state of the Waitlist User.
          example: pending
        approved_at:
          format: date-time
          type:
          - string
          - 'null'
          description: The timestamp when the Waitlist User was approved, or null if not yet approved.
          example: null
        created_at:
          format: date-time
          type: string
          description: An ISO 8601 timestamp.
          example: '2026-01-15T12:00:00.000Z'
        updated_at:
          format: date-time
          type: string
          description: An ISO 8601 timestamp.
          example: '2026-01-15T12:00:00.000Z'
      required:
      - object
      - id
      - email
      - state
      - approved_at
      - created_at
      - updated_at
    EventSchema:
      allOf:
      - type: object
        properties:
          object:
            type: string
            description: Distinguishes the Event object.
            const: event
          id:
            type: string
            description: Unique identifier for the Event.
            example: event_01EHZNVPK3SFK441A1RGBFSHRT
          event:
            type: string
            description: The type of event that occurred.
            example: dsync.user.created
          data:
            type: object
            additionalProperties: {}
            description: The event payload.
            example:
              id: directory_user_01E1JG7J09H96KYP8HM9B0G5SJ
              directory_id: directory_01ECAZ4NV9QMV47GW873HDCX74
              organization_id: org_01EZTR6WYX1A0DSE2CYMGXQ24Y
              state: active
              email: veda@foo-corp.com
              emails:
              - primary: true
                type: work
                value: veda@foo-corp.com
              idp_id: '2836'
              object: directory_user
              username: veda@foo-corp.com
              last_name: Torp
              first_name: Veda
              raw_attributes: {}
              custom_attributes: {}
              created_at: '2021-06-25T19:07:33.155Z'
              updated_at: '2021-06-25T19:07:33.155Z'
          created_at:
            format: date-time
            type: string
            description: An ISO 8601 timestamp.
            example: '2026-01-15T12:00:00.000Z'
          context:
            type: object
            additionalProperties: {}
            description: Additional context about the event.
        required:
        - object
        - id
        - event
        - data
        - created_at
        description: An event emitted by WorkOS.
        example:
          object: event
          id: event_01EHZNVPK3SFK441A1RGBFSHRT
          event: dsync.user.created
          data:
            id: directory_user_01E1JG7J09H96KYP8HM9B0G5SJ
            directory_id: directory_01ECAZ4NV9QMV47GW873HDCX74
            organization_id: org_01EZTR6WYX1A0DSE2CYMGXQ24Y
            state: active
            email: veda@foo-corp.com
            emails:
            - primary: true
              type: work
              value: veda@foo-corp.com
            idp_id: '2836'
            object: directory_user
            username: veda@foo-corp.com
            last_name: Torp
            first_name: Veda
            raw_attributes: {}
            custom_attributes: {}
            created_at: '2021-06-25T19:07:33.155Z'
            updated_at: '2021-06-25T19:07:33.155Z'
          created_at: '2021-06-25T19:07:33.155Z'
          context: {}
      - oneOf:
        - type: object
          properties:
            id:
              type: string
              description: Unique identifier for the event.
              example: event_01EHZNVPK3SFK441A1RGBFSHRT
            event:
              type: string
              const: action.authentication.denied
            data:
              type: object
              properties:
                action_endpoint_id:
                  type: string
                  description: The ID of the action endpoint.
                  example: action_endpoint_01EHWNCE74X7JSDV0X3SZ3KJNY
                action_execution_id:
                  type: string
                  description: The ID of the action execution.
                  example: action_execution_01EHWNCE74X7JSDV0X3SZ3KJNY
                type:
                  type: string
                  description: The type of action that was denied.
                  const: authentication
                verdict:
                  type: string
                  description: The verdict of the action.
                  const: Deny
                user_id:
                  type: string
                  description: The ID of the user.
                  example: user_01EHWNCE74X7JSDV0X3SZ3KJNY
                organization_id:
                  type:
                  - string
                  - 'null'
                  description: The ID of the organization.
                  example: org_01EHWNCE74X7JSDV0X3SZ3KJNY
                email:
                  type: string
                  description: The email address of the user.
                  example: user@example.com
                ip_address:
                  type:
                  - string
                  - 'null'
                  description: The IP address of the request.
                  example: 203.0.113.1
                user_agent:
                  type:
                  - string
                  - 'null'
                  description: The user agent of the request.
                  example: Mozilla/5.0
              required:
              - action_endpoint_id
              - action_execution_id
              - type
              - verdict
              - user_id
              - organization_id
              - email
              - ip_address
              - user_agent
              description: The event payload.
            context:
              $ref: '#/components/schemas/EventContextDto'
            created_at:
              format: date-time
              type: string
              description: An ISO 8601 timestamp.
              example: '2026-01-15T12:00:00.000Z'
            object:
              type: string
              description: Distinguishes the Event object.
              const: event
          required:
          - id
          - event
          - data
          - created_at
          - object
        - type: object
          properties:
            id:
              type: string
              description: Unique identifier for the event.
              example: event_01EHZNVPK3SFK441A1RGBFSHRT
            event:
              type: string
              const: action.user_registration.denied
            data:
              type: object
              properties:
                action_endpoint_id:
                  type: string
                  description: The ID of the action endpoint.
                  example: action_endpoint_01EHWNCE74X7JSDV0X3SZ3KJNY
                action_execution_id:
                  type: string
                  description: The ID of the action execution.
                  example: action_execution_01EHWNCE74X7JSDV0X3SZ3KJNY
                type:
                  type: string
                  description: The type of action that was denied.
                  const: user_registration
                verdict:
                  type: string
                  description: The verdict of the action.
                  const: Deny
                organization_id:
                  type:
                  - string
                  - 'null'
                  description: The ID of the organization.
                  example: org_01EHWNCE74X7JSDV0X3SZ3KJNY
                email:
                  type: string
                  description: The email address of the user.
                  example: user@example.com
                ip_address:
                  type:
                  - string
                  - 'null'
                  description: The IP address of the request.
                  example: 203.0.113.1
                user_agent:
                  type:
                  - string
                  - 'null'
                  description: The user agent of the request.
                  example: Mozilla/5.0
              required:
              - action_endpoint_id
              - action_execution_id
              - type
              - verdict
              - organization_id
              - email
              - ip_address
              - user_agent
              description: The event payload.
            context:
              $ref: '#/components/schemas/EventContextDto'
            created_at:
              format: date-time
              type: string
              description: An ISO 8601 timestamp.
              example: '2026-01-15T12:00:00.000Z'
            object:
              type: string
              description: Distinguishes the Event object.
              const: event
          required:
          - id
          - event
          - data
          - created_at
          - object
        - type: object
          properties:
            id:
              type: string
              description: Unique identifier for the event.
              example: event_01EHZNVPK3SFK441A1RGBFSHRT
            event:
              type: string
              const: api_key.created
            data:
              type: object
              properties:
                object:
                  type: string
                  description: Distinguishes the API key object.
                  const: api_key
                id:
                  type: string
                  description: Unique identifier of the API key.
                  example: api_key_01EHWNCE74X7JSDV0X3SZ3KJNY
                owner:
                  oneOf:
                  - type: object
                    properties:
                      type:
                        type: string
                        description: The type of the API key owner.
                        const: organization
                      id:
                        type: string
                        description: The unique identifier of the API key owner.
                        example: org_01EHWNCE74X7JSDV0X3SZ3KJNY
                    required:
                    - type
                    - id
                  - type: object
                    properties:
                      type:
                        type: string
                        description: The type of the API key owner.
                        const: user
                      id:
                        type: string
                        description: The unique identifier of the user who owns the API key.
                        example: user_01EHWNCE74X7JSDV0X3SZ3KJNY
                      organization_id:
                        type: string
                        description: The unique identifier of the organization the API key belongs to.
                        example: org_01EHWNCE74X7JSDV0X3SZ3KJNY
                    required:
                    - type
                    - id
                    - organization_id
                  description: The owner of the API key.
                name:
                  type: string
                  description: The name of the API key.
                  example: My API Key
                obfuscated_value:
                  type: string
                  description: The obfuscated value of the API key.
                  example: sk_test_...1234
                last_used_at:
                  type:
                  - string
                  - 'null'
                  description: The timestamp when the API key was last used.
                  example: '2026-01-15T12:00:00.000Z'
                permissions:
                  type: array
                  items:
                    type: string
                  description: The permissions granted to the API key.
                  example:
                  - users:read
                  - users:write
                created_at:
                  type: string
                  description: The timestamp when the API key was created.
                  example: '2026-01-15T12:00:00.000Z'
                updated_at:
                  type: string
                  description: The timestamp when the API key was last updated.
                  example: '2026-01-15T12:00:00.000Z'
              required:
              - object
              - id
              - owner
              - name
              - obfuscated_value
              - last_used_at
              - permissions
              - created_at
              - updated_at
              description: The event payload.
            created_at:
              format: date-time
              type: string
              description: An ISO 8601 timestamp.
              example: '2026-01-15T12:00:00.000Z'
            context:
              $ref: '#/components/schemas/EventContextDto'
            object:
              type: string
              description: Distinguishes the Event object.
              const: event
          required:
          - id
          - event
          - data
          - created_at
          - object
        - type: object
          properties:
            id:
              type: string
              description: Unique identifier for the event.
              example: event_01EHZNVPK3SFK441A1RGBFSHRT
            event:
              type: string
              const: api_key.revoked
            data:
              type: object
              properties:
                object:
                  type: string
                  description: Distinguishes the API key object.
                  const: api_key
                id:
                  type: string
                  description: Unique identifier of the API key.
                  example: api_key_01EHWNCE74X7JSDV0X3SZ3KJNY
                owner:
                  oneOf:
                  - type: object
                    properties:
                      type:
                        type: string
                        description: The type of the API key owner.
                        const: organization
                      id:
                        type: string
                        description: The unique identifier of the API key owner.
                        example: org_01EHWNCE74X7JSDV0X3SZ3KJNY
                    required:
                    - type
                    - id
                  - type: object
                    properties:
                      type:
                        type: string
                        description: The type of the API key owner.
                        const: user
                      id:
                        type: string
                        description: The unique identifier of the user who owns the API key.
                        example: user_01EHWNCE74X7JSDV0X3SZ3KJNY
                      organization_id:
                        type: string
                        description: The unique identifier of the organization the API key belongs to.
                        example: org_01EHWNCE74X7JSDV0X3SZ3KJNY
                    required:
                    - type
                    - id
                    - organization_id
                  description: The owner of the API key.
                name:
                  type: string
                  description: The name of the API key.
                  example: My API Key
                obfuscated_value:
                  type: string
                  description: The obfuscated value of the API key.
                  example: sk_test_...1234
                last_used_at:
                  type:
                  - string
                  - 'null'
                  description: The timestamp when the API key was last used.
                  example: '2026-01-15T12:00:00.000Z'
                permissions:
                  type: array
                  items:
                    type: string
                  description: The permissions granted to the API key.
                  example:
                  - users:read
                  - users:write
                created_at:
                  type: string
                  description: The timestamp when the API key was created.
                  example: '2026-01-15T12:00:00.000Z'
                updated_at:
                  type: string
                  description: The timestamp when the API key was last updated.
                  example: '2026-01-15T12:00:00.000Z'
              required:
              - object
              - id
              - owner
              - name
              - obfuscated_value
              - last_used_at
              - permissions
              - created_at
              - updated_at
              description: The event payload.
            created_at:
              format: date-time
              type: string
              description: An ISO 8601 timestamp.
              example: '2026-01-15T12:00:00.000Z'
            context:
              $ref: '#/components/schemas/EventContextDto'
            object:
              type: string
              description: Distinguishes the Event object.
              const: event
          required:
          - id
          - event
          - data
          - created_at
          - object
        - type: object
          properties:
            id:
              type: string
              description: Unique identifier for the event.
              example: event_01EHZNVPK3SFK441A1RGBFSHRT
            event:
              type: string
              const: authentication.email_verification_failed
            data:
              type: object
              properties:
                type:
                  type: string
                  const: email_verification
                status:
                  type: string
                  const: failed
                ip_address:
                  type:
                  - string
                  - 'null'
                  description: The IP address of the request.
                  example: 203.0.113.42
                user_agent:
                  type:
                  - string
                  - 'null'
                  description: The user agent of the request.
                  example: Mozilla/5.0
                user_id:
                  type:
                  - string
                  - 'null'
                  description: The ID of the user.
                  example: user_01E4ZCR3C56J083X43JQXF3JK5
                email:
                  type:
                  - string
                  - 'null'
                  description: The email address of the user.
                  example: user@example.com
                error:
                  type: object
                  properties:
                    code:
                      type: string
                      description: The error code.
                      example: mfa_challenge_failed
                    message:
                      type: string
                      description: A human-readable error message.
                      example: The MFA challenge has failed.
                  required:
                  - code
                  - message
                  description: Details about the authentication error.
              required:
              - type
              - status
              - ip_address
              - user_agent
              - user_id
              - email
              - error
              description: The event payload.
            created_at:
              format: date-time
              type: string
              description: An ISO 8601 timestamp.
              example: '2026-01-15T12:00:00.000Z'
            context:
              $ref: '#/components/schemas/EventContextDto'
            object:
              type: string
              description: Distinguishes the Event object.
              const: event
          required:
          - id
          - event
          - data
          - created_at
          - object
        - type: object
          properties:
            id:
              type: string
              description: Unique identifier for the event.
              example: event_01EHZNVPK3SFK441A1RGBFSHRT
            event:
              type: string
              const: authentication.email_verification_succeeded
            data:
              type: object
              properties:
                type:
                  type: string
                  const: email_verification
                status:
                  type: string
                  const: succeeded
                ip_address:
                  type:
                  - string
                  - 'null'
                  description: The IP address of the request.
                  example: 203.0.113.42
                user_agent:
                  type:
                  - string
                  - 'null'
                  description: The user agent of the request.
                  example: Mozilla/5.0
                user_id:
                  type: string
                  description: The ID of the user.
                  example: user_01E4ZCR3C56J083X43JQXF3JK5
                email:
                  type: string
                  description: The email address of the user.
                  example: user@example.com
              required:
              - type
              - status
              - ip_address
              - user_agent
              - user_id
              - email
              description: The event payload.
            created_at:
              format: date-time
              type: string
              description: An ISO 8601 timestamp.
              example: '2026-01-15T12:00:00.000Z'
            context:
              $ref: '#/components/schemas/EventContextDto'
            object:
              type: string
              description: Distinguishes the Event object.
              const: event
          required:
          - id
          - event
          - data
          - created_at
          - object
        - type: object
          properties:
            id:
              type: string
              description: Unique identifier for the event.
              example: event_01EHZNVPK3SFK441A1RGBFSHRT
            event:
              type: string
              const: authentication.magic_auth_failed
            data:
              type: object
              properties:
                type:
                  type: string
                  const: magic_auth
                status:
                  type: string
                  const: failed
                ip_address:
                  type:
                  - string
                  - 'null'
                  description: The IP address of the request.
                  example: 203.0.113.42
                user_agent:
                  type:
                  - string
                  - 'null'
                  description: The user agent of the request.
                  example: Mozilla/5.0
                user_id:
                  type:
                  - string
                  - 'null'
                  description: The ID of the user.
                  example: user_01E4ZCR3C56J083X43JQXF3JK5
                email:
                  type:
                  - string
                  - 'null'
                  description: The email address of the user.
                  example: user@example.com
                error:
                  type: object
                  properties:
                    code:
                      type: string
                      description: The error code.
                      example: mfa_challenge_failed
                    message:
                      type: string
                      description: A human-readable error message.
                      example: The MFA challenge has failed.
                  required:
                  - code
                  - message
                  description: Details about the authentication error.
              required:
              - type
              - status
              - ip_address
              - user_agent
              - user_id
              - email
              - error
              description: The event payload.
            created_at:
              format: date-time
              type: string
              description: An ISO 8601 timestamp.
              example: '2026-01-15T12:00:00.000Z'
            context:
              $ref: '#/components/schemas/EventContextDto'
            object:
              type: string
              description: Distinguishes the Event object.
              const: event
          required:
          - id
          - event
          - data
          - created_at
          - object
        - type: object
          properties:
            id:
              type: string
              description: Unique identifier for the event.
              example: event_01EHZNVPK3SFK441A1RGBFSHRT
            event:
              type: string
              const: authentication.magic_auth_succeeded
            data:
              type: object
              properties:
                type:
                  type: string
                  const: magic_auth
                status:
                  type: string
                  const: succeeded
                ip_address:
                  type:
                  - string
                  - 'null'
                  description: The IP address of the request.
                  example: 203.0.113.42
                user_agent:
                  type:
                  - string
                  - 'null'
                  description: The user agent of the request.
                  example: Mozilla/5.0
                user_id:
                  type: string
                  description: The ID of the user.
                  example: user_01E4ZCR3C56J083X43JQXF3JK5
                email:
                  type: string
                  description: The email address of the user.
                  example: user@example.com
              required:
              - type
              - status
              - ip_ad

# --- truncated at 32 KB (290 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/workos/refs/heads/main/openapi/workos-events-api-openapi.yml