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

# Send Message to Collab Agent

POST https://api.athenaintel.com/api/v0/collab-agents/{asset_id}/messages
Content-Type: application/json

Submit a message to a collab agent through its Programmatic channel. The agent must have the channel explicitly enabled (programmaticEnabled) and must be shared with the caller. With wait=false (default) the submission is queued and the endpoint returns 202 immediately; the resulting session appears in Athena under the caller's account. With wait=true the request long-polls: the connection stays open while the agent runs and the final agent message is returned verbatim in the reply field — size client timeouts for multi-minute runs. Submissions from the same caller with the same clientThreadKey continue one conversation until 24 hours of inactivity.

Reference: https://docs.athenaintel.com/api-reference/collab-agents/send-message

## Authentication

- `X-API-KEY` header (required) — API Key authentication via header

## Request

### Path parameters

- `asset_id` (string, required) — Asset id of the collab agent to message

### Body (application/json)

This endpoint expects a CollabAgentSendMessageRequestIn.

- `message` (string, required) — The message text to submit to the agent. Delivered verbatim as the user turn of the agent session.
- `channel` (string, optional, nullable) — Optional custom-channel id from the agent's Channels tab. Selects that channel's configuration overrides (model, prompt, tools) and stamps the session's origin. External SSO viewers MUST select a channel whose settings admit external viewers — they are refused everywhere else. Distinct channels hold distinct conversations even under the same clientThreadKey.
- `clientThreadKey` (string, optional, nullable) — Optional caller-chosen conversation key. Submissions from the same caller with the same key continue one agent session (until 24 hours of inactivity); different keys hold independent conversations. Omitted, all of a caller's submissions to this agent share one 'default' thread.
- `voiceUpdateHandle` (string, optional, nullable) — Reserved for Athena voice surfaces (the OpenAI Live Console). An opaque callback handle for a live voice conversation that delegated this submission: the run gains a send_voice_update tool that streams interim updates back to that conversation. Requires wait=true. Leave unset for ordinary submissions.
- `wait` (boolean, optional, default: false) — When false (default), the submission is queued and the endpoint returns 202 immediately. When true, the request long-polls: the connection is held open while the agent runs (typically seconds to a few minutes) and the final reply is returned in the response.

## Response

### 200

Agent run completed inline (wait=true) and the final reply is included

- `status` (string, required) — 'accepted' when the submission was queued (wait=false, HTTP 202); 'completed' when the agent run finished inline (wait=true, HTTP 200).
- `threadKey` (string, required) — The conversation key this submission was routed under — the clientThreadKey from the request, or 'default'.
- `reply` (string, optional, nullable) — The agent's final message, verbatim. Null on 202 responses, and null on completed runs where the agent declined to reply (it invoked its dont_respond tool).
- `sessionId` (string, optional, nullable) — Asset id of the Athena session that handled the submission. Null on 202 responses (the session is resolved asynchronously).

### 202

Submission queued (wait=false); the agent runs in the background

- `status` (string, required) — 'accepted' when the submission was queued (wait=false, HTTP 202); 'completed' when the agent run finished inline (wait=true, HTTP 200).
- `threadKey` (string, required) — The conversation key this submission was routed under — the clientThreadKey from the request, or 'default'.
- `reply` (string, optional, nullable) — The agent's final message, verbatim. Null on 202 responses, and null on completed runs where the agent declined to reply (it invoked its dont_respond tool).
- `sessionId` (string, optional, nullable) — Asset id of the Athena session that handled the submission. Null on 202 responses (the session is resolved asynchronously).

## Errors

### 403 Forbidden Error

Caller is a member of the agent's workspace but the agent is not shared with them

- `detail` (string, required) — Explanation of the denied access.

### 404 Not Found Error

Agent asset not found

- `detail` (string, required) — Not-found message. Identical for nonexistent assets and assets the caller cannot see.

### 409 Conflict Error

The agent has not enabled the Programmatic channel

- `detail` (string, required) — Explanation of the disabled channel.

### 422 Unprocessable Entity Error

Validation Error

- `detail` (list of ValidationError, optional)

### 500 Internal Server Error

Internal Server Error

- `map from string to any`

### 502 Bad Gateway Error

The agent run failed before producing a reply

- `map from string to any`

### 503 Service Unavailable Error

Queueing is temporarily unavailable (wait=false only)

- `map from string to any`

## Types

### ValidationError

- `loc` (list of ValidationErrorLocItems, required)
- `msg` (string, required)
- `type` (string, required)
- `ctx` (ValidationErrorCtx, optional)
- `input` (any, optional)

### ValidationErrorLocItems

- string
- integer

### ValidationErrorCtx

## Examples

### Example 1

**Request**

```json
{
  "message": "Summarize yesterday's pipeline changes.",
  "clientThreadKey": "crm-sync-42",
  "wait": true
}
```

**Response**

```json
{
  "status": "completed",
  "threadKey": "crm-sync-42",
  "reply": "Three pipeline changes landed yesterday: ...",
  "sessionId": "asset_5c4f0b6e-93d1-4b3a-9a94-2f6f4f1f9a10"
}
```

**SDK Code**

```python
import requests

url = "https://api.athenaintel.com/api/v0/collab-agents/asset_id/messages"

payload = {
    "message": "Summarize yesterday's pipeline changes.",
    "clientThreadKey": "crm-sync-42",
    "wait": True
}
headers = {
    "X-API-KEY": "<apiKey>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript
const url = 'https://api.athenaintel.com/api/v0/collab-agents/asset_id/messages';
const options = {
  method: 'POST',
  headers: {'X-API-KEY': '<apiKey>', 'Content-Type': 'application/json'},
  body: '{"message":"Summarize yesterday\'s pipeline changes.","clientThreadKey":"crm-sync-42","wait":true}'
};

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

```go
package main

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

func main() {

	url := "https://api.athenaintel.com/api/v0/collab-agents/asset_id/messages"

	payload := strings.NewReader("{\n  \"message\": \"Summarize yesterday's pipeline changes.\",\n  \"clientThreadKey\": \"crm-sync-42\",\n  \"wait\": true\n}")

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

	req.Header.Add("X-API-KEY", "<apiKey>")
	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
require 'uri'
require 'net/http'

url = URI("https://api.athenaintel.com/api/v0/collab-agents/asset_id/messages")

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

request = Net::HTTP::Post.new(url)
request["X-API-KEY"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"message\": \"Summarize yesterday's pipeline changes.\",\n  \"clientThreadKey\": \"crm-sync-42\",\n  \"wait\": true\n}"

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

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

HttpResponse<String> response = Unirest.post("https://api.athenaintel.com/api/v0/collab-agents/asset_id/messages")
  .header("X-API-KEY", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"message\": \"Summarize yesterday's pipeline changes.\",\n  \"clientThreadKey\": \"crm-sync-42\",\n  \"wait\": true\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.athenaintel.com/api/v0/collab-agents/asset_id/messages', [
  'body' => '{
  "message": "Summarize yesterday\'s pipeline changes.",
  "clientThreadKey": "crm-sync-42",
  "wait": true
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'X-API-KEY' => '<apiKey>',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://api.athenaintel.com/api/v0/collab-agents/asset_id/messages");
var request = new RestRequest(Method.POST);
request.AddHeader("X-API-KEY", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"message\": \"Summarize yesterday's pipeline changes.\",\n  \"clientThreadKey\": \"crm-sync-42\",\n  \"wait\": true\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "X-API-KEY": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "message": "Summarize yesterday's pipeline changes.",
  "clientThreadKey": "crm-sync-42",
  "wait": true
] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.athenaintel.com/api/v0/collab-agents/asset_id/messages")! 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()
```

### Example 2

**Request**

```json
{
  "message": "Summarize yesterday's pipeline changes.",
  "clientThreadKey": "crm-sync-42",
  "wait": true
}
```

**Response**

```json
{
  "status": "completed",
  "threadKey": "crm-sync-42",
  "reply": "Three pipeline changes landed yesterday: ...",
  "sessionId": "asset_5c4f0b6e-93d1-4b3a-9a94-2f6f4f1f9a10"
}
```

**SDK Code**

```python
import requests

url = "https://api.athenaintel.com/api/v0/collab-agents/asset_id/messages"

payload = {
    "message": "Summarize yesterday's pipeline changes.",
    "clientThreadKey": "crm-sync-42",
    "wait": True
}
headers = {
    "X-API-KEY": "<apiKey>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript
const url = 'https://api.athenaintel.com/api/v0/collab-agents/asset_id/messages';
const options = {
  method: 'POST',
  headers: {'X-API-KEY': '<apiKey>', 'Content-Type': 'application/json'},
  body: '{"message":"Summarize yesterday\'s pipeline changes.","clientThreadKey":"crm-sync-42","wait":true}'
};

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

```go
package main

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

func main() {

	url := "https://api.athenaintel.com/api/v0/collab-agents/asset_id/messages"

	payload := strings.NewReader("{\n  \"message\": \"Summarize yesterday's pipeline changes.\",\n  \"clientThreadKey\": \"crm-sync-42\",\n  \"wait\": true\n}")

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

	req.Header.Add("X-API-KEY", "<apiKey>")
	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
require 'uri'
require 'net/http'

url = URI("https://api.athenaintel.com/api/v0/collab-agents/asset_id/messages")

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

request = Net::HTTP::Post.new(url)
request["X-API-KEY"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"message\": \"Summarize yesterday's pipeline changes.\",\n  \"clientThreadKey\": \"crm-sync-42\",\n  \"wait\": true\n}"

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

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

HttpResponse<String> response = Unirest.post("https://api.athenaintel.com/api/v0/collab-agents/asset_id/messages")
  .header("X-API-KEY", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"message\": \"Summarize yesterday's pipeline changes.\",\n  \"clientThreadKey\": \"crm-sync-42\",\n  \"wait\": true\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.athenaintel.com/api/v0/collab-agents/asset_id/messages', [
  'body' => '{
  "message": "Summarize yesterday\'s pipeline changes.",
  "clientThreadKey": "crm-sync-42",
  "wait": true
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'X-API-KEY' => '<apiKey>',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://api.athenaintel.com/api/v0/collab-agents/asset_id/messages");
var request = new RestRequest(Method.POST);
request.AddHeader("X-API-KEY", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"message\": \"Summarize yesterday's pipeline changes.\",\n  \"clientThreadKey\": \"crm-sync-42\",\n  \"wait\": true\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "X-API-KEY": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "message": "Summarize yesterday's pipeline changes.",
  "clientThreadKey": "crm-sync-42",
  "wait": true
] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.athenaintel.com/api/v0/collab-agents/asset_id/messages")! 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()
```