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

# List ad server sources

> List the customer's ad server source connections with their ad-server type and status.



## OpenAPI

````yaml /v2/storefront-api-v2.yaml get /esa
openapi: 3.0.0
info:
  title: Scope3 Storefront API
  version: 2.0.0
  description: |-
    REST API for partners to manage storefronts, inventory sources, and billing.

    ## Authentication

    All endpoints require a Bearer token in the Authorization header:
    ```
    Authorization: Bearer your-api-key
    ```

    ## Base URL

    `https://api.interchange.io/api/v2/storefront`

    ## For AI Agents

    AI agents can use the MCP endpoint at `/mcp/v2/storefront` with three tools:
    - `initialize`: Start an MCP session
    - `api_call`: Make REST API calls
    - `ask_about_capability`: Learn about API features
servers:
  - url: https://api.interchange.io/api/v2/storefront
    description: Production server
security: []
tags:
  - name: Account
    description: Account management, service tokens, and preferences
  - name: Storefront
    description: Manage storefront and inventory sources
  - name: Storefront Agents
    description: List and manage registered sales, signals, and outcomes agents
  - name: Storefront Activity
    description: Audit log of configuration and inventory changes on the storefront
  - name: Storefront Billing
    description: Payout bank details and billing configuration for storefronts
  - name: AI Usage
    description: Storefront AI token usage visibility by model
  - name: MCP
    description: Model Context Protocol endpoints
paths:
  /esa:
    get:
      tags:
        - Storefront
      summary: List ad server sources
      description: >-
        List the customer's ad server source connections with their ad-server
        type and status.
      operationId: listEsaConnections
      responses:
        '200':
          description: List ad server sources
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EsaConnectionList'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - bearerAuth: []
components:
  schemas:
    EsaConnectionList:
      description: All managed ad-server source connections owned by this storefront.
      type: array
      items:
        $ref: '#/components/schemas/EsaConnection'
    ErrorResponse:
      description: Standard error response
      type: object
      properties:
        data:
          type: string
          nullable: true
          enum:
            - null
        error:
          $ref: '#/components/schemas/ApiError'
      required:
        - data
        - error
      additionalProperties: false
    EsaConnection:
      description: >-
        Storefront → managed ad-server source connection. A storefront can have
        multiple connections, each addressed by `id`.
      type: object
      properties:
        id:
          description: >-
            Stable id for this managed ad-server source. Use this id to address
            per-source actions (provision, deactivate, save ad-server config,
            etc.). A customer can have multiple managed sources.
          type: string
        customerId:
          description: Owning customer/storefront id.
          type: integer
          minimum: -9007199254740991
          maximum: 9007199254740991
        tenantId:
          description: >-
            Upstream managed-source id for the managed ad-server source. Null
            until provisioning succeeds.
          nullable: true
          type: string
        mcpUrl:
          description: >-
            MCP endpoint exposed by the provisioned managed ad-server source.
            May be a relative path (e.g. `/mcp/`) — the consumer composes the
            absolute URL using the upstream base URL.
          nullable: true
          type: string
        a2aUrl:
          description: >-
            A2A endpoint exposed by the provisioned managed ad-server source.
            May be a relative path (e.g. `/a2a`) — see `mcpUrl` for resolution.
          nullable: true
          type: string
        adServer:
          description: Publisher-supplied ad-server config. Null if not yet collected.
          nullable: true
          allOf:
            - $ref: '#/components/schemas/AdServerConfigView'
        serviceAccountEmail:
          description: >-
            Per-customer service-account email the publisher must grant access
            to in their ad server. Created when ad-server config is saved.
            Surfaced so the UI can show it during onboarding.
          nullable: true
          type: string
          format: email
          pattern: >-
            ^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$
        lastError:
          description: >-
            Failure reason from the most recent provisioning or test-connection
            attempt.
          nullable: true
          type: string
        lastErrorCode:
          description: >-
            Machine-readable classification of the most recent provisioning
            failure. `ADAPTER_NETWORK_NOT_FOUND` (typo),
            `ADAPTER_PERMISSION_DENIED` (GAM grant still propagating),
            `ADAPTER_INVALID_CREDENTIALS` (storefront service account broken),
            `ADAPTER_INVALID_CONFIG` (bad field-level config), and
            `ADAPTER_CONNECTION_FAILED` (transient blip) are the adapter probe
            failures. `INTERNAL_ERROR` indicates an upstream or platform
            problem. Null when there has been no failure or after a successful
            provision.
          nullable: true
          type: string
        lastTestedAt:
          nullable: true
          type: string
          format: date-time
          pattern: >-
            ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
        provisionedAt:
          nullable: true
          type: string
          format: date-time
          pattern: >-
            ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
        deactivatedAt:
          nullable: true
          type: string
          format: date-time
          pattern: >-
            ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
        createdAt:
          type: string
          format: date-time
          pattern: >-
            ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
        updatedAt:
          type: string
          format: date-time
          pattern: >-
            ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
        inventorySync:
          description: >-
            Cached inventory-sync state. Null when no signal has landed yet (no
            webhook delivered and no /status poll has run).
          nullable: true
          allOf:
            - $ref: '#/components/schemas/EsaInventorySync'
      required:
        - id
        - customerId
        - tenantId
        - mcpUrl
        - a2aUrl
        - adServer
        - serviceAccountEmail
        - lastError
        - lastErrorCode
        - lastTestedAt
        - provisionedAt
        - deactivatedAt
        - createdAt
        - updatedAt
        - inventorySync
      additionalProperties: false
    ApiError:
      description: Structured error object
      type: object
      properties:
        code:
          description: Machine-readable error code
          type: string
        message:
          description: Human-readable error message
          type: string
        field:
          description: Field path associated with the error
          type: string
        details:
          description: Additional error context
          type: object
          additionalProperties: {}
      required:
        - code
        - message
      additionalProperties: false
    AdServerConfigView:
      description: >-
        Non-secret view of the connection ad-server config. Returned by GET
        endpoints; never contains credentials.
      oneOf:
        - $ref: '#/components/schemas/GamAdServerConfigOutput'
        - type: object
          properties:
            type:
              type: string
              enum:
                - freewheel
            clientId:
              nullable: true
              type: string
            username:
              nullable: true
              type: string
            environment:
              type: string
              enum:
                - production
                - staging
            defaultAdvertiserId:
              nullable: true
              type: string
          required:
            - type
            - clientId
            - username
            - environment
            - defaultAdvertiserId
          additionalProperties: false
        - type: object
          properties:
            type:
              type: string
              enum:
                - springserve
            email:
              nullable: true
              type: string
            environment:
              type: string
              enum:
                - production
            defaultDemandPartnerId:
              nullable: true
              type: integer
              minimum: -9007199254740991
              maximum: 9007199254740991
          required:
            - type
            - email
            - environment
            - defaultDemandPartnerId
          additionalProperties: false
        - type: object
          properties:
            type:
              type: string
              enum:
                - adswizz
            agencyId:
              type: integer
              minimum: -9007199254740991
              maximum: 9007199254740991
            environment:
              type: string
              enum:
                - AUDIOSERVE
            baseUrl:
              type: string
            forecastingBaseUrl:
              type: string
            defaultCurrency:
              type: string
            cpmLimit:
              nullable: true
              type: number
            defaultAdvertiserId:
              nullable: true
              type: string
          required:
            - type
            - agencyId
            - environment
            - baseUrl
            - forecastingBaseUrl
            - defaultCurrency
            - cpmLimit
            - defaultAdvertiserId
          additionalProperties: false
      type: object
    EsaInventorySync:
      description: >-
        Cached inventory-sync state for this managed ad-server source. Updated
        by the /webhooks/esa-sync receiver when the upstream service emits
        `sync_run.completed` / `sync_run.failed`, and by the /status polling
        fallback for missed deliveries.
      type: object
      properties:
        status:
          nullable: true
          description: >-
            Last known inventory-sync state on the upstream managed source.
            `unknown` means we have no signal yet (row predates the sync
            tracking, no webhook or status poll has landed). Other values mirror
            the upstream managed-source vocabulary.
          type: string
          enum:
            - unknown
            - never_run
            - running
            - success
            - failed
        lastRunAt:
          nullable: true
          type: string
          format: date-time
          pattern: >-
            ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
        completedAt:
          nullable: true
          type: string
          format: date-time
          pattern: >-
            ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
        itemCount:
          nullable: true
          type: integer
          minimum: -9007199254740991
          maximum: 9007199254740991
        error:
          nullable: true
          type: string
        updatedAt:
          nullable: true
          type: string
          format: date-time
          pattern: >-
            ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
      required:
        - status
        - lastRunAt
        - completedAt
        - itemCount
        - error
        - updatedAt
      additionalProperties: false
    GamAdServerConfigOutput:
      description: >-
        Google Ad Manager configuration. Per-customer service-account
        credentials are managed by Scope3 (publisher grants access in their GAM
        admin console).
      type: object
      properties:
        type:
          type: string
          enum:
            - google_ad_manager
        networkCode:
          description: Google Ad Manager network code.
          example: '12345678'
          type: string
          minLength: 1
          maxLength: 32
          pattern: ^[0-9]+$
      required:
        - type
        - networkCode
      additionalProperties: false
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: API key or access token

````