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

# Poll a Gate signup session

> Requires Authorization: Bearer gtpoll_....



## OpenAPI

````yaml /api-reference/openapi.json get /v1/gate/sessions/{gateSessionId}
openapi: 3.1.0
info:
  title: Foil API
  version: '2026-03-25'
  description: >-
    Customer-facing Foil server APIs for sessions, visitor fingerprints,
    organizations, and API keys.
servers:
  - url: https://api.usefoil.com
    description: Production
security: []
tags:
  - name: Sessions
    description: Durable session readback endpoints.
  - name: Visitor fingerprints
    description: Durable visitor fingerprint readback endpoints.
  - name: Organizations
    description: Organization lifecycle endpoints.
  - name: API Keys
    description: Organization API key lifecycle endpoints.
  - name: Gate
    description: >-
      Registry, organization-owned services, signup sessions, agent tokens, and
      dashboard login sessions.
  - name: Gate Webhooks
    description: Outbound Gate webhook delivery contracts.
  - name: Webhooks
    description: Manage webhook endpoints, subscriptions, and outgoing event delivery.
  - name: Events
    description: Inspect organization events and their webhook delivery attempts.
paths:
  /v1/gate/sessions/{gateSessionId}:
    get:
      tags:
        - Gate
      summary: Poll a Gate signup session
      description: 'Requires Authorization: Bearer gtpoll_....'
      operationId: pollGateSession
      parameters:
        - name: gateSessionId
          in: path
          required: true
          schema:
            $ref: '#/components/schemas/GateSessionId'
            example: gate_0123456789abcdefghjkmnpqrs
      responses:
        '200':
          description: Gate session status response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GateSessionPollResponse'
                example:
                  data:
                    object: gate_session
                    id: gate_0123456789abcdefghjkmnpqrs
                    status: pending
                    expires_at: '2026-03-24T20:00:05.000Z'
                    gate_account_id: gacct_0123456789abcdefghjkmnpqrs
                    account_name: Acme Growth Workspace
                    delivery_bundle:
                      integrator:
                        version: 1
                        algorithm: x25519-hkdf-sha256/aes-256-gcm
                        key_id: key_6cw04zdmetw8t5rsdppadhper0
                        ephemeral_public_key: >-
                          MCowBQYDK2VuAyEA7X6s5q0aQm1Bv1Q0nK5l2o3p9w8y7z6x5c4b3a2f1e0
                        salt: l7vW1kYpQ2m8nR4sT6u9xA
                        iv: b2M0NnA4cXJ0dXZ3eA
                        ciphertext: 203.0.113.10
                        tag: Y2hhY2hhMjBwb2x5MTMwNQ
                      gate:
                        version: 1
                        algorithm: x25519-hkdf-sha256/aes-256-gcm
                        key_id: key_6cw04zdmetw8t5rsdppadhper0
                        ephemeral_public_key: >-
                          MCowBQYDK2VuAyEA7X6s5q0aQm1Bv1Q0nK5l2o3p9w8y7z6x5c4b3a2f1e0
                        salt: l7vW1kYpQ2m8nR4sT6u9xA
                        iv: b2M0NnA4cXJ0dXZ3eA
                        ciphertext: 203.0.113.10
                        tag: Y2hhY2hhMjBwb2x5MTMwNQ
                    docs_url: https://app.acme.co/signup
                  meta:
                    request_id: req_cf147349a4134208aebb8c70e25fb7e1
        '401':
          description: Missing bearer token.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorEnvelope'
                example:
                  error:
                    code: request.validation_failed
                    message: Observation payload failed validation.
                    status: 1
                    retryable: true
                    request_id: req_cf147349a4134208aebb8c70e25fb7e1
                    docs_url: https://app.acme.co/signup
                    details:
                      fields:
                        - name: Acme Growth Workspace
                          issue: required
                          expected: string
                          received: any_of
                      allowed_values:
                        - verified
                      header_name: x-forwarded-for
                      parameter_set: browser_fingerprint
                      next_action: retry
        '403':
          description: Invalid bearer token.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorEnvelope'
                example:
                  error:
                    code: request.validation_failed
                    message: Observation payload failed validation.
                    status: 1
                    retryable: true
                    request_id: req_cf147349a4134208aebb8c70e25fb7e1
                    docs_url: https://app.acme.co/signup
                    details:
                      fields:
                        - name: Acme Growth Workspace
                          issue: required
                          expected: string
                          received: any_of
                      allowed_values:
                        - verified
                      header_name: x-forwarded-for
                      parameter_set: browser_fingerprint
                      next_action: retry
        '404':
          description: Session not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorEnvelope'
                example:
                  error:
                    code: request.validation_failed
                    message: Observation payload failed validation.
                    status: 1
                    retryable: true
                    request_id: req_cf147349a4134208aebb8c70e25fb7e1
                    docs_url: https://app.acme.co/signup
                    details:
                      fields:
                        - name: Acme Growth Workspace
                          issue: required
                          expected: string
                          received: any_of
                      allowed_values:
                        - verified
                      header_name: x-forwarded-for
                      parameter_set: browser_fingerprint
                      next_action: retry
        '410':
          description: Session expired or delivery consumed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorEnvelope'
                example:
                  error:
                    code: request.validation_failed
                    message: Observation payload failed validation.
                    status: 1
                    retryable: true
                    request_id: req_cf147349a4134208aebb8c70e25fb7e1
                    docs_url: https://app.acme.co/signup
                    details:
                      fields:
                        - name: Acme Growth Workspace
                          issue: required
                          expected: string
                          received: any_of
                      allowed_values:
                        - verified
                      header_name: x-forwarded-for
                      parameter_set: browser_fingerprint
                      next_action: retry
      security:
        - BearerAuth: []
components:
  schemas:
    GateSessionId:
      type: string
      example: gate_0123456789abcdefghjkmnpqrs
    GateSessionPollResponse:
      type: object
      required:
        - data
        - meta
      properties:
        data:
          $ref: '#/components/schemas/GateSessionPollData'
          example:
            object: gate_session
            id: gate_0123456789abcdefghjkmnpqrs
            status: pending
            expires_at: '2026-03-24T20:00:05.000Z'
            gate_account_id: gacct_0123456789abcdefghjkmnpqrs
            account_name: Acme Growth Workspace
            delivery_bundle:
              integrator:
                version: 1
                algorithm: x25519-hkdf-sha256/aes-256-gcm
                key_id: key_6cw04zdmetw8t5rsdppadhper0
                ephemeral_public_key: MCowBQYDK2VuAyEA7X6s5q0aQm1Bv1Q0nK5l2o3p9w8y7z6x5c4b3a2f1e0
                salt: l7vW1kYpQ2m8nR4sT6u9xA
                iv: b2M0NnA4cXJ0dXZ3eA
                ciphertext: 203.0.113.10
                tag: Y2hhY2hhMjBwb2x5MTMwNQ
              gate:
                version: 1
                algorithm: x25519-hkdf-sha256/aes-256-gcm
                key_id: key_6cw04zdmetw8t5rsdppadhper0
                ephemeral_public_key: MCowBQYDK2VuAyEA7X6s5q0aQm1Bv1Q0nK5l2o3p9w8y7z6x5c4b3a2f1e0
                salt: l7vW1kYpQ2m8nR4sT6u9xA
                iv: b2M0NnA4cXJ0dXZ3eA
                ciphertext: 203.0.113.10
                tag: Y2hhY2hhMjBwb2x5MTMwNQ
            docs_url: https://app.acme.co/signup
        meta:
          $ref: '#/components/schemas/ResponseMeta'
          example:
            request_id: req_cf147349a4134208aebb8c70e25fb7e1
      example:
        data:
          object: gate_session
          id: gate_0123456789abcdefghjkmnpqrs
          status: pending
          expires_at: '2026-03-24T20:00:05.000Z'
          gate_account_id: gacct_0123456789abcdefghjkmnpqrs
          account_name: Acme Growth Workspace
          delivery_bundle:
            integrator:
              version: 1
              algorithm: x25519-hkdf-sha256/aes-256-gcm
              key_id: key_6cw04zdmetw8t5rsdppadhper0
              ephemeral_public_key: MCowBQYDK2VuAyEA7X6s5q0aQm1Bv1Q0nK5l2o3p9w8y7z6x5c4b3a2f1e0
              salt: l7vW1kYpQ2m8nR4sT6u9xA
              iv: b2M0NnA4cXJ0dXZ3eA
              ciphertext: 203.0.113.10
              tag: Y2hhY2hhMjBwb2x5MTMwNQ
            gate:
              version: 1
              algorithm: x25519-hkdf-sha256/aes-256-gcm
              key_id: key_6cw04zdmetw8t5rsdppadhper0
              ephemeral_public_key: MCowBQYDK2VuAyEA7X6s5q0aQm1Bv1Q0nK5l2o3p9w8y7z6x5c4b3a2f1e0
              salt: l7vW1kYpQ2m8nR4sT6u9xA
              iv: b2M0NnA4cXJ0dXZ3eA
              ciphertext: 203.0.113.10
              tag: Y2hhY2hhMjBwb2x5MTMwNQ
          docs_url: https://app.acme.co/signup
        meta:
          request_id: req_cf147349a4134208aebb8c70e25fb7e1
    ApiErrorEnvelope:
      type: object
      additionalProperties: false
      required:
        - error
      properties:
        error:
          $ref: '#/components/schemas/PublicError'
          example:
            code: request.validation_failed
            message: Observation payload failed validation.
            status: 1
            retryable: true
            request_id: req_cf147349a4134208aebb8c70e25fb7e1
            docs_url: https://app.acme.co/signup
            details:
              fields:
                - name: Acme Growth Workspace
                  issue: required
                  expected: string
                  received: any_of
              allowed_values:
                - verified
              header_name: x-forwarded-for
              parameter_set: browser_fingerprint
              next_action: retry
      example:
        error:
          code: request.validation_failed
          message: Observation payload failed validation.
          status: 1
          retryable: true
          request_id: req_cf147349a4134208aebb8c70e25fb7e1
          docs_url: https://app.acme.co/signup
          details:
            fields:
              - name: Acme Growth Workspace
                issue: required
                expected: string
                received: any_of
            allowed_values:
              - verified
            header_name: x-forwarded-for
            parameter_set: browser_fingerprint
            next_action: retry
    GateSessionPollData:
      type: object
      required:
        - object
        - id
        - status
      properties:
        object:
          type: string
          const: gate_session
          example: gate_session
        id:
          $ref: '#/components/schemas/GateSessionId'
          example: gate_0123456789abcdefghjkmnpqrs
        status:
          type: string
          enum:
            - pending
            - approved
            - rejected
            - expired
          example: pending
        expires_at:
          type: string
          format: date-time
          example: '2026-03-24T20:00:05.000Z'
        gate_account_id:
          type: string
          example: gacct_0123456789abcdefghjkmnpqrs
        account_name:
          type: string
          example: Acme Growth Workspace
        delivery_bundle:
          $ref: '#/components/schemas/GateDeliveryBundle'
          example:
            integrator:
              version: 1
              algorithm: x25519-hkdf-sha256/aes-256-gcm
              key_id: key_6cw04zdmetw8t5rsdppadhper0
              ephemeral_public_key: MCowBQYDK2VuAyEA7X6s5q0aQm1Bv1Q0nK5l2o3p9w8y7z6x5c4b3a2f1e0
              salt: l7vW1kYpQ2m8nR4sT6u9xA
              iv: b2M0NnA4cXJ0dXZ3eA
              ciphertext: 203.0.113.10
              tag: Y2hhY2hhMjBwb2x5MTMwNQ
            gate:
              version: 1
              algorithm: x25519-hkdf-sha256/aes-256-gcm
              key_id: key_6cw04zdmetw8t5rsdppadhper0
              ephemeral_public_key: MCowBQYDK2VuAyEA7X6s5q0aQm1Bv1Q0nK5l2o3p9w8y7z6x5c4b3a2f1e0
              salt: l7vW1kYpQ2m8nR4sT6u9xA
              iv: b2M0NnA4cXJ0dXZ3eA
              ciphertext: 203.0.113.10
              tag: Y2hhY2hhMjBwb2x5MTMwNQ
        docs_url:
          type: string
          format: uri
          example: https://app.acme.co/signup
      example:
        object: gate_session
        id: gate_0123456789abcdefghjkmnpqrs
        status: pending
        expires_at: '2026-03-24T20:00:05.000Z'
        gate_account_id: gacct_0123456789abcdefghjkmnpqrs
        account_name: Acme Growth Workspace
        delivery_bundle:
          integrator:
            version: 1
            algorithm: x25519-hkdf-sha256/aes-256-gcm
            key_id: key_6cw04zdmetw8t5rsdppadhper0
            ephemeral_public_key: MCowBQYDK2VuAyEA7X6s5q0aQm1Bv1Q0nK5l2o3p9w8y7z6x5c4b3a2f1e0
            salt: l7vW1kYpQ2m8nR4sT6u9xA
            iv: b2M0NnA4cXJ0dXZ3eA
            ciphertext: 203.0.113.10
            tag: Y2hhY2hhMjBwb2x5MTMwNQ
          gate:
            version: 1
            algorithm: x25519-hkdf-sha256/aes-256-gcm
            key_id: key_6cw04zdmetw8t5rsdppadhper0
            ephemeral_public_key: MCowBQYDK2VuAyEA7X6s5q0aQm1Bv1Q0nK5l2o3p9w8y7z6x5c4b3a2f1e0
            salt: l7vW1kYpQ2m8nR4sT6u9xA
            iv: b2M0NnA4cXJ0dXZ3eA
            ciphertext: 203.0.113.10
            tag: Y2hhY2hhMjBwb2x5MTMwNQ
        docs_url: https://app.acme.co/signup
    ResponseMeta:
      type: object
      additionalProperties: false
      required:
        - request_id
      properties:
        request_id:
          $ref: '#/components/schemas/RequestId'
          example: req_cf147349a4134208aebb8c70e25fb7e1
      example:
        request_id: req_cf147349a4134208aebb8c70e25fb7e1
    PublicError:
      type: object
      additionalProperties: false
      required:
        - code
        - message
        - status
        - retryable
        - request_id
      properties:
        code:
          type: string
          x-foil-known-values-ref: '#/components/schemas/KnownPublicErrorCode'
          example: request.validation_failed
        message:
          type: string
          example: Observation payload failed validation.
        status:
          type: integer
          example: 1
        retryable:
          type: boolean
          example: true
        request_id:
          $ref: '#/components/schemas/RequestId'
          example: req_cf147349a4134208aebb8c70e25fb7e1
        docs_url:
          type: string
          format: uri
          example: https://app.acme.co/signup
        details:
          $ref: '#/components/schemas/ApiErrorDetails'
          example:
            fields:
              - name: Acme Growth Workspace
                issue: required
                expected: string
                received: any_of
            allowed_values:
              - verified
            header_name: x-forwarded-for
            parameter_set: browser_fingerprint
            next_action: retry
      example:
        code: request.validation_failed
        message: Observation payload failed validation.
        status: 1
        retryable: true
        request_id: req_cf147349a4134208aebb8c70e25fb7e1
        docs_url: https://app.acme.co/signup
        details:
          fields:
            - name: Acme Growth Workspace
              issue: required
              expected: string
              received: any_of
          allowed_values:
            - verified
          header_name: x-forwarded-for
          parameter_set: browser_fingerprint
          next_action: retry
    GateDeliveryBundle:
      type: object
      required:
        - integrator
        - gate
      properties:
        integrator:
          $ref: '#/components/schemas/GateDeliveryEnvelope'
          example:
            version: 1
            algorithm: x25519-hkdf-sha256/aes-256-gcm
            key_id: key_6cw04zdmetw8t5rsdppadhper0
            ephemeral_public_key: MCowBQYDK2VuAyEA7X6s5q0aQm1Bv1Q0nK5l2o3p9w8y7z6x5c4b3a2f1e0
            salt: l7vW1kYpQ2m8nR4sT6u9xA
            iv: b2M0NnA4cXJ0dXZ3eA
            ciphertext: 203.0.113.10
            tag: Y2hhY2hhMjBwb2x5MTMwNQ
        gate:
          $ref: '#/components/schemas/GateDeliveryEnvelope'
          example:
            version: 1
            algorithm: x25519-hkdf-sha256/aes-256-gcm
            key_id: key_6cw04zdmetw8t5rsdppadhper0
            ephemeral_public_key: MCowBQYDK2VuAyEA7X6s5q0aQm1Bv1Q0nK5l2o3p9w8y7z6x5c4b3a2f1e0
            salt: l7vW1kYpQ2m8nR4sT6u9xA
            iv: b2M0NnA4cXJ0dXZ3eA
            ciphertext: 203.0.113.10
            tag: Y2hhY2hhMjBwb2x5MTMwNQ
      example:
        integrator:
          version: 1
          algorithm: x25519-hkdf-sha256/aes-256-gcm
          key_id: key_6cw04zdmetw8t5rsdppadhper0
          ephemeral_public_key: MCowBQYDK2VuAyEA7X6s5q0aQm1Bv1Q0nK5l2o3p9w8y7z6x5c4b3a2f1e0
          salt: l7vW1kYpQ2m8nR4sT6u9xA
          iv: b2M0NnA4cXJ0dXZ3eA
          ciphertext: 203.0.113.10
          tag: Y2hhY2hhMjBwb2x5MTMwNQ
        gate:
          version: 1
          algorithm: x25519-hkdf-sha256/aes-256-gcm
          key_id: key_6cw04zdmetw8t5rsdppadhper0
          ephemeral_public_key: MCowBQYDK2VuAyEA7X6s5q0aQm1Bv1Q0nK5l2o3p9w8y7z6x5c4b3a2f1e0
          salt: l7vW1kYpQ2m8nR4sT6u9xA
          iv: b2M0NnA4cXJ0dXZ3eA
          ciphertext: 203.0.113.10
          tag: Y2hhY2hhMjBwb2x5MTMwNQ
    RequestId:
      type: string
      pattern: ^req_[0-9a-f]{32}$
      example: req_cf147349a4134208aebb8c70e25fb7e1
    ApiErrorDetails:
      type: object
      properties:
        fields:
          type: array
          items:
            $ref: '#/components/schemas/ApiFieldIssue'
            example:
              name: Acme Growth Workspace
              issue: required
              expected: string
              received: any_of
          example:
            - name: Acme Growth Workspace
              issue: required
              expected: string
              received: any_of
        allowed_values:
          type: array
          items:
            type: string
            example: verified
          example:
            - verified
        header_name:
          type: string
          example: x-forwarded-for
        parameter_set:
          type: string
          example: browser_fingerprint
        next_action:
          type: string
          enum:
            - retry
            - new_session
            - reload_bundle
            - contact_support
          example: retry
      additionalProperties: true
      example:
        fields:
          - name: Acme Growth Workspace
            issue: required
            expected: string
            received: any_of
        allowed_values:
          - verified
        header_name: x-forwarded-for
        parameter_set: browser_fingerprint
        next_action: retry
    GateDeliveryEnvelope:
      type: object
      required:
        - version
        - algorithm
        - key_id
        - ephemeral_public_key
        - salt
        - iv
        - ciphertext
        - tag
      properties:
        version:
          type: integer
          const: 1
          example: 1
        algorithm:
          type: string
          const: x25519-hkdf-sha256/aes-256-gcm
          example: x25519-hkdf-sha256/aes-256-gcm
        key_id:
          type: string
          example: key_6cw04zdmetw8t5rsdppadhper0
        ephemeral_public_key:
          type: string
          example: MCowBQYDK2VuAyEA7X6s5q0aQm1Bv1Q0nK5l2o3p9w8y7z6x5c4b3a2f1e0
        salt:
          type: string
          example: l7vW1kYpQ2m8nR4sT6u9xA
        iv:
          type: string
          example: b2M0NnA4cXJ0dXZ3eA
        ciphertext:
          type: string
          example: 203.0.113.10
        tag:
          type: string
          example: Y2hhY2hhMjBwb2x5MTMwNQ
      example:
        version: 1
        algorithm: x25519-hkdf-sha256/aes-256-gcm
        key_id: key_6cw04zdmetw8t5rsdppadhper0
        ephemeral_public_key: MCowBQYDK2VuAyEA7X6s5q0aQm1Bv1Q0nK5l2o3p9w8y7z6x5c4b3a2f1e0
        salt: l7vW1kYpQ2m8nR4sT6u9xA
        iv: b2M0NnA4cXJ0dXZ3eA
        ciphertext: 203.0.113.10
        tag: Y2hhY2hhMjBwb2x5MTMwNQ
    ApiFieldIssue:
      type: object
      additionalProperties: false
      required:
        - name
        - issue
      properties:
        name:
          type: string
          example: Acme Growth Workspace
        issue:
          type: string
          example: required
        expected:
          type: string
          example: string
        received:
          anyOf:
            - type: string
              example: '0'
            - type: number
              example: 1.5
            - type: boolean
              example: true
            - type: 'null'
              example: null
          example: any_of
      example:
        name: Acme Growth Workspace
        issue: required
        expected: string
        received: any_of
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: >-
        Send Authorization: Bearer <token>. Gate business endpoints require sk_*
        secret keys. Gate workflow endpoints use gate-native bearer tokens such
        as gtpoll_* or agt_* where documented.

````