Rest API
Create a task
const url = 'https://api.unless.com/api/v1/tasks';const options = { method: 'POST', headers: { 'x-api-key': 'example', 'x-user-email': 'example', 'x-account-id': 'example', 'x-website-id': 'example', 'Content-Type': 'application/json' }, body: '{"name":"example","description":"example","type":"knowledge-suggestion","source":"team-assistant","data":{}}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.unless.com/api/v1/tasks \ --header 'Content-Type: application/json' \ --header 'x-account-id: example' \ --header 'x-api-key: example' \ --header 'x-user-email: example' \ --header 'x-website-id: example' \ --data '{ "name": "example", "description": "example", "type": "knowledge-suggestion", "source": "team-assistant", "data": {} }'Create a new task for the account team. The task appears in the dashboard Tasks page in the open state.
Use cases
- Knowledge suggestions: Record a suggestion to add or improve knowledge content
- Follow-ups: Log something a human needs to review or act on after an automated investigation
Notes
name,description,typeandsourceare required- Use the
datafield for structured context the assignee needs
Parameters
Section titled “Parameters”Header Parameters
Section titled “Header Parameters”Your API key from account settings.
The email address of your user.
The ID of your account. You can find this in the account settings.
The ID of the workspace you want to use.
Request Bodyrequired
Section titled “Request Bodyrequired”object
Short title of the task.
Longer explanation of what the task is about.
The kind of work this task represents.
Where the task originated.
Optional structured payload attached to the task.
object
Responses
Section titled “Responses”The created task.
object
object
The account ID that owns this task.
Unique identifier for this task.
Short title of the task.
Longer explanation of what the task is about.
The kind of work this task represents.
Where the task originated.
Current state of the task.
Arbitrary structured payload attached to the task, depends on the task type.
object
Email address of the user the task is assigned to.
The website this task belongs to.
Unix timestamp (ms) when the task was created.
Unix timestamp (ms) when the task was last updated.
Example
{ "task": { "type": "knowledge-suggestion", "source": "team-assistant", "state": "open" }}Bad request - missing required fields.
Unauthorized - invalid API key.