> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://developer.jelliu.co/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://developer.jelliu.co/_mcp/server.

# Create an export job

POST https://api.jelliu.co/api/exports
Content-Type: application/json

Queues an asynchronous export and returns the job right away with `status: pending` and HTTP
`202`. Poll `GET /api/exports/{id}` until `status` is `completed`, then stream the file from
`GET /api/exports/{id}/download`. The file can be downloaded for 72 hours after completion.

Each type accepts only some filters. A filter the type cannot apply is rejected with `400`, never
silently ignored:

* `calls`: `date_from`, `date_to` (on `started_at`), `campaign_id`, `agent_id`, `status`, `outcome`
* `contacts`: `date_from`, `date_to`, `campaign_id`, `agent_id` (through the contact's campaign), `status`
* `conversations`: `date_from`, `date_to`, `agent_id`, `status`
* `analytics`: `date_from`, `date_to`, `campaign_id`, `agent_id`, `status`
* `agent_actions`: `date_from`, `date_to`, `agent_id`, `status` (the action outcome: `success`, `error`, `denied`, `timeout` or `indeterminate`)
* `audit_log`: `date_from`, `date_to`

A file holds at most 100,000 rows, newest first. A larger result completes anyway, with `error`
set to `Results truncated to 100000 rows`. Phone numbers and PII in call summaries are masked. In
CSV files, cells starting with `=`, `+`, `-`, `@`, tab or CR are prefixed with `'` so spreadsheets
do not run them as formulas.

**Side effects.** Inserts a job and enqueues it for a background worker. Up to 3 jobs per
workspace can be `pending` or `processing` at once. When the job finishes, the requesting user
gets an in-app notification (export ready, or export failed). Written to the audit log as
`export.create`.

**Idempotency.** Not idempotent. Retrying after a timeout creates a second job, which also takes one
of the 3 in-progress slots. Before retrying, check `GET /api/exports` for a job created a moment ago
with the same type.

**Webhook events.** Emits `audit.log_recorded` to webhooks subscribed to it. No event is sent when
the export completes. See [Webhooks](/webhooks).

**Access**

* **Required scope:** `write`. `audit_log` and `agent_actions` need `full`, and human users need the owner or admin role for those two types.
* **Rate limit:** General API (120–600 requests/min per workspace, by plan) plus the configuration-mutations limit — 10 requests/min per workspace, shared with other configuration changes. See [Rate limits](/rate-limits).
* **Plan:** Requires the `reportExport` plan feature. Every plan includes it today, including workspaces without an active plan, so this gate currently refuses nobody.

Reference: https://developer.jelliu.co/api-reference/exports/post-exports

## Authentication

- `Authorization` header (bearer token, required) — Workspace API key: `jl_` followed by 64 lowercase hex characters, created by the workspace owner in the dashboard (**Settings → API Keys**) and sent as `Authorization: Bearer jl_...`. The plaintext is shown once, at creation; Jelliu stores only a SHA-256 hash. A workspace can hold up to 25 active keys. | Scope | GET / HEAD | POST / PUT / PATCH / DELETE | Admin-only routes | | --- | --- | --- | --- | | `read` | Yes | No | No | | `write` | Yes | Yes | No | | `full` | Yes | Yes | Yes | Operations restricted to admins or owners reject keys without the `full` scope with `403`, and say so in their description. No key, whatever its scope, can mint or revoke API keys or rotate a webhook secret — that requires a signed-in owner session. A revoked key stops authenticating within about 10 seconds. See [Authentication](/authentication).

## Request

### Body (application/json)

This endpoint expects an object.

- `type` (enum, required) — The data set to export. `calls`: one row per call. `contacts`: campaign contacts. `conversations`: WhatsApp and webchat threads. `analytics`: daily aggregates per campaign. `agent_actions`: one row per tool an agent invoked (owner/admin only). `audit_log`: the audit trail, including `changes` (owner/admin only).
  - Allowed values: `calls`, `contacts`, `conversations`, `analytics`, `agent_actions`, `audit_log`
- `format` (enum, optional, default: csv) — File format. `csv` with a header row, `json` as a single pretty-printed array, or `jsonl` with one JSON object per line (best for very large files and SIEM ingestion).
  - Allowed values: `csv`, `json`, `jsonl`
- `filters` (object, optional, default: {}) — Optional filters, combined with AND. Only the filters listed for the chosen `type` are allowed; empty strings count as not sent.
  - `date_from` (datetime, optional) — Inclusive lower bound. ISO 8601 datetime in UTC with a `Z` suffix; offsets like `-05:00` are rejected.
  - `date_to` (datetime, optional) — Inclusive upper bound. ISO 8601 datetime in UTC with a `Z` suffix.
  - `campaign_id` (string, optional) — Only rows of this campaign. Allowed for `calls`, `contacts` and `analytics`.
  - `agent_id` (string, optional) — Only rows handled by this agent. Allowed for every type except `audit_log`.
  - `status` (string, optional) — Exact match on the row's status (call, contact, conversation or campaign status), or on the action outcome for `agent_actions`. Not allowed for `audit_log`.
  - `outcome` (string, optional) — Exact match on the call outcome. Allowed for `calls` only.

## Response

### 202

The job was queued. It starts `pending`.

- `data` (object, required) — An asynchronous export job, as stored (snake_case). Created by `POST /api/exports`.
  - `id` (string, optional) — Job id. Use it with `GET /api/exports/{id}` and `/download`.
  - `tenant_id` (string, optional) — The workspace that owns the job.
  - `user_id` (string, optional) — Who requested it. A dashboard user id, or `apikey:<keyId>` for API-key requests. This user gets the in-app notification.
  - `type` (enum, optional) — Data set exported. `calls`, `contacts`, `conversations`, `analytics` (daily aggregates per campaign), `agent_actions` and `audit_log` (both owner/admin only).
    - Allowed values: `calls`, `contacts`, `conversations`, `analytics`, `agent_actions`, `audit_log`
  - `format` (enum, optional) — File format. `csv`, `json` (one array) or `jsonl` (one object per line).
    - Allowed values: `csv`, `json`, `jsonl`
  - `status` (enum, optional) — `pending`: queued. `processing`: a worker is building the file. `completed`: ready to download until `expires_at`. `failed`: see `error`. A failed job is retried once about 10 s later, so it can go back to `processing`.
    - Allowed values: `pending`, `processing`, `completed`, `failed`
  - `filters` (map from string to any, optional) — The filters sent on creation, as stored (`{}` when none).
  - `row_count` (integer, optional, nullable) — Rows written to the file (at most 100000). Null until completed.
  - `file_size_bytes` (integer, optional, nullable) — File size in bytes. Null until completed.
  - `file_url` (string, optional, nullable) — Internal storage reference, not a downloadable URL. Always download through `GET /api/exports/{id}/download`. Cleared when the cleanup sweep removes the file.
  - `error` (string, optional, nullable) — Failure reason on `failed` jobs. On a `completed` job, `Results truncated to 100000 rows` when the result was cut short. Otherwise null.
  - `started_at` (datetime, optional, nullable) — When a worker started processing (updated on the retry).
  - `completed_at` (datetime, optional, nullable) — When the job finished, successfully or not.
  - `expires_at` (datetime, optional, nullable) — Set on completion, 72 hours later. After it, the download answers `410`.
  - `created_at` (datetime, optional) — When the job was created.

## Errors

### 400 Bad Request Error

The body failed schema validation (issue list in `details`), or a filter is not supported by the export type (message only).

- `error` (object, required) — The error object. Always has `code` and `message`.
  - `code` (string, required) — Stable machine-readable error code (for example `VALIDATION_FAILED`, `UNAUTHORIZED`, `FORBIDDEN`, `NOT_FOUND`, `BILLING_ERROR`, `COMPLIANCE_BLOCKED`, `RATE_LIMIT_EXCEEDED`, `INTERNAL_ERROR`). Switch on this, not on `message`. See [Errors](/errors).
  - `message` (string, required) — Human-readable explanation. English or Spanish depending on the route; may change without notice.
  - `details` (object or list of object, optional) — Present on `VALIDATION_FAILED` only. Its shape depends on how the route validates: * a field map, either Zod's `flatten()` output (`{ "formErrors": [], "fieldErrors": { "name": ["..."] } }`) or just its `fieldErrors` part (`{ "name": ["..."] }`); * an issue list, where each issue has at least `path`, `message` and `code`. `path` is a dot-separated string on routes that let the schema throw, and an array of keys on routes that forward Zod's raw issues (those also carry Zod's extra issue fields).
    - Field map
      - `formErrors` (list of string, optional)
      - `fieldErrors` (map from string to list of string, optional)
  - `metadata` (map from string to any, optional) — Structured detail exposed for a small allowlist of codes only — for example `BILLING_ERROR` carries `limit`, `current` and `tier` (resource caps) or `tier` and `feature` (feature gates).

### 401 Unauthorized Error

No usable credential. Either the `Authorization` header is missing or is not a well-formed `Bearer jl_…` key, or the key is unknown, revoked or expired. Do not retry with the same key. See [Authentication](/authentication#401-unauthorized).

- `error` (object, required) — The error object. Always has `code` and `message`.
  - `code` (string, required) — Stable machine-readable error code (for example `VALIDATION_FAILED`, `UNAUTHORIZED`, `FORBIDDEN`, `NOT_FOUND`, `BILLING_ERROR`, `COMPLIANCE_BLOCKED`, `RATE_LIMIT_EXCEEDED`, `INTERNAL_ERROR`). Switch on this, not on `message`. See [Errors](/errors).
  - `message` (string, required) — Human-readable explanation. English or Spanish depending on the route; may change without notice.
  - `details` (object or list of object, optional) — Present on `VALIDATION_FAILED` only. Its shape depends on how the route validates: * a field map, either Zod's `flatten()` output (`{ "formErrors": [], "fieldErrors": { "name": ["..."] } }`) or just its `fieldErrors` part (`{ "name": ["..."] }`); * an issue list, where each issue has at least `path`, `message` and `code`. `path` is a dot-separated string on routes that let the schema throw, and an array of keys on routes that forward Zod's raw issues (those also carry Zod's extra issue fields).
    - Field map
      - `formErrors` (list of string, optional)
      - `fieldErrors` (map from string to list of string, optional)
  - `metadata` (map from string to any, optional) — Structured detail exposed for a small allowlist of codes only — for example `BILLING_ERROR` carries `limit`, `current` and `tier` (resource caps) or `tier` and `feature` (feature gates).

### 403 Forbidden Error

An `audit_log` / `agent_actions` export requested by a member or viewer, or with an API key below `full`; a key without `write`; or a plan without export (not possible today).

- `error` (object, required) — The error object. Always has `code` and `message`.
  - `code` (string, required) — Stable machine-readable error code (for example `VALIDATION_FAILED`, `UNAUTHORIZED`, `FORBIDDEN`, `NOT_FOUND`, `BILLING_ERROR`, `COMPLIANCE_BLOCKED`, `RATE_LIMIT_EXCEEDED`, `INTERNAL_ERROR`). Switch on this, not on `message`. See [Errors](/errors).
  - `message` (string, required) — Human-readable explanation. English or Spanish depending on the route; may change without notice.
  - `details` (object or list of object, optional) — Present on `VALIDATION_FAILED` only. Its shape depends on how the route validates: * a field map, either Zod's `flatten()` output (`{ "formErrors": [], "fieldErrors": { "name": ["..."] } }`) or just its `fieldErrors` part (`{ "name": ["..."] }`); * an issue list, where each issue has at least `path`, `message` and `code`. `path` is a dot-separated string on routes that let the schema throw, and an array of keys on routes that forward Zod's raw issues (those also carry Zod's extra issue fields).
    - Field map
      - `formErrors` (list of string, optional)
      - `fieldErrors` (map from string to list of string, optional)
  - `metadata` (map from string to any, optional) — Structured detail exposed for a small allowlist of codes only — for example `BILLING_ERROR` carries `limit`, `current` and `tier` (resource caps) or `tier` and `feature` (feature gates).

### 429 Too Many Requests Error

Too many exports already in progress, or a rate limit (configuration mutations or general API) was exceeded.

- `error` (object, required) — The error object. Always has `code` and `message`.
  - `code` (string, required) — Stable machine-readable error code (for example `VALIDATION_FAILED`, `UNAUTHORIZED`, `FORBIDDEN`, `NOT_FOUND`, `BILLING_ERROR`, `COMPLIANCE_BLOCKED`, `RATE_LIMIT_EXCEEDED`, `INTERNAL_ERROR`). Switch on this, not on `message`. See [Errors](/errors).
  - `message` (string, required) — Human-readable explanation. English or Spanish depending on the route; may change without notice.
  - `details` (object or list of object, optional) — Present on `VALIDATION_FAILED` only. Its shape depends on how the route validates: * a field map, either Zod's `flatten()` output (`{ "formErrors": [], "fieldErrors": { "name": ["..."] } }`) or just its `fieldErrors` part (`{ "name": ["..."] }`); * an issue list, where each issue has at least `path`, `message` and `code`. `path` is a dot-separated string on routes that let the schema throw, and an array of keys on routes that forward Zod's raw issues (those also carry Zod's extra issue fields).
    - Field map
      - `formErrors` (list of string, optional)
      - `fieldErrors` (map from string to list of string, optional)
  - `metadata` (map from string to any, optional) — Structured detail exposed for a small allowlist of codes only — for example `BILLING_ERROR` carries `limit`, `current` and `tier` (resource caps) or `tier` and `feature` (feature gates).

## Examples

### Exports_postExports_example

**Request**

```json
undefined
```

**Response**

```json
{
  "data": {
    "id": "5e4d3c2b-1a09-4f8e-9d7c-6b5a4f3e2d1c",
    "tenant_id": "7a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d",
    "user_id": "user_2kLmNoPqRsTuVwXyZ",
    "type": "calls",
    "format": "csv",
    "status": "pending",
    "filters": {
      "campaign_id": "0b3e7c52-8d4f-4a11-b2c9-5e6f7a8b9c0d",
      "date_from": "2026-09-01T00:00:00Z",
      "date_to": "2026-09-14T23:59:59Z",
      "outcome": "interested"
    },
    "row_count": null,
    "file_size_bytes": null,
    "file_url": null,
    "error": null,
    "started_at": null,
    "completed_at": null,
    "expires_at": null,
    "created_at": "2026-09-14T15:10:01.995Z"
  }
}
```

**SDK Code**

```python Exports_postExports_example
import requests

url = "https://api.jelliu.co/api/exports"

headers = {"Authorization": "Bearer <token>"}

response = requests.post(url, headers=headers)

print(response.json())
```

```javascript Exports_postExports_example
const url = 'https://api.jelliu.co/api/exports';
const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Exports_postExports_example
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.jelliu.co/api/exports"

	req, _ := http.NewRequest("POST", url, nil)

	req.Header.Add("Authorization", "Bearer <token>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Exports_postExports_example
require 'uri'
require 'net/http'

url = URI("https://api.jelliu.co/api/exports")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
```

```java Exports_postExports_example
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.jelliu.co/api/exports")
  .header("Authorization", "Bearer <token>")
  .asString();
```

```php Exports_postExports_example
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.jelliu.co/api/exports', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

echo $response->getBody();
```

```csharp Exports_postExports_example
using RestSharp;

var client = new RestClient("https://api.jelliu.co/api/exports");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift Exports_postExports_example
import Foundation

let headers = ["Authorization": "Bearer <token>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.jelliu.co/api/exports")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### Calls of one campaign as CSV

**Request**

```json
{
  "type": "calls",
  "format": "csv",
  "filters": {
    "date_from": "2026-09-01T00:00:00Z",
    "date_to": "2026-09-14T23:59:59Z",
    "campaign_id": "0b3e7c52-8d4f-4a11-b2c9-5e6f7a8b9c0d",
    "outcome": "interested"
  }
}
```

**Response**

```json
{
  "data": {
    "id": "5e4d3c2b-1a09-4f8e-9d7c-6b5a4f3e2d1c",
    "tenant_id": "7a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d",
    "user_id": "user_2kLmNoPqRsTuVwXyZ",
    "type": "calls",
    "format": "csv",
    "status": "pending",
    "filters": {
      "campaign_id": "0b3e7c52-8d4f-4a11-b2c9-5e6f7a8b9c0d",
      "date_from": "2026-09-01T00:00:00Z",
      "date_to": "2026-09-14T23:59:59Z",
      "outcome": "interested"
    },
    "row_count": null,
    "file_size_bytes": null,
    "file_url": null,
    "error": null,
    "started_at": null,
    "completed_at": null,
    "expires_at": null,
    "created_at": "2026-09-14T15:10:01.995Z"
  }
}
```

**SDK Code**

```python Calls of one campaign as CSV
import requests

url = "https://api.jelliu.co/api/exports"

payload = {
    "type": "calls",
    "format": "csv",
    "filters": {
        "date_from": "2026-09-01T00:00:00Z",
        "date_to": "2026-09-14T23:59:59Z",
        "campaign_id": "0b3e7c52-8d4f-4a11-b2c9-5e6f7a8b9c0d",
        "outcome": "interested"
    }
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript Calls of one campaign as CSV
const url = 'https://api.jelliu.co/api/exports';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"type":"calls","format":"csv","filters":{"date_from":"2026-09-01T00:00:00Z","date_to":"2026-09-14T23:59:59Z","campaign_id":"0b3e7c52-8d4f-4a11-b2c9-5e6f7a8b9c0d","outcome":"interested"}}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Calls of one campaign as CSV
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.jelliu.co/api/exports"

	payload := strings.NewReader("{\n  \"type\": \"calls\",\n  \"format\": \"csv\",\n  \"filters\": {\n    \"date_from\": \"2026-09-01T00:00:00Z\",\n    \"date_to\": \"2026-09-14T23:59:59Z\",\n    \"campaign_id\": \"0b3e7c52-8d4f-4a11-b2c9-5e6f7a8b9c0d\",\n    \"outcome\": \"interested\"\n  }\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Calls of one campaign as CSV
require 'uri'
require 'net/http'

url = URI("https://api.jelliu.co/api/exports")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"type\": \"calls\",\n  \"format\": \"csv\",\n  \"filters\": {\n    \"date_from\": \"2026-09-01T00:00:00Z\",\n    \"date_to\": \"2026-09-14T23:59:59Z\",\n    \"campaign_id\": \"0b3e7c52-8d4f-4a11-b2c9-5e6f7a8b9c0d\",\n    \"outcome\": \"interested\"\n  }\n}"

response = http.request(request)
puts response.read_body
```

```java Calls of one campaign as CSV
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.jelliu.co/api/exports")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"type\": \"calls\",\n  \"format\": \"csv\",\n  \"filters\": {\n    \"date_from\": \"2026-09-01T00:00:00Z\",\n    \"date_to\": \"2026-09-14T23:59:59Z\",\n    \"campaign_id\": \"0b3e7c52-8d4f-4a11-b2c9-5e6f7a8b9c0d\",\n    \"outcome\": \"interested\"\n  }\n}")
  .asString();
```

```php Calls of one campaign as CSV
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.jelliu.co/api/exports', [
  'body' => '{
  "type": "calls",
  "format": "csv",
  "filters": {
    "date_from": "2026-09-01T00:00:00Z",
    "date_to": "2026-09-14T23:59:59Z",
    "campaign_id": "0b3e7c52-8d4f-4a11-b2c9-5e6f7a8b9c0d",
    "outcome": "interested"
  }
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp Calls of one campaign as CSV
using RestSharp;

var client = new RestClient("https://api.jelliu.co/api/exports");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"type\": \"calls\",\n  \"format\": \"csv\",\n  \"filters\": {\n    \"date_from\": \"2026-09-01T00:00:00Z\",\n    \"date_to\": \"2026-09-14T23:59:59Z\",\n    \"campaign_id\": \"0b3e7c52-8d4f-4a11-b2c9-5e6f7a8b9c0d\",\n    \"outcome\": \"interested\"\n  }\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Calls of one campaign as CSV
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "type": "calls",
  "format": "csv",
  "filters": [
    "date_from": "2026-09-01T00:00:00Z",
    "date_to": "2026-09-14T23:59:59Z",
    "campaign_id": "0b3e7c52-8d4f-4a11-b2c9-5e6f7a8b9c0d",
    "outcome": "interested"
  ]
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.jelliu.co/api/exports")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### Audit trail for a SIEM (owner/admin)

**Request**

```json
{
  "type": "audit_log",
  "format": "jsonl",
  "filters": {
    "date_from": "2026-08-01T00:00:00Z",
    "date_to": "2026-08-31T23:59:59Z"
  }
}
```

**Response**

```json
{
  "data": {
    "id": "5e4d3c2b-1a09-4f8e-9d7c-6b5a4f3e2d1c",
    "tenant_id": "7a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d",
    "user_id": "user_2kLmNoPqRsTuVwXyZ",
    "type": "calls",
    "format": "csv",
    "status": "pending",
    "filters": {
      "campaign_id": "0b3e7c52-8d4f-4a11-b2c9-5e6f7a8b9c0d",
      "date_from": "2026-09-01T00:00:00Z",
      "date_to": "2026-09-14T23:59:59Z",
      "outcome": "interested"
    },
    "row_count": null,
    "file_size_bytes": null,
    "file_url": null,
    "error": null,
    "started_at": null,
    "completed_at": null,
    "expires_at": null,
    "created_at": "2026-09-14T15:10:01.995Z"
  }
}
```

**SDK Code**

```python Audit trail for a SIEM (owner/admin)
import requests

url = "https://api.jelliu.co/api/exports"

payload = {
    "type": "audit_log",
    "format": "jsonl",
    "filters": {
        "date_from": "2026-08-01T00:00:00Z",
        "date_to": "2026-08-31T23:59:59Z"
    }
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript Audit trail for a SIEM (owner/admin)
const url = 'https://api.jelliu.co/api/exports';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"type":"audit_log","format":"jsonl","filters":{"date_from":"2026-08-01T00:00:00Z","date_to":"2026-08-31T23:59:59Z"}}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Audit trail for a SIEM (owner/admin)
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.jelliu.co/api/exports"

	payload := strings.NewReader("{\n  \"type\": \"audit_log\",\n  \"format\": \"jsonl\",\n  \"filters\": {\n    \"date_from\": \"2026-08-01T00:00:00Z\",\n    \"date_to\": \"2026-08-31T23:59:59Z\"\n  }\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Audit trail for a SIEM (owner/admin)
require 'uri'
require 'net/http'

url = URI("https://api.jelliu.co/api/exports")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"type\": \"audit_log\",\n  \"format\": \"jsonl\",\n  \"filters\": {\n    \"date_from\": \"2026-08-01T00:00:00Z\",\n    \"date_to\": \"2026-08-31T23:59:59Z\"\n  }\n}"

response = http.request(request)
puts response.read_body
```

```java Audit trail for a SIEM (owner/admin)
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.jelliu.co/api/exports")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"type\": \"audit_log\",\n  \"format\": \"jsonl\",\n  \"filters\": {\n    \"date_from\": \"2026-08-01T00:00:00Z\",\n    \"date_to\": \"2026-08-31T23:59:59Z\"\n  }\n}")
  .asString();
```

```php Audit trail for a SIEM (owner/admin)
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.jelliu.co/api/exports', [
  'body' => '{
  "type": "audit_log",
  "format": "jsonl",
  "filters": {
    "date_from": "2026-08-01T00:00:00Z",
    "date_to": "2026-08-31T23:59:59Z"
  }
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp Audit trail for a SIEM (owner/admin)
using RestSharp;

var client = new RestClient("https://api.jelliu.co/api/exports");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"type\": \"audit_log\",\n  \"format\": \"jsonl\",\n  \"filters\": {\n    \"date_from\": \"2026-08-01T00:00:00Z\",\n    \"date_to\": \"2026-08-31T23:59:59Z\"\n  }\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Audit trail for a SIEM (owner/admin)
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "type": "audit_log",
  "format": "jsonl",
  "filters": [
    "date_from": "2026-08-01T00:00:00Z",
    "date_to": "2026-08-31T23:59:59Z"
  ]
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.jelliu.co/api/exports")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### Failed tool calls of one agent

**Request**

```json
{
  "type": "agent_actions",
  "format": "json",
  "filters": {
    "agent_id": "2c4e6a8b-0d1f-4e3a-9b5c-7d9e1f3a5b7c",
    "status": "error"
  }
}
```

**Response**

```json
{
  "data": {
    "id": "5e4d3c2b-1a09-4f8e-9d7c-6b5a4f3e2d1c",
    "tenant_id": "7a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d",
    "user_id": "user_2kLmNoPqRsTuVwXyZ",
    "type": "calls",
    "format": "csv",
    "status": "pending",
    "filters": {
      "campaign_id": "0b3e7c52-8d4f-4a11-b2c9-5e6f7a8b9c0d",
      "date_from": "2026-09-01T00:00:00Z",
      "date_to": "2026-09-14T23:59:59Z",
      "outcome": "interested"
    },
    "row_count": null,
    "file_size_bytes": null,
    "file_url": null,
    "error": null,
    "started_at": null,
    "completed_at": null,
    "expires_at": null,
    "created_at": "2026-09-14T15:10:01.995Z"
  }
}
```

**SDK Code**

```python Failed tool calls of one agent
import requests

url = "https://api.jelliu.co/api/exports"

payload = {
    "type": "agent_actions",
    "format": "json",
    "filters": {
        "agent_id": "2c4e6a8b-0d1f-4e3a-9b5c-7d9e1f3a5b7c",
        "status": "error"
    }
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript Failed tool calls of one agent
const url = 'https://api.jelliu.co/api/exports';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"type":"agent_actions","format":"json","filters":{"agent_id":"2c4e6a8b-0d1f-4e3a-9b5c-7d9e1f3a5b7c","status":"error"}}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Failed tool calls of one agent
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.jelliu.co/api/exports"

	payload := strings.NewReader("{\n  \"type\": \"agent_actions\",\n  \"format\": \"json\",\n  \"filters\": {\n    \"agent_id\": \"2c4e6a8b-0d1f-4e3a-9b5c-7d9e1f3a5b7c\",\n    \"status\": \"error\"\n  }\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Failed tool calls of one agent
require 'uri'
require 'net/http'

url = URI("https://api.jelliu.co/api/exports")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"type\": \"agent_actions\",\n  \"format\": \"json\",\n  \"filters\": {\n    \"agent_id\": \"2c4e6a8b-0d1f-4e3a-9b5c-7d9e1f3a5b7c\",\n    \"status\": \"error\"\n  }\n}"

response = http.request(request)
puts response.read_body
```

```java Failed tool calls of one agent
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.jelliu.co/api/exports")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"type\": \"agent_actions\",\n  \"format\": \"json\",\n  \"filters\": {\n    \"agent_id\": \"2c4e6a8b-0d1f-4e3a-9b5c-7d9e1f3a5b7c\",\n    \"status\": \"error\"\n  }\n}")
  .asString();
```

```php Failed tool calls of one agent
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.jelliu.co/api/exports', [
  'body' => '{
  "type": "agent_actions",
  "format": "json",
  "filters": {
    "agent_id": "2c4e6a8b-0d1f-4e3a-9b5c-7d9e1f3a5b7c",
    "status": "error"
  }
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp Failed tool calls of one agent
using RestSharp;

var client = new RestClient("https://api.jelliu.co/api/exports");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"type\": \"agent_actions\",\n  \"format\": \"json\",\n  \"filters\": {\n    \"agent_id\": \"2c4e6a8b-0d1f-4e3a-9b5c-7d9e1f3a5b7c\",\n    \"status\": \"error\"\n  }\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Failed tool calls of one agent
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "type": "agent_actions",
  "format": "json",
  "filters": [
    "agent_id": "2c4e6a8b-0d1f-4e3a-9b5c-7d9e1f3a5b7c",
    "status": "error"
  ]
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.jelliu.co/api/exports")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```