For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Contact SalesGet Support
HomeGuidesAPI reference
HomeGuidesAPI reference
  • Middesk API
        • GETList agent threads
        • POSTCreate an agent thread
        • GETRetrieve an agent thread
LogoLogo
Contact SalesGet Support
Middesk APIAgentsThreads

Create an agent thread

POST
https://api.middesk.com/v1/threads
POST
/v1/threads
$curl -X POST https://api.middesk.com/v1/threads \
> -H "Authorization: Bearer <token>" \
> -H "Content-Type: application/json" \
> -d '{
> "type": "cip_orchestrator"
>}'
1{
2 "object": "thread",
3 "id": "id",
4 "created_at": "2024-01-15T09:30:00Z",
5 "updated_at": "2024-01-15T09:30:00Z",
6 "status": "running",
7 "metadata": {
8 "key": "value"
9 },
10 "requester": {
11 "key": "value"
12 },
13 "steps": [
14 {
15 "id": "id",
16 "run_id": "run_id",
17 "type": "activity",
18 "name": "name",
19 "label": "label",
20 "status": "running",
21 "started_at": "2024-01-15T09:30:00Z",
22 "agent": "agent",
23 "parent_step_id": "parent_step_id",
24 "completed_at": "2024-01-15T09:30:00Z",
25 "artifacts": [
26 {
27 "title": "title",
28 "type": "type"
29 }
30 ]
31 }
32 ]
33}
Creates a new agent thread for running agent workflows
Was this page helpful?
Previous

Retrieve an agent thread

Next
Built with

Authentication

AuthorizationBearer

Bearer authentication of the form Bearer <token>, where token is your auth token.

Request

This endpoint expects an object.
typestringRequired
The agent type to use for this agent thread
business_idstringOptionalformat: "uuid"

Business to use as context for the thread. Shorthand for context_type=business. Required unless context_type and context_id are provided.

context_typestringOptional

The type of context resource (e.g., “business”)

context_idstringOptionalformat: "uuid"

The ID of the context resource. Must be provided with context_type.

Response

agent thread created with context_type and context_id

objectstring
Object type identifier.
idstringformat: "uuid"
Unique identifier for the agent thread.
created_atdatetime
Timestamp when the agent thread was created.
updated_atdatetime
Timestamp when the agent thread was last updated.
statusenum
Current lifecycle status of the agent thread.
Allowed values:
metadatamap from strings to any or null
Internal metadata associated with the agent thread.
requestermap from strings to any or null
Requester context associated with the agent thread.
stepslist of objects
Execution steps emitted by the underlying agent state

Errors

404
Create Agent Thread Request Not Found Error