> For the complete documentation index, see [llms.txt](https://docs.dispach.moeenmahmud.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.dispach.moeenmahmud.com/reference/http/dispach-agent-server/start-a-turn-returns-once-accepted-the-turn-runs-detached.md).

# Start a turn. Returns once accepted; the turn runs detached.

```json
{"openapi":"3.1.0","info":{"title":"Dispach agent server","version":"0.1.3"},"servers":[{"url":"http://localhost:7420","description":"Local server. Replace this with the URL of your deployment."}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer","description":"An operator key or the configured token."}}},"paths":{"/v1/agents/{id}/messages":{"post":{"summary":"Start a turn. Returns once accepted; the turn runs detached.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"202":{"description":"accepted"},"401":{"description":"No credential, or one this server does not accept."},"404":{"description":"No such agent, or it is switched off."},"429":{"description":"over limits.maxConcurrentTurns or limits.tokens; nothing recorded"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"text":{"type":"string","minLength":1,"code":"message_text_required","hint":"Send { \"text\": \"...\" }. An empty turn would be billed for a full prompt and produce nothing.","description":"What to say to the agent."},"sessionKey":{"description":"Which conversation this belongs to. Defaults to `api:default`.","type":"string","minLength":1},"deliver":{"anyOf":[{"type":"string","const":"none"},{"type":"object","properties":{"channel":{"type":"string","minLength":1},"to":{"type":"string","minLength":1}},"required":["channel","to"]}],"code":"deliver_invalid","hint":"A bare channel id is not enough on an API turn: the request has no originating conversation, so there is no recipient to infer. Send { \"channel\": \"tg\", \"to\": \"12345\" }, or \"none\" to read the reply from the event stream.","description":"Where the reply goes. \"none\" leaves it on the event stream and in the store."},"from":{"type":"object","properties":{"id":{"type":"string","minLength":1,"code":"sender_invalid","hint":"Send { \"from\": { \"id\": \"agent:ops-bot\", \"kind\": \"agent\" } }, or omit it entirely for a turn the token-holder is sending itself.","description":"Stable identifier for the sender. Appears on the turn row and in events."},"kind":{"type":"string","enum":["user","agent"],"code":"sender_invalid","hint":"This field decides the trust boundary — \"agent\" fences the message and blocks mutating tools for the turn, \"user\" does not — so there is no default and an unknown value is refused rather than guessed at. A turn the token-holder is sending itself omits \"from\".","description":"The trust boundary. \"agent\" fences the text as data and blocks mutating tools for the whole turn."},"name":{"code":"sender_invalid","hint":"A display name, shown beside the sender id. Omit it rather than sending an empty string.","description":"Human-readable name for the sender.","type":"string"}},"required":["id","kind"],"description":"Attribution for a turn somebody other than the token-holder is sending. Omit for your own."},"stream":{"description":"Stream the turn's events inline as SSE rather than returning a handle.","type":"boolean"},"chunks":{"description":"Include per-token `model.chunk` frames. Off by default — the reader decides.","type":"boolean"}},"required":["text"]}}}}}}}}
```
