Skip to main content
PATCH
Update a tracking pixel
PATCH /v1/tracking-pixel/{pixel_id} updates one tracking pixel in the API key’s workspace. It requires Tracking pixels: Write (tracking_pixels.update). The API playground provides three request variants: Rename only, Provider configuration, and Custom code configuration.
Select Custom code configuration above the request fields when editing custom code. custom is not a provider dropdown option.

Rename without changing configuration

Send only name to preserve the current type and all compatible configuration.

Update a provider pixel

When changing provider configuration, include type and pixel_id together. You may also include name in the same request.
The request may keep the current provider type or select another supported provider. Do not include head_code or body_code. After a successful update, both custom-code fields are null.

Update custom code

Include type: "custom" whenever changing head_code or body_code.
Omitted custom-code fields keep their existing values when the pixel is already custom. Send null to clear one code field. The resulting configuration must still have a non-empty head_code or body_code.

Change between provider and custom

Type changes are atomic and remove fields that do not belong to the new type.
  • Provider to custom: send type: "custom" and at least one code field. Biqli clears the old pixel_id.
  • Custom to provider: send the new provider type and pixel_id. Biqli clears both custom-code fields.
  • Provider to provider: send the new type and its matching pixel_id.
This prevents old custom JavaScript from remaining attached to a provider pixel and prevents a stale provider ID from remaining on a custom configuration.

Validation behavior

The endpoint returns 422 validation_error when:
  • pixel_id is sent without type.
  • head_code or body_code is sent without type: "custom".
  • A provider request includes either custom-code field.
  • A custom request includes pixel_id.
  • A provider request does not include a non-empty pixel_id.
  • The resulting custom configuration has no non-empty code field.
  • The body is empty or contains an unknown field.
A duplicate name returns 409 pixel_name_taken. Success returns 200 OK with the complete updated resource.

Shared API behavior

Authentication is workspace-scoped; see Authentication. Errors use the standard envelope and request IDs described in Errors, and requests are subject to Rate limits.

Authorizations

Authorization
string
header
required

A workspace API key beginning with biqli_.

Path Parameters

pixel
string
required
Pattern: ^biq_pxl_[0-9A-HJKMNP-TV-Z]{26}$

Body

application/json
name
string
required
Required string length: 3 - 80

Response

Updated pixel.

pixel
object
required
status
string
required
Allowed value: "success"