Create a new tracking pixel and declare where it runs. Send exactly one of allowed_origins, a list of the sites the pixel runs on, or allow_any_origin: true, for a pixel that runs on any site, such as one pixel shared across many client sites. Sending neither, an empty list, or both returns a 400. Everything else matches v1: pass only a title for the defaults, or include params and custom_fields. Name the target project with a project_id field. For an Email pixel, send the param pixel_type email and allow_any_origin: true: it records opens from mail clients, not visits to a site, so its origins are not used.
Add dry_run: true to check the declaration without creating anything: the response returns the sites as they would be stored. A test API key gets a fixed sample response, marked with the X-Delivr-Mode: test header, and creates no pixel.
Response fields by status. 200: response (dry_run, allowed_origins, allow_any_origin, origins_status). 201: response (pixel_id, installation_url, allowed_origins, allow_any_origin, origins_status). 400, 500: type, code, message, help_url, request_id, fields[] (field, constraint, allowed). 401: error.
| Time | Status | User Agent | |
|---|---|---|---|
Retrieving recent requests… | |||
