Reference
Exports
Generate downloadable CSV/XLSX dumps of contacts. The flow is asynchronous:
store enqueues an ExportContacts job and returns immediately. Poll show
until status=completed, then download via the signed download URL.
List exports
Returns paginated export jobs owned by the authenticated user, newest first.
GET
/api/exports
Query parameters
-
per_pageintegerRows per page. Default 20, maximum 100. See Lists, paging and filters.
Example:
20
curl --request GET \
--get "https://klozzo.com/api/exports?per_page=20" \
--header "Authorization: Bearer {YOUR_API_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
const url = new URL(
"https://klozzo.com/api/exports"
);
const params = {
"per_page": "20",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_API_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'https://klozzo.com/api/exports';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_API_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'query' => [
'per_page' => '20',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json
url = 'https://klozzo.com/api/exports'
params = {
'per_page': '20',
}
headers = {
'Authorization': 'Bearer {YOUR_API_TOKEN}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers, params=params)
response.json()
{
"data": [
{
"id": null,
"format": "csv",
"status": "pending",
"total_rows": 0,
"file_name": null,
"filters": null,
"columns": null,
"error": null,
"started_at": null,
"finished_at": null,
"expires_at": null,
"created_at": null,
"download_url": null
},
{
"id": null,
"format": "csv",
"status": "pending",
"total_rows": 0,
"file_name": null,
"filters": null,
"columns": null,
"error": null,
"started_at": null,
"finished_at": null,
"expires_at": null,
"created_at": null,
"download_url": null
}
],
"links": {
"first": "/?page=1",
"last": "/?page=1",
"prev": null,
"next": null
},
"meta": {
"current_page": 1,
"from": 1,
"last_page": 1,
"links": [
{
"url": null,
"label": "« Previous",
"page": null,
"active": false
},
{
"url": "/?page=1",
"label": "1",
"page": 1,
"active": true
},
{
"url": null,
"label": "Next »",
"page": null,
"active": false
}
],
"path": "/",
"per_page": 20,
"to": 2,
"total": 2
}
}
-
dataobject[]-
idstring -
formatstring -
statusstring -
total_rowsinteger -
file_namestring -
filtersstring -
columnsstring -
errorstring -
started_atstring -
finished_atstring -
expires_atstring -
created_atstring -
download_urlstring
-
-
linksobject-
firststring -
laststring -
prevstring -
nextstring
-
-
metaobject-
current_pageinteger -
frominteger -
last_pageinteger -
linksobject[]-
urlstring -
labelstring -
pagestring -
activeboolean
-
-
pathstring -
per_pageinteger -
tointeger -
totalinteger
-
Create an export
Queues an export of contacts and answers immediately with
status=pending. Poll the
resource (GET /api/exports/{id}) until status=completed, then call
GET /api/exports/{id}/download to stream the file.
POST
/api/exports
Body parameters
-
formatstringOutput format. One of
csv(default),xlsx.Example:
csv -
filtersobjectSame shape as smart-list filters; restrict the export to matching rows.
Example:
[] -
columnsstring[]Whitelist of contact columns to include. Omit to use the default set.
Example:
["first_name","last_name","email"] -
location_idintegerScope the export to a specific location.
Example:
1
curl --request POST \
"https://klozzo.com/api/exports" \
--header "Authorization: Bearer {YOUR_API_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"format\": \"csv\",
\"filters\": [],
\"columns\": [
\"first_name\",
\"last_name\",
\"email\"
],
\"location_id\": 1
}"
const url = new URL(
"https://klozzo.com/api/exports"
);
const headers = {
"Authorization": "Bearer {YOUR_API_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"format": "csv",
"filters": [],
"columns": [
"first_name",
"last_name",
"email"
],
"location_id": 1
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'https://klozzo.com/api/exports';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_API_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'format' => 'csv',
'filters' => [],
'columns' => ['first_name', 'last_name', 'email'],
'location_id' => 1,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json
url = 'https://klozzo.com/api/exports'
payload = {
"format": "csv",
"filters": [],
"columns": [
"first_name",
"last_name",
"email"
],
"location_id": 1
}
headers = {
'Authorization': 'Bearer {YOUR_API_TOKEN}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json()
{
"data": {
"id": null,
"format": "csv",
"status": "pending",
"total_rows": 0,
"file_name": null,
"filters": null,
"columns": null,
"error": null,
"started_at": null,
"finished_at": null,
"expires_at": null,
"created_at": null,
"download_url": null
}
}
-
dataobject-
idstring -
formatstring -
statusstring -
total_rowsinteger -
file_namestring -
filtersstring -
columnsstring -
errorstring -
started_atstring -
finished_atstring -
expires_atstring -
created_atstring -
download_urlstring
-
{
"message": "Format no es una opción válida.",
"errors": {
"format": [
"Format no es una opción válida."
]
}
}
Every error shares the same shape — message and errors.
See Errors.
{
"message": "Columns.0 no puede tener más de 64 caracteres.",
"errors": {
"columns.0": [
"Columns.0 no puede tener más de 64 caracteres."
]
}
}
Every error shares the same shape — message and errors.
See Errors.
Fetch an export
Returns the full export record including current status and (when ready)
a download URL.
GET
/api/exports/{id}
Path parameters
-
idinteger requiredExport ID.
Example:
8
curl --request GET \
--get "https://klozzo.com/api/exports/8" \
--header "Authorization: Bearer {YOUR_API_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
const url = new URL(
"https://klozzo.com/api/exports/8"
);
const headers = {
"Authorization": "Bearer {YOUR_API_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'https://klozzo.com/api/exports/8';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_API_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json
url = 'https://klozzo.com/api/exports/8'
headers = {
'Authorization': 'Bearer {YOUR_API_TOKEN}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()
{
"data": {
"id": null,
"format": "csv",
"status": "pending",
"total_rows": 0,
"file_name": null,
"filters": null,
"columns": null,
"error": null,
"started_at": null,
"finished_at": null,
"expires_at": null,
"created_at": null,
"download_url": null
}
}
-
dataobject-
idstring -
formatstring -
statusstring -
total_rowsinteger -
file_namestring -
filtersstring -
columnsstring -
errorstring -
started_atstring -
finished_atstring -
expires_atstring -
created_atstring -
download_urlstring
-
Delete an export
Deletes the export record and the underlying file from storage. Subsequent download attempts will return 404.
DELETE
/api/exports/{id}
Path parameters
-
idinteger requiredExport ID.
Example:
8
curl --request DELETE \
"https://klozzo.com/api/exports/8" \
--header "Authorization: Bearer {YOUR_API_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
const url = new URL(
"https://klozzo.com/api/exports/8"
);
const headers = {
"Authorization": "Bearer {YOUR_API_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'https://klozzo.com/api/exports/8';
$response = $client->delete(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_API_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json
url = 'https://klozzo.com/api/exports/8'
headers = {
'Authorization': 'Bearer {YOUR_API_TOKEN}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('DELETE', url, headers=headers)
response.json()
{
"message": "Export deleted."
}
-
messagestring
Download export file
Streams the finished export file through a pre-signed link that needs no
token. Available only when status=completed and the
file has not been pruned.
GET
/api/exports/{export_id}/download
public
Do not build this URL yourself. It is a pre-signed link: take the
download_url the export returns and follow it as-is. It carries no token
— the signature is the credential — which is what lets you hand it to a
browser, a download manager or a colleague without leaking an API key.
It stops working on expires_at, and a tampered or expired signature
answers 403, not 404.
Path parameters
-
export_idinteger requiredExport ID.
Example:
8
curl --request GET \
--get "https://klozzo.com/api/exports/8/download" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
const url = new URL(
"https://klozzo.com/api/exports/8/download"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'https://klozzo.com/api/exports/8/download';
$response = $client->get(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json
url = 'https://klozzo.com/api/exports/8/download'
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()