Agents
Our Agents API allows you to integrate your parcelLab agent in your customer service tools, applications or message interfaces.
Agent Integration Guide
This section describes the basics of using the Agents API to integrate your parcelLab agent into your application or chat interfaces.
Requirements
Before you start, ensure the following prerequisites are met:
OpenAI opt-in enabled for your parcelLab account
parcelLab API access
Credentials required: parcelLab account ID and API token with
readandwritescopes
An agent configured for your account. The agent ID for your parcelLab agent is required for using the API and will be provided after the agent is configured for your account.
Using the Agents API
Agents API Reference
These requests allow you to start message threads with your pre-configured agent and submit messages to existing threads.
Start Asynchronous Agent Execution
You can start a thread with the agent using the v4/agents/{agent_id}/execute endpoint.
Starts agent execution asynchronously and returns a thread reference immediately. Use the thread reference to poll for results.
Send Authorization: Parcellab-API-Token <encoded-token>.
<encoded-token> = base64(account_id:token) as provided in the portal.
External ID of this agent, used on the simple agent thread API
Payload for starting async agent execution.
Execution account ID. Required for installable agents.
The user's input query
Optional context data for the agent
Response for async agent execution.
External reference ID of the thread
External ID of the agent currently responsible for the thread
Current execution status
POST /v4/agents/{agent_id}/execute/ HTTP/1.1
Host: api.parcellab.com
Authorization: Parcellab-API-Token YOUR_BASE64_ENCODED_API_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 44
{
"account_id": 1,
"query": "text",
"context": {}
}{
"threadId": "text",
"currentAgent": "123e4567-e89b-12d3-a456-426614174000",
"executionStatus": "text"
}Get Thread Status and Messages
You can retrieve the current status and messages of an agent thread using the v4/agents/{agent_id}/threads/{thread_ref} endpoint.
Retrieve the current status and messages of an agent thread.
Send Authorization: Parcellab-API-Token <encoded-token>.
<encoded-token> = base64(account_id:token) as provided in the portal.
External ID of this agent, used on the simple agent thread API
External reference ID of the thread
Execution account ID. Required for installable agents.
Public-facing thread details with limited message info.
private- Privateaccount_read- Account readaccount_write- Account write
External ID of this agent, used on the simple agent thread API
External ID of this agent, used on the simple agent thread API
idle- Idlerunning- Runningcompleted- Completedfailed- Failed
Lowercased Django model name of the linked object (e.g. 'layout', 'tracking'). Pair with object_id.
GET /v4/agents/{agent_id}/threads/{thread_ref}/ HTTP/1.1
Host: api.parcellab.com
Authorization: Parcellab-API-Token YOUR_BASE64_ENCODED_API_TOKEN
Accept: */*
{
"id": 1,
"title": "text",
"visibility": "private",
"externalReferenceId": "text",
"account": 1,
"agent": "123e4567-e89b-12d3-a456-426614174000",
"currentAgent": "123e4567-e89b-12d3-a456-426614174000",
"user": 1,
"executionStatus": "idle",
"taxonomyClassification": {
"id": 1,
"account": 1,
"thread": 1,
"threadExternalReferenceId": "text",
"taxonomyAgent": 1,
"taxonomyAgentKey": "text",
"category": 1,
"categoryCode": "text",
"categoryName": "text",
"classifierThread": null,
"classifierThreadExternalReferenceId": null,
"confidence": null,
"rationale": "text",
"rawResult": {},
"createdAt": "2026-01-01T00:00:00.000Z",
"updatedAt": "2026-01-01T00:00:00.000Z"
},
"contentType": null,
"objectId": "text",
"createdAt": "2026-01-01T00:00:00.000Z",
"updatedAt": "2026-01-01T00:00:00.000Z",
"messages": [
{
"created_at": "2026-01-01T00:00:00.000Z",
"input_message_id": "text",
"id": "text",
"type": "input_message",
"kind": "user",
"target_agent_id": 1,
"reasoning_effort": "off",
"context": {
"ANY_ADDITIONAL_PROPERTY": "anything"
},
"query": "text",
"attachments": [
{
"id": 1,
"name": "text",
"content_type": "text",
"byte_size": 1
}
]
}
],
"progressText": "text",
"progressReasoning": "text",
"stream": {
"enabled": true,
"interactive": true,
"status": "unavailable",
"expectedInputId": "text",
"websocketUrl": "text",
"endpointToken": "text",
"workspaceFileUrl": "text",
"expiresAt": "text"
}
}Submit Message to Existing Thread
You can submit messages to existing threads using the v4/agents/{agent_id}/threads/{thread_ref}/messages endpoint.
Async add a new message to an existing thread.
Send Authorization: Parcellab-API-Token <encoded-token>.
<encoded-token> = base64(account_id:token) as provided in the portal.
External ID of this agent, used on the simple agent thread API
External reference ID of the thread
Payload for starting async agent execution.
Execution account ID. Required for installable agents.
The user's input query
Optional context data for the agent
Response for async agent execution.
External reference ID of the thread
External ID of the agent currently responsible for the thread
Current execution status
POST /v4/agents/{agent_id}/threads/{thread_ref}/messages/ HTTP/1.1
Host: api.parcellab.com
Authorization: Parcellab-API-Token YOUR_BASE64_ENCODED_API_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 44
{
"account_id": 1,
"query": "text",
"context": {}
}{
"threadId": "text",
"currentAgent": "123e4567-e89b-12d3-a456-426614174000",
"executionStatus": "text"
}Last updated
Was this helpful?