---
title: "Trellus Call Data API documentation"
description: "Public API documentation for reading Trellus calls, transcripts, outcomes and reporting metrics. Includes authentication, filters, all supported fields, examples and OpenAPI."
source: "https://www.trellus.ai/developers/api"
note: "Text-only copy of the page for AI assistants and agents. Link to the source address, not this file."
site_summary: "https://www.trellus.ai/llms.txt"
---

# Call Data API

Read call records, transcripts and outcomes. Build reports with counts, duration totals and breakdowns, then retrieve the details or audio for a selected call.

## Make your first request

1. Call /visible first. A 200 response proves the key works and shows the users readable in the requested team.
2. Call /bootstrap only when you need the full account configuration or exact option strings for filters.
3. Use metric-details-v7 for totals and breakdowns; use session-list-v6 for rows and transcript snippets.
4. After choosing one session_id, use /session for complete detail or /get-audio-links for temporary audio URLs.

Verify readable users

```bash
curl https://ext.trellus.ai/visible \
  -H "api_key: $TRELLUS_API_KEY"
```

```javascript
const response = await fetch("https://ext.trellus.ai/visible", {
  method: "GET",
  headers: {
    "api_key": process.env.TRELLUS_API_KEY,
  },
});
console.log(await response.text());
```

```python
import os
import requests

response = requests.get(
    "https://ext.trellus.ai/visible",
    headers={
        "api_key": os.environ["TRELLUS_API_KEY"],
    },
)
print(response.text)
```

The directory includes readable users, a user ID to email mapping, groups and memberships. `team` appears only when the user can read the whole team. Its absence does not mean authentication failed.

Example directory response

```json
{
  "team": { "team_id": "...", "team": "..." },
  "users": [{ "user_id": "...", "user_name": "..." }],
  "user_id_to_email": { "...": "rep@example.com" },
  "groups": [],
  "memberships": []
}
```

Start with a bounded date window and a short list of columns. The example below requests October 1–7, 2026 in UTC. Use the [request builder](https://www.trellus.ai/developers#list-calls) to choose your own dates. Examples on this page never send requests or ask you to enter a key.

List calls and transcript turns

```bash
curl https://rpt-2.trellus.ai/session-list-v6 \
  -H "Authorization: Bearer $TRELLUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "start": 1790812800000000,
    "end": 1791417600000000,
    "cnf": [[{ "column_name": "conversation_type", "operator": "EQ", "value_safe": 1 }]],
    "limit": 50,
    "select": [
      "session_id",
      "started_at",
      "customer_address",
      "customer_data.name",
      "customer_data.title",
      "customer_data.company_name",
      "turn_data.texts",
      "turn_data.is_customers",
      "turn_data.starts"
    ]
  }'
```

```javascript
const response = await fetch("https://rpt-2.trellus.ai/session-list-v6", {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${process.env.TRELLUS_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "start": 1790812800000000,
    "end": 1791417600000000,
    "cnf": [[{ "column_name": "conversation_type", "operator": "EQ", "value_safe": 1 }]],
    "limit": 50,
    "select": [
      "session_id",
      "started_at",
      "customer_address",
      "customer_data.name",
      "customer_data.title",
      "customer_data.company_name",
      "turn_data.texts",
      "turn_data.is_customers",
      "turn_data.starts"
    ]
  }),
});
console.log(await response.text());
```

```python
import os
import requests

response = requests.post(
    "https://rpt-2.trellus.ai/session-list-v6",
    headers={
        "Authorization": f"Bearer {os.environ['TRELLUS_API_KEY']}",
        "Content-Type": "application/json",
    },
    json={
        "start": 1790812800000000,
        "end": 1791417600000000,
        "cnf": [[{ "column_name": "conversation_type", "operator": "EQ", "value_safe": 1 }]],
        "limit": 50,
        "select": [
            "session_id",
            "started_at",
            "customer_address",
            "customer_data.name",
            "customer_data.title",
            "customer_data.company_name",
            "turn_data.texts",
            "turn_data.is_customers",
            "turn_data.starts"
        ]
    },
)
print(response.text)
```

## Six reporting endpoints

Use the directory to resolve people, reporting endpoints to answer questions, and detail endpoints for one selected call. Each endpoint has its own page with parameters, a request in three languages and the errors that apply.

Call Data API endpoints

| Endpoint | What it returns | Authentication |
| --- | --- | --- |
| GET [Visible directory](https://www.trellus.ai/developers/api/visible) `https://ext.trellus.ai/visible` | Start here. Returns the team, users, emails, groups, and memberships this key can see. | api_key header |
| GET [Bootstrap](https://www.trellus.ai/developers/api/bootstrap) `https://ext.trellus.ai/bootstrap` | Load the complete account context and exact disposition, sentiment, and purpose values. | api_key header |
| POST [List calls and transcripts](https://www.trellus.ai/developers/api/list-calls) `https://rpt-2.trellus.ai/session-list-v6` | Return recent matching session rows and optional transcript columns. Maximum 1,000 rows. | Bearer token |
| POST [Count calls and sum durations](https://www.trellus.ai/developers/api/metrics) `https://rpt-2.trellus.ai/metric-details-v7` | Calculate counts and numeric sums, optionally filtered or grouped by a reporting column. | Bearer token |
| GET [Read one call](https://www.trellus.ai/developers/api/session) `https://rpt-2.trellus.ai/session` | Fetch one complete session after session-list returns the session_id you want to inspect. | Bearer token + x-session-id |
| GET [Audio links](https://www.trellus.ai/developers/api/audio) `https://api.trellus.ai/get-audio-links` | Return temporary download URLs for one readable call. Generate them only when needed. | api_key + session_id headers |

## Sync call records from your server

Use the Trellus `session_id` to match call history, transcripts and recordings to the same call in your app. For calls your app starts with the dialer SDK, save the `sessionId` from `session.created` alongside your task ID. Run the fetches below from a server with a key authorized to read the records.

1. **Find calls.** [POST `https://rpt-2.trellus.ai/session-list-v6`](https://www.trellus.ai/developers/api/list-calls) with `Authorization: Bearer <key>` and a JSON body. Use UTC Unix microseconds for `start` (inclusive) and `end` (exclusive). Add `session_id` to `select` and map each positional row using that same column order. Returned `started_at` is in seconds. For inbound-only rows, add `dial_metric.is_inbound EQ true` as a separate filter group alongside `conversation_type EQ 1`.
2. **Read one call and its transcript.** [GET `https://rpt-2.trellus.ai/session`](https://www.trellus.ai/developers/api/session) with the same Bearer key, `x-session-id` and `x-proto-as-json: true`. Read `turnData.texts[i]`, `isCustomers[i]` and `starts[i]` from the same transcript snapshot. `starts` and optional `ends` are offsets in seconds. A call may have no transcript. The legacy media type can be `applicaton/json`. Parse the body as JSON when you request that format.
3. **Get recording links when needed.** [GET `https://api.trellus.ai/get-audio-links`](https://www.trellus.ai/developers/api/audio) with `api_key` and `session_id` headers. Pair `audio[i]` with `audio_links[i]`. Audio can arrive as separate participant recordings. Links expire after one hour. Keep them out of logs and request fresh links when needed. Empty arrays can mean the audio is unavailable or outside retention.

Poll overlapping start-time windows broad enough for call length and reporting delays. Upsert by `session_id` and split a window that returns the row limit before calling it complete. Revisit recent sessions when you expect recording or transcript data that hasn’t arrived. Follow the [request limits](https://www.trellus.ai/developers/api/rate-limits) and honor `Retry-After` on 429 when present. Use bounded backoff when it is absent. Detail and audio share a one-request-per-second default budget for each user. Use [metric details](https://www.trellus.ai/developers/api/metrics) for totals across a window.

Call history, transcript and audio client

```javascript
const reporting = 'https://rpt-2.trellus.ai';
const select = [
  'session_id', 'started_at', 'resource_id', 'duration', 'end_reason',
  'dial_metric.is_inbound', 'user_log.disposition',
];

export function createCallDataReader(apiKey, request = fetch) {
  if (!apiKey) throw new Error('Set TRELLUS_API_KEY on your server.');
  const authorization = { Authorization: 'Bearer ' + apiKey };
  let detailQueue = Promise.resolve();
  let nextDetailAt = 0;

  async function readJson(url, options) {
    const response = await request(url, {
      ...options, redirect: 'error', signal: AbortSignal.timeout(45_000),
    });
    if (!response.ok) {
      const error = new Error('Call Data API returned HTTP ' + response.status);
      error.status = response.status;
      error.retryAfter = response.headers.get('Retry-After');
      if (response.status === 401 && url === reporting + '/session') {
        const reason = (await response.text()).trim();
        if (['inactive user', 'not permissioned', 'not found', 'not on db'].includes(reason)) {
          error.reason = reason;
        }
      }
      throw error;
    }
    // Detail JSON can arrive with the legacy 'applicaton/json' header.
    return response.json();
  }

  async function listCallWindow(start, end) {
    const startMs = start.getTime();
    const endMs = end.getTime();
    if (!Number.isFinite(startMs) || !Number.isFinite(endMs) || startMs >= endMs) {
      throw new Error('Pass a valid UTC time window.');
    }
    const limit = 1000;
    const rows = await readJson(reporting + '/session-list-v6', {
      method: 'POST',
      headers: { ...authorization, 'Content-Type': 'application/json' },
      body: JSON.stringify({
        start: startMs * 1000,
        end: endMs * 1000,
        select,
        limit,
        cnf: [[{ column_name: 'conversation_type', operator: 'EQ', value_safe: 1 }]],
      }),
    });
    return {
      reachedLimit: rows.length === limit,
      calls: rows.map(row => Object.fromEntries(select.map((field, i) => [field, row[i]]))),
    };
  }

  // Detail and audio share a per-user limit. Reuse this client for one user.
  function readDetail(url, options) {
    const result = detailQueue.then(async () => {
      const delay = nextDetailAt - performance.now();
      if (delay > 0) await new Promise(resolve => setTimeout(resolve, delay));
      try {
        return await readJson(url, options);
      } finally {
        nextDetailAt = performance.now() + 1100;
      }
    });
    detailQueue = result.catch(() => {});
    return result;
  }

  const readCall = sessionId => readDetail(reporting + '/session', {
    headers: { ...authorization, 'x-session-id': sessionId, 'x-proto-as-json': 'true' },
  });

  const getRecordingLinks = sessionId => readDetail('https://api.trellus.ai/get-audio-links', {
    headers: { api_key: apiKey, session_id: sessionId },
  });

  return { listCallWindow, readCall, getRecordingLinks };
}
```

Construct the client with `createCallDataReader(process.env.TRELLUS_API_KEY)`. Call `listCallWindow` with two `Date` objects, then use `readCall(sessionId)` or `getRecordingLinks(sessionId)` for the record you need. Reuse the reader to pace detail and audio together. Coordinate pacing across processes that use the same user’s key. If detail says `not found` or `not on db` for a newly created session, revisit it after the call is stored. Keep credentials and call content out of application logs.

[Download the OpenAPI specification](https://www.trellus.ai/developers/openapi.json).

## Guides

The rules that apply across endpoints each have a page.

- [ **Authentication** ](https://www.trellus.ai/developers/api/authentication) Where to copy your key, which header each host expects, and what the key can read.
- [ **Requests and filters** ](https://www.trellus.ai/developers/api/requests) Body parameters, microsecond date ranges, filter groups, operators and array paths.
- [ **Responses and transcripts** ](https://www.trellus.ai/developers/api/responses) Positional rows, timestamp units, aligned transcript arrays and detail JSON.
- [ **Field reference** ](https://www.trellus.ai/developers/api/fields) 150 selectable fields and 17 array members, with types and enum values.
- [ **Rate limits and exports** ](https://www.trellus.ai/developers/api/rate-limits) Per-user limits for each endpoint and how to export a full date range.
- [ **Errors** ](https://www.trellus.ai/developers/api/errors) What 400, 401 and 429 responses mean, and what to check when rows are missing.

## Common tasks

### Confirm the key and readable scope

Call /visible first. It returns the readable directory for one team, including user and group IDs. The team field appears only with whole-team read access.

### Find real connected-call examples

Use session-list-v6 with conversation_type = 1 and dial_metric.live_duration >= 30. Do not require SIP 200 by default, because processed calls can come from non-Trellus telephony. Include transcript columns when snippets are enough.

### Answer aggregate questions

Use metric-details-v7 for counts, numeric sums, and categorical breakdowns. It accepts the same reporting column paths used by session-list-v6. Only fetch session rows when the user asks which calls caused the metric or wants transcript evidence.

### Resolve a rep or option name

Use /visible to resolve user names to resource_id values. Use /bootstrap when you also need exact user_log.disposition, user_log.sentiment, or user_log.purpose strings.

### Get up to 1000 rows per request

Pass limit in the session-list-v6 JSON body. Use limit: 1000 for bulk pulls, then narrow by rep, disposition, date, call type, or duration. For broader history, split windows that reach the limit and merge rows by session_id; a capped response is not a complete export.

### Download audio for one call

Choose a readable call from session-list, then call /get-audio-links with its session_id header. The returned links expire after one hour; request them only when you are ready to play or download the audio.

## OpenAPI and coding-assistant prompt

Download the OpenAPI 3.1 specification for the six read endpoints. It includes authentication, request parameters, and the commonly used fields for call details and audio links.

[Download OpenAPI JSON](https://www.trellus.ai/developers/openapi.json) or [set up an MCP connection](https://www.trellus.ai/developers/mcp).

### Copy integration instructions for your coding assistant

Add the report or integration you want to build, then paste these instructions into your coding assistant. The prompt contains no API key. Set the key privately in your server environment before making live requests.

Call Data API integration instructions

```
Implement a server-side client for the Trellus Call Data API.
Follow my existing project's language and framework. Implement the integration and give
me setup steps plus a small test. Use these reporting endpoints to read data; do not use
them to manage dialer settings or CRM mappings.

Read TRELLUS_API_KEY from the server environment. Never ask me to paste a key into chat.
If it is missing, implement the code and explain how to set it privately before live requests.
Do not expose it in browser code, URLs, logs, output, or prompts. This prompt has no credential.
Ask about the timezone or team only when my requested report depends on that choice.

Authentication and endpoint map:
- GET https://ext.trellus.ai/visible — api_key header; optional team_id header.
- GET https://ext.trellus.ai/bootstrap — api_key header; key owner's account configuration.
- POST https://rpt-2.trellus.ai/session-list-v6 — Authorization: Bearer <API_KEY>; JSON body.
- POST https://rpt-2.trellus.ai/metric-details-v7 — Authorization: Bearer <API_KEY>; JSON body.
- GET https://rpt-2.trellus.ai/session — Authorization: Bearer <API_KEY>, x-session-id, x-proto-as-json: true.
- GET https://api.trellus.ai/get-audio-links — api_key and session_id headers.

Call /visible first to verify identity and read permissions. A key belongs to a user;
team_id selects a permitted team and does not expand access. Do not assume a separate read-only key.
Use /bootstrap for exact disposition, sentiment and purpose strings.

List requests require start (Unix microseconds) and select (array of column paths).
end is exclusive and defaults to now. cnf defaults to []; limit defaults to 50, maximum 1000.
For calls, cnf = [[{ "column_name": "conversation_type", "operator": "EQ", "value_safe": 1 }]].
Fields include session_id, started_at, resource_id, customer_address, customer_data.name,
customer_data.title, customer_data.company_name, duration, turn_data.texts,
turn_data.is_customers and turn_data.starts. There is no standard customer email column.
Return rows are arrays in select order; started_at is seconds, not microseconds.
cnf is AND of OR groups. Filter values for started_at use seconds. Turn offsets and duration use seconds.
For counts/sums, use metric-details-v7 with selects: [{ "cnf": [] }, { "column_name": "duration" }].
If grouped, the group value precedes numeric cells. Both column_name and cnf can appear in a select.

Request parameter definitions:
- start: inclusive range start, Unix microseconds; required for list and metrics.
- end: exclusive range end, Unix microseconds; optional, defaults to now.
- team_id: optional report-body team selector; defaults to the key owner's team. One team per request.
- select: required list of exact column paths for session-list-v6; response cell i corresponds to select[i].
- limit: session-list row cap, default 50, maximum 1000; not a page size with a continuation token.
- cnf: optional AND of OR filter groups. [] imposes no extra filter; avoid empty inner groups.
- column_name: exact column path to filter, sum or group; not an alias or display label.
- operator: EQ equals; NEQ not equal; GT greater; GE greater or equal; LT less;
  LE less or equal; IN is one of the value_safe array; NIN is not in that array;
  REGEX searches a string using the backend regex engine (no look-around/backreferences).
- value_safe: typed comparison value, not a stringified JSON value. Booleans use true/false,
  numerics use numbers, IN/NIN use arrays, bytes use base64, recognized enum columns accept names or numeric values. user_log.source is a numeric
  field for list results and filters; use its numeric codes, not the explanatory labels.
- reducer: required only when a filter path contains [*]; ANY = at least one item matches,
  ALL = every item matches. Do not attach reducer to a path without [*].
- selects: required metric-details-v7 aggregation array. { "cnf": [] } counts matching rows;
  { "column_name": "duration" } sums seconds; specifying both gives a filtered sum.
  Boolean sums count true values. Each aggregation's cnf is additional to the top-level cnf.
  Empty {} is invalid. Numeric response cells follow selects order.
- group_by: optional metrics object with column_name; its value is the first cell in each row.
  String/boolean/enum grouping uses exact values; float/time grouping requires step_size_safe
  and step_start_safe. Integer grouping can use exact values or steps.
- step_size_safe: bin width; step_start_safe: bin origin; step_modulus_safe: optional repeat period.
  Steps use the grouped column's units (started_at uses seconds). A step requires an origin;
  do not supply step parameters for strings, booleans or enums. Group cells with steps are bin
  indices: floor(((value - origin) modulo period, if supplied) / width), not timestamps.
  Compatibility note: when grouping started_at, the current endpoint scales that bin index by
  1,000,000. Divide the returned group cell by 1,000,000 before reconstructing a time bin.

Response definitions and defaults:
- /visible users: readable user records, including user_id for resource_id matching.
  user_id_to_email maps known user IDs to email addresses; not every user must have an entry.
  team is included only for whole-team readers; absence does not mean the key failed.
  groups are readable group records; memberships link user_group_id to member_id;
  member_is_group distinguishes a group member from a user member.
- /bootstrap: the key owner's account configuration and option vocabulary, not a call list.
- session-list-v6: JSON array of positional row arrays; [] means no matching readable sessions.
  Each cell's type/meaning is defined in the catalogue below. Results are newest started_at first.
- metric-details-v7: JSON row arrays; with grouping, [groupValue, ...aggregationValues].
  Without grouping, cells follow selects order. Counts and sums are numeric, not session objects.
- /session: SessionData object in protobuf JSON, with camelCase property names, enum names
  and base64 bytes. Default scalar/empty fields may be omitted; missing is not permission evidence.
  Catalogue paths are snake_case list-query paths, not property names to copy into detail JSON.
- /get-audio-links: session is one session metadata object; audio is a recording metadata array;
  audio_links[i] is the temporary URL for audio[i]. Empty audio/audio_links arrays may mean
  recording retention expired. Do not treat session as an array.
- Unset proto values can appear as 0, false, empty string or empty arrays in list cells.
  A default value is not proof an event was measured or a prediction/evaluation ran.
  Sales/quality flags are detection signals, not guaranteed ground truth.

Use the exact session_id from a row as x-session-id for /session, not a URL query or JSON body.
/session JSON is camelCase (sessionId, customerData, turnData) and omits wordData.
Inspect 401 text: not found differs from not permissioned and not on db.
Audio returns { session, audio, audio_links }; links expire after one hour.

Pace list requests at least 2.5 seconds apart. The default application limit is 2 requests
per 4 seconds per user, shared with session-list-v5. Metrics: 4 per 4 seconds; detail and audio share 1 per second.
Honor Retry-After on 429 when present. Audio errors can omit it and return an empty body. Use bounded backoff when it is absent and for transient 5xx. Read rpt-2 error bodies as text.
There is no cursor/offset paging. If a window returns limit rows, split it into smaller date
windows and deduplicate by session_id; never claim a capped response is a full export.
Never log credentials or include them in prompts. Report missing enrichment/transcripts honestly.

Minimal call-list body (compute the dates; do not copy old sample timestamps):
{
  "start": START_UNIX_MICROSECONDS,
  "end": END_UNIX_MICROSECONDS,
  "limit": 50,
  "cnf": [[{ "column_name": "conversation_type", "operator": "EQ", "value_safe": 1 }]],
  "select": ["session_id", "started_at", "resource_id", "customer_address", "customer_data.name",
    "customer_data.title", "customer_data.company_name", "user_log.disposition", "turn_data.texts",
    "turn_data.is_customers", "turn_data.starts"]
}
Use Date.parse(ISO_WITH_TIMEZONE) * 1000 to build start/end in JavaScript.
Use new Date(started_at * 1000) for returned list timestamps. Handle empty results before
indexing a row. Combine the aligned transcript arrays into speaker/text/offset objects.

For errors, preserve the HTTP status and response text but redact credentials and customer
personal data in logs. If correct /session headers still produce not found or not on db,
report that as an unresolved backend detail lookup; do not fabricate a transcript.
Return accurate totals and label capped or sampled results clearly.

To sync call history and recordings from a server, start with https://www.trellus.ai/developers/api#sync-call-records.

Complete field names, types, enum values and definitions:
https://www.trellus.ai/developers/api/fields
OpenAPI starter:
https://www.trellus.ai/developers/openapi.json
Read the field reference before choosing columns. Do not invent aliases.
Member paths containing .[]. are documentation notation. Select the parent array, or use .[0]. or .[*]. projections. Filters through [*] require ANY/ALL; select projections do not use a reducer.
```
