> ## Documentation Index
> Fetch the complete documentation index at: https://docs.agnost.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Trellus

> Send Trellus call transcripts to Agnost

Agnost accepts the default Trellus call webhook and turns each call into a session with events for each user/agent exchange. Trellus already provides the transcript, so this integration does not run speech-to-text again.

## Configure the webhook

In Trellus, create a webhook with:

```text theme={null}
URL: https://api.agnost.ai/api/voice/v1/webhooks/trellus
Method: POST
Header: X-Org-Id: <your-agnost-org-id>
Body: Default Trellus payload
```

Get your organization ID from [app.agnost.ai](https://app.agnost.ai). It must be a UUID.

Do not add a custom payload mapping. Agnost reads the standard Trellus fields directly.

## Required data

The webhook needs:

* A call ID in `session_id`, `unique_id`, or `custom_id`.
* A prospect identity in `contact_name`, `target_number`, or both.
* Call text in `transcript` or, as a fallback, `summary`.

Agnost uses the Trellus call ID as the stable session ID. Repeated deliveries for the same call map to the same session, but may duplicate its events, so do not manually replay a successful webhook.

## Example payload

```json theme={null}
{
  "session_id": "sess_abc123def456",
  "duration": 245,
  "direction": "outbound",
  "call_status": "answered",
  "rep_id": "rep_001",
  "rep_name": "John Smith",
  "rep_number": "+15551234567",
  "contact_id": "contact_001",
  "contact_name": "Jane Doe",
  "target_number": "+15559876543",
  "disposition": "Connected",
  "sentiment": "Positive",
  "summary": "Discussed product features and pricing.",
  "audio_url": "https://recordings.example.com/calls/sess_abc.mp3",
  "transcript": "Jane Doe: Hi, who is this?\nJohn Smith: Hi Jane, this is John from Acme."
}
```

Trellus speaker labels such as `Rep`, `Contact`, and `Prospect` are mapped automatically. Rep and contact names are also recognized when they appear as transcript labels.

## Response

A successful request returns:

```json theme={null}
{
  "status": "accepted",
  "session_id": "sess_abc123def456",
  "user_id": "jane-doe:+15559876543",
  "event_count": 1
}
```

The rep name becomes the Agnost agent name. The contact name and target number form a stable user ID, with either field used alone when only one is present.

## What appears in Agnost

* One session for the Trellus call.
* Conversation events created from user and rep turns.
* Call metadata such as direction, disposition, sentiment, duration, summary, rep, and contact fields.
* Safe `http` or `https` audio, transcript, and platform links when provided.

## Troubleshooting

* **`422` for a missing header**: add `X-Org-Id` to the Trellus webhook.
* **`400` for the organization ID**: confirm `X-Org-Id` is a valid UUID.
* **`400` for identity**: include a call ID and either `contact_name` or `target_number`.
* **`422` for an empty transcript**: include `transcript` or `summary`.
* **The call has no events**: confirm transcript turns use `Speaker: text` lines. Agnost recognizes `Rep`, `Contact`, `Prospect`, and the rep/contact names.
