Developer API
Create and manage short links, QR codes, campaigns and more from your own code. Every response is JSON.
Authentication
Create a key under Dashboard → API Keys and send it in the Authorization header. Each key is limited to the areas (scopes) you choose, read-only or read & write. Keys act on the workspace they were created in.
Authorization: Bearer sk_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
For simple GET requests you may also pass ?key=YOUR_API_KEY, but the header is safer because URLs end up in logs.
Create an account to get a keyRate limits
Each key can make 60 requests per minute. Every response includes these headers:
X-RateLimit-Limit: 60
X-RateLimit-Remaining: 59
X-RateLimit-Reset: 1793750400 # Unix time when the window resets
Over the limit you get HTTP 429 with a Retry-After header (seconds).
Errors
Successful responses have "error": 0. Failures have "error": 1, a human-readable "message" and an HTTP status code:
| 400 | The body is not valid JSON. |
| 401 | Missing or unknown API key. |
| 403 | The key lacks the scope, the account is not active, or the API is disabled. |
| 404 | The item does not exist or belongs to someone else. |
| 422 | Validation failed (e.g. alias taken, invalid URL). |
| 429 | Rate limit exceeded. |
{ "error": 1, "message": "This alias is already taken. Please choose another one." }
Link object
{
"id": 42,
"alias": "spring",
"shorturl": "https://gocooks.co/spring",
"longurl": "https://example.com/spring-sale?utm_source=api",
"title": "Spring sale",
"description": "",
"type": "direct",
"status": "active",
"archived": false,
"clicks": 1280,
"uniqueclicks": 913,
"password": false,
"expires": null,
"clicklimit": 0,
"campaign": 0,
"pixels": [],
"geotarget": [
{
"location": "FR",
"state": "",
"link": "https://example.com/fr/soldes"
}
],
"devicetarget": [],
"languagetarget": [],
"parameters": [
{
"name": "utm_source",
"value": "api"
}
],
"deeplink": {},
"metatitle": "",
"metadescription": "",
"metaimage": "",
"date": "2026-11-04 09:30:00"
}
Creating a link returns { "error": 0, "id": …, "shorturl": "…", "data": { link object } } with HTTP 201. Lists return "data": [ … ] plus "pagination". The Premium URL Shortener style endpoints GET /urls, POST /url/add, PUT /url/{id}/update and DELETE /url/{id}/delete are also available.
Account
Your profile and totals.
curl "https://gocooks.co/api/account" \
-H "Authorization: Bearer YOUR_API_KEY"$ch = curl_init('https://gocooks.co/api/account');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ['Authorization: Bearer YOUR_API_KEY'],
]);
$result = json_decode(curl_exec($ch), true);const res = await fetch('https://gocooks.co/api/account', {
headers: { 'Authorization': 'Bearer YOUR_API_KEY' },
});
const result = await res.json();import requests
r = requests.get(
"https://gocooks.co/api/account",
headers={"Authorization": "Bearer YOUR_API_KEY"},
)
print(r.json()) Links
List links, newest first.
| Field | Type | Description |
|---|---|---|
| limit | int | Items per page, 1–100 (default 20). |
| page | int | Page number (default 1). |
| order | string | date (default) or clicks. |
| q | string | Search alias, title and URL. |
curl "https://gocooks.co/api/links" \
-H "Authorization: Bearer YOUR_API_KEY"$ch = curl_init('https://gocooks.co/api/links');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ['Authorization: Bearer YOUR_API_KEY'],
]);
$result = json_decode(curl_exec($ch), true);const res = await fetch('https://gocooks.co/api/links', {
headers: { 'Authorization': 'Bearer YOUR_API_KEY' },
});
const result = await res.json();import requests
r = requests.get(
"https://gocooks.co/api/links",
headers={"Authorization": "Bearer YOUR_API_KEY"},
)
print(r.json()) Create a short link.
| Field | Type | Description |
|---|---|---|
| url required | string | Destination URL (http or https). |
| custom | string | Custom alias. Random when empty. |
| domain | int|string | Domain id or host name from GET /api/domains. Main domain when empty. |
| title | string | Title. Fetched from the page when empty. |
| description | string | Notes / description. |
| type | string | direct, frame, splash, splash:{id} (custom splash) or overlay:{id} (CTA overlay). |
| password | string|null | Protect the link with a password. null removes it on update. |
| expiry | string | Expiry date/time, e.g. 2026-12-31 23:59:00 (UTC). |
| clicklimit | int | Stop working after this many clicks. |
| expirationredirect | string | Where to send visitors once the link has expired. |
| geotarget | array | [{"location":"US","state":"","link":"https://…"}] |
| devicetarget | array | [{"device":"iphone|ipad|android|windows|macos|linux|chromeos|mobile|tablet|desktop","link":"https://…"}] |
| languagetarget | array | [{"language":"fr","link":"https://…"}] |
| advancedtarget | array | [{"country":"US","device":"mobile","language":"en","link":"https://…"}] — all set fields must match. |
| abtesting | array | [{"link":"https://…","percent":30}] — the main URL gets the rest. |
| parameters | array | [{"name":"utm_source","value":"api"}] appended to the destination. |
| forwardparams | bool | Pass query parameters added to the short link to the destination. |
| deeplink | object | {"apple":"myapp://…","google":"intent://…","auto":true} |
| pixels | int[] | Pixel ids from GET /api/pixels. |
| campaign | int | Campaign id. |
| channel | int | Channel id. |
| metatitle / metadescription / metaimage | string | Custom social preview (metaimage is an image URL). |
| public | bool | Make statistics public at the short link followed by +. |
| blockbots / breakout | bool | Block bots / open in the real browser from in-app browsers. |
curl -X POST "https://gocooks.co/api/links" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"url":"https://example.com/spring-sale","custom":"spring","parameters":[{"name":"utm_source","value":"api"}],"geotarget":[{"location":"FR","link":"https://example.com/fr/soldes"}]}'$ch = curl_init('https://gocooks.co/api/links');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_HTTPHEADER => ['Authorization: Bearer YOUR_API_KEY', 'Content-Type: application/json'],
CURLOPT_POSTFIELDS => '{"url":"https://example.com/spring-sale","custom":"spring","parameters":[{"name":"utm_source","value":"api"}],"geotarget":[{"location":"FR","link":"https://example.com/fr/soldes"}]}',
]);
$result = json_decode(curl_exec($ch), true);const res = await fetch('https://gocooks.co/api/links', {
method: 'POST',
headers: { 'Authorization': 'Bearer YOUR_API_KEY', 'Content-Type': 'application/json' },
body: JSON.stringify({
"url": "https://example.com/spring-sale",
"custom": "spring",
"parameters": [
{
"name": "utm_source",
"value": "api"
}
],
"geotarget": [
{
"location": "FR",
"link": "https://example.com/fr/soldes"
}
]
}),
});
const result = await res.json();import requests
r = requests.post(
"https://gocooks.co/api/links",
headers={"Authorization": "Bearer YOUR_API_KEY"},
json={
"url": "https://example.com/spring-sale",
"custom": "spring",
"parameters": [{
"name": "utm_source",
"value": "api"
}],
"geotarget": [{
"location": "FR",
"link": "https://example.com/fr/soldes"
}]
},
)
print(r.json()) Get one link.
curl "https://gocooks.co/api/links/123" \
-H "Authorization: Bearer YOUR_API_KEY"$ch = curl_init('https://gocooks.co/api/links/123');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ['Authorization: Bearer YOUR_API_KEY'],
]);
$result = json_decode(curl_exec($ch), true);const res = await fetch('https://gocooks.co/api/links/123', {
headers: { 'Authorization': 'Bearer YOUR_API_KEY' },
});
const result = await res.json();import requests
r = requests.get(
"https://gocooks.co/api/links/123",
headers={"Authorization": "Bearer YOUR_API_KEY"},
)
print(r.json()) Update a link. Only the fields you send change (PATCH works too). Add "archived": true to archive.
| Field | Type | Description |
|---|---|---|
| url required | string | Destination URL (http or https). |
| custom | string | Custom alias. Random when empty. |
| domain | int|string | Domain id or host name from GET /api/domains. Main domain when empty. |
| title | string | Title. Fetched from the page when empty. |
| description | string | Notes / description. |
| type | string | direct, frame, splash, splash:{id} (custom splash) or overlay:{id} (CTA overlay). |
| password | string|null | Protect the link with a password. null removes it on update. |
| expiry | string | Expiry date/time, e.g. 2026-12-31 23:59:00 (UTC). |
| clicklimit | int | Stop working after this many clicks. |
| expirationredirect | string | Where to send visitors once the link has expired. |
| geotarget | array | [{"location":"US","state":"","link":"https://…"}] |
| devicetarget | array | [{"device":"iphone|ipad|android|windows|macos|linux|chromeos|mobile|tablet|desktop","link":"https://…"}] |
| languagetarget | array | [{"language":"fr","link":"https://…"}] |
| advancedtarget | array | [{"country":"US","device":"mobile","language":"en","link":"https://…"}] — all set fields must match. |
| abtesting | array | [{"link":"https://…","percent":30}] — the main URL gets the rest. |
| parameters | array | [{"name":"utm_source","value":"api"}] appended to the destination. |
| forwardparams | bool | Pass query parameters added to the short link to the destination. |
| deeplink | object | {"apple":"myapp://…","google":"intent://…","auto":true} |
| pixels | int[] | Pixel ids from GET /api/pixels. |
| campaign | int | Campaign id. |
| channel | int | Channel id. |
| metatitle / metadescription / metaimage | string | Custom social preview (metaimage is an image URL). |
| public | bool | Make statistics public at the short link followed by +. |
| blockbots / breakout | bool | Block bots / open in the real browser from in-app browsers. |
curl -X PUT "https://gocooks.co/api/links/123" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"title":"Spring sale 2026","clicklimit":1000}'$ch = curl_init('https://gocooks.co/api/links/123');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'PUT',
CURLOPT_HTTPHEADER => ['Authorization: Bearer YOUR_API_KEY', 'Content-Type: application/json'],
CURLOPT_POSTFIELDS => '{"title":"Spring sale 2026","clicklimit":1000}',
]);
$result = json_decode(curl_exec($ch), true);const res = await fetch('https://gocooks.co/api/links/123', {
method: 'PUT',
headers: { 'Authorization': 'Bearer YOUR_API_KEY', 'Content-Type': 'application/json' },
body: JSON.stringify({
"title": "Spring sale 2026",
"clicklimit": 1000
}),
});
const result = await res.json();import requests
r = requests.put(
"https://gocooks.co/api/links/123",
headers={"Authorization": "Bearer YOUR_API_KEY"},
json={
"title": "Spring sale 2026",
"clicklimit": 1000
},
)
print(r.json()) Delete a link and its statistics.
curl -X DELETE "https://gocooks.co/api/links/123" \
-H "Authorization: Bearer YOUR_API_KEY"$ch = curl_init('https://gocooks.co/api/links/123');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'DELETE',
CURLOPT_HTTPHEADER => ['Authorization: Bearer YOUR_API_KEY'],
]);
$result = json_decode(curl_exec($ch), true);const res = await fetch('https://gocooks.co/api/links/123', {
method: 'DELETE',
headers: { 'Authorization': 'Bearer YOUR_API_KEY' },
});
const result = await res.json();import requests
r = requests.delete(
"https://gocooks.co/api/links/123",
headers={"Authorization": "Bearer YOUR_API_KEY"},
)
print(r.json()) Clicks, unique visitors, timeline, countries, cities, devices, browsers, referrers.
| Field | Type | Description |
|---|---|---|
| from | date | YYYY-MM-DD (default: 30 days ago) |
| to | date | YYYY-MM-DD (default: today) |
curl "https://gocooks.co/api/links/123/stats" \
-H "Authorization: Bearer YOUR_API_KEY"$ch = curl_init('https://gocooks.co/api/links/123/stats');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ['Authorization: Bearer YOUR_API_KEY'],
]);
$result = json_decode(curl_exec($ch), true);const res = await fetch('https://gocooks.co/api/links/123/stats', {
headers: { 'Authorization': 'Bearer YOUR_API_KEY' },
});
const result = await res.json();import requests
r = requests.get(
"https://gocooks.co/api/links/123/stats",
headers={"Authorization": "Bearer YOUR_API_KEY"},
)
print(r.json()) QR codes
List QR codes.
| Field | Type | Description |
|---|---|---|
| limit | int | Items per page, 1–100 (default 20). |
| page | int | Page number (default 1). |
curl "https://gocooks.co/api/qr" \
-H "Authorization: Bearer YOUR_API_KEY"$ch = curl_init('https://gocooks.co/api/qr');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ['Authorization: Bearer YOUR_API_KEY'],
]);
$result = json_decode(curl_exec($ch), true);const res = await fetch('https://gocooks.co/api/qr', {
headers: { 'Authorization': 'Bearer YOUR_API_KEY' },
});
const result = await res.json();import requests
r = requests.get(
"https://gocooks.co/api/qr",
headers={"Authorization": "Bearer YOUR_API_KEY"},
)
print(r.json()) Create a QR code. "link" codes are dynamic (trackable, editable) and return an image URL; text, email, phone, sms and wifi codes are static.
| Field | Type | Description |
|---|---|---|
| name | string | Name shown in your dashboard. |
| type required | string | link, text, email, phone, sms, wifi |
| data required | object | link: {url} · text: {text} · email: {email, subject, body} · phone: {phone} · sms: {phone, message} · wifi: {ssid, password, encryption: WPA|WEP|nopass, hidden} |
| design | object | {"foreground":"#000000","background":"#ffffff"} |
| custom / domain | string | Alias and domain for dynamic codes. |
curl -X POST "https://gocooks.co/api/qr" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"name":"Menu","type":"link","data":{"url":"https://example.com/menu"},"design":{"foreground":"#1e1b4b"}}'$ch = curl_init('https://gocooks.co/api/qr');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_HTTPHEADER => ['Authorization: Bearer YOUR_API_KEY', 'Content-Type: application/json'],
CURLOPT_POSTFIELDS => '{"name":"Menu","type":"link","data":{"url":"https://example.com/menu"},"design":{"foreground":"#1e1b4b"}}',
]);
$result = json_decode(curl_exec($ch), true);const res = await fetch('https://gocooks.co/api/qr', {
method: 'POST',
headers: { 'Authorization': 'Bearer YOUR_API_KEY', 'Content-Type': 'application/json' },
body: JSON.stringify({
"name": "Menu",
"type": "link",
"data": {
"url": "https://example.com/menu"
},
"design": {
"foreground": "#1e1b4b"
}
}),
});
const result = await res.json();import requests
r = requests.post(
"https://gocooks.co/api/qr",
headers={"Authorization": "Bearer YOUR_API_KEY"},
json={
"name": "Menu",
"type": "link",
"data": {
"url": "https://example.com/menu"
},
"design": {
"foreground": "#1e1b4b"
}
},
)
print(r.json()) Get one QR code.
curl "https://gocooks.co/api/qr/123" \
-H "Authorization: Bearer YOUR_API_KEY"$ch = curl_init('https://gocooks.co/api/qr/123');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ['Authorization: Bearer YOUR_API_KEY'],
]);
$result = json_decode(curl_exec($ch), true);const res = await fetch('https://gocooks.co/api/qr/123', {
headers: { 'Authorization': 'Bearer YOUR_API_KEY' },
});
const result = await res.json();import requests
r = requests.get(
"https://gocooks.co/api/qr/123",
headers={"Authorization": "Bearer YOUR_API_KEY"},
)
print(r.json()) Delete a QR code.
curl -X DELETE "https://gocooks.co/api/qr/123" \
-H "Authorization: Bearer YOUR_API_KEY"$ch = curl_init('https://gocooks.co/api/qr/123');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'DELETE',
CURLOPT_HTTPHEADER => ['Authorization: Bearer YOUR_API_KEY'],
]);
$result = json_decode(curl_exec($ch), true);const res = await fetch('https://gocooks.co/api/qr/123', {
method: 'DELETE',
headers: { 'Authorization': 'Bearer YOUR_API_KEY' },
});
const result = await res.json();import requests
r = requests.delete(
"https://gocooks.co/api/qr/123",
headers={"Authorization": "Bearer YOUR_API_KEY"},
)
print(r.json()) Bio pages
List link-in-bio pages.
| Field | Type | Description |
|---|---|---|
| limit | int | Items per page, 1–100 (default 20). |
| page | int | Page number (default 1). |
curl "https://gocooks.co/api/bio" \
-H "Authorization: Bearer YOUR_API_KEY"$ch = curl_init('https://gocooks.co/api/bio');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ['Authorization: Bearer YOUR_API_KEY'],
]);
$result = json_decode(curl_exec($ch), true);const res = await fetch('https://gocooks.co/api/bio', {
headers: { 'Authorization': 'Bearer YOUR_API_KEY' },
});
const result = await res.json();import requests
r = requests.get(
"https://gocooks.co/api/bio",
headers={"Authorization": "Bearer YOUR_API_KEY"},
)
print(r.json()) Get a bio page with its profile, social links and blocks.
curl "https://gocooks.co/api/bio/123" \
-H "Authorization: Bearer YOUR_API_KEY"$ch = curl_init('https://gocooks.co/api/bio/123');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ['Authorization: Bearer YOUR_API_KEY'],
]);
$result = json_decode(curl_exec($ch), true);const res = await fetch('https://gocooks.co/api/bio/123', {
headers: { 'Authorization': 'Bearer YOUR_API_KEY' },
});
const result = await res.json();import requests
r = requests.get(
"https://gocooks.co/api/bio/123",
headers={"Authorization": "Bearer YOUR_API_KEY"},
)
print(r.json()) Campaigns
List campaigns.
curl "https://gocooks.co/api/campaigns" \
-H "Authorization: Bearer YOUR_API_KEY"$ch = curl_init('https://gocooks.co/api/campaigns');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ['Authorization: Bearer YOUR_API_KEY'],
]);
$result = json_decode(curl_exec($ch), true);const res = await fetch('https://gocooks.co/api/campaigns', {
headers: { 'Authorization': 'Bearer YOUR_API_KEY' },
});
const result = await res.json();import requests
r = requests.get(
"https://gocooks.co/api/campaigns",
headers={"Authorization": "Bearer YOUR_API_KEY"},
)
print(r.json()) Create a campaign.
| Field | Type | Description |
|---|---|---|
| name required | string | |
| slug | string | Rotator path /c/{slug}. |
| description | string | |
| rotator | bool | Enable the rotator link (default true). |
| public | bool | Show on your public profile. |
curl -X POST "https://gocooks.co/api/campaigns" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"name":"Black Friday","slug":"bf26"}'$ch = curl_init('https://gocooks.co/api/campaigns');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_HTTPHEADER => ['Authorization: Bearer YOUR_API_KEY', 'Content-Type: application/json'],
CURLOPT_POSTFIELDS => '{"name":"Black Friday","slug":"bf26"}',
]);
$result = json_decode(curl_exec($ch), true);const res = await fetch('https://gocooks.co/api/campaigns', {
method: 'POST',
headers: { 'Authorization': 'Bearer YOUR_API_KEY', 'Content-Type': 'application/json' },
body: JSON.stringify({
"name": "Black Friday",
"slug": "bf26"
}),
});
const result = await res.json();import requests
r = requests.post(
"https://gocooks.co/api/campaigns",
headers={"Authorization": "Bearer YOUR_API_KEY"},
json={
"name": "Black Friday",
"slug": "bf26"
},
)
print(r.json()) Update a campaign.
curl -X PUT "https://gocooks.co/api/campaigns/123" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"public":true}'$ch = curl_init('https://gocooks.co/api/campaigns/123');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'PUT',
CURLOPT_HTTPHEADER => ['Authorization: Bearer YOUR_API_KEY', 'Content-Type: application/json'],
CURLOPT_POSTFIELDS => '{"public":true}',
]);
$result = json_decode(curl_exec($ch), true);const res = await fetch('https://gocooks.co/api/campaigns/123', {
method: 'PUT',
headers: { 'Authorization': 'Bearer YOUR_API_KEY', 'Content-Type': 'application/json' },
body: JSON.stringify({
"public": true
}),
});
const result = await res.json();import requests
r = requests.put(
"https://gocooks.co/api/campaigns/123",
headers={"Authorization": "Bearer YOUR_API_KEY"},
json={
"public": True
},
)
print(r.json()) Delete a campaign (its links stay).
curl -X DELETE "https://gocooks.co/api/campaigns/123" \
-H "Authorization: Bearer YOUR_API_KEY"$ch = curl_init('https://gocooks.co/api/campaigns/123');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'DELETE',
CURLOPT_HTTPHEADER => ['Authorization: Bearer YOUR_API_KEY'],
]);
$result = json_decode(curl_exec($ch), true);const res = await fetch('https://gocooks.co/api/campaigns/123', {
method: 'DELETE',
headers: { 'Authorization': 'Bearer YOUR_API_KEY' },
});
const result = await res.json();import requests
r = requests.delete(
"https://gocooks.co/api/campaigns/123",
headers={"Authorization": "Bearer YOUR_API_KEY"},
)
print(r.json()) Channels
List channels.
curl "https://gocooks.co/api/channels" \
-H "Authorization: Bearer YOUR_API_KEY"$ch = curl_init('https://gocooks.co/api/channels');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ['Authorization: Bearer YOUR_API_KEY'],
]);
$result = json_decode(curl_exec($ch), true);const res = await fetch('https://gocooks.co/api/channels', {
headers: { 'Authorization': 'Bearer YOUR_API_KEY' },
});
const result = await res.json();import requests
r = requests.get(
"https://gocooks.co/api/channels",
headers={"Authorization": "Bearer YOUR_API_KEY"},
)
print(r.json()) Create a channel.
| Field | Type | Description |
|---|---|---|
| name required | string | |
| color | string | #RRGGBB |
| description | string | |
| starred | bool |
curl -X POST "https://gocooks.co/api/channels" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"name":"Newsletter","color":"#ec4899"}'$ch = curl_init('https://gocooks.co/api/channels');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_HTTPHEADER => ['Authorization: Bearer YOUR_API_KEY', 'Content-Type: application/json'],
CURLOPT_POSTFIELDS => '{"name":"Newsletter","color":"#ec4899"}',
]);
$result = json_decode(curl_exec($ch), true);const res = await fetch('https://gocooks.co/api/channels', {
method: 'POST',
headers: { 'Authorization': 'Bearer YOUR_API_KEY', 'Content-Type': 'application/json' },
body: JSON.stringify({
"name": "Newsletter",
"color": "#ec4899"
}),
});
const result = await res.json();import requests
r = requests.post(
"https://gocooks.co/api/channels",
headers={"Authorization": "Bearer YOUR_API_KEY"},
json={
"name": "Newsletter",
"color": "#ec4899"
},
)
print(r.json()) Update a channel.
curl -X PUT "https://gocooks.co/api/channels/123" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"starred":true}'$ch = curl_init('https://gocooks.co/api/channels/123');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'PUT',
CURLOPT_HTTPHEADER => ['Authorization: Bearer YOUR_API_KEY', 'Content-Type: application/json'],
CURLOPT_POSTFIELDS => '{"starred":true}',
]);
$result = json_decode(curl_exec($ch), true);const res = await fetch('https://gocooks.co/api/channels/123', {
method: 'PUT',
headers: { 'Authorization': 'Bearer YOUR_API_KEY', 'Content-Type': 'application/json' },
body: JSON.stringify({
"starred": true
}),
});
const result = await res.json();import requests
r = requests.put(
"https://gocooks.co/api/channels/123",
headers={"Authorization": "Bearer YOUR_API_KEY"},
json={
"starred": True
},
)
print(r.json()) Delete a channel (its items stay).
curl -X DELETE "https://gocooks.co/api/channels/123" \
-H "Authorization: Bearer YOUR_API_KEY"$ch = curl_init('https://gocooks.co/api/channels/123');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'DELETE',
CURLOPT_HTTPHEADER => ['Authorization: Bearer YOUR_API_KEY'],
]);
$result = json_decode(curl_exec($ch), true);const res = await fetch('https://gocooks.co/api/channels/123', {
method: 'DELETE',
headers: { 'Authorization': 'Bearer YOUR_API_KEY' },
});
const result = await res.json();import requests
r = requests.delete(
"https://gocooks.co/api/channels/123",
headers={"Authorization": "Bearer YOUR_API_KEY"},
)
print(r.json()) Pixels
List tracking pixels.
curl "https://gocooks.co/api/pixels" \
-H "Authorization: Bearer YOUR_API_KEY"$ch = curl_init('https://gocooks.co/api/pixels');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ['Authorization: Bearer YOUR_API_KEY'],
]);
$result = json_decode(curl_exec($ch), true);const res = await fetch('https://gocooks.co/api/pixels', {
headers: { 'Authorization': 'Bearer YOUR_API_KEY' },
});
const result = await res.json();import requests
r = requests.get(
"https://gocooks.co/api/pixels",
headers={"Authorization": "Bearer YOUR_API_KEY"},
)
print(r.json()) Add a pixel.
| Field | Type | Description |
|---|---|---|
| provider required | string | facebook, gtag, adwords, gtm, linkedin, twitter, bing, snapchat, pinterest, reddit, quora, tiktok, adroll |
| tag required | string | Pixel / tag ID. |
| name | string |
curl -X POST "https://gocooks.co/api/pixels" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"provider":"facebook","tag":"123456789012345","name":"Meta pixel"}'$ch = curl_init('https://gocooks.co/api/pixels');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_HTTPHEADER => ['Authorization: Bearer YOUR_API_KEY', 'Content-Type: application/json'],
CURLOPT_POSTFIELDS => '{"provider":"facebook","tag":"123456789012345","name":"Meta pixel"}',
]);
$result = json_decode(curl_exec($ch), true);const res = await fetch('https://gocooks.co/api/pixels', {
method: 'POST',
headers: { 'Authorization': 'Bearer YOUR_API_KEY', 'Content-Type': 'application/json' },
body: JSON.stringify({
"provider": "facebook",
"tag": "123456789012345",
"name": "Meta pixel"
}),
});
const result = await res.json();import requests
r = requests.post(
"https://gocooks.co/api/pixels",
headers={"Authorization": "Bearer YOUR_API_KEY"},
json={
"provider": "facebook",
"tag": "123456789012345",
"name": "Meta pixel"
},
)
print(r.json()) Update a pixel.
curl -X PUT "https://gocooks.co/api/pixels/123" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"name":"Main Meta pixel"}'$ch = curl_init('https://gocooks.co/api/pixels/123');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'PUT',
CURLOPT_HTTPHEADER => ['Authorization: Bearer YOUR_API_KEY', 'Content-Type: application/json'],
CURLOPT_POSTFIELDS => '{"name":"Main Meta pixel"}',
]);
$result = json_decode(curl_exec($ch), true);const res = await fetch('https://gocooks.co/api/pixels/123', {
method: 'PUT',
headers: { 'Authorization': 'Bearer YOUR_API_KEY', 'Content-Type': 'application/json' },
body: JSON.stringify({
"name": "Main Meta pixel"
}),
});
const result = await res.json();import requests
r = requests.put(
"https://gocooks.co/api/pixels/123",
headers={"Authorization": "Bearer YOUR_API_KEY"},
json={
"name": "Main Meta pixel"
},
)
print(r.json()) Delete a pixel.
curl -X DELETE "https://gocooks.co/api/pixels/123" \
-H "Authorization: Bearer YOUR_API_KEY"$ch = curl_init('https://gocooks.co/api/pixels/123');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'DELETE',
CURLOPT_HTTPHEADER => ['Authorization: Bearer YOUR_API_KEY'],
]);
$result = json_decode(curl_exec($ch), true);const res = await fetch('https://gocooks.co/api/pixels/123', {
method: 'DELETE',
headers: { 'Authorization': 'Bearer YOUR_API_KEY' },
});
const result = await res.json();import requests
r = requests.delete(
"https://gocooks.co/api/pixels/123",
headers={"Authorization": "Bearer YOUR_API_KEY"},
)
print(r.json()) Domains
Domains you can use: the main domain (id 0), shared domains and your own.
curl "https://gocooks.co/api/domains" \
-H "Authorization: Bearer YOUR_API_KEY"$ch = curl_init('https://gocooks.co/api/domains');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ['Authorization: Bearer YOUR_API_KEY'],
]);
$result = json_decode(curl_exec($ch), true);const res = await fetch('https://gocooks.co/api/domains', {
headers: { 'Authorization': 'Bearer YOUR_API_KEY' },
});
const result = await res.json();import requests
r = requests.get(
"https://gocooks.co/api/domains",
headers={"Authorization": "Bearer YOUR_API_KEY"},
)
print(r.json()) Add a branded domain. Point its DNS to this server first.
| Field | Type | Description |
|---|---|---|
| domain required | string | go.example.com |
| root_redirect | string | Where the bare domain redirects. |
| notfound_redirect | string | Where unknown aliases redirect. |
curl -X POST "https://gocooks.co/api/domains" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"domain":"go.example.com","root_redirect":"https://example.com"}'$ch = curl_init('https://gocooks.co/api/domains');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_HTTPHEADER => ['Authorization: Bearer YOUR_API_KEY', 'Content-Type: application/json'],
CURLOPT_POSTFIELDS => '{"domain":"go.example.com","root_redirect":"https://example.com"}',
]);
$result = json_decode(curl_exec($ch), true);const res = await fetch('https://gocooks.co/api/domains', {
method: 'POST',
headers: { 'Authorization': 'Bearer YOUR_API_KEY', 'Content-Type': 'application/json' },
body: JSON.stringify({
"domain": "go.example.com",
"root_redirect": "https://example.com"
}),
});
const result = await res.json();import requests
r = requests.post(
"https://gocooks.co/api/domains",
headers={"Authorization": "Bearer YOUR_API_KEY"},
json={
"domain": "go.example.com",
"root_redirect": "https://example.com"
},
)
print(r.json()) Remove a domain. Its links move to the main domain.
curl -X DELETE "https://gocooks.co/api/domains/123" \
-H "Authorization: Bearer YOUR_API_KEY"$ch = curl_init('https://gocooks.co/api/domains/123');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'DELETE',
CURLOPT_HTTPHEADER => ['Authorization: Bearer YOUR_API_KEY'],
]);
$result = json_decode(curl_exec($ch), true);const res = await fetch('https://gocooks.co/api/domains/123', {
method: 'DELETE',
headers: { 'Authorization': 'Bearer YOUR_API_KEY' },
});
const result = await res.json();import requests
r = requests.delete(
"https://gocooks.co/api/domains/123",
headers={"Authorization": "Bearer YOUR_API_KEY"},
)
print(r.json()) Splash pages & overlays
List custom splash pages (use the returned type when creating links).
curl "https://gocooks.co/api/splash" \
-H "Authorization: Bearer YOUR_API_KEY"$ch = curl_init('https://gocooks.co/api/splash');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ['Authorization: Bearer YOUR_API_KEY'],
]);
$result = json_decode(curl_exec($ch), true);const res = await fetch('https://gocooks.co/api/splash', {
headers: { 'Authorization': 'Bearer YOUR_API_KEY' },
});
const result = await res.json();import requests
r = requests.get(
"https://gocooks.co/api/splash",
headers={"Authorization": "Bearer YOUR_API_KEY"},
)
print(r.json()) List CTA overlays (use the returned type when creating links).
curl "https://gocooks.co/api/overlays" \
-H "Authorization: Bearer YOUR_API_KEY"$ch = curl_init('https://gocooks.co/api/overlays');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ['Authorization: Bearer YOUR_API_KEY'],
]);
$result = json_decode(curl_exec($ch), true);const res = await fetch('https://gocooks.co/api/overlays', {
headers: { 'Authorization': 'Bearer YOUR_API_KEY' },
});
const result = await res.json();import requests
r = requests.get(
"https://gocooks.co/api/overlays",
headers={"Authorization": "Bearer YOUR_API_KEY"},
)
print(r.json())