> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://infonite.dev/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://infonite.dev/_mcp/server.

# On Flow Started

POST 

Triggered when the user opens the Spain Public Administration widget and starts the verification flow. If an `aes_key` was provided during [Create Session](api:POST/es-public-administration/v1/manager/init), the browser metadata inside the `data` payload will be delivered encrypted in `aes::Base64(IV + Ciphertext + Tag)` format.

<Card title="Encrypted Payload" icon="fa-solid fa-key" href="/payload-encryption">
  If you configured an `aes_key`, this payload is encrypted. View step-by-step decryption walkthrough and code templates in the **Payload Encryption** guide.
</Card>

If no `aes_key` was specified, the `data` payload is omitted (null).


Reference: https://infonite.dev/api-reference/spain-public-administration/spain-public-administration-api/webhooks/webhook-es-public-administration-started

## OpenAPI 3.1 Webhook Specification

```yaml
openapi: 3.1.0
info:
  title: es-public-administration-v1-0-0-openapi
  version: 1.0.0
paths: {}
webhooks:
  subpackage_webhooks.webhook:es-public-administration:started:
    post:
      operationId: subpackage_webhooks.webhook:es-public-administration:started
      summary: On Flow Started
      description: >
        Triggered when the user opens the Spain Public Administration widget and
        starts the verification flow. If an `aes_key` was provided during
        [Create Session](api:POST/es-public-administration/v1/manager/init), the
        browser metadata inside the `data` payload will be delivered encrypted
        in `aes::Base64(IV + Ciphertext + Tag)` format.


        <Card title="Encrypted Payload" icon="fa-solid fa-key"
        href="/payload-encryption">
          If you configured an `aes_key`, this payload is encrypted. View step-by-step decryption walkthrough and code templates in the **Payload Encryption** guide.
        </Card>


        If no `aes_key` was specified, the `data` payload is omitted (null).
      responses:
        '200':
          description: Webhook received successfully
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WebhookStartedPayload'
components:
  schemas:
    WebhookStartedPayloadStatusCode:
      type: string
      enum:
        - READY
        - WAITING
        - COMPLETED
        - FAILED
        - SYSTEM_CANCELLED
        - CLIENT_CANCELLED
        - CUSTOMER_CANCELLED
        - TIMED_OUT
        - CONFIGURATION_ERROR
      description: >-
        Base status codes for widget flows

        Allowed values are:
         - `READY`: The flow is waiting for an input
        - `WAITING`: Flow is waiting for an external event

        - `COMPLETED`: The flow has finalized successfully

        - `FAILED`: The flow has failed

        - `SYSTEM_CANCELLED`: The flow has ben cancelled by the system

        - `CLIENT_CANCELLED`: The flow has been cancelled by the client

        - `CUSTOMER_CANCELLED`: The flow has been cancelled by the customer

        - `TIMED_OUT`: The flow has timed out

        - `CONFIGURATION_ERROR`: The flow has been rejected due to a
        configuration error
      title: WebhookStartedPayloadStatusCode
    catgrid_flows__flows__es_public_administration__v1__machine__ctx__FlowOpenCtx__Out:
      type: object
      properties:
        origin:
          type: string
        user_agent:
          type: string
        browser_session:
          type: string
        user_ip:
          type: string
      description: Browser metadata of the customer device.
      title: >-
        catgrid_flows__flows__es_public_administration__v1__machine__ctx__FlowOpenCtx__Out
    WebhookStartedPayload:
      type: object
      properties:
        event_class:
          type: string
          enum:
            - EsPublicAdministrationV1FlowEvent
          description: >-
            Payload class discriminator — always this value for Spain Public
            Administration events.
        app_id:
          type: string
          format: ObjectId
        customer_id:
          type: string
        session_id:
          type: string
          format: ObjectId
        producer:
          type: string
          enum:
            - es-public-administration
          description: The flow that produced the event.
        event:
          type: string
          enum:
            - es-public-administration:started
          description: 'The event type: `started`.'
        date:
          type: string
          format: datetime
        status_code:
          $ref: '#/components/schemas/WebhookStartedPayloadStatusCode'
          description: >-
            Base status codes for widget flows

            Allowed values are:
             - `READY`: The flow is waiting for an input
            - `WAITING`: Flow is waiting for an external event

            - `COMPLETED`: The flow has finalized successfully

            - `FAILED`: The flow has failed

            - `SYSTEM_CANCELLED`: The flow has ben cancelled by the system

            - `CLIENT_CANCELLED`: The flow has been cancelled by the client

            - `CUSTOMER_CANCELLED`: The flow has been cancelled by the customer

            - `TIMED_OUT`: The flow has timed out

            - `CONFIGURATION_ERROR`: The flow has been rejected due to a
            configuration error
        status_message:
          type:
            - string
            - 'null'
        data:
          $ref: >-
            #/components/schemas/catgrid_flows__flows__es_public_administration__v1__machine__ctx__FlowOpenCtx__Out
          description: Details of the just-started session.
      required:
        - event_class
        - app_id
        - customer_id
        - session_id
        - producer
        - event
        - status_code
      description: >-
        Fired the moment the end user opens the flow: the session is live and
        the experience has

        started.
      title: WebhookStartedPayload

```