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

# POST /experiences/{experienceId}/route

> Find appropriate sequence for a consumer



## OpenAPI

````yaml /api/openapi/consumer-api.json post /experiences/{experienceId}/route
openapi: 3.1.0
info:
  description: Consumer API for Fanfare
  title: Fanfare Consumer API
  version: 1.0.0
servers:
  - description: Production
    url: https://consumer.fanfare.io/api
  - description: Local development
    url: http://localhost:4802
security: []
paths:
  /experiences/{experienceId}/route:
    post:
      tags:
        - Experiences
      description: Find appropriate sequence for a consumer
      operationId: postExperiencesByExperienceIdRoute
      parameters:
        - in: path
          name: experienceId
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              properties:
                accessCode:
                  type: string
              required: []
              type: object
      responses:
        '200':
          content:
            application/json:
              schema:
                anyOf:
                  - properties:
                      experienceId:
                        type: string
                      offers:
                        items:
                          properties:
                            gates:
                              items:
                                anyOf:
                                  - properties:
                                      reason:
                                        properties:
                                          code:
                                            const: AUTH_REQUIRED
                                          detail:
                                            type: string
                                        required:
                                          - code
                                        type: object
                                      status:
                                        const: required
                                      type:
                                        const: authentication
                                    required:
                                      - type
                                      - status
                                      - reason
                                    type: object
                                  - properties:
                                      reason:
                                        properties:
                                          code:
                                            enum:
                                              - ACCESS_CODE_REQUIRED
                                              - ACCESS_CODE_INVALID
                                          detail:
                                            type: string
                                        required:
                                          - code
                                        type: object
                                      status:
                                        enum:
                                          - missing
                                          - invalid
                                      type:
                                        const: access_code
                                    required:
                                      - type
                                      - status
                                      - reason
                                    type: object
                                  - properties:
                                      challenge:
                                        properties:
                                          expiresAt:
                                            type: string
                                          id:
                                            type: string
                                          iframeUrl:
                                            type: string
                                          provider:
                                            const: turnstile
                                          type:
                                            enum:
                                              - turnstile_invisible
                                              - turnstile_managed
                                              - turnstile_interactive
                                        required:
                                          - id
                                          - provider
                                          - type
                                          - iframeUrl
                                          - expiresAt
                                        type: object
                                      mitigation:
                                        properties:
                                          attemptsRemaining:
                                            type: number
                                          blockedUntil:
                                            type: string
                                          message:
                                            type: string
                                        required: []
                                        type: object
                                      reason:
                                        properties:
                                          code:
                                            enum:
                                              - BOT_REQUIRED
                                              - BOT_BLOCKED
                                          detail:
                                            type: string
                                        required:
                                          - code
                                        type: object
                                      status:
                                        enum:
                                          - required
                                          - blocked
                                      type:
                                        const: bot_check
                                    required:
                                      - type
                                      - status
                                      - reason
                                    type: object
                              type: array
                            reasons:
                              items:
                                properties:
                                  code:
                                    enum:
                                      - NO_SEQUENCES
                                      - NO_ACCESS
                                      - AUTH_REQUIRED
                                      - ACCESS_CODE_REQUIRED
                                      - ACCESS_CODE_INVALID
                                      - AUDIENCE_NOT_MEMBER
                                      - BOT_REQUIRED
                                      - BOT_BLOCKED
                                  detail:
                                    type: string
                                required:
                                  - code
                                type: object
                              type: array
                            sequence:
                              properties:
                                color:
                                  anyOf:
                                    - type: string
                                    - type: 'null'
                                experienceId:
                                  type: string
                                id:
                                  type: string
                                name:
                                  type: string
                                priority:
                                  type: number
                              required:
                                - id
                                - name
                                - experienceId
                                - priority
                                - color
                              type: object
                            sequenceCapabilityGrant:
                              type: string
                            sequenceCapabilityGrantExpiresAt:
                              type: string
                            status:
                              const: gated
                          required:
                            - sequence
                            - status
                            - gates
                            - reasons
                          type: object
                        type: array
                      outcome:
                        const: routed
                      outcomeReasons:
                        items:
                          properties:
                            code:
                              enum:
                                - NO_SEQUENCES
                                - NO_ACCESS
                                - AUTH_REQUIRED
                                - ACCESS_CODE_REQUIRED
                                - ACCESS_CODE_INVALID
                                - AUDIENCE_NOT_MEMBER
                                - BOT_REQUIRED
                                - BOT_BLOCKED
                            detail:
                              type: string
                          required:
                            - code
                          type: object
                        type: array
                      schemaVersion:
                        const: 1
                      selected:
                        properties:
                          gates:
                            items:
                              anyOf:
                                - properties:
                                    reason:
                                      properties:
                                        code:
                                          const: AUTH_REQUIRED
                                        detail:
                                          type: string
                                      required:
                                        - code
                                      type: object
                                    status:
                                      const: required
                                    type:
                                      const: authentication
                                  required:
                                    - type
                                    - status
                                    - reason
                                  type: object
                                - properties:
                                    reason:
                                      properties:
                                        code:
                                          enum:
                                            - ACCESS_CODE_REQUIRED
                                            - ACCESS_CODE_INVALID
                                        detail:
                                          type: string
                                      required:
                                        - code
                                      type: object
                                    status:
                                      enum:
                                        - missing
                                        - invalid
                                    type:
                                      const: access_code
                                  required:
                                    - type
                                    - status
                                    - reason
                                  type: object
                                - properties:
                                    challenge:
                                      properties:
                                        expiresAt:
                                          type: string
                                        id:
                                          type: string
                                        iframeUrl:
                                          type: string
                                        provider:
                                          const: turnstile
                                        type:
                                          enum:
                                            - turnstile_invisible
                                            - turnstile_managed
                                            - turnstile_interactive
                                      required:
                                        - id
                                        - provider
                                        - type
                                        - iframeUrl
                                        - expiresAt
                                      type: object
                                    mitigation:
                                      properties:
                                        attemptsRemaining:
                                          type: number
                                        blockedUntil:
                                          type: string
                                        message:
                                          type: string
                                      required: []
                                      type: object
                                    reason:
                                      properties:
                                        code:
                                          enum:
                                            - BOT_REQUIRED
                                            - BOT_BLOCKED
                                        detail:
                                          type: string
                                      required:
                                        - code
                                      type: object
                                    status:
                                      enum:
                                        - required
                                        - blocked
                                    type:
                                      const: bot_check
                                  required:
                                    - type
                                    - status
                                    - reason
                                  type: object
                            type: array
                          reasons:
                            items:
                              properties:
                                code:
                                  enum:
                                    - NO_SEQUENCES
                                    - NO_ACCESS
                                    - AUTH_REQUIRED
                                    - ACCESS_CODE_REQUIRED
                                    - ACCESS_CODE_INVALID
                                    - AUDIENCE_NOT_MEMBER
                                    - BOT_REQUIRED
                                    - BOT_BLOCKED
                                detail:
                                  type: string
                              required:
                                - code
                              type: object
                            type: array
                          sequence:
                            properties:
                              color:
                                anyOf:
                                  - type: string
                                  - type: 'null'
                              experienceId:
                                type: string
                              id:
                                type: string
                              name:
                                type: string
                              priority:
                                type: number
                            required:
                              - id
                              - name
                              - experienceId
                              - priority
                              - color
                            type: object
                          sequenceCapabilityGrant:
                            type: string
                          sequenceCapabilityGrantExpiresAt:
                            type: string
                          status:
                            const: admissible
                        required:
                          - sequence
                          - status
                          - gates
                          - reasons
                        type: object
                    required:
                      - schemaVersion
                      - experienceId
                      - outcome
                      - selected
                      - offers
                      - outcomeReasons
                    type: object
                  - properties:
                      experienceId:
                        type: string
                      offers:
                        items: []
                        minItems: 0
                        type: array
                      outcome:
                        const: gated
                      outcomeReasons:
                        items:
                          properties:
                            code:
                              enum:
                                - NO_SEQUENCES
                                - NO_ACCESS
                                - AUTH_REQUIRED
                                - ACCESS_CODE_REQUIRED
                                - ACCESS_CODE_INVALID
                                - AUDIENCE_NOT_MEMBER
                                - BOT_REQUIRED
                                - BOT_BLOCKED
                            detail:
                              type: string
                          required:
                            - code
                          type: object
                        type: array
                      schemaVersion:
                        const: 1
                      selected:
                        properties:
                          gates:
                            items:
                              anyOf:
                                - properties:
                                    reason:
                                      properties:
                                        code:
                                          const: AUTH_REQUIRED
                                        detail:
                                          type: string
                                      required:
                                        - code
                                      type: object
                                    status:
                                      const: required
                                    type:
                                      const: authentication
                                  required:
                                    - type
                                    - status
                                    - reason
                                  type: object
                                - properties:
                                    reason:
                                      properties:
                                        code:
                                          enum:
                                            - ACCESS_CODE_REQUIRED
                                            - ACCESS_CODE_INVALID
                                        detail:
                                          type: string
                                      required:
                                        - code
                                      type: object
                                    status:
                                      enum:
                                        - missing
                                        - invalid
                                    type:
                                      const: access_code
                                  required:
                                    - type
                                    - status
                                    - reason
                                  type: object
                                - properties:
                                    challenge:
                                      properties:
                                        expiresAt:
                                          type: string
                                        id:
                                          type: string
                                        iframeUrl:
                                          type: string
                                        provider:
                                          const: turnstile
                                        type:
                                          enum:
                                            - turnstile_invisible
                                            - turnstile_managed
                                            - turnstile_interactive
                                      required:
                                        - id
                                        - provider
                                        - type
                                        - iframeUrl
                                        - expiresAt
                                      type: object
                                    mitigation:
                                      properties:
                                        attemptsRemaining:
                                          type: number
                                        blockedUntil:
                                          type: string
                                        message:
                                          type: string
                                      required: []
                                      type: object
                                    reason:
                                      properties:
                                        code:
                                          enum:
                                            - BOT_REQUIRED
                                            - BOT_BLOCKED
                                        detail:
                                          type: string
                                      required:
                                        - code
                                      type: object
                                    status:
                                      enum:
                                        - required
                                        - blocked
                                    type:
                                      const: bot_check
                                  required:
                                    - type
                                    - status
                                    - reason
                                  type: object
                            type: array
                          reasons:
                            items:
                              properties:
                                code:
                                  enum:
                                    - NO_SEQUENCES
                                    - NO_ACCESS
                                    - AUTH_REQUIRED
                                    - ACCESS_CODE_REQUIRED
                                    - ACCESS_CODE_INVALID
                                    - AUDIENCE_NOT_MEMBER
                                    - BOT_REQUIRED
                                    - BOT_BLOCKED
                                detail:
                                  type: string
                              required:
                                - code
                              type: object
                            type: array
                          sequence:
                            properties:
                              color:
                                anyOf:
                                  - type: string
                                  - type: 'null'
                              experienceId:
                                type: string
                              id:
                                type: string
                              name:
                                type: string
                              priority:
                                type: number
                            required:
                              - id
                              - name
                              - experienceId
                              - priority
                              - color
                            type: object
                          sequenceCapabilityGrant:
                            type: string
                          sequenceCapabilityGrantExpiresAt:
                            type: string
                          status:
                            const: gated
                        required:
                          - sequence
                          - status
                          - gates
                          - reasons
                        type: object
                    required:
                      - schemaVersion
                      - experienceId
                      - outcome
                      - selected
                      - offers
                      - outcomeReasons
                    type: object
                  - properties:
                      experienceId:
                        type: string
                      offers:
                        items: []
                        minItems: 0
                        type: array
                      outcome:
                        const: no_access
                      outcomeReasons:
                        items:
                          properties:
                            code:
                              enum:
                                - NO_SEQUENCES
                                - NO_ACCESS
                                - AUTH_REQUIRED
                                - ACCESS_CODE_REQUIRED
                                - ACCESS_CODE_INVALID
                                - AUDIENCE_NOT_MEMBER
                                - BOT_REQUIRED
                                - BOT_BLOCKED
                            detail:
                              type: string
                          required:
                            - code
                          type: object
                        type: array
                      schemaVersion:
                        const: 1
                    required:
                      - schemaVersion
                      - experienceId
                      - outcome
                      - offers
                      - outcomeReasons
                    type: object
          description: Sequence routing result
        '400':
          content:
            application/json:
              schema:
                properties:
                  error:
                    const: validation_error
                  issues:
                    items:
                      properties:
                        expected:
                          type: string
                        kind:
                          type: string
                        message:
                          type: string
                        path:
                          items:
                            properties:
                              input: {}
                              key:
                                type: string
                              origin:
                                type: string
                              type:
                                type: string
                            required:
                              - type
                              - origin
                              - input
                              - key
                            type: object
                          type: array
                        received:
                          type: string
                        type:
                          type: string
                      required:
                        - kind
                        - type
                        - expected
                        - received
                        - message
                        - path
                      type: object
                    type: array
                required:
                  - error
                  - issues
                type: object
          description: Bad Request - Invalid input schema
        '401':
          content:
            application/json:
              schema:
                properties:
                  error:
                    type: string
                required:
                  - error
                type: object
          description: Unauthorized - Authentication required
        '403':
          content:
            application/json:
              schema:
                properties:
                  error:
                    type: string
                required:
                  - error
                type: object
          description: Forbidden - User must be authenticated
        '500':
          content:
            application/json:
              schema:
                properties:
                  error:
                    type: string
                required:
                  - error
                type: object
          description: Internal server error

````