# Tag Managers

> Manage pixel-scoped tag manager containers: the parent of tags, triggers, variables, and folders. Create a tag manager, edit its display name and data-layer override, or delete the container (which cascade-deletes its children).

Source: https://docs.oursprivacy.com/docs/platform-api/tag-managers

Tag managers are pixel-scoped containers that hold tags, triggers, variables, and folders. Create a tag manager to get a `pixel` token, then drop the install snippet on your site so the SDK can load and evaluate tags.

A new tag manager is seeded with three default triggers (`Initialization`, `PageView`, `DomReady`) and one `OursInitTag` so the container is immediately usable. Child entities are managed via the sibling resources:

* [`/rest/v1/tag-manager-tags`](https://docs.oursprivacy.com/docs/platform-api/tag-manager-tags): fire tags on matching triggers
* [`/rest/v1/tag-manager-triggers`](https://docs.oursprivacy.com/docs/platform-api/tag-manager-triggers): conditions that decide when tags fire
* [`/rest/v1/tag-manager-variables`](https://docs.oursprivacy.com/docs/platform-api/tag-manager-variables): reusable lookups for tag/trigger config
* [`/rest/v1/tag-manager-folders`](https://docs.oursprivacy.com/docs/platform-api/tag-manager-folders): dashboard-only grouping

Deleting a tag manager also deletes its tags, triggers, variables, and folders.

Create a preview link to try unpublished tags on your site. Links expire after one hour and should be kept private. Previewing can still send real events; use [Test Mode](https://docs.oursprivacy.com/docs/test-mode) to test destination delivery safely.

## GET /rest/v1/tag-managers

List every tag manager on this account. Each tag manager is a pixel-scoped container of tags, triggers, variables, and folders. Not paginated — accounts are capped at a small number of tag managers in practice, so the response fits in a single page. Requires API-key scope or current OAuth user permission: tagManagers:list

Request URL: `GET https://app.oursprivacy.com/rest/v1/tag-managers`

Authentication: apiKey or oauth2.

### Responses

- `200`: List of tag managers
- `400`: Bad Request
- `401`: Unauthorized — missing, invalid, or expired API key or OAuth access token
- `403`: Forbidden — credential does not have the required current Ours permission
- `404`: Not Found
- `500`: Internal Server Error

#### `200` response body

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `entities` | object[] | Yes |  |
| `entities[].id` | string | Yes | Server-assigned UUID for this tag manager container. |
| `entities[].accountId` | string | Yes | Account that owns this tag manager. |
| `entities[].name` | string | Yes | Human-readable name for the tag manager. |
| `entities[].pixel` | string | Yes | Server-assigned pixel/container token. Used in the tag-manager install snippet served on customer sites — do not regenerate via the API. |
| `entities[].dataLayerName` | string \| null | No | Window-global name of the customer data layer that triggers and variables read from (e.g. `dataLayer`). Defaults to `null`, which means the SDK falls back to its built-in name. |
| `entities[].createdAt` | string \| null | No | ISO 8601 timestamp when the tag manager was created. |
| `entities[].updatedAt` | string \| null | No | ISO 8601 timestamp of the last update. |

Full schema: [OpenAPI specification](https://docs.oursprivacy.com/openapi-platform.json).

## POST /rest/v1/tag-managers

Create a new tag manager. The server seeds three default triggers (`Initialization`, `PageView`, `DomReady`) and one `OursInitTag` so the container is immediately usable — call `GET /tag-manager-triggers?tagManagerId={id}` right after create to grab their server-assigned ids so you can reuse them in `fireTriggerIds` instead of redundantly creating a second `PageView`/`DomReady`/`Initialization`. Returns the bare entity. Requires API-key scope or current OAuth user permission: tagManagers:create

Request URL: `POST https://app.oursprivacy.com/rest/v1/tag-managers`

Authentication: apiKey or oauth2.

### Request body (`application/json`, required)

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `name` | string | Yes | Human-readable name for the new tag manager. |
| `dataLayerName` | string \| null | No | Optional global data-layer name (e.g. `dataLayer`). Omit to use the SDK default. |

### Responses

- `200`: Created tag manager
- `400`: Bad Request
- `401`: Unauthorized — missing, invalid, or expired API key or OAuth access token
- `403`: Forbidden — credential does not have the required current Ours permission
- `404`: Not Found
- `500`: Internal Server Error

#### `200` response body

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | string | Yes | Server-assigned UUID for this tag manager container. |
| `accountId` | string | Yes | Account that owns this tag manager. |
| `name` | string | Yes | Human-readable name for the tag manager. |
| `pixel` | string | Yes | Server-assigned pixel/container token. Used in the tag-manager install snippet served on customer sites — do not regenerate via the API. |
| `dataLayerName` | string \| null | No | Window-global name of the customer data layer that triggers and variables read from (e.g. `dataLayer`). Defaults to `null`, which means the SDK falls back to its built-in name. |
| `createdAt` | string \| null | No | ISO 8601 timestamp when the tag manager was created. |
| `updatedAt` | string \| null | No | ISO 8601 timestamp of the last update. |

Full schema: [OpenAPI specification](https://docs.oursprivacy.com/openapi-platform.json).

## GET /rest/v1/tag-managers/{id}

Fetch a single tag manager by id, including its server-assigned `pixel` token used by the install snippet. Requires API-key scope or current OAuth user permission: tagManagers:find

Request URL: `GET https://app.oursprivacy.com/rest/v1/tag-managers/{id}`

Authentication: apiKey or oauth2.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | path | string | Yes |  |

### Responses

- `200`: Tag manager details
- `400`: Bad Request
- `401`: Unauthorized — missing, invalid, or expired API key or OAuth access token
- `403`: Forbidden — credential does not have the required current Ours permission
- `404`: Not Found
- `500`: Internal Server Error

#### `200` response body

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | string | Yes | Server-assigned UUID for this tag manager container. |
| `accountId` | string | Yes | Account that owns this tag manager. |
| `name` | string | Yes | Human-readable name for the tag manager. |
| `pixel` | string | Yes | Server-assigned pixel/container token. Used in the tag-manager install snippet served on customer sites — do not regenerate via the API. |
| `dataLayerName` | string \| null | No | Window-global name of the customer data layer that triggers and variables read from (e.g. `dataLayer`). Defaults to `null`, which means the SDK falls back to its built-in name. |
| `createdAt` | string \| null | No | ISO 8601 timestamp when the tag manager was created. |
| `updatedAt` | string \| null | No | ISO 8601 timestamp of the last update. |

Full schema: [OpenAPI specification](https://docs.oursprivacy.com/openapi-platform.json).

## PATCH /rest/v1/tag-managers/{id}

Partially update a tag manager. Only the fields you send are changed; omitted fields keep their current value. Send `dataLayerName: null` to clear the override and fall back to the SDK default. Requires API-key scope or current OAuth user permission: tagManagers:update

Request URL: `PATCH https://app.oursprivacy.com/rest/v1/tag-managers/{id}`

Authentication: apiKey or oauth2.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | path | string | Yes |  |

### Request body (`application/json`, required)

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `name` | string | No | New display name. |
| `dataLayerName` | string \| null | No | New data-layer name. Send `null` to clear and fall back to the SDK default. |

### Responses

- `200`: Updated tag manager
- `400`: Bad Request
- `401`: Unauthorized — missing, invalid, or expired API key or OAuth access token
- `403`: Forbidden — credential does not have the required current Ours permission
- `404`: Not Found
- `500`: Internal Server Error

#### `200` response body

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | string | Yes | Server-assigned UUID for this tag manager container. |
| `accountId` | string | Yes | Account that owns this tag manager. |
| `name` | string | Yes | Human-readable name for the tag manager. |
| `pixel` | string | Yes | Server-assigned pixel/container token. Used in the tag-manager install snippet served on customer sites — do not regenerate via the API. |
| `dataLayerName` | string \| null | No | Window-global name of the customer data layer that triggers and variables read from (e.g. `dataLayer`). Defaults to `null`, which means the SDK falls back to its built-in name. |
| `createdAt` | string \| null | No | ISO 8601 timestamp when the tag manager was created. |
| `updatedAt` | string \| null | No | ISO 8601 timestamp of the last update. |

Full schema: [OpenAPI specification](https://docs.oursprivacy.com/openapi-platform.json).

## DELETE /rest/v1/tag-managers/{id}

Delete a tag manager. Child tags, triggers, variables, and folders are cascade-deleted with the container. Requires API-key scope or current OAuth user permission: tagManagers:delete

Request URL: `DELETE https://app.oursprivacy.com/rest/v1/tag-managers/{id}`

Authentication: apiKey or oauth2.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | path | string | Yes |  |

### Responses

- `200`: Deleted successfully
- `400`: Bad Request
- `401`: Unauthorized — missing, invalid, or expired API key or OAuth access token
- `403`: Forbidden — credential does not have the required current Ours permission
- `404`: Not Found
- `500`: Internal Server Error

#### `200` response body

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | string | Yes | The id of the tag manager that was deleted. |
| `deleted` | boolean | Yes | True when the tag manager was deleted. |

Full schema: [OpenAPI specification](https://docs.oursprivacy.com/openapi-platform.json).

## POST /rest/v1/tag-managers/{id}/preview

Create a one-hour link to preview this container’s unpublished tags on your website. Requires permission to view the tag manager. Requires API-key scope or current OAuth user permission: tagManagers:find

Request URL: `POST https://app.oursprivacy.com/rest/v1/tag-managers/{id}/preview`

Authentication: apiKey or oauth2.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | path | string | Yes |  |

### Request body (`application/json`, required)

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `url` | string (uri) | Yes |  |

### Responses

- `200`: A private preview link and its expiration time
- `400`: Bad Request
- `401`: Unauthorized — missing, invalid, or expired API key or OAuth access token
- `403`: Forbidden — credential does not have the required current Ours permission
- `404`: Not Found
- `500`: Internal Server Error

#### `200` response body

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `url` | string | Yes |  |
| `expiresAt` | string | Yes |  |

Full schema: [OpenAPI specification](https://docs.oursprivacy.com/openapi-platform.json).

## GET /rest/v1/tag-managers/{id}/install-snippet

Return the HTML to install this tag manager in the page head. Uses its public pixel and the first ready custom domain, or the default CDN. Find the container with GET /rest/v1/tag-managers. Publish its configuration before expecting tags to run. Returns 404 for an unavailable container. Requires API-key scope or current OAuth user permission: tagManagers:find

Request URL: `GET https://app.oursprivacy.com/rest/v1/tag-managers/{id}/install-snippet`

Authentication: apiKey or oauth2.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | path | string | Yes |  |

### Responses

- `200`: Paste-ready tag manager installation HTML
- `400`: Bad Request
- `401`: Unauthorized — missing, invalid, or expired API key or OAuth access token
- `403`: Forbidden — credential does not have the required current Ours permission
- `404`: Not Found
- `500`: Internal Server Error

#### `200` response body

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `installScript` | string | Yes | Paste-ready HTML for the page head: main.js followed by tag-manager-init with this container’s public pixel. Uses the first ready custom domain, or the default CDN. Publish the container before expecting tags to run. |

Full schema: [OpenAPI specification](https://docs.oursprivacy.com/openapi-platform.json).
