> ## 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.

# /ad-stack/:id/integration/:iid/hierarchy

> Returns, for every settable field of one integration on an ad stack, which level's value wins and which values sit above (integration default) and below it (ad units, publishers, organisations). Use it to annotate an ad stack's integration form with "inherited from" / "overridden by" hints.

**Permission:** `ad_stack.view`. The integration must be one the caller (or, with `uid`, the publisher's organisation) may use, otherwise 404 "Integration {iid} Not Found"; the Global Settings pseudo-integration is accepted too. For `id` > 0 the stack must exist, be non-archived and (for non-CORE callers) belong to the caller's organisation tree, otherwise 404. `id` = 0 means a stack not saved yet: no stack or ad-unit values are read.

**Fields:** only fields the caller can set (read-only computed fields and, for non-owners, owner-only fields and approval are left out).

**Without `uid`:** the chain is stack then integration default; `below` aggregates every ad unit on the stack, their publishers and those publishers' organisations that set their own value (`count`, `value` when one, `values[]` when 20 or fewer).

**With `uid`:** the view is that publisher's: its own value and its organisations' (stack organisation chain first, then the publisher's) are single entries in `below` after the ad-unit aggregate, and `resolved_level` is what the publisher gets on this stack. The ad-unit aggregate still spans every unit on the stack.

Values keep their stored types and `entity_id` stays text on this endpoint. Read-only: use POST /v1/mapping/apply to change values.



## OpenAPI

````yaml /openapi.json get /v1/ad-stack/{id}/integration/{iid}/hierarchy
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/ad-stack/{id}/integration/{iid}/hierarchy:
    get:
      tags:
        - Ad Stack/Integration
        - public
      summary: /ad-stack/:id/integration/:iid/hierarchy
      description: >-
        Returns, for every settable field of one integration on an ad stack,
        which level's value wins and which values sit above (integration
        default) and below it (ad units, publishers, organisations). Use it to
        annotate an ad stack's integration form with "inherited from" /
        "overridden by" hints.


        **Permission:** `ad_stack.view`. The integration must be one the caller
        (or, with `uid`, the publisher's organisation) may use, otherwise 404
        "Integration {iid} Not Found"; the Global Settings pseudo-integration is
        accepted too. For `id` > 0 the stack must exist, be non-archived and
        (for non-CORE callers) belong to the caller's organisation tree,
        otherwise 404. `id` = 0 means a stack not saved yet: no stack or ad-unit
        values are read.


        **Fields:** only fields the caller can set (read-only computed fields
        and, for non-owners, owner-only fields and approval are left out).


        **Without `uid`:** the chain is stack then integration default; `below`
        aggregates every ad unit on the stack, their publishers and those
        publishers' organisations that set their own value (`count`, `value`
        when one, `values[]` when 20 or fewer).


        **With `uid`:** the view is that publisher's: its own value and its
        organisations' (stack organisation chain first, then the publisher's)
        are single entries in `below` after the ad-unit aggregate, and
        `resolved_level` is what the publisher gets on this stack. The ad-unit
        aggregate still spans every unit on the stack.


        Values keep their stored types and `entity_id` stays text on this
        endpoint. Read-only: use POST /v1/mapping/apply to change values.
      parameters:
        - name: id
          in: path
          description: Ad stack id; 0 for a stack that hasn't been saved yet.
          required: true
          example: 338
          schema:
            type: integer
            minimum: 0
        - name: iid
          in: path
          description: Encoded integration id (from GET /v1/integration).
          required: true
          example: gjdi9e
          schema:
            type: string
        - name: uid
          in: query
          description: >-
            Optional publisher uid to view the hierarchy as that publisher gets
            it (its own and its organisations' values as single entries;
            integration access scoped to its organisation). Must be a publisher
            in the caller's organisation (CORE: any).
          required: false
          example: 18620
          schema:
            type: integer
      responses:
        '200':
          description: Hierarchy per settable field.
          content:
            application/json:
              schema:
                type: object
                properties:
                  results:
                    type: object
                    properties: {}
                    description: >-
                      One hierarchy per settable field of the integration, keyed
                      by field key. Empty object when the integration has no
                      settable fields.
                    additionalProperties:
                      type: object
                      description: >-
                        Where this field's effective value comes from and how it
                        relates to the other levels.
                      properties:
                        resolved_level:
                          type: string
                          enum:
                            - integration
                            - ad_stack
                            - organisation
                            - publisher
                            - config
                            - null
                          description: >-
                            Level whose value wins in this view: without `uid`,
                            `ad_stack` or `integration` (ad-unit, publisher and
                            organisation values are only in `below`); with
                            `uid`, what that publisher gets on this stack before
                            any ad-unit value (`publisher`, `organisation`,
                            `ad_stack` or `integration`). Null when nothing
                            resolves.
                          nullable: true
                        above:
                          type: array
                          description: >-
                            The `integration` default, when set (or marked
                            will-not-map). At most one entry.
                          items:
                            type: object
                            description: >-
                              A value at a less specific level that this row
                              overrides (or a will-not-map marker there).
                            properties:
                              level:
                                type: string
                                enum:
                                  - integration
                                  - ad_stack
                                  - organisation
                                  - publisher
                                  - config
                                description: The level holding the value.
                              value:
                                description: >-
                                  The stored value with its type kept (text,
                                  number, yes/no boolean or list);
                                  numeric-looking text is NOT converted to a
                                  number in this field. Plain scalars are sent
                                  as text; booleans stay booleans; lists stay
                                  lists. Absent when `wnm` is true.
                                nullable: true
                                oneOf:
                                  - type: string
                                  - type: integer
                                  - type: boolean
                                  - type: array
                                  - type: object
                                  - type: number
                              wnm:
                                type: boolean
                                description: >-
                                  Present (true) when this level only marks the
                                  field will-not-map and holds no value.
                            required:
                              - level
                        below:
                          type: array
                          description: >-
                            Values that override the stack's: first the ad units
                            on the stack (`config`), then without `uid` the
                            publishers and organisations of those units
                            (aggregates), or with `uid` that publisher's own
                            value and its nearest organisation value
                            (single-value entries).
                          items:
                            type: object
                            description: >-
                              A more specific value that overrides the stack's
                              value. Two forms: a child-entity aggregate
                              (`level` + `count`, optional `value` / `values`)
                              for ad units (and, without `uid`, publishers and
                              organisations on the stack); or, with `uid`, a
                              single-value entry for the viewing publisher's own
                              `publisher` / `organisation` level (`level` +
                              `value`, or `level` + `wnm: true`).
                            properties:
                              level:
                                type: string
                                enum:
                                  - config
                                  - publisher
                                  - organisation
                                description: The more specific level.
                              count:
                                type: integer
                                minimum: 1
                                description: >-
                                  Child-entity form: how many entities at this
                                  level set a value.
                              value:
                                description: >-
                                  The value: in the child-entity form only when
                                  exactly one entity sets it. Kept exactly as
                                  stored or sent as text for scalars (no numeric
                                  conversion); booleans and lists keep their
                                  type.
                                nullable: true
                                oneOf:
                                  - type: string
                                  - type: integer
                                  - type: boolean
                                  - type: array
                                  - type: object
                                  - type: number
                              wnm:
                                type: boolean
                                description: >-
                                  Single-value form only: true when the
                                  publisher's own level only marks the field
                                  will-not-map.
                              values:
                                type: array
                                description: >-
                                  Child-entity form, when 20 or fewer entities
                                  set a value: each entity's value with its
                                  display name.
                                items:
                                  type: object
                                  properties:
                                    entity_id:
                                      type: string
                                      description: >-
                                        Ad unit id, publisher uid or
                                        organisation id. Kept as text on this
                                        endpoint.
                                    label:
                                      type: string
                                      description: >-
                                        Organisation name, publisher domain, or
                                        "domain · unit label" for an ad unit;
                                        null if not found.
                                      nullable: true
                                    value:
                                      description: >-
                                        That entity's value (stored type kept;
                                        scalars as text).
                                      nullable: true
                                      oneOf:
                                        - type: string
                                        - type: integer
                                        - type: boolean
                                        - type: array
                                        - type: object
                                        - type: number
                                  required:
                                    - entity_id
                                    - label
                                    - value
                            required:
                              - level
                      required:
                        - resolved_level
                        - above
                        - below
                  success:
                    type: boolean
                    description: Always true on success.
                required:
                  - results
                  - success
              example:
                results:
                  pubid:
                    resolved_level: publisher
                    above:
                      - level: integration
                        value: CI-DEFAULT
                    below:
                      - level: config
                        count: 2
                        values:
                          - entity_id: '8388'
                            label: example.com · MPU 1
                            value: ABC123-MPU1
                          - entity_id: '8390'
                            label: example.com · MPU 2
                            value: ABC123-MPU2
                      - level: publisher
                        value: XYZ789
                      - level: organisation
                        wnm: true
                  publisherSubId:
                    resolved_level: null
                    above: []
                    below: []
                success: true
          headers: {}
        '403':
          description: The token has no user, or the user lacks the required permission.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: Human-readable error message.
                  success:
                    type: boolean
                    description: Always false for an error.
                required:
                  - message
                  - success
              example:
                message: User forbidden
                success: false
          headers: {}
        '404':
          description: >-
            Integration not accessible, ad stack not found/accessible, or `uid`
            publisher not accessible ("Not Found").
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: Human-readable error message.
                  success:
                    type: boolean
                    description: Always false for an error.
                required:
                  - message
                  - success
              examples:
                integration:
                  summary: Integration not accessible
                  value:
                    message: Integration gjdi9e Not Found
                    success: false
                stack:
                  summary: Ad stack not found
                  value:
                    message: Ad stack 338 Not Found
                    success: false
                publisher:
                  summary: uid not accessible
                  value:
                    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.