Create a task
client.task.create(TaskCreateParams { fields, relationships } body, RequestOptionsoptions?): TaskCreateResponse { id, createdAt, fields, 4 more }
POST/v1/tasks
Creates a new task record. The $title and $status fields and the $assignedTo relationship are required.
If $createdBy is omitted it defaults to the authenticated user. The $note relationship is read-only — manage notes via their own relationships.
Supports idempotency via the Idempotency-Key header.
Required scope: tasks:create
Rate limit category: Write
Parameters
Returns
Create a task
import Lightfield from 'lightfield';
const client = new Lightfield({
apiKey: 'My API Key',
});
const taskCreateResponse = await client.task.create({
fields: { $status: '$status', $title: '$title' },
relationships: { foo: 'string' },
});
console.log(taskCreateResponse.id);{
"id": "id",
"createdAt": "createdAt",
"fields": {
"foo": {
"value": "string",
"valueType": "ADDRESS"
}
},
"httpLink": "httpLink",
"relationships": {
"foo": {
"cardinality": "cardinality",
"objectType": "objectType",
"values": [
"string"
]
}
},
"updatedAt": "updatedAt",
"externalId": "externalId"
}Returns Examples
{
"id": "id",
"createdAt": "createdAt",
"fields": {
"foo": {
"value": "string",
"valueType": "ADDRESS"
}
},
"httpLink": "httpLink",
"relationships": {
"foo": {
"cardinality": "cardinality",
"objectType": "objectType",
"values": [
"string"
]
}
},
"updatedAt": "updatedAt",
"externalId": "externalId"
}