> ## 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/apply

> Writes mapping records across integrations. It validates every record exactly as POST /v1/mapping/validate does, stores the valid ones and returns the refused ones in `failed`. This is the write path for agents and bulk uploads.

**Mode.** `overwrite` (default) inserts or replaces the value for each (integration, level, entity, field). `append` only writes keys that have no stored row yet; an existing value, empty row or wnm row all count as set, and those records are counted in `skipped`. Array values replace the stored array entirely.

**Values.** `wnm: true` stores a will-not-map acknowledgement and discards `value`: it clears the completeness warning but doesn't block inherited values. An empty value (null, "" or []) is stored as an empty row that resolution skips. To remove a row, use DELETE /v1/mapping.

**Rebuilds.** Writes queue tag rebuild checks for every publisher the change can reach: all publishers using the integration (integration level), publishers with units on the ad stack, publishers in the organisation and its child organisations, the publisher itself, or the ad unit's publisher. Only real config changes rebuild.

**Response.** Always 200 with per-row results, even when nothing was written. `applied` counts rows written, `skipped` rows left alone by append, `failed` the refused records (same shape as validate's `rows`). Numeric-looking strings in the response come back as numbers.

**Typical chain:** GET /v1/mapping/gaps (or GET /v1/mapping/schema/{platform}) → fill in `value`s → POST /v1/mapping/validate → POST /v1/mapping/apply → GET /v1/mapping/gaps to confirm.

Requires the `integration.edit` permission.



## OpenAPI

````yaml /openapi.json post /v1/mapping/apply
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/apply:
    post:
      tags:
        - Mapping
        - '[IN PROGRESS] Integration/Mapping'
        - public
      summary: /mapping/apply
      description: >-
        Writes mapping records across integrations. It validates every record
        exactly as POST /v1/mapping/validate does, stores the valid ones and
        returns the refused ones in `failed`. This is the write path for agents
        and bulk uploads.


        **Mode.** `overwrite` (default) inserts or replaces the value for each
        (integration, level, entity, field). `append` only writes keys that have
        no stored row yet; an existing value, empty row or wnm row all count as
        set, and those records are counted in `skipped`. Array values replace
        the stored array entirely.


        **Values.** `wnm: true` stores a will-not-map acknowledgement and
        discards `value`: it clears the completeness warning but doesn't block
        inherited values. An empty value (null, "" or []) is stored as an empty
        row that resolution skips. To remove a row, use DELETE /v1/mapping.


        **Rebuilds.** Writes queue tag rebuild checks for every publisher the
        change can reach: all publishers using the integration (integration
        level), publishers with units on the ad stack, publishers in the
        organisation and its child organisations, the publisher itself, or the
        ad unit's publisher. Only real config changes rebuild.


        **Response.** Always 200 with per-row results, even when nothing was
        written. `applied` counts rows written, `skipped` rows left alone by
        append, `failed` the refused records (same shape as validate's `rows`).
        Numeric-looking strings in the response come back as numbers.


        **Typical chain:** GET /v1/mapping/gaps (or GET
        /v1/mapping/schema/{platform}) → fill in `value`s → POST
        /v1/mapping/validate → POST /v1/mapping/apply → GET /v1/mapping/gaps to
        confirm.


        Requires the `integration.edit` permission.
      parameters:
        - name: uid
          in: query
          description: >-
            Optional publisher uid. Integrations available to that publisher's
            organisation chain (its organisation, its parents and CORE) are
            accepted for every record, in place of the caller's own chain. The
            caller must be able to access the publisher (404 `Not Found`
            otherwise). Rarely needed: a record's integration is accepted anyway
            when it is available to the organisation of the record's own entity.
          required: false
          example: 17086
          schema:
            type: integer
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - records
              properties:
                mode:
                  type: string
                  enum:
                    - overwrite
                    - append
                  default: overwrite
                  description: >-
                    `overwrite` inserts or replaces each (integration, level,
                    entity, field) value. `append` only writes keys with no
                    stored row yet (an existing value, empty row or wnm row
                    counts as set) and counts the rest as `skipped`. Any other
                    value behaves as `overwrite`. Array values always replace
                    the stored array.
                records:
                  type: array
                  items:
                    type: object
                    required:
                      - integration_id
                      - level
                      - field
                    properties:
                      integration_id:
                        type: string
                        description: >-
                          Encoded integration id: an opaque string such as
                          `gjdi9e`, as returned by GET /v1/integration, GET
                          /v1/mapping/schema/{platform}
                          (`integrations[].integration_id`) or GET
                          /v1/mapping/gaps. Never a raw database id.
                        example: gjdi9e
                      level:
                        type: string
                        enum:
                          - integration
                          - ad_stack
                          - organisation
                          - publisher
                          - config
                        description: >-
                          Where the value is set. Resolution is most specific
                          first: config > publisher > organisation chain
                          (nearest first) > ad_stack > integration.
                      entity_id:
                        type: integer
                        description: >-
                          The entity at `level`: organisation id
                          (`organisation`), ad stack id (`ad_stack`), publisher
                          uid (`publisher`) or ad unit id, also called config id
                          (`config`). Required at every level except
                          `integration`, where it is ignored (send null or omit
                          it).
                        nullable: true
                        example: 17086
                      field:
                        type: string
                        description: >-
                          Exact field key from the integration's catalogue
                          (`fields[].key` in GET /v1/mapping/schema/{platform}),
                          e.g. `placementId` or a dotted sub-field such as
                          `video.mimes`. `approved` is the built-in approval
                          field.
                        example: placement
                      value:
                        description: >-
                          The value, matching the field's JSON Schema (string,
                          number, boolean, array or object as the schema says).
                          Ignored when `wnm` is true. An empty value (null, ""
                          or []) skips schema validation and is stored as an
                          empty row, which resolution skips.
                        example: inScreen
                      wnm:
                        type: boolean
                        default: false
                        description: >-
                          Will not map: acknowledges that this required field is
                          deliberately left empty for this entity. Clears the
                          completeness warning but doesn't block values
                          inherited from higher levels. Not allowed for
                          `approved`.
                  description: >-
                    The mapping records. Each carries its own `integration_id`,
                    so one request can span integrations. A missing `records` is
                    treated as an empty list; a non-array is a 400.
            example:
              mode: append
              records:
                - integration_id: gjdi9e
                  level: publisher
                  entity_id: 17086
                  field: placement
                  value: inScreen
                  wnm: false
                - integration_id: gjdi9e
                  level: config
                  entity_id: 7111
                  field: placment
                  value: inArticle
                  wnm: false
        required: true
      responses:
        '200':
          description: What was written, skipped and refused.
          content:
            application/json:
              schema:
                type: object
                required:
                  - results
                  - success
                properties:
                  results:
                    type: object
                    required:
                      - applied
                      - skipped
                      - failed
                    properties:
                      applied:
                        type: integer
                        description: Records written (inserted or replaced).
                      skipped:
                        type: integer
                        description: >-
                          Valid records not written because `mode` was `append`
                          and a row already existed.
                      failed:
                        type: array
                        items:
                          type: object
                          required:
                            - index
                            - valid
                            - integration_id
                            - field
                            - errors
                          properties:
                            index:
                              type: integer
                              description: >-
                                Position of the record in the request's
                                `records` array (0-based).
                            valid:
                              type: boolean
                              description: >-
                                True when the record would be written by POST
                                /v1/mapping/apply.
                            integration_id:
                              type: string
                              description: >-
                                The record's `integration_id` as sent (null when
                                missing). An all-digit encoded id comes back as
                                a JSON number (numeric coercion).
                              nullable: true
                            field:
                              type: string
                              description: >-
                                The record's `field` as sent (null when
                                missing).
                              nullable: true
                            errors:
                              type: array
                              items:
                                type: string
                              description: >-
                                Why the record is invalid; empty when valid.
                                Messages include: `Unknown or inaccessible
                                integration`, `Integration module not found`,
                                `Unknown level '<level>'`, `Field is required`,
                                `Unknown field '<field>' for this integration`,
                                `'<Title>' is filled in automatically, so it
                                can't be set`, `Only the integration's owner can
                                set '<Title>'`, `'<Title>' is read-only, so it
                                can't be set`, `'<field>' can't be set per ad
                                unit: <Platform> uses one value for every unit.
                                Set it at publisher level or above.`, `Only the
                                integration's owner can approve publishers`,
                                approval level / wnm errors, JSON Schema
                                validation messages (up to 5), and entity scope
                                errors (`entity_id is required for <level>`,
                                `Unknown <level> <id>`, `No access to <level>
                                <id>`, `Only the integration owner can set
                                integration-level values`).
                        description: >-
                          The invalid records, as POST /v1/mapping/validate
                          reports them (each with `valid: false` and its
                          `errors`).
                  success:
                    type: boolean
                    enum:
                      - true
                    description: Always true on success.
              example:
                results:
                  applied: 1
                  skipped: 0
                  failed:
                    - index: 1
                      valid: false
                      integration_id: gjdi9e
                      field: placment
                      errors:
                        - Unknown field 'placment' for this integration
                success: true
          headers: {}
        '400':
          description: '`records` isn''t an array.'
          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: records must be an array
                success: false
          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: '`uid` was given and the caller can''t access that publisher.'
          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: 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.