Bem

Bem Webhooks API

bem POSTs a JSON event to your configured webhook URL each time a subscribed function call, workflow output, or collection-processing job fires. This section is the reference for those deliveries: the payload shape per event type, plus the endpoints you use to manage the signing secret. Every variant shares the same envelope — function/workflow IDs, timestamps, the inbound email that triggered the call, and so on — and adds a payload field that depends on the function type. The `eventType` field on the body is the discriminator: dispatch on it to select which payload shape to expect. SDKs generated from this spec expose a `webhooks.unwrap()` helper that performs the dispatch and returns a typed event. ## Payloads | `eventType` | Payload | Schema | | --- | --- | --- | | `extract` | [Extract event](/api/v3/webhooks/events/extract) | `ExtractEvent` | | `classify` | [Classify event](/api/v3/webhooks/events/classify) | `ClassifyEvent` | | `parse` | [Parse event](/api/v3/webhooks/events/parse) | `ParseEvent` | | `split_collection` | [Split collection event](/api/v3/webhooks/events/split-collection) | `SplitCollectionEvent` | | `split_item` | [Split item event](/api/v3/webhooks/events/split-item) | `SplitItemEvent` | | `join` | [Join event](/api/v3/webhooks/events/join) | `JoinEvent` | | `enrich` | [Enrich event](/api/v3/webhooks/events/enrich) | `EnrichEvent` | | `payload_shaping` | [Payload shaping event](/api/v3/webhooks/events/payload-shaping) | `PayloadShapingEvent` | | `send` | [Send event](/api/v3/webhooks/events/send) | `SendEvent` | | `evaluation` | [Evaluation event](/api/v3/webhooks/events/evaluation) | `EvaluationEvent` | | `collection_processing` | [Collection processing event](/api/v3/webhooks/events/collection-processing) | `collectionProcessingEvent` | | `error` | [Error event](/api/v3/webhooks/events/error) | `ErrorEvent` | ## Signing secret Every delivery includes a `bem-signature` header in the format `t={unix_timestamp},v1={hex_hmac_sha256}`. The signature covers `{timestamp}.{raw_request_body}` and is computed with HMAC-SHA256 using the active signing secret for your environment. To verify a payload: 1. Parse `bem-signature: t={timestamp},v1={signature}`. 2. Construct the signed string: `{timestamp}.{raw_request_body}`. 3. Compute HMAC-SHA256 of that string using your secret. 4. Reject the request if the hex digest doesn't match `v1`, or if the timestamp is more than a few minutes old. Manage the secret with these endpoints: - [**Generate a signing secret**](/api/v3/webhooks/secret/generate-secret) — `POST /v3/webhook-secret`. Returns the new secret in full exactly once. - [**Get the signing secret**](/api/v3/webhooks/secret/get-secret) — `GET /v3/webhook-secret`. Returns the active secret. - [**Revoke the signing secret**](/api/v3/webhooks/secret/revoke-secret) — `DELETE /v3/webhook-secret`. Webhook deliveries continue but are unsigned until a new secret is generated. For zero-downtime rotation, briefly accept both the old and new secret in your verification logic before revoking the old one. ## Retries bem treats any non-2XX response (or a transport failure) as a delivery error and retries with exponential backoff. Return a 2XX as soon as you have durably queued the payload — do not block on downstream work.

Operations 3

GET /v3/webhook-secret Get Webhook Secret #
POST /v3/webhook-secret Generate Webhook Secret #
DELETE /v3/webhook-secret Revoke Webhook Secret #

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/bem-webhooks-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 email required.

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

OpenAPI Specification

bem-webhooks-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Bem Webhooks API
  version: 1.0.0
  description: 'bem POSTs a JSON event to your configured webhook URL each time a subscribed function call, workflow output, or collection-processing job fires. This section is the reference for those deliveries: the payload shape per event type, plus the endpoints you use to manage the signing secret.


    Every variant shares the same envelope — function/workflow IDs, timestamps, the inbound email that triggered the call, and so on — and adds a payload field that depends on the function type. The `eventType` field on the body is the discriminator: dispatch on it to select which payload shape to expect. SDKs generated from this spec expose a `webhooks.unwrap()` helper that performs the dispatch and returns a typed event.


    ## Payloads


    | `eventType` | Payload | Schema |

    | --- | --- | --- |

    | `extract` | [Extract event](/api/v3/webhooks/events/extract) | `ExtractEvent` |

    | `classify` | [Classify event](/api/v3/webhooks/events/classify) | `ClassifyEvent` |

    | `parse` | [Parse event](/api/v3/webhooks/events/parse) | `ParseEvent` |

    | `split_collection` | [Split collection event](/api/v3/webhooks/events/split-collection) | `SplitCollectionEvent` |

    | `split_item` | [Split item event](/api/v3/webhooks/events/split-item) | `SplitItemEvent` |

    | `join` | [Join event](/api/v3/webhooks/events/join) | `JoinEvent` |

    | `enrich` | [Enrich event](/api/v3/webhooks/events/enrich) | `EnrichEvent` |

    | `payload_shaping` | [Payload shaping event](/api/v3/webhooks/events/payload-shaping) | `PayloadShapingEvent` |

    | `send` | [Send event](/api/v3/webhooks/events/send) | `SendEvent` |

    | `evaluation` | [Evaluation event](/api/v3/webhooks/events/evaluation) | `EvaluationEvent` |

    | `collection_processing` | [Collection processing event](/api/v3/webhooks/events/collection-processing) | `collectionProcessingEvent` |

    | `error` | [Error event](/api/v3/webhooks/events/error) | `ErrorEvent` |


    ## Signing secret


    Every delivery includes a `bem-signature` header in the format `t={unix_timestamp},v1={hex_hmac_sha256}`. The signature covers `{timestamp}.{raw_request_body}` and is computed with HMAC-SHA256 using the active signing secret for your environment.


    To verify a payload:


    1. Parse `bem-signature: t={timestamp},v1={signature}`.

    2. Construct the signed string: `{timestamp}.{raw_request_body}`.

    3. Compute HMAC-SHA256 of that string using your secret.

    4. Reject the request if the hex digest doesn''t match `v1`, or if the timestamp is more than a few minutes old.


    Manage the secret with these endpoints:


    - [**Generate a signing secret**](/api/v3/webhooks/secret/generate-secret) — `POST /v3/webhook-secret`. Returns the new secret in full exactly once.

    - [**Get the signing secret**](/api/v3/webhooks/secret/get-secret) — `GET /v3/webhook-secret`. Returns the active secret.

    - [**Revoke the signing secret**](/api/v3/webhooks/secret/revoke-secret) — `DELETE /v3/webhook-secret`. Webhook deliveries continue but are unsigned until a new secret is generated.


    For zero-downtime rotation, briefly accept both the old and new secret in your verification logic before revoking the old one.


    ## Retries


    bem treats any non-2XX response (or a transport failure) as a delivery error and retries with exponential backoff. Return a 2XX as soon as you have durably queued the payload — do not block on downstream work.'
servers:
- url: https://api.bem.ai
  description: US Region API
  variables: {}
- url: https://api.eu1.bem.ai
  description: EU Region API
  variables: {}
security:
- API Key: []
tags:
- name: Webhooks
  description: 'bem POSTs a JSON event to your configured webhook URL each time a subscribed function call, workflow output, or collection-processing job fires. This section is the reference for those deliveries: the payload shape per event type, plus the endpoints you use to manage the signing secret.


    Every variant shares the same envelope — function/workflow IDs, timestamps, the inbound email that triggered the call, and so on — and adds a payload field that depends on the function type. The `eventType` field on the body is the discriminator: dispatch on it to select which payload shape to expect. SDKs generated from this spec expose a `webhooks.unwrap()` helper that performs the dispatch and returns a typed event.


    ## Payloads


    | `eventType` | Payload | Schema |

    | --- | --- | --- |

    | `extract` | [Extract event](/api/v3/webhooks/events/extract) | `ExtractEvent` |

    | `classify` | [Classify event](/api/v3/webhooks/events/classify) | `ClassifyEvent` |

    | `parse` | [Parse event](/api/v3/webhooks/events/parse) | `ParseEvent` |

    | `split_collection` | [Split collection event](/api/v3/webhooks/events/split-collection) | `SplitCollectionEvent` |

    | `split_item` | [Split item event](/api/v3/webhooks/events/split-item) | `SplitItemEvent` |

    | `join` | [Join event](/api/v3/webhooks/events/join) | `JoinEvent` |

    | `enrich` | [Enrich event](/api/v3/webhooks/events/enrich) | `EnrichEvent` |

    | `payload_shaping` | [Payload shaping event](/api/v3/webhooks/events/payload-shaping) | `PayloadShapingEvent` |

    | `send` | [Send event](/api/v3/webhooks/events/send) | `SendEvent` |

    | `evaluation` | [Evaluation event](/api/v3/webhooks/events/evaluation) | `EvaluationEvent` |

    | `collection_processing` | [Collection processing event](/api/v3/webhooks/events/collection-processing) | `collectionProcessingEvent` |

    | `error` | [Error event](/api/v3/webhooks/events/error) | `ErrorEvent` |


    ## Signing secret


    Every delivery includes a `bem-signature` header in the format `t={unix_timestamp},v1={hex_hmac_sha256}`. The signature covers `{timestamp}.{raw_request_body}` and is computed with HMAC-SHA256 using the active signing secret for your environment.


    To verify a payload:


    1. Parse `bem-signature: t={timestamp},v1={signature}`.

    2. Construct the signed string: `{timestamp}.{raw_request_body}`.

    3. Compute HMAC-SHA256 of that string using your secret.

    4. Reject the request if the hex digest doesn''t match `v1`, or if the timestamp is more than a few minutes old.


    Manage the secret with these endpoints:


    - [**Generate a signing secret**](/api/v3/webhooks/secret/generate-secret) — `POST /v3/webhook-secret`. Returns the new secret in full exactly once.

    - [**Get the signing secret**](/api/v3/webhooks/secret/get-secret) — `GET /v3/webhook-secret`. Returns the active secret.

    - [**Revoke the signing secret**](/api/v3/webhooks/secret/revoke-secret) — `DELETE /v3/webhook-secret`. Webhook deliveries continue but are unsigned until a new secret is generated.


    For zero-downtime rotation, briefly accept both the old and new secret in your verification logic before revoking the old one.


    ## Retries


    bem treats any non-2XX response (or a transport failure) as a delivery error and retries with exponential backoff. Return a 2XX as soon as you have durably queued the payload — do not block on downstream work.'
paths:
  /v3/webhook-secret:
    get:
      operationId: v3-get-webhook-secret
      summary: Get Webhook Secret
      description: '**Get the current webhook signing secret.**


        Returns the active secret used to sign outbound webhook deliveries via the `bem-signature`

        header. Returns 404 if no secret has been generated for this environment yet.


        Use the secret to verify incoming webhook payloads:

        1. Parse `bem-signature: t={timestamp},v1={signature}`.

        2. Construct the signed string: `{timestamp}.{raw request body}`.

        3. Compute HMAC-SHA256 of that string using the secret.

        4. Compare the hex digest against `v1`.

        5. Reject requests where the timestamp is more than a few minutes old.'
      parameters: []
      responses:
        '200':
          description: The request has succeeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WebhookSecret'
      tags:
      - Webhooks
    post:
      operationId: v3-generate-webhook-secret
      summary: Generate Webhook Secret
      description: '**Generate a new webhook signing secret.**


        Creates a new signing secret for this environment (or replaces the existing one).

        The new secret is returned in full exactly once — store it securely.


        After rotation all newly delivered webhooks will be signed with the new secret.

        Update your verification logic before calling this endpoint if you need zero-downtime rotation.'
      parameters: []
      responses:
        '200':
          description: The request has succeeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WebhookSecret'
      tags:
      - Webhooks
    delete:
      operationId: v3-revoke-webhook-secret
      summary: Revoke Webhook Secret
      description: '**Revoke the current webhook signing secret.**


        Deletes the active signing secret. Webhook deliveries will continue but will no longer

        include a `bem-signature` header until a new secret is generated.'
      parameters: []
      responses:
        '200':
          description: The request has succeeded.
      tags:
      - Webhooks
webhooks:
  extract:
    post:
      summary: Extract event
      description: 'Delivered when an `extract` function completes processing of a document and produces structured JSON. The body''s `transformedContent` matches the function''s `outputSchema`.


        For signing-secret setup and retry semantics that apply to every variant, see the [Webhooks overview](/api/v3/webhooks).'
      tags:
      - Webhooks
      operationId: extract
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ExtractEvent'
      responses:
        2XX:
          description: Return any 2XX status code to acknowledge receipt. The exact code is not inspected.
  classify:
    post:
      summary: Classify event
      description: 'Delivered when a `classify` function chooses a category for a document. The selected label is in `choice` and matches one of the function version''s declared `classifications`.


        For signing-secret setup and retry semantics that apply to every variant, see the [Webhooks overview](/api/v3/webhooks).'
      tags:
      - Webhooks
      operationId: classify
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ClassifyEvent'
      responses:
        2XX:
          description: Return any 2XX status code to acknowledge receipt. The exact code is not inspected.
  parse:
    post:
      summary: Parse event
      description: 'Delivered when a `parse` function renders a document into a navigable structure of sections, entities, and relationships. The full parsed structure is in `transformedContent`.


        For signing-secret setup and retry semantics that apply to every variant, see the [Webhooks overview](/api/v3/webhooks).'
      tags:
      - Webhooks
      operationId: parse
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ParseEvent'
      responses:
        2XX:
          description: Return any 2XX status code to acknowledge receipt. The exact code is not inspected.
  split-collection:
    post:
      summary: Split collection event
      description: 'Delivered when a `split` function completes its collection-level pass and emits the list of items it found. Each item is fanned out to a downstream function as its own input.


        For signing-secret setup and retry semantics that apply to every variant, see the [Webhooks overview](/api/v3/webhooks).'
      tags:
      - Webhooks
      operationId: split-collection
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SplitCollectionEvent'
      responses:
        2XX:
          description: Return any 2XX status code to acknowledge receipt. The exact code is not inspected.
  split-item:
    post:
      summary: Split item event
      description: 'Delivered for each individual item produced by a `split` function. Carries the item''s offset within its parent collection and a presigned URL to its bytes.


        For signing-secret setup and retry semantics that apply to every variant, see the [Webhooks overview](/api/v3/webhooks).'
      tags:
      - Webhooks
      operationId: split-item
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SplitItemEvent'
      responses:
        2XX:
          description: Return any 2XX status code to acknowledge receipt. The exact code is not inspected.
  join:
    post:
      summary: Join event
      description: 'Delivered when a `join` function combines outputs from multiple upstream calls into a single transformed payload.


        For signing-secret setup and retry semantics that apply to every variant, see the [Webhooks overview](/api/v3/webhooks).'
      tags:
      - Webhooks
      operationId: join
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/JoinEvent'
      responses:
        2XX:
          description: Return any 2XX status code to acknowledge receipt. The exact code is not inspected.
  enrich:
    post:
      summary: Enrich event
      description: 'Delivered when an `enrich` function augments an input payload with results from semantic search against a collection. The enriched payload is in `enrichedContent`.


        For signing-secret setup and retry semantics that apply to every variant, see the [Webhooks overview](/api/v3/webhooks).'
      tags:
      - Webhooks
      operationId: enrich
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EnrichEvent'
      responses:
        2XX:
          description: Return any 2XX status code to acknowledge receipt. The exact code is not inspected.
  payload-shaping:
    post:
      summary: Payload shaping event
      description: 'Delivered when a `payload_shaping` function applies its JMESPath expressions to reshape an input payload. The reshaped result is in `transformedContent`.


        For signing-secret setup and retry semantics that apply to every variant, see the [Webhooks overview](/api/v3/webhooks).'
      tags:
      - Webhooks
      operationId: payload-shaping
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PayloadShapingEvent'
      responses:
        2XX:
          description: Return any 2XX status code to acknowledge receipt. The exact code is not inspected.
  send:
    post:
      summary: Send event
      description: 'Delivered when a `send` function attempts to deliver a payload to a downstream destination (webhook, S3, or Google Drive). The result of that delivery — including the destination''s response — is in the body. The original payload that was delivered is mirrored in `deliveredContent`.


        For signing-secret setup and retry semantics that apply to every variant, see the [Webhooks overview](/api/v3/webhooks).'
      tags:
      - Webhooks
      operationId: send
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SendEvent'
      responses:
        2XX:
          description: Return any 2XX status code to acknowledge receipt. The exact code is not inspected.
  evaluation:
    post:
      summary: Evaluation event
      description: 'Delivered when a function-accuracy evaluation completes for a transformation. The evaluator''s scores and per-field judgments are in `result`; check `status` for terminal success/failure.


        For signing-secret setup and retry semantics that apply to every variant, see the [Webhooks overview](/api/v3/webhooks).'
      tags:
      - Webhooks
      operationId: evaluation
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EvaluationEvent'
      responses:
        2XX:
          description: Return any 2XX status code to acknowledge receipt. The exact code is not inspected.
  collection-processing:
    post:
      summary: Collection processing event
      description: 'Delivered when a batch add or update against a Collection finishes. Reports how many items were processed and lists the IDs that were touched.


        For signing-secret setup and retry semantics that apply to every variant, see the [Webhooks overview](/api/v3/webhooks).'
      tags:
      - Webhooks
      operationId: collection-processing
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/collectionProcessingEvent'
      responses:
        2XX:
          description: Return any 2XX status code to acknowledge receipt. The exact code is not inspected.
  error:
    post:
      summary: Error event
      description: 'Delivered when a function call terminates with an error that''s surfaceable to the customer. The user-facing failure reason is in `message`.


        For signing-secret setup and retry semantics that apply to every variant, see the [Webhooks overview](/api/v3/webhooks).'
      tags:
      - Webhooks
      operationId: error
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ErrorEvent'
      responses:
        2XX:
          description: Return any 2XX status code to acknowledge receipt. The exact code is not inspected.
components:
  schemas:
    SendEventS3Output:
      type: object
      required:
      - bucketName
      - key
      properties:
        bucketName:
          type: string
          description: Name of the S3 bucket the payload was written to.
        key:
          type: string
          description: Object key under which the payload was stored.
      description: Metadata returned when a Send function delivers to an S3 bucket.
    SendEventWebhookOutput:
      type: object
      required:
      - httpStatusCode
      - httpResponseBody
      properties:
        httpStatusCode:
          type: integer
          description: HTTP status code returned by the webhook endpoint.
        httpResponseBody:
          type: string
          description: Raw HTTP response body returned by the webhook endpoint.
      description: Metadata returned when a Send function delivers to a webhook.
    SendDestinationType:
      type: string
      enum:
      - webhook
      - s3
      - google_drive
      description: Destination type for a Send function.
    ExtractEvent:
      type: object
      required:
      - eventID
      - referenceID
      - functionID
      - functionName
      - transformedContent
      - itemOffset
      - itemCount
      properties:
        functionCallTryNumber:
          type: integer
          description: The attempt number of the function call that created this event. 1 indexed.
        eventID:
          type: string
          description: Unique ID generated by bem to identify the event.
        createdAt:
          type: string
          format: date-time
          description: Timestamp indicating when the event was created.
        referenceID:
          type: string
          description: The unique ID you use internally to refer to this data point, propagated from the original function input.
        inboundEmail:
          allOf:
          - $ref: '#/components/schemas/EventInboundEmail'
          description: The inbound email that triggered this event.
        metadata:
          type: object
          properties:
            durationFunctionToEventSeconds:
              type: number
        eventType:
          type: string
          enum:
          - extract
        functionCallID:
          type: string
          description: Unique identifier of function call that this event is associated with.
        functionID:
          type: string
          description: Unique identifier of function that this event is associated with.
        functionName:
          type: string
          description: Unique name of function that this event is associated with.
        functionVersionNum:
          type: integer
          description: Version number of function that this event is associated with.
        callID:
          type: string
          description: Unique identifier of workflow call that this event is associated with.
        workflowID:
          type: string
          description: Unique identifier of workflow that this event is associated with.
        workflowName:
          type: string
          description: Name of workflow that this event is associated with.
        workflowVersionNum:
          type: integer
          description: Version number of workflow that this event is associated with.
        inputType:
          $ref: '#/components/schemas/InputType'
        transformationID:
          type: string
          description: Unique ID for each transformation output generated by bem following Segment's KSUID conventions.
        s3URL:
          anyOf:
          - type: string
          - type: 'null'
          description: Presigned S3 URL for the input content uploaded to S3.
        inputs:
          anyOf:
          - type: array
            items:
              type: object
              properties:
                inputType:
                  anyOf:
                  - type: string
                  - type: 'null'
                inputContent:
                  anyOf:
                  - type: string
                  - type: 'null'
                jsonInputContent:
                  anyOf:
                  - type: object
                    unevaluatedProperties: {}
                  - type: 'null'
                s3URL:
                  anyOf:
                  - type: string
                  - type: 'null'
          - type: 'null'
          description: Array of transformation inputs with their types and S3 URLs.
        transformedContent:
          type: object
          unevaluatedProperties: {}
          description: The transformed content of the input. The structure of this object is defined by the function configuration.
        correctedContent:
          anyOf:
          - type: object
            properties:
              output:
                type: array
                items:
                  $ref: '#/components/schemas/AnyType'
          - $ref: '#/components/schemas/AnyType'
          description: Corrected feedback provided for fine-tuning purposes.
        invalidProperties:
          type: array
          items:
            type: string
          description: List of properties that were invalid in the input.
        itemOffset:
          type: integer
          description: The offset of the first item that was transformed. Used for batch transformations to indicate which item in the batch this event corresponds to.
        itemCount:
          type: integer
          description: The number of items that were transformed. Used for batch transformations to indicate how many items were transformed.
        fieldBoundingBoxes:
          type: object
          unevaluatedProperties: {}
          description: 'Per-field bounding boxes. A JSON object mapping RFC 6901 JSON Pointer paths (e.g. `"/invoiceNumber"`,

            `"/items/0/price"`) to the document regions from which each extracted value was sourced.'
        fieldConfidences:
          type: object
          unevaluatedProperties:
            type: number
            format: float
          description: 'Per-field confidence scores. A JSON object mapping RFC 6901 JSON Pointer paths (e.g. `"/invoiceNumber"`)

            to float values in the range [0, 1] indicating the model''s confidence in each extracted field value.'
        avgConfidence:
          anyOf:
          - type: number
            format: float
          - type: 'null'
          description: Average confidence score across all extracted fields, in the range [0, 1].
      description: 'V3 event variants that do not exist in the shared `Event` union.


        `ExtractEvent` and `ClassifyEvent` are emitted only by V3-era function types

        (`extract` and `classify`). The shared `Event` union in `specs/events/models.tsp`

        predates these types and continues to describe V2 / V1-alpha responses verbatim;

        V3 response payloads add the new variants via the `EventV3` union below while

        keeping every shared variant intact for backward compatibility.'
      title: Extract Event
    AnyType:
      anyOf:
      - type: object
        unevaluatedProperties: {}
      - type: array
        items: {}
      - type: string
      - type: number
      - type: integer
      - type: boolean
      - type: 'null'
    EvaluationEvent:
      type: object
      required:
      - eventID
      - referenceID
      - functionID
      - functionName
      - transformId
      - evaluationVersion
      - result
      - status
      properties:
        functionCallTryNumber:
          type: integer
          description: The attempt number of the function call that created this event. 1 indexed.
        eventID:
          type: string
          description: Unique ID generated by bem to identify the event.
        createdAt:
          type: string
          format: date-time
          description: Timestamp indicating when the event was created.
        referenceID:
          type: string
          description: The unique ID you use internally to refer to this data point, propagated from the original function input.
        inboundEmail:
          allOf:
          - $ref: '#/components/schemas/EventInboundEmail'
          description: The inbound email that triggered this event.
        metadata:
          type: object
          properties:
            durationFunctionToEventSeconds:
              type: number
        eventType:
          type: string
          enum:
          - evaluation
        functionCallID:
          type: string
          description: Unique identifier of function call that this event is associated with.
        functionID:
          type: string
          description: Unique identifier of function that this event is associated with.
        functionName:
          type: string
          description: Unique name of function that this event is associated with.
        functionVersionNum:
          type: integer
          description: Version number of function that this event is associated with.
        callID:
          type: string
          description: Unique identifier of workflow call that this event is associated with.
        workflowID:
          type: string
          description: Unique identifier of workflow that this event is associated with.
        workflowName:
          type: string
          description: Name of workflow that this event is associated with.
        workflowVersionNum:
          type: integer
          description: Version number of workflow that this event is associated with.
        transformId:
          type: string
          description: Unique ID of the transformation that was evaluated.
        evaluationVersion:
          type: string
          description: Version identifier of the evaluation logic that produced this result.
        result:
          type: object
          unevaluatedProperties: {}
          description: 'Evaluator output. Shape depends on `evaluationVersion` and includes

            confidence scores, per-field hallucination flags, and relevance metrics.'
        status:
          type: string
          enum:
          - success
          - failed
          description: Terminal status of the evaluation run.
        errorMessage:
          type: string
          description: Failure reason populated when `status` is `failed`.
      description: 'Emitted when a function-accuracy evaluation completes for a transformation.

        Evaluations are scheduled by `POST /v3/eval` and run asynchronously; this

        event reports the terminal result.'
      title: Evaluation Event
    JoinEventItem:
      type: object
      required:
      - itemReferenceID
      - itemOffset
      - itemCount
      properties:
        itemReferenceID:
          type: string
          description: The unique ID you use internally to refer to this data point.
        itemOffset:
          type: integer
          description: The offset of the first item that was transformed. Used for batch transformations to indicate which item in the batch this event corresponds to.
        itemCount:
          type: integer
          description: The number of items that were transformed.
        s3URL:
          type: string
          description: The presigned S3 URL of the file that was joined.
    SplitCollectionEvent:
      type: object
      required:
      - eventID
      - referenceID
      - functionID
      - functionName
      - outputType
      - printPageOutput
      - semanticPageOutput
      properties:
        functionCallTryNumber:
          type: integer
          description: The attempt number of the function call that created this event. 1 indexed.
        eventID:
          type: string
          description: Unique ID generated by bem to identify the event.
        createdAt:
          type: string
          format: date-time
          description: Timestamp indicating when the event was created.
        referenceID:
          type: string
          description: The unique ID you use internally to refer to this data point, propagated from the original function input.
        inboundEmail:
          allOf:
          - $ref: '#/components/schemas/EventInboundEmail'
          description: The inbound email that triggered this event.
        metadata:
          type: object
          properties:
            durationFunctionToEventSeconds:
              type: number
        eventType:
          type: string
          enum:
          - split_collection
        functionCallID:
          type: string
          description: Unique identifier of function call that this event is associated with.
        functionID:
          type: string
          description: Unique identifier of function that this event is associated with.
        functionName:
          type: string
          description: Unique name of function that this event is associated with.
        functionVersionNum:
          type: integer
          description: Version number of function that this event is associated with.
        callID:
          type: string
          description: Unique identifier of workflow call that this event is associated with.
        workflowID:
          type: string
          description: Unique identifier of workflow that this event is associated with.
        workflowName:
          type: string
          description: Name of workflow that this event is associated with.
        workflowVersionNum:
          type: integer
          description: Version number of workflow that this event is associated with.
        outputType:
          type: string
          enum:
          - print_page
          - semantic_page
        printPageOutput:
          type: object
          properties:
            itemCount:
              type: integer
            items:
              type: array
              items:
                type: object
                properties:
                  itemReferenceID:
                    type: string
                  itemOffset:
                    type: integer
                  s3URL:
                    type: string
        semanticPageOutput:
          type: object
          properties:
            pageCount:
              type: integer
            itemCount:
              type: integer
            items:
              type: array
              items:
                type: object
                properties:
                  itemReferenceID:
                    type: s

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