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

# /mapping/gaps

> Finds required mapping fields that resolve to no value for live ad units, grouped per (integration, publisher, field), with the exact records that would fill each gap. This is the agent's to-do list for completing mapping.

**How it works.** It checks every active ad unit on an active ad stack that includes an integration in scope, plus disabled units that a running experiment still serves. Each required field is resolved through the unit's whole chain: the unit, its publisher, the organisation and its parents, the ad stack, then the integration default. A field with no value anywhere is `missing`. A field only acknowledged as will-not-map is `wnm`, and is listed only with `include_wnm=true`. Computed fields never gap; owner-only fields do, because the build needs them.

**Records.** Each gap lists the affected `units` and the `records` to send: one publisher-level record that covers all the publisher's units, or one record per affected unit when the publisher already sets that field per unit. `records` is empty when `owner_only` is true.

**Workflow.**
1. GET /v1/mapping/gaps, narrowed with `publisher_uid`, `organisation_id`, `integration_id` or `platform`.
2. Fill in each record's `value` so it matches the gap's `schema` (GET /v1/mapping/schema/{platform} has the full catalogue), or set `wnm: true` to acknowledge a deliberate gap.
3. POST the records to /v1/mapping/validate, then POST the valid ones to /v1/mapping/apply.
4. Call this endpoint again to confirm the gaps are gone.

Scope is as for GET /v1/mapping/query: the caller's organisation chain, or the publisher's with `publisher_uid`. Non-CORE callers only see publishers in their organisation tree. Gaps are ordered by integration, publisher uid, then unit. `limit` caps gaps (default 200, max 2000), and `truncated` says when there are more. `units_checked` counts the distinct units examined. Requires the `integration.view` permission.



## OpenAPI

````yaml /openapi.json get /v1/mapping/gaps
openapi: 3.0.1
info:
  title: CI Public API
  description: >-
    # Introduction

    Welcome to the Content Ignite API. A central place for all Content Ignite
    functionality. 


    This API enforces a separation between function and form, meaning anything
    you can do in our platforms can be replicated in your own bespoke solution.


    # Authentication

    Authentication is handled via JWTs. You can retrieve your unique JSON Web
    Token from the settings page in the platform, which needs to be passed in
    with every request.

    To do this, simple include it in an Authorization header with the "Bearer"
    key word.


    Please contact support for help getting started.


    # Error Codes

    This is a fully RESTful API, so prepare for a number of different HTTP
    status codes.


    There is also a standard "success" field returned for each request. This
    boolean value can provide a first check against a response.


    # Rate limit

    We reserve the right to block requests if we deem a client to be abusing the
    API.
  version: 1.0.0
servers:
  - url: https://api.tagdeliver.com
    description: Production
security:
  - BearerAuth: []
tags:
  - name: Reporting
  - name: Reporting/Revenue Reports
  - name: Reporting/Experiment Reporting
  - name: Reporting/Campaign Reports
  - name: Reporting/Health Check
  - name: Reporting/Ads.txt
  - name: Reporting/Utility
  - name: Reporting/Insights Hub
  - name: Reporting/Insights Hub/SSP Insights
  - name: Reporting/Insights Hub/Core Web Vitals
  - name: Reporting/Insights Hub/Ads.txt Insights
  - name: Reporting/Insights Hub/Live Insights
  - name: Reporting/Insights Hub/Metrics
  - name: Reporting/Insights Hub/Diagnostics
  - name: Reporting/Insights Hub/Revenue Insights
  - name: Reporting/Insights Hub/Revenue Analytics
  - name: Reporting/Insights Hub/Demand Mix
  - name: Reporting/Insights Hub/Benchmarking
  - name: Organisation
  - name: Organisation/Organisation Meta
  - name: Organisation/Pricing
  - name: Ad Stack
  - name: Ad Stack/Integration
  - name: Publisher
  - name: Publisher/Publisher Stack
  - name: Publisher/Publisher Tag
  - name: Publisher/Publisher Meta
  - name: Publisher/Experiment
  - name: Publisher/Config (Ad unit)
  - name: Publisher/App Placement
  - name: AI
  - name: AI/Activity
  - name: Billing
  - name: Billing/Invoice
  - name: Audit Log
  - name: '[IN PROGRESS] Integration'
  - name: '[IN PROGRESS] Integration/Mapping'
  - name: '[IN PROGRESS] User'
  - name: '[IN PROGRESS] User/Account'
  - name: Mapping
  - name: public
paths:
  /v1/mapping/gaps:
    get:
      tags:
        - Mapping
        - '[IN PROGRESS] Integration/Mapping'
        - public
      summary: /mapping/gaps
      description: >-
        Finds required mapping fields that resolve to no value for live ad
        units, grouped per (integration, publisher, field), with the exact
        records that would fill each gap. This is the agent's to-do list for
        completing mapping.


        **How it works.** It checks every active ad unit on an active ad stack
        that includes an integration in scope, plus disabled units that a
        running experiment still serves. Each required field is resolved through
        the unit's whole chain: the unit, its publisher, the organisation and
        its parents, the ad stack, then the integration default. A field with no
        value anywhere is `missing`. A field only acknowledged as will-not-map
        is `wnm`, and is listed only with `include_wnm=true`. Computed fields
        never gap; owner-only fields do, because the build needs them.


        **Records.** Each gap lists the affected `units` and the `records` to
        send: one publisher-level record that covers all the publisher's units,
        or one record per affected unit when the publisher already sets that
        field per unit. `records` is empty when `owner_only` is true.


        **Workflow.**

        1. GET /v1/mapping/gaps, narrowed with `publisher_uid`,
        `organisation_id`, `integration_id` or `platform`.

        2. Fill in each record's `value` so it matches the gap's `schema` (GET
        /v1/mapping/schema/{platform} has the full catalogue), or set `wnm:
        true` to acknowledge a deliberate gap.

        3. POST the records to /v1/mapping/validate, then POST the valid ones to
        /v1/mapping/apply.

        4. Call this endpoint again to confirm the gaps are gone.


        Scope is as for GET /v1/mapping/query: the caller's organisation chain,
        or the publisher's with `publisher_uid`. Non-CORE callers only see
        publishers in their organisation tree. Gaps are ordered by integration,
        publisher uid, then unit. `limit` caps gaps (default 200, max 2000), and
        `truncated` says when there are more. `units_checked` counts the
        distinct units examined. Requires the `integration.view` permission.
      parameters:
        - name: integration_id
          in: query
          description: >-
            Only this integration (encoded id). 404 when it isn't in the
            caller's scope.
          required: false
          example: gjdi9e
          schema:
            type: string
        - name: platform
          in: query
          description: >-
            Only integrations on this platform (module id, case-insensitive, as
            listed by GET /v1/mapping/schema). An unknown platform returns no
            results rather than an error.
          required: false
          example: pubmatic
          schema:
            type: string
        - name: publisher_uid
          in: query
          description: >-
            Only this publisher's ad units. Also switches the integration scope
            to the publisher's organisation chain, so its own organisation's
            integrations are checked. 404 `Not Found` when the caller can't
            access the publisher.
          required: false
          example: 17086
          schema:
            type: integer
        - name: organisation_id
          in: query
          description: >-
            Only publishers in this organisation and its child organisations.
            Non-CORE callers stay limited to their own organisation tree.
          required: false
          example: 234523814
          schema:
            type: integer
        - name: include_wnm
          in: query
          description: >-
            Also list fields marked will not map (state `wnm`) as well as
            missing ones. Accepts `true`/`false` (also `1`/`0`). Default
            `false`: only missing fields.
          required: false
          example: 'true'
          schema:
            type: boolean
            default: false
        - name: limit
          in: query
          description: >-
            Maximum gaps to return. Default 200, maximum 2000; values outside
            1–2000 are clamped (a non-numeric value counts as 1). `truncated:
            true` in the response means more exist.
          required: false
          example: 200
          schema:
            type: integer
            minimum: 1
            maximum: 2000
            default: 200
      responses:
        '200':
          description: Open gaps with the records that fill them.
          content:
            application/json:
              schema:
                type: object
                required:
                  - results
                  - success
                properties:
                  results:
                    type: object
                    required:
                      - gaps
                      - count
                      - truncated
                      - units_checked
                    properties:
                      gaps:
                        type: array
                        items:
                          type: object
                          required:
                            - integration_id
                            - platform
                            - integration_name
                            - field
                            - field_label
                            - state
                            - owner_only
                            - schema
                            - publisher_uid
                            - publisher_label
                            - organisation_id
                            - units
                            - records
                          properties:
                            integration_id:
                              type: string
                              description: Encoded integration id.
                            platform:
                              type: string
                              description: Platform module id.
                            integration_name:
                              type: string
                              description: The integration's account name.
                            field:
                              type: string
                              description: The required field key that has no value.
                            field_label:
                              type: string
                              description: Field title.
                            state:
                              type: string
                              enum:
                                - missing
                                - wnm
                              description: >-
                                `missing`: no value anywhere in the chain for at
                                least one listed unit. `wnm`: only acknowledged
                                as will-not-map (listed only with
                                `include_wnm=true`).
                            owner_only:
                              type: boolean
                              description: >-
                                True when only the integration's owner can set
                                this field and the caller isn't the owner.
                                `records` is then empty: tell the user the owner
                                must set it.
                            schema:
                              type: object
                              additionalProperties: true
                              description: >-
                                The field's JSON Schema; values you fill in must
                                validate against it.
                              properties: {}
                              nullable: true
                            publisher_uid:
                              type: integer
                              description: Publisher uid.
                            publisher_label:
                              type: string
                              description: Publisher domain.
                            organisation_id:
                              type: integer
                              description: The publisher's organisation id.
                            units:
                              type: array
                              description: The publisher's ad units missing the field.
                              items:
                                type: object
                                required:
                                  - config_id
                                  - label
                                  - ad_stack_id
                                properties:
                                  config_id:
                                    type: integer
                                    description: Ad unit (config) id.
                                  label:
                                    description: >-
                                      Unit label, else its unit name, else `Ad
                                      unit`. A numeric-looking label comes back
                                      as a number.
                                  ad_stack_id:
                                    type: integer
                                    description: The unit's ad stack id.
                            records:
                              type: array
                              items:
                                type: object
                                required:
                                  - integration_id
                                  - level
                                  - entity_id
                                  - field
                                  - value
                                  - wnm
                                properties:
                                  integration_id:
                                    type: string
                                    description: Encoded integration id.
                                  level:
                                    type: string
                                    enum:
                                      - publisher
                                      - config
                                    description: >-
                                      `publisher` (one value for all the
                                      publisher's units) or `config` (one ad
                                      unit).
                                  entity_id:
                                    type: integer
                                    description: Publisher uid or ad unit id.
                                  field:
                                    type: string
                                    description: Field key.
                                  value:
                                    description: >-
                                      Always null: fill it in with a value
                                      matching the gap's `schema`.
                                    nullable: true
                                    oneOf:
                                      - type: string
                                      - type: integer
                                      - type: boolean
                                      - type: array
                                      - type: object
                                      - type: number
                                  wnm:
                                    type: boolean
                                    description: >-
                                      Always false: set true instead of a value
                                      to acknowledge the gap as deliberate.
                              description: >-
                                Records that fill the gap once `value` is filled
                                in: one publisher-level record, or one config
                                record per listed unit when the publisher
                                already sets this field per ad unit. Empty when
                                `owner_only` is true.
                        description: One entry per (integration, publisher, field).
                      count:
                        type: integer
                        description: Number of gaps returned.
                      truncated:
                        type: boolean
                        description: True when there were more gaps than `limit`.
                      units_checked:
                        type: integer
                        description: >-
                          Distinct ad units examined in scope (across all
                          integrations), whether or not they have gaps.
                  success:
                    type: boolean
                    enum:
                      - true
                    description: Always true on success.
              example:
                results:
                  gaps:
                    - integration_id: gjdi9e
                      platform: Seedtag
                      integration_name: Content Ignite
                      field: placement
                      field_label: Placement
                      state: missing
                      owner_only: false
                      schema:
                        type: string
                        title: Placement
                        enum:
                          - inScreen
                          - inArticle
                          - inBanner
                      publisher_uid: 17086
                      publisher_label: example.com
                      organisation_id: 234523814
                      units:
                        - config_id: 5350
                          label: iab
                          ad_stack_id: 105
                        - config_id: 7111
                          label: In-Article DT Test
                          ad_stack_id: 105
                      records:
                        - integration_id: gjdi9e
                          level: publisher
                          entity_id: 17086
                          field: placement
                          value: null
                          wnm: false
                  count: 1
                  truncated: false
                  units_checked: 42
                success: true
          headers: {}
        '403':
          description: >-
            The caller lacks the required permission (or no user could be read
            from the token).
          content:
            application/json:
              schema:
                type: object
                required:
                  - message
                  - success
                properties:
                  message:
                    type: string
                    description: What went wrong.
                  success:
                    type: boolean
                    enum:
                      - false
                    description: Always false on errors.
              example:
                message: User forbidden
                success: false
          headers: {}
        '404':
          description: >-
            `integration_id` isn't in the caller's scope, or `publisher_uid`
            isn't accessible.
          content:
            application/json:
              schema:
                type: object
                required:
                  - message
                  - success
                properties:
                  message:
                    type: string
                    description: What went wrong.
                  success:
                    type: boolean
                    enum:
                      - false
                    description: Always false on errors.
              example:
                message: Integration gjdi9e Not Found
                success: false
          headers: {}
      deprecated: false
      security:
        - BearerAuth: []
components:
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer

````

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