Skip to content
Klozzo API
OpenAPI Postman

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

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"
{
    "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
    }
}
  • data object[]

    • id string

    • format string

    • status string

    • total_rows integer

    • file_name string

    • filters string

    • columns string

    • error string

    • started_at string

    • finished_at string

    • expires_at string

    • created_at string

    • download_url string

  • links object

    • first string

    • last string

    • prev string

    • next string

  • meta object

    • current_page integer

    • from integer

    • last_page integer

    • links object[]

      • url string

      • label string

      • page string

      • active boolean

    • path string

    • per_page integer

    • to integer

    • total integer

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

  • format string

    Output format. One of csv (default), xlsx.

    Example: csv

  • filters object

    Same shape as smart-list filters; restrict the export to matching rows.

    Example: []

  • columns string[]

    Whitelist of contact columns to include. Omit to use the default set.

    Example: ["first_name","last_name","email"]

  • location_id integer

    Scope 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
}"
{
    "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
    }
}
  • data object

    • id string

    • format string

    • status string

    • total_rows integer

    • file_name string

    • filters string

    • columns string

    • error string

    • started_at string

    • finished_at string

    • expires_at string

    • created_at string

    • download_url string

Fetch an export

Returns the full export record including current status and (when ready) a download URL.

GET /api/exports/{id}

Path parameters

  • id integer required

    Export 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"
{
    "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
    }
}
  • data object

    • id string

    • format string

    • status string

    • total_rows integer

    • file_name string

    • filters string

    • columns string

    • error string

    • started_at string

    • finished_at string

    • expires_at string

    • created_at string

    • download_url string

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

  • id integer required

    Export 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"
{
    "message": "Export deleted."
}
  • message string

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_id integer required

    Export ID.

    Example: 8

curl --request GET \
    --get "https://klozzo.com/api/exports/8/download" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
"<binary CSV or XLSX>"

This response has no body.