> ## 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 your application's visits

> Every visit at your application, newest first by default, a page at a time: `limit`, then `cursor` from `X-Next-Cursor`, or `offset`. `X-Total-Count` and `X-Total-Pages` count every match and are sent on the first cursor page and on every offset page. `start_date` and `end_date` select visits by the day they started in `tz`. A visit's figures lag its latest record by about a minute.



## OpenAPI

````yaml /api-reference/openapi.json get /acceptance/visits
openapi: 3.1.0
info:
  title: baselayer-api-service
  version: 0.1.0
servers:
  - url: https://api.baselayer.com/
security: []
paths:
  /acceptance/visits:
    get:
      tags:
        - Acceptance
      summary: List your application's visits
      description: >-
        Every visit at your application, newest first by default, a page at a
        time: `limit`, then `cursor` from `X-Next-Cursor`, or `offset`.
        `X-Total-Count` and `X-Total-Pages` count every match and are sent on
        the first cursor page and on every offset page. `start_date` and
        `end_date` select visits by the day they started in `tz`. A visit's
        figures lag its latest record by about a minute.
      operationId: acceptance_visits_list
      parameters:
        - 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.VisitSortField'
              - type: 'null'
            description: >-
              `started_at`: the visit's first record; `last_seen_at`: its
              latest. Ties break on the visit's id. Defaults to `started_at`
              `desc`.
            title: Sort
          description: >-
            `started_at`: the visit's first record; `last_seen_at`: its latest.
            Ties break on the visit's id. Defaults to `started_at` `desc`.
        - 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: `started_at` `desc`, `last_seen_at` `desc`.
            title: Sort Direction
          description: >-
            `asc` or `desc`, for every key of the sort. Defaults to the field's
            own: `started_at` `desc`, `last_seen_at` `desc`.
        - name: presence_kind
          in: query
          required: false
          schema:
            anyOf:
              - type: array
                items:
                  $ref: '#/components/schemas/PresenceKind'
              - type: 'null'
            description: Only this presence kind now. Repeat for several.
            title: Presence Kind
          description: Only this presence kind now. Repeat for several.
        - name: presence_trust
          in: query
          required: false
          schema:
            anyOf:
              - type: array
                items:
                  $ref: '#/components/schemas/PresenceTrust'
              - type: 'null'
            description: Only this presence trust now. Repeat for several.
            title: Presence Trust
          description: Only this presence trust now. Repeat for several.
        - name: identity_level
          in: query
          required: false
          schema:
            anyOf:
              - type: array
                items:
                  $ref: '#/components/schemas/IdentityLevel'
              - type: 'null'
            description: Only visits that reached this identity level. Repeat for several.
            title: Identity Level
          description: Only visits that reached this identity level. Repeat for several.
        - name: transport
          in: query
          required: false
          schema:
            anyOf:
              - items:
                  $ref: '#/components/schemas/v1.VisitTransport'
                type: array
              - type: 'null'
            description: Only this transport. Repeat for several.
            title: Transport
          description: Only this transport. Repeat for several.
        - name: state
          in: query
          required: false
          schema:
            anyOf:
              - type: array
                items:
                  $ref: '#/components/schemas/v1.VisitState'
              - type: 'null'
            description: Only visits in this state. Repeat for several.
            title: State
          description: Only visits in this state. Repeat for several.
        - name: outcome
          in: query
          required: false
          schema:
            anyOf:
              - type: array
                items:
                  $ref: '#/components/schemas/v1.VisitOutcome'
              - type: 'null'
            description: Only visits that ended this way. Repeat for several.
            title: Outcome
          description: Only visits that ended this way. Repeat for several.
        - name: agent_key_thumbprint
          in: query
          required: false
          schema:
            anyOf:
              - items:
                  type: string
                type: array
              - type: 'null'
            description: Only this agent key. Repeat for several.
            title: Agent Key Thumbprint
          description: Only this agent key. Repeat for several.
        - name: credential_id
          in: query
          required: false
          schema:
            anyOf:
              - items:
                  type: string
                type: array
              - type: 'null'
            description: >-
              Only visits whose latest verified credential has this `jti`.
              Repeat for several.
            title: Credential Id
          description: >-
            Only visits whose latest verified credential has this `jti`. Repeat
            for several.
        - name: credential_subject
          in: query
          required: false
          schema:
            anyOf:
              - items:
                  type: string
                type: array
              - type: 'null'
            description: >-
              Only visits whose latest verified credential has this subject.
              Repeat for several.
            title: Credential Subject
          description: >-
            Only visits whose latest verified credential has this subject.
            Repeat for several.
        - name: start_date
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: date
              - type: 'null'
            description: 'Filter records created on or after this date (format: YYYY-MM-DD).'
            title: Start Date
          description: 'Filter records created on or after this date (format: YYYY-MM-DD).'
        - name: end_date
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: date
              - type: 'null'
            description: >-
              Filter records created on or before this date (format:
              YYYY-MM-DD).
            title: End Date
          description: 'Filter records created on or before this date (format: YYYY-MM-DD).'
        - name: tz
          in: query
          required: false
          schema:
            type: string
            description: >-
              IANA timezone identifier used to interpret start_date and end_date
              (defaults to UTC).
            examples:
              - UTC
              - America/Los_Angeles
              - Europe/London
            default: UTC
            title: Tz
          description: >-
            IANA timezone identifier used to interpret start_date and end_date
            (defaults to UTC).
      responses:
        '200':
          description: Visits in the requested order.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/v1.Visit'
            application/vnd.baselayer.v1+json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/v1.Visit'
          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
        '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.VisitSortField:
      type: string
      enum:
        - started_at
        - last_seen_at
      title: VisitSortField
      description: The field a visit list sorts on.
    SortMethod:
      type: string
      enum:
        - asc
        - desc
      title: SortMethod
    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
    PresenceTrust:
      description: |-
        How strongly the evidence backs a request's presence, strongest first:
        `credentialed` (a KYA credential), `verified` (a verified signature
        such as Web Bot Auth), `declared` (a User-Agent corroborated by the
        platform's published IP range), `scored` (a detection verdict),
        `unobserved` (the first request of a browser visit, before any
        evidence), `none` (evidence that did not corroborate).
      enum:
        - credentialed
        - verified
        - declared
        - scored
        - unobserved
        - none
      title: PresenceTrust
      type: string
    IdentityLevel:
      description: |-
        The deepest identity established for a visitor, lowest to highest:
        `L1` the operator is known, `L2` a consistent per-person identifier
        (pseudonymous), `L3` a verified-identity credential.
      enum:
        - L1
        - L2
        - L3
      title: IdentityLevel
      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.VisitState:
      description: 'Whether a visit is still going: a visit ends after 30 minutes idle.'
      enum:
        - active
        - ended
      title: VisitState
      type: string
    v1.VisitOutcome:
      description: How a visit ended for the merchant. Values may be added.
      enum:
        - converted
        - abandoned
        - blocked
      title: VisitOutcome
      type: string
    v1.Visit:
      description: |-
        One visitor's run of records at a merchant, browser events and server
        records alike, until 30 minutes pass without one.
      properties:
        visit_id:
          description: The visit's id.
          format: uuid
          title: Visit Id
          type: string
        environment:
          $ref: '#/components/schemas/v1.ApplicationType'
          description: The application's environment.
        transport:
          anyOf:
            - $ref: '#/components/schemas/v1.VisitTransport'
            - type: 'null'
          default: null
          description: >-
            How the visitor arrived: `browser` when it has only browser events;
            null when no record says.
        state:
          $ref: '#/components/schemas/v1.VisitState'
          description: Whether it goes on.
        outcome:
          anyOf:
            - $ref: '#/components/schemas/v1.VisitOutcome'
            - type: 'null'
          default: null
          description: How it ended; null while active.
        first_step:
          anyOf:
            - $ref: '#/components/schemas/v1.VisitStep'
            - type: 'null'
          default: null
          description: The step of its first decision; null when it has none.
        last_step:
          anyOf:
            - $ref: '#/components/schemas/v1.VisitStep'
            - type: 'null'
          default: null
          description: The step of its latest decision; null when it has none.
        presence:
          $ref: '#/components/schemas/v1.VisitPresence'
          description: The visitor's presence now.
        identity_level:
          anyOf:
            - $ref: '#/components/schemas/v1.IdentityLevel'
            - type: 'null'
          default: null
          description: The deepest identity any of its decisions had.
        agent:
          anyOf:
            - $ref: '#/components/schemas/v1.VisitAgent'
            - type: 'null'
          default: null
          description: The agent behind it.
        credential:
          anyOf:
            - $ref: '#/components/schemas/v1.VisitVerifiedCredential'
            - type: 'null'
          default: null
          description: The latest KYA credential the SDK verified on it; null when none.
        decision_count:
          description: Its decisions so far.
          minimum: 0
          title: Decision Count
          type: integer
        started_at:
          description: Its first record.
          format: date-time
          title: Started At
          type: string
        last_seen_at:
          description: Its latest record.
          format: date-time
          title: Last Seen At
          type: string
        ended_at:
          anyOf:
            - format: date-time
              type: string
            - type: 'null'
          default: null
          description: When it ended; null while active.
          title: Ended At
        funnel_stage:
          $ref: '#/components/schemas/v1.FunnelStage'
          description: The furthest stage it reached.
        identity_stage:
          $ref: '#/components/schemas/v1.VisitIdentityStage'
          description: >-
            How far its identity got, from its presence trust: `credentialed`
            once any decision verified a credential, `verified_agent` for a
            verified signature, `declared` for a corroborated claim, and
            `anonymous` otherwise.
        recognized_by:
          anyOf:
            - $ref: '#/components/schemas/v1.VisitRecognition'
            - type: 'null'
          default: null
          description: What the visitor was recognized by; null when nothing recognized it.
        risk_score:
          anyOf:
            - maximum: 100
              minimum: 0
              type: integer
            - type: 'null'
          default: null
          description: >-
            The risk its latest detection update scored, 0 to 100; null before
            one, or when the update carried no score.
          title: Risk Score
        journey:
          anyOf:
            - $ref: '#/components/schemas/v1.VisitJourney'
            - type: 'null'
          default: null
          description: Its page views; null when it viewed no page.
        detection_label:
          anyOf:
            - $ref: '#/components/schemas/v1.VisitDetectionLabel'
            - type: 'null'
          default: null
          description: >-
            The tool, product, provider or environment its latest detection
            update attributed it to with the highest confidence; null when none.
      required:
        - visit_id
        - environment
        - state
        - presence
        - decision_count
        - started_at
        - last_seen_at
        - funnel_stage
        - identity_stage
      title: Visit (v1)
      type: object
    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.ApplicationType:
      enum:
        - sandbox
        - production
      title: ApplicationType
      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.VisitPresence:
      description: What is behind a visit now and how strongly the evidence backs it.
      properties:
        kind:
          $ref: '#/components/schemas/v1.PresenceKind'
          description: What is behind it; `unknown` before any evidence.
        trust:
          $ref: '#/components/schemas/v1.PresenceTrust'
          description: >-
            How strongly the evidence backs `kind`; `unobserved` before any
            evidence.
        agent_platform:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          description: >-
            The agent platform its latest record named; null for a person or an
            unnamed agent.
          examples:
            - OpenAI ChatGPT
          title: Agent Platform
      required:
        - kind
        - trust
      title: VisitPresence (v1)
      type: object
    v1.IdentityLevel:
      description: |-
        The deepest identity established for a visitor, lowest to highest:
        `L1` the operator is known, `L2` a consistent per-person identifier
        (pseudonymous), `L3` a verified-identity credential.
      enum:
        - L1
        - L2
        - L3
      title: IdentityLevel
      type: string
    v1.VisitAgent:
      description: |-
        The agent behind a decision or visit, with what Baselayer has seen of it
        so far.
      properties:
        agent_key_thumbprint:
          description: The agent key's RFC 7638 thumbprint.
          title: Agent Key Thumbprint
          type: string
        agent_key_kid:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          description: The key's `kid`, when it has one.
          title: Agent Key Kid
        agent_key_source:
          $ref: '#/components/schemas/v1.AgentKeySource'
          description: Where the key came from.
        agent_platform:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          description: The agent platform the key belongs to, when known.
          title: Agent Platform
        first_seen_at:
          description: When this application first saw the agent; its value now.
          format: date-time
          title: First Seen At
          type: string
        visit_count:
          description: The agent's visits to this application; its value now.
          minimum: 0
          title: Visit Count
          type: integer
      required:
        - agent_key_thumbprint
        - agent_key_source
        - first_seen_at
        - visit_count
      title: VisitAgent (v1)
      type: object
    v1.VisitVerifiedCredential:
      description: The latest KYA credential the SDK verified on a visit.
      properties:
        credential_id:
          description: The credential's `jti`.
          title: Credential Id
          type: string
        subject:
          description: The credential's pairwise subject DID for this audience.
          title: Subject
          type: string
      required:
        - credential_id
        - subject
      title: VisitVerifiedCredential (v1)
      type: object
    v1.FunnelStage:
      description: |-
        A stage of the merchant's funnel, earliest first; a visit reaches each
        stage independently. Values may be added.
      enum:
        - arrived
        - admitted
        - browsed
        - carted
        - checked_out
        - converted
      title: FunnelStage
      type: string
    v1.VisitIdentityStage:
      description: >-
        How far a visit's identity got, from its presence trust.


        `declared` and `verified_agent` follow the visit's latest presence
        trust, so

        a visit can fall back from them; `credentialed` never falls back.
      enum:
        - anonymous
        - declared
        - verified_agent
        - credentialed
      title: VisitIdentityStage
      type: string
    v1.VisitRecognition:
      description: What a visit's visitor was recognized by.
      enum:
        - detection
        - user_agent
        - web_bot_auth
        - credential
      title: VisitRecognition
      type: string
    v1.VisitJourney:
      description: The pages a visit viewed and how long it has run.
      properties:
        page_count:
          description: Its page views.
          minimum: 0
          title: Page Count
          type: integer
        duration_ms:
          description: From its first record to its latest, in milliseconds.
          minimum: 0
          title: Duration Ms
          type: integer
        path_templates:
          description: The pages it viewed, as templates, in order; the first 20.
          examples:
            - - /
              - /pricing/
              - /about/
          items:
            type: string
          title: Path Templates
          type: array
      required:
        - page_count
        - duration_ms
        - path_templates
      title: VisitJourney (v1)
      type: object
    v1.VisitDetectionLabel:
      description: Something detection attributed the visitor to.
      properties:
        kind:
          $ref: '#/components/schemas/v1.DetectionLabelKind'
          description: What it names.
          examples:
            - tool
        value:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          description: Its key.
          examples:
            - playwright
          title: Value
        label:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          description: Its name.
          examples:
            - Playwright
          title: Label
        confidence:
          anyOf:
            - type: integer
            - type: 'null'
          default: null
          description: How sure, 0 to 100.
          title: Confidence
      required:
        - kind
      title: VisitDetectionLabel (v1)
      type: object
    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.PresenceTrust:
      description: |-
        How strongly the evidence backs a request's presence, strongest first:
        `credentialed` (a KYA credential), `verified` (a verified signature
        such as Web Bot Auth), `declared` (a User-Agent corroborated by the
        platform's published IP range), `scored` (a detection verdict),
        `unobserved` (the first request of a browser visit, before any
        evidence), `none` (evidence that did not corroborate).
      enum:
        - credentialed
        - verified
        - declared
        - scored
        - unobserved
        - none
      title: PresenceTrust
      type: string
    v1.AgentKeySource:
      description: |-
        Where an agent's key came from: a KYA credential, a Web Bot Auth
        signature, or a TAP token. Values may be added.
      enum:
        - kya
        - web_bot_auth
        - tap
      title: AgentKeySource
      type: string
    v1.DetectionLabelKind:
      description: 'What a detection label names: what the visitor runs, not who it is.'
      enum:
        - tool
        - product
        - provider
        - environment
      title: DetectionLabelKind
      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.