> ## Documentation Index
> Fetch the complete documentation index at: https://docs.baselayer.com/llms.txt
> Use this file to discover all available pages before exploring further.

# List one visit's timeline

> What happened during one visit at your application, oldest first by default, a page at a time: its browser events, detection updates, requests and server events, each by `kind`, on the visit's key from its start to when it was last seen. A decided request carries its decision and what the merchant did with it. `X-Total-Count` and `X-Total-Pages` count every match and are sent on the first cursor page and on every offset page. The timeline runs to when the visit was last seen, which lags its latest record by about a minute, so a record appears here about a minute after it is reported.



## OpenAPI

````yaml /api-reference/openapi.json get /acceptance/visits/{visit_id}/timeline
openapi: 3.1.0
info:
  title: baselayer-api-service
  version: 0.1.0
servers:
  - url: https://api.baselayer.com/
security: []
paths:
  /acceptance/visits/{visit_id}/timeline:
    get:
      tags:
        - Acceptance
      summary: List one visit's timeline
      description: >-
        What happened during one visit at your application, oldest first by
        default, a page at a time: its browser events, detection updates,
        requests and server events, each by `kind`, on the visit's key from its
        start to when it was last seen. A decided request carries its decision
        and what the merchant did with it. `X-Total-Count` and `X-Total-Pages`
        count every match and are sent on the first cursor page and on every
        offset page. The timeline runs to when the visit was last seen, which
        lags its latest record by about a minute, so a record appears here about
        a minute after it is reported.
      operationId: acceptance_visits_timeline_list
      parameters:
        - name: visit_id
          in: path
          required: true
          schema:
            description: The visit's id.
            format: uuid
            title: Visit Id
            type: string
          description: The visit's id.
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            maximum: 1000
            minimum: 1
            description: >-
              Maximum number of records to return in a single page. Must be
              between 1 and 1000.
            default: 10
            title: Limit
          description: >-
            Maximum number of records to return in a single page. Must be
            between 1 and 1000.
        - name: offset
          in: query
          required: false
          schema:
            anyOf:
              - type: integer
                minimum: 0
              - type: 'null'
            description: >-
              Number of records to skip from the beginning. Use 0 for the first
              page. Cannot be used with cursor.
            title: Offset
          description: >-
            Number of records to skip from the beginning. Use 0 for the first
            page. Cannot be used with cursor.
        - name: cursor
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: >-
              Opaque pagination cursor token that identifies the position in the
              result set. Use the cursor from the previous response to get the
              next page. Cannot be used with offset.
            title: Cursor
          description: >-
            Opaque pagination cursor token that identifies the position in the
            result set. Use the cursor from the previous response to get the
            next page. Cannot be used with offset.
        - name: sort
          in: query
          required: false
          schema:
            anyOf:
              - $ref: '#/components/schemas/v1.VisitTimelineSortField'
              - type: 'null'
            description: >-
              `timeline`: when it happened, oldest first; ties break on
              `record_id`. Defaults to `timeline` `asc`.
            title: Sort
          description: >-
            `timeline`: when it happened, oldest first; ties break on
            `record_id`. Defaults to `timeline` `asc`.
        - name: sort_direction
          in: query
          required: false
          schema:
            anyOf:
              - $ref: '#/components/schemas/SortMethod'
              - type: 'null'
            description: >-
              `asc` or `desc`, for every key of the sort. Defaults to the
              field's own: `timeline` `asc`.
            title: Sort Direction
          description: >-
            `asc` or `desc`, for every key of the sort. Defaults to the field's
            own: `timeline` `asc`.
      responses:
        '200':
          description: The visit's timeline in the requested order.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/v1.VisitTimelineItem'
            application/vnd.baselayer.v1+json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/v1.VisitTimelineItem'
          headers:
            X-Total-Count:
              description: Total number of records matching the query.
              schema:
                type: integer
            X-Total-Pages:
              description: Total number of pages available based on the current limit.
              schema:
                type: integer
            X-Next-Cursor:
              description: >-
                Cursor for the next page (only present when using the keyset
                pagination and if `has_more` is true.
              schema:
                type: string
        '404':
          description: No visit of your application has this id.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
                title: ResourceNotFound
                description: Could not locate the resource for the given URI.
                examples:
                  - type: resource_not_found
                    code: 1
                    message: Could not locate the resource for the given URI.
                    metadata: {}
        '422':
          description: The request is invalid.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
                title: ValidationFailed
                description: The request is invalid.
                examples:
                  - type: validation_failed
                    code: 7112
                    message: The request is invalid.
                    metadata: {}
        '503':
          description: >-
            Acceptance data cannot be read right now; retry after `Retry-After`
            seconds.
          headers:
            Retry-After:
              description: Seconds to wait before retrying.
              schema:
                type: integer
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
                title: AcceptanceReadsUnavailable
                description: >-
                  Acceptance data is temporarily unavailable. Retry after the
                  Retry-After interval.
                examples:
                  - type: acceptance_reads_unavailable
                    code: 7252
                    message: >-
                      Acceptance data is temporarily unavailable. Retry after
                      the Retry-After interval.
                    metadata: {}
      security:
        - APIKeyHeader: []
components:
  schemas:
    v1.VisitTimelineSortField:
      type: string
      enum:
        - timeline
      title: VisitTimelineSortField
      description: The field a visit's timeline sorts on.
    SortMethod:
      type: string
      enum:
        - asc
        - desc
      title: SortMethod
    v1.VisitTimelineItem:
      description: One item of a visit's timeline, by its `kind`.
      discriminator:
        mapping:
          browser_event: '#/components/schemas/v1.VisitTimelineBrowserEvent'
          detection_update: '#/components/schemas/v1.VisitTimelineDetectionUpdate'
          event: '#/components/schemas/v1.VisitTimelineServerEvent'
          request: '#/components/schemas/v1.VisitTimelineRequest'
        propertyName: kind
      oneOf:
        - $ref: '#/components/schemas/v1.VisitTimelineBrowserEvent'
        - $ref: '#/components/schemas/v1.VisitTimelineDetectionUpdate'
        - $ref: '#/components/schemas/v1.VisitTimelineRequest'
        - $ref: '#/components/schemas/v1.VisitTimelineServerEvent'
      title: VisitTimelineItem
    Error:
      properties:
        type:
          type: string
          title: Type
          description: >-
            Stable snake_case name of the error. Branch on this, never on
            `message`.
        code:
          type: integer
          title: Code
          description: Integer catalog code of the error.
        message:
          type: string
          title: Message
          description: For a human reading a log; not stable and not localized.
        metadata:
          additionalProperties: true
          type: object
          title: Metadata
          description: Context documented per `type`.
        request_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Request Id
          description: The `X-Request-ID` of the failed request.
      type: object
      required:
        - type
        - code
        - message
      title: Error
      description: The one body of every error a KYA route answers.
    v1.VisitTimelineBrowserEvent:
      description: |-
        Something that happened in the visitor's browser. Each member is set
        for the `event_kind` that carries it, as the browser reported it.
      properties:
        record_id:
          description: The record's id.
          format: uuid
          title: Record Id
          type: string
        occurred_at:
          description: When it happened.
          format: date-time
          title: Occurred At
          type: string
        path_template:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          description: >-
            The page it happened on, or the request's path, as a template; null
            when the record names none.
          examples:
            - /orders/{id}/items
          title: Path Template
        kind:
          const: browser_event
          title: Kind
          type: string
        event_kind:
          $ref: '#/components/schemas/v1.BrowserEventKind'
          description: What happened.
        dwell_ms:
          anyOf:
            - type: integer
            - type: 'null'
          default: null
          description: How long the page was open.
          title: Dwell Ms
        visible_ms:
          anyOf:
            - type: integer
            - type: 'null'
          default: null
          description: How long it was visible.
          title: Visible Ms
        max_scroll_pct:
          anyOf:
            - type: integer
            - type: 'null'
          default: null
          description: The furthest it was scrolled.
          title: Max Scroll Pct
        from_path_template:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          description: The page navigated from.
          title: From Path Template
        to_path_template:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          description: The page navigated to.
          title: To Path Template
        navigation_type:
          anyOf:
            - $ref: '#/components/schemas/v1.NavigationType'
            - type: 'null'
          default: null
          description: An in-page route or a full load.
        interaction_kind:
          anyOf:
            - $ref: '#/components/schemas/v1.InteractionKind'
            - type: 'null'
          default: null
          description: What the visitor did.
        target_role:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          description: The target element's ARIA role, or its tag name.
          title: Target Role
        target_label_hash:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          description: The target's label, hashed.
          title: Target Label Hash
        form_id_hash:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          description: The form's id or name, hashed.
          title: Form Id Hash
        field_name_hash:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          description: The field's name, hashed.
          title: Field Name Hash
        field_type:
          anyOf:
            - $ref: '#/components/schemas/v1.FormFieldType'
            - type: 'null'
          default: null
          description: The kind of control.
        phase:
          anyOf:
            - $ref: '#/components/schemas/v1.FormFieldPhase'
            - type: 'null'
          default: null
          description: The moment in the field.
        time_in_field_ms:
          anyOf:
            - type: integer
            - type: 'null'
          default: null
          description: How long the field held focus, at `blur`.
          title: Time In Field Ms
        validation_error_code:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          description: The browser's validity state that failed, at `invalid`.
          title: Validation Error Code
        error_kind:
          anyOf:
            - $ref: '#/components/schemas/v1.BrowserErrorKind'
            - type: 'null'
          default: null
          description: Where the error came from.
        message_hash:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          description: The error message, hashed.
          title: Message Hash
        source_path_template:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          description: The failing script's or resource's path.
          title: Source Path Template
      required:
        - record_id
        - occurred_at
        - kind
        - event_kind
      title: VisitTimelineBrowserEvent (v1)
      type: object
    v1.VisitTimelineDetectionUpdate:
      description: A detection result that arrived after the page.
      properties:
        record_id:
          description: The record's id.
          format: uuid
          title: Record Id
          type: string
        occurred_at:
          description: When it happened.
          format: date-time
          title: Occurred At
          type: string
        path_template:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          description: >-
            The page it happened on, or the request's path, as a template; null
            when the record names none.
          examples:
            - /orders/{id}/items
          title: Path Template
        kind:
          const: detection_update
          title: Kind
          type: string
        presence:
          $ref: '#/components/schemas/v1.PresenceKind'
          description: What detection judged the visitor.
        risk_level:
          $ref: '#/components/schemas/v1.RiskLevel'
          description: The risk it scored.
        confidence:
          anyOf:
            - $ref: '#/components/schemas/v1.ConfidenceLevel'
            - type: 'null'
          default: null
          description: How sure it was.
        agent_platform:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          description: The agent platform detection named.
          examples:
            - OpenAI ChatGPT
          title: Agent Platform
        risk_score:
          anyOf:
            - maximum: 100
              minimum: 0
              type: integer
            - type: 'null'
          default: null
          description: The risk it scored, 0 to 100; null when it sent none.
          title: Risk Score
      required:
        - record_id
        - occurred_at
        - kind
        - presence
        - risk_level
      title: VisitTimelineDetectionUpdate (v1)
      type: object
    v1.VisitTimelineServerEvent:
      description: A funnel event the merchant's server reported.
      properties:
        record_id:
          description: The record's id.
          format: uuid
          title: Record Id
          type: string
        occurred_at:
          description: When it happened.
          format: date-time
          title: Occurred At
          type: string
        path_template:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          description: >-
            The page it happened on, or the request's path, as a template; null
            when the record names none.
          examples:
            - /orders/{id}/items
          title: Path Template
        kind:
          const: event
          title: Kind
          type: string
        event_kind:
          $ref: '#/components/schemas/v1.BrowserEventKind'
          description: What happened.
        conversion:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          description: The name of the policy conversion that matched, on a `purchase`.
          title: Conversion
        order_reference:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          description: The merchant's order id.
          title: Order Reference
      required:
        - record_id
        - occurred_at
        - kind
        - event_kind
      title: VisitTimelineServerEvent (v1)
      type: object
    v1.VisitTimelineRequest:
      description: A request the merchant's server saw, with its decision inline.
      properties:
        record_id:
          description: The record's id.
          format: uuid
          title: Record Id
          type: string
        occurred_at:
          description: When it happened.
          format: date-time
          title: Occurred At
          type: string
        path_template:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          description: >-
            The page it happened on, or the request's path, as a template; null
            when the record names none.
          examples:
            - /orders/{id}/items
          title: Path Template
        kind:
          const: request
          title: Kind
          type: string
        method:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          description: The HTTP method.
          examples:
            - GET
          title: Method
        status:
          anyOf:
            - type: integer
            - type: 'null'
          default: null
          description: The response status.
          title: Status
        latency_ms:
          anyOf:
            - type: integer
            - type: 'null'
          default: null
          description: How long it took, in milliseconds.
          title: Latency Ms
        transport:
          $ref: '#/components/schemas/v1.VisitTransport'
          description: How the visitor reached the merchant.
        decision:
          anyOf:
            - $ref: '#/components/schemas/v1.VisitTimelineDecision'
            - type: 'null'
          default: null
          description: Null when the SDK did not run the policy.
      required:
        - record_id
        - occurred_at
        - kind
        - transport
      title: VisitTimelineRequest (v1)
      type: object
    v1.BrowserEventKind:
      description: |-
        What a browser record says happened. `purchase` is a server event and
        is refused on the browser route.
      enum:
        - page_view
        - page_exit
        - navigation
        - interaction
        - form_field
        - error
        - search
        - view_item
        - add_to_cart
        - begin_checkout
        - purchase
      title: BrowserEventKind
      type: string
    v1.NavigationType:
      description: How a browser moved between pages.
      enum:
        - spa
        - full_load
      title: NavigationType
      type: string
    v1.InteractionKind:
      description: What the visitor did on a page.
      enum:
        - click
        - submit
        - scroll
        - rage_click
        - dead_click
        - copy
        - paste
      title: InteractionKind
      type: string
    v1.FormFieldType:
      description: The kind of form control a `form_field` record is about.
      enum:
        - text
        - email
        - tel
        - password
        - number
        - date
        - checkbox
        - radio
        - select
        - textarea
        - file
        - other
      title: FormFieldType
      type: string
    v1.FormFieldPhase:
      description: The moment of a form field's life a `form_field` record marks.
      enum:
        - focus
        - change
        - blur
        - invalid
      title: FormFieldPhase
      type: string
    v1.BrowserErrorKind:
      description: Where a client JavaScript error came from.
      enum:
        - uncaught
        - unhandled_rejection
        - resource
      title: BrowserErrorKind
      type: string
    v1.PresenceKind:
      description: |-
        What is behind a request at a merchant: a person, an AI agent, a
        crawler, other automation, or not yet known.
      enum:
        - human
        - agent
        - crawler
        - automation
        - unknown
      title: PresenceKind
      type: string
    v1.RiskLevel:
      enum:
        - high
        - medium
        - low
        - no_risk
      title: RiskLevel
      type: string
    v1.ConfidenceLevel:
      enum:
        - high
        - medium
        - low
      title: ConfidenceLevel
      type: string
    v1.VisitTransport:
      description: How a visitor reached the merchant. Values may be added.
      enum:
        - browser
        - api
        - mcp
        - ucp
      title: VisitTransport
      type: string
    v1.VisitTimelineDecision:
      description: What the SDK decided for a request, and what the merchant then did.
      properties:
        acceptance_decision_id:
          description: The decision's id.
          format: uuid
          title: Acceptance Decision Id
          type: string
        outcome:
          $ref: '#/components/schemas/v1.AcceptanceDecisionOutcome'
          description: What it recommended.
        merchant_outcome:
          anyOf:
            - $ref: '#/components/schemas/v1.AcceptanceDecisionOutcome'
            - type: 'null'
          default: null
          description: >-
            What the merchant did with the recommendation; null when the SDK
            could not observe it.
        enforcement_mode:
          $ref: '#/components/schemas/v1.EnforcementMode'
          description: Whether the step enforced it.
        step:
          $ref: '#/components/schemas/v1.VisitStep'
          description: The funnel step it decided.
        rule:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          description: The rule that decided it; null for the default.
          title: Rule
        reasons:
          description: Why it decided as it did.
          items:
            $ref: '#/components/schemas/v1.AcceptanceDecisionReason'
          title: Reasons
          type: array
      required:
        - acceptance_decision_id
        - outcome
        - enforcement_mode
        - step
        - reasons
      title: VisitTimelineDecision (v1)
      type: object
    v1.AcceptanceDecisionOutcome:
      description: |-
        What a decision recommends for a request: let it through, serve a
        challenge, ask for a stronger credential, or refuse it.
      enum:
        - allow
        - challenge
        - step_up
        - block
      title: AcceptanceDecisionOutcome
      type: string
    v1.EnforcementMode:
      description: Whether a step's decisions are only recorded or also applied.
      enum:
        - report_only
        - enforce
      title: EnforcementMode
      type: string
    v1.VisitStep:
      description: The funnel step a request maps to under the acceptance policy.
      enum:
        - browse
        - search
        - cart
        - checkout
        - payment
        - account
        - signup
        - write
      title: VisitStep
      type: string
    v1.AcceptanceDecisionReason:
      description: |-
        Why a decision came out as it did.

        `rule_unsupported` means the SDK met a rule it cannot read: the rule
        never matches and the whole step runs report-only. Values may be added.
      enum:
        - credential_verified
        - credential_refused
        - web_bot_auth_verified
        - tap_verified
        - declared_user_agent
        - ip_range_match
        - detection_scored
        - detection_unavailable
        - presence_conflict
        - challenge_passed
        - no_rule_matched
        - unobserved
        - rule_unsupported
      title: AcceptanceDecisionReason
      type: string
  securitySchemes:
    APIKeyHeader:
      type: apiKey
      in: header
      name: X-API-Key

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.