When to use tasks vs conversations
| If the work is… | Use |
|---|---|
| A customer interaction (call, chat, email) | /conversations |
| Back-office work an agent did in your internal admin tool (no customer on the line) | /tasks |
Upload methods
Rulebase supports two methods for uploading tasks. Pick based on how your source system exports data.- Single task.
POST /taskswith a JSON body. Use this when your system pushes individual tasks in real time. - Bulk CSV upload.
POST /tasks/uploadwith a multipart CSV containing many tasks. Use this for periodic exports.
Method 1: single task
Send a JSON body toPOST /tasks with the task details:
GET /tasks/{id}.
For the full REST spec, see Create a task.
Method 2: bulk CSV upload
Upload a CSV toPOST /tasks/upload as multipart/form-data:
id and a processing status:
GET /tasks/upload/{id} until status becomes completed (or failed). Each row in the CSV is processed as if it were a separate POST /tasks call.
Bulk upload requirements
- Content-Type:
multipart/form-data - File format: CSV with a header row
- Header row required; column order is flexible
Task schema reference
| Field | Required | Type | Description |
|---|---|---|---|
external_id | Yes | string | Unique identifier for this task in your system. Used to deduplicate re-uploads. |
agent | Yes | object | The agent who handled the task. See Agent object below. |
completed_at | Yes | string | ISO 8601 timestamp of when the agent finished the task. Used for time-based reporting. |
custom_attributes | No | object | Free-form key/value pairs for anything else (task type, status, outcome, risk category, etc.). |
custom_attributes rather than the top-level schema. Rulebase stores the full object and exposes it in reports and filters.
Agent object
agent is an object, not a string:
| Field | Required | Description |
|---|---|---|
external_id | One of email or external_id required | Stable identifier from your system (employee/user ID). |
email | One of email or external_id required | Work email of the agent. |
name | No | Display name. Used to label dashboards and reports. |
How agents are matched
When Rulebase receives a task, it looks up the agent against your existing employee records:- Match by
external_idif provided. - Otherwise, match by
email. - If neither matches an existing employee, a new one is created from the fields you sent.
email or external_id is always required.
CSV column reference
CSV uploads use flat columns that map onto the JSON schema:| Column | Required | Maps to |
|---|---|---|
external_id | Yes | external_id |
agent_email | One of agent_email or agent_external_id required | agent.email |
agent_external_id | One of agent_email or agent_external_id required | agent.external_id |
agent_name | No | agent.name |
completed_at | Yes | completed_at |
custom_<key> | No | custom_attributes.<key> |
custom_ is flattened into custom_attributes. For example, a custom_task_type column becomes custom_attributes.task_type.
Example CSV
Retrieving a task
UseGET /tasks/{id} to fetch a task back by its Rulebase ID: