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

# Get user flow

> User paths: the pages and events that come after (or before) the anchors, step by step. The same report as User paths in the dashboard.



## OpenAPI

````yaml /api/openapi.json post /v0/projects/{projectId}/query/flow
openapi: 3.1.0
info:
  title: Manalens API
  version: 0.1.0
  description: >-
    The public API of Manalens: event ingestion, profile properties and the
    Query API. Success bodies are the resource, with no envelope. Errors use the
    `Error` format. See https://docs.manalens.dev/api/overview.
servers:
  - url: https://api.manalens.dev
    description: API
  - url: https://events.manalens.dev
    description: Event ingestion
security: []
tags:
  - name: Events
    description: Send website, game and server events
  - name: Profiles
    description: Set and delete profile properties
  - name: Query
    description: Read analytics reports with an API key
paths:
  /v0/projects/{projectId}/query/flow:
    post:
      tags:
        - Query
      summary: Get user flow
      description: >-
        User paths: the pages and events that come after (or before) the
        anchors, step by step. The same report as User paths in the dashboard.
      operationId: getFlow
      parameters:
        - name: projectId
          in: path
          required: true
          description: The project ID
          schema:
            type: string
            format: uuid
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                date_from:
                  description: >-
                    First day (UTC) as YYYY-MM-DD. Default: 29 days before
                    date_to.
                  type: string
                  pattern: ^\d{4}-\d{2}-\d{2}$
                date_to:
                  description: >-
                    Last day (UTC) as YYYY-MM-DD. Default: today. The range is
                    at most 367 days.
                  type: string
                  pattern: ^\d{4}-\d{2}-\d{2}$
                page_path:
                  description: Only events on this page path
                  type: string
                  maxLength: 2048
                  pattern: ^\/
                utm_source:
                  type: string
                  maxLength: 255
                utm_medium:
                  type: string
                  maxLength: 255
                utm_campaign:
                  type: string
                  maxLength: 255
                utm_content:
                  type: string
                  maxLength: 255
                utm_term:
                  type: string
                  maxLength: 255
                ref:
                  description: Referral code (`ref` link parameter)
                  type: string
                  maxLength: 255
                paid_source:
                  description: Ad network of a paid click
                  type: string
                  enum:
                    - google
                    - meta
                    - microsoft
                    - tiktok
                    - twitter
                    - linkedin
                    - reddit
                    - snapchat
                    - paid_utm
                click_id:
                  description: Ad click ID (gclid, fbclid and others)
                  type: string
                  maxLength: 255
                channel_type:
                  description: Acquisition channel
                  type: string
                  enum:
                    - Paid Search
                    - Paid Video
                    - Paid Social
                    - Paid Other
                    - Email
                    - Referrals
                    - Display
                    - AI
                    - Organic Search
                    - Organic Social
                    - Organic Video
                    - Referrers
                    - Direct
                referrer:
                  description: Referrer origin, for example https://www.reddit.com
                  type: string
                  maxLength: 2048
                locale:
                  type: string
                  maxLength: 32
                device:
                  type: string
                  enum:
                    - desktop
                    - mobile
                    - tablet
                    - bot
                os:
                  type: string
                  enum:
                    - windows
                    - macos
                    - ios
                    - android
                    - linux
                    - other
                browser:
                  type: string
                  enum:
                    - chrome
                    - safari
                    - firefox
                    - edge
                    - opera
                    - other
                country:
                  description: ISO 3166-1 alpha-2 country code
                  type: string
                  pattern: ^[A-Za-z]{2}$
                currency:
                  description: 'Report currency for revenue (ISO 4217). Default: USD.'
                  type: string
                  pattern: ^[A-Z]{3}$
                currency_mode:
                  description: >-
                    `convert` (default) converts other currencies with the rate
                    of the event day. `only` counts the report currency alone.
                  type: string
                  enum:
                    - convert
                    - only
                filters:
                  description: Operator filters, combined with AND
                  maxItems: 20
                  type: array
                  items:
                    type: object
                    properties:
                      field:
                        type: string
                        description: >-
                          A context field (utm_source, referrer, channel_type,
                          country, ...), page_path, event, or properties.<key>
                      op:
                        type: string
                        enum:
                          - eq
                          - neq
                          - in
                          - nin
                          - gt
                          - lt
                          - gte
                          - lte
                          - startsWith
                          - endsWith
                          - contains
                          - notEmpty
                          - isEmpty
                      value:
                        anyOf:
                          - type: string
                          - type: array
                            items:
                              type: string
                    required:
                      - field
                      - op
                anchors:
                  minItems: 1
                  maxItems: 5
                  type: array
                  items:
                    type: object
                    properties:
                      type:
                        type: string
                        enum:
                          - page
                          - track
                      value:
                        type: string
                        minLength: 1
                        maxLength: 2048
                      filters: {}
                    required:
                      - type
                      - value
                    additionalProperties: false
                window_seconds:
                  default: 7200
                  type: integer
                  minimum: 3600
                  maximum: 1209600
                max_steps:
                  default: 3
                  type: integer
                  minimum: 2
                  maximum: 5
                nodes_per_step:
                  default: 20
                  type: integer
                  minimum: 2
                  maximum: 100
                included_events:
                  maxItems: 50
                  type: array
                  items:
                    type: string
                    minLength: 1
                    maxLength: 128
                excluded_events:
                  maxItems: 50
                  type: array
                  items:
                    type: string
                    minLength: 1
                    maxLength: 128
      responses:
        '200':
          description: The report
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ReportRows'
        '400':
          description: >-
            `INVALID_QUERY`: a parameter or the body is not valid. The message
            names the problem.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: >-
            `UNAUTHORIZED`: the API key is missing, malformed, unknown or
            revoked
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '402':
          description: >-
            `SUBSCRIPTION_REQUIRED`: the workspace has no active subscription or
            trial. `PLAN_UPGRADE_REQUIRED`: API keys need the Scale plan
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: >-
            `FORBIDDEN`: the key does not have the scope, its creator left the
            workspace, or the request came from a browser
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: >-
            `NOT_FOUND`: the key belongs to another project, or the resource
            does not exist
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          description: '`TOO_MANY_REQUESTS`: the key or workspace budget is used up'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          headers:
            Retry-After:
              description: Seconds to wait before a retry
              schema:
                type: integer
        '500':
          description: '`INTERNAL`: an unexpected error. The body has a `request_id`.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - ApiKey: []
components:
  schemas:
    ReportRows:
      type: object
      properties:
        date_from:
          type: string
          pattern: ^\d{4}-\d{2}-\d{2}$
          description: First day of the report
        date_to:
          type: string
          pattern: ^\d{4}-\d{2}-\d{2}$
          description: Last day of the report
        rows:
          type: array
          items:
            type: object
            propertyNames:
              type: string
            additionalProperties: {}
      required:
        - date_from
        - date_to
        - rows
    Error:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              description: A stable, machine-readable code. Branch on it.
            message:
              type: string
              description: A human-readable text. The wording can change.
            request_id:
              description: 'INTERNAL only: quote it when you contact support'
              type: string
          required:
            - code
            - message
      required:
        - error
      description: >-
        The error format of every endpoint. See
        https://docs.manalens.dev/api/errors.
  securitySchemes:
    ApiKey:
      type: http
      scheme: bearer
      description: >-
        An API key (`mana_api_...`) with scopes. It reads reports and writes
        profile properties.

````

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