# Send to Shared Thread

Posts a message to the live-shared conversation behind a share link, as the recipient who joined via this slug — the slug-scoped twin of [Create a Response](/api-reference/responses/create-response) for a participant who is **not** the owner (and may be in a different organization). It accepts the **same** request body and returns the **same** response: an [SSE](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events) event stream when `stream` is `true`, otherwise a single JSON response.

Allowed **only** when the link's `access_level` is `live` (a `view` or `fork` slug returns `403`); an unknown or unauthorized link returns `404`. The posted message is attributed to the caller, and the turn runs under the shared thread's organization. Any `thread_id` in the body is ignored — the slug determines the target thread.

## Authentication

Requires **user** authentication. Authenticate with a Bearer token or `x-api-key` header. Native `EventSource` clients that cannot set an `Authorization` header may pass the token via the `token` query param (streaming only).

## Path Parameters

**`slug`** string required

The share-link slug, taken from the share URL.

## Query Parameters

**`token`** string optional

Access token for clients that cannot set an `Authorization` header (native `EventSource`). Ignored when a header credential is present.

## Body Parameters

The body is identical to [Create a Response](/api-reference/responses/create-response). The most common fields:

**`inputs`** array required

The conversation inputs for this turn — a list of message objects (`role`, `content`).

**`stream`** boolean optional

When `true`, returns an SSE event stream; otherwise a single JSON response. Defaults to `false`.

**`thread_id`** string optional

Ignored on this endpoint — the target thread is always the one the slug resolves to.

**`mention_mode`** string optional

Routes the `@`-tags in this message; see [Create a Response](/api-reference/responses/create-response) for the accepted IDs. Whether the assistant answers is decided by the **slug's** thread, not by the `thread_id` in the body, and that thread already exists — so this field never changes the thread's assistant participation here. A thread created in `conversation` mode stays a group chat: an untagged message posts without an assistant turn, and tagging an assistant pulls it in for that turn.

## Returns

When `stream` is `false`, a single JSON response describing the assistant's reply (same shape as [Create a Response](/api-reference/responses/create-response)). When `stream` is `true`, a `text/event-stream` response carrying the same SSE event sequence as the owner send.

## Code Examples

### cURL


```bash
curl -X POST "https://api.aitronos.com/v1/shared-threads/abc123slug/response" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "inputs": [{"role": "user", "content": "Let'\''s add a rollback step."}],
    "stream": false
  }'
```

### Python SDK


```python
from aitronos import Aitronos

client = Aitronos(api_key="", token="YOUR_TOKEN")
result = client.threads.shared.respond(
    slug="abc123slug",
    inputs=[{"role": "user", "content": "Let's add a rollback step."}],
    stream=False,
)
print(result)
```

### Python (requests)


```python
import requests

response = requests.post(
    "https://api.aitronos.com/v1/shared-threads/abc123slug/response",
    headers={"Authorization": "Bearer YOUR_TOKEN"},
    json={
        "inputs": [{"role": "user", "content": "Let's add a rollback step."}],
        "stream": False,
    },
)
print(response.json())
```

### JavaScript


```javascript
const response = await fetch(
  "https://api.aitronos.com/v1/shared-threads/abc123slug/response",
  {
    method: "POST",
    headers: {
      Authorization: "Bearer YOUR_TOKEN",
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      inputs: [{ role: "user", content: "Let's add a rollback step." }],
      stream: false,
    }),
  },
);
console.log(await response.json());
```

## Response Examples

### Success (200) — non-streaming


```json
{
  "success": true,
  "thread_id": "thread_5f8c2a1b9d4e4c3f8a7b6c5d4e3f2a1b",
  "response": [{"type": "text", "text": "Added a rollback step before the deploy."}],
  "response_id": "resp_8a7b6c5d",
  "stop_reason": "end_turn"
}
```

### Error — Link does not grant live access (403)


```json
{
  "success": false,
  "error": {
    "code": "INSUFFICIENT_PERMISSIONS",
    "message": "This share link does not grant live co-working access",
    "system_message": "Insufficient permissions",
    "type": "authorization_error",
    "status": 403,
    "details": {
      "link_id": "slink_2b1c3d4e5f6a7b8c9d0e1f2a3b4c5d6e",
      "access_level": "view"
    },
    "trace_id": "...",
    "timestamp": "..."
  }
}
```

### Error — Link not found or not authorized (404)


```json
{
  "success": false,
  "error": {
    "code": "RESOURCE_NOT_FOUND",
    "message": "That share link could not be found.",
    "system_message": "Share link unresolved for user",
    "type": "client_error",
    "status": 404,
    "details": {},
    "trace_id": "...",
    "timestamp": "..."
  }
}
```

## Related Resources

- [Join Shared Thread](/api-reference/shared-threads/join-shared-thread) — Join a live-shared thread first
- [Live Shared Thread](/api-reference/shared-threads/live-shared-thread) — Subscribe to the co-working event stream
- [Reconnect to Shared Thread Stream](/api-reference/shared-threads/reconnect-shared-thread-stream) — Resume an in-flight response
- [Cancel Shared Thread Response](/api-reference/shared-threads/cancel-shared-thread-response) — Cancel your in-flight response