Docs menu

Pixels API

Add, list, change and delete Meta, Google, TikTok, LinkedIn, Pinterest, X, Snapchat, Microsoft, Reddit and Quora pixels, then fire them on links, with the siz.la REST API.

A pixel is an ad or analytics id, such as a Meta pixel or a Google Analytics measurement id, that fires when someone clicks a link, before the visitor moves on. Reading needs a key. Adding, changing and deleting pixels need a key with write access.

To use a pixel, send its id in the pixels list when you make or change a link (see (https://siz.la/docs/links)). A link can fire a limited number of pixels at once. Deleting a pixel takes it off every link that used it.

List pixels

GET/api/pixels

Your pixels by name. Send their ids as pixels when you make or change a link.

Needs: API key.

Parameters

NameInTypeDescription
limitQueryintegerHow many pixels to return on a page. 1 to 100. Default 15.
pageQueryintegerWhich page to return. At least 1. Default 1.

Example request

Shell
curl "https://siz.la/api/pixels?limit=10&page=1" \
  -H "Authorization: Bearer $SIZLA_API_KEY"
JavaScript
const response = await fetch("https://siz.la/api/pixels?limit=10&page=1", {
  headers: {
    Authorization: `Bearer ${process.env.SIZLA_API_KEY}`,
  },
});
const data = await response.json();
console.log(data);
Python
import os
import requests

response = requests.get(
    "https://siz.la/api/pixels",
    headers={"Authorization": f"Bearer {os.environ['SIZLA_API_KEY']}"},
    params={
        "limit": 10,
        "page": 1,
    },
)
print(response.json())
PHP
$ch = curl_init('https://siz.la/api/pixels?limit=10&page=1');
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        'Authorization: Bearer '.getenv('SIZLA_API_KEY'),
    ],
]);
$data = json_decode(curl_exec($ch), true);

Example answer, status 200

JSON
{
    "error": "0",
    "data": {
        "result": 1,
        "perpage": 10,
        "currentpage": 1,
        "nextpage": null,
        "maxpage": 1,
        "pixels": [
            {
                "id": 9,
                "type": "meta",
                "name": "Spring campaign",
                "tag": "123456789012345",
                "date": "2026-11-12 08:20:00"
            }
        ]
    }
}

Errors specific to this call

  • 403: The plan does not include pixels.

Notes

  • error is the text "0" on this endpoint and the number 0 on the others.

Add a pixel

POST/api/pixel/add

Add a pixel. The id is checked against the format of the type you pick.

Needs: API key with write access.

Parameters

NameInTypeDescription
type (required)BodystringWhere the pixel reports to. One of meta, google_ads, ga4, tiktok, linkedin, pinterest, x, snapchat, microsoft, reddit, quora.
name (required)BodystringA name for you. Only you see it. Up to 80 characters.
tag (required)BodystringThe pixel id from the provider. It must fit the format of the type. Up to 60 characters.

Example request

Shell
curl -X POST "https://siz.la/api/pixel/add" \
  -H "Authorization: Bearer $SIZLA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"type":"meta","name":"Spring campaign","tag":"123456789012345"}'
JavaScript
const response = await fetch("https://siz.la/api/pixel/add", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.SIZLA_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "type": "meta",
    "name": "Spring campaign",
    "tag": "123456789012345"
  }),
});
const data = await response.json();
console.log(data);
Python
import os
import requests

response = requests.post(
    "https://siz.la/api/pixel/add",
    headers={"Authorization": f"Bearer {os.environ['SIZLA_API_KEY']}"},
    json={
        "type": "meta",
        "name": "Spring campaign",
        "tag": "123456789012345",
    },
)
print(response.json())
PHP
$ch = curl_init('https://siz.la/api/pixel/add');
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_CUSTOMREQUEST => 'POST',
    CURLOPT_HTTPHEADER => [
        'Authorization: Bearer '.getenv('SIZLA_API_KEY'),
        'Content-Type: application/json',
    ],
    CURLOPT_POSTFIELDS => json_encode([
        'type' => 'meta',
        'name' => 'Spring campaign',
        'tag' => '123456789012345',
    ]),
]);
$data = json_decode(curl_exec($ch), true);

Example answer, status 200

JSON
{
    "error": 0,
    "id": 9
}

Errors specific to this call

  • 400: The type or id is not valid, you already have that pixel, or the account has the most pixels it can keep. message says which.
  • 403: The plan does not include pixels.

Notes

  • Ids by type: meta is the pixel id, all digits, from Events Manager; google_ads is the conversion id that starts with AW-; ga4 is the measurement id that starts with G-; tiktok is the pixel id from TikTok Events Manager; linkedin is the Insight Tag partner id, all digits; pinterest is the tag id, all digits, from Pinterest Ads; x is the pixel id from X Ads events manager; snapchat is the pixel id from Snapchat Ads Manager, with its dashes; microsoft is the UET tag id, all digits; reddit is the pixel id from Reddit Ads, starting with t2_ or a2_; quora is the pixel id from Quora Ads Manager, 32 letters and digits.

Update a pixel

PUT/api/pixel/{id}/update

Change a pixel. Only the fields you send change. Links that use it fire the new id from then on.

Needs: API key with write access.

Parameters

NameInTypeDescription
id (required)PathintegerThe pixel's id. At least 1.
typeBodystringWhere the pixel reports to. One of meta, google_ads, ga4, tiktok, linkedin, pinterest, x, snapchat, microsoft, reddit, quora.
nameBodystringA name for you. Only you see it. Up to 80 characters.
tagBodystringThe pixel id from the provider. It must fit the format of the type. Up to 60 characters.

Example request

Shell
curl -X PUT "https://siz.la/api/pixel/9/update" \
  -H "Authorization: Bearer $SIZLA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name":"Spring campaign 2026"}'
JavaScript
const response = await fetch("https://siz.la/api/pixel/9/update", {
  method: "PUT",
  headers: {
    Authorization: `Bearer ${process.env.SIZLA_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "name": "Spring campaign 2026"
  }),
});
const data = await response.json();
console.log(data);
Python
import os
import requests

response = requests.put(
    "https://siz.la/api/pixel/9/update",
    headers={"Authorization": f"Bearer {os.environ['SIZLA_API_KEY']}"},
    json={
        "name": "Spring campaign 2026",
    },
)
print(response.json())
PHP
$ch = curl_init('https://siz.la/api/pixel/9/update');
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_CUSTOMREQUEST => 'PUT',
    CURLOPT_HTTPHEADER => [
        'Authorization: Bearer '.getenv('SIZLA_API_KEY'),
        'Content-Type: application/json',
    ],
    CURLOPT_POSTFIELDS => json_encode([
        'name' => 'Spring campaign 2026',
    ]),
]);
$data = json_decode(curl_exec($ch), true);

Example answer, status 200

JSON
{
    "error": 0,
    "message": "Pixel has been updated successfully"
}

Errors specific to this call

  • 400: A value is not valid. message says which.
  • 403: The plan does not include pixels.
  • 404: The pixel does not exist or belongs to someone else.

Delete a pixel

DELETE/api/pixel/{id}/delete

Delete a pixel. Every link that used it stops firing it.

Needs: API key with write access.

Parameters

NameInTypeDescription
id (required)PathintegerThe pixel's id. At least 1.

Example request

Shell
curl -X DELETE "https://siz.la/api/pixel/9/delete" \
  -H "Authorization: Bearer $SIZLA_API_KEY"
JavaScript
const response = await fetch("https://siz.la/api/pixel/9/delete", {
  method: "DELETE",
  headers: {
    Authorization: `Bearer ${process.env.SIZLA_API_KEY}`,
  },
});
const data = await response.json();
console.log(data);
Python
import os
import requests

response = requests.delete(
    "https://siz.la/api/pixel/9/delete",
    headers={"Authorization": f"Bearer {os.environ['SIZLA_API_KEY']}"},
)
print(response.json())
PHP
$ch = curl_init('https://siz.la/api/pixel/9/delete');
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_CUSTOMREQUEST => 'DELETE',
    CURLOPT_HTTPHEADER => [
        'Authorization: Bearer '.getenv('SIZLA_API_KEY'),
    ],
]);
$data = json_decode(curl_exec($ch), true);

Example answer, status 200

JSON
{
    "error": 0,
    "message": "Pixel has been deleted successfully"
}

Errors specific to this call

  • 403: The plan does not include pixels.
  • 404: The pixel does not exist or belongs to someone else.