Tasks
Create a task
Create an organization or event task. Send an Idempotency-Key header.
Method
POST
Path
/v1/tasks
Required scope
tasks:writeRequest
curl -X POST "https://api.endurancehq.app/v1/tasks" \
-H "Authorization: Bearer $EHQ_API_KEY" \
-H "Idempotency-Key: $(uuidgen)"JSON body schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"workSessionUrl": {
"description": "Originating work session: an HTTPS app link or machine-qualified T3 thread link. Saved with task attachments; never starts work. Keep the handoff brief in description.",
"type": "string",
"maxLength": 2048,
"format": "uri"
},
"organizationId": {
"anyOf": [
{
"type": "string",
"minLength": 1
},
{
"type": "null"
}
]
},
"eventId": {
"anyOf": [
{
"type": "string",
"minLength": 1
},
{
"type": "null"
}
]
},
"projectId": {
"anyOf": [
{
"type": "string",
"minLength": 1
},
{
"type": "null"
}
]
},
"title": {
"type": "string",
"minLength": 1,
"maxLength": 200
},
"description": {
"anyOf": [
{
"type": "string",
"maxLength": 2000
},
{
"type": "null"
}
]
},
"status": {
"default": "not_started",
"type": "string",
"enum": [
"not_started",
"in_progress",
"blocked",
"completed"
],
"description": "not_started, in_progress, blocked (open work stuck until something outside it changes; still open) or completed. Cancelled tasks read as completed."
},
"priority": {
"default": "medium",
"type": "string",
"enum": [
"low",
"medium",
"high"
]
},
"category": {
"default": "general",
"type": "string",
"minLength": 1,
"maxLength": 40,
"pattern": "^[a-z0-9_]+$"
},
"phase": {
"default": "planning",
"type": "string",
"enum": [
"planning",
"setup",
"live",
"teardown",
"closeout"
]
},
"dueDate": {
"anyOf": [
{
"type": "string",
"format": "date-time",
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
},
{
"type": "null"
}
]
},
"parkedAt": {
"anyOf": [
{
"type": "string",
"format": "date-time",
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
},
{
"type": "null"
}
]
},
"waitingExternalAt": {
"anyOf": [
{
"type": "string",
"format": "date-time",
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
},
{
"type": "null"
}
]
},
"tags": {
"maxItems": 20,
"type": "array",
"items": {
"type": "string",
"minLength": 1,
"maxLength": 40
}
},
"assigneeId": {
"type": [
"string",
"null"
]
},
"assigneeName": {
"anyOf": [
{
"type": "string",
"maxLength": 200
},
{
"type": "null"
}
],
"description": "A name with no account, with assigneeId null. On an event task \"All hands\" (or \"Everyone\") gives it to everyone on the event's team: it shows in each teammate's own list, completes once for everyone, and notifies no one."
},
"contact": {
"type": "object",
"properties": {
"name": {
"anyOf": [
{
"type": "string",
"maxLength": 200
},
{
"type": "null"
}
]
},
"organization": {
"anyOf": [
{
"type": "string",
"maxLength": 200
},
{
"type": "null"
}
]
},
"phone": {
"anyOf": [
{
"type": "string",
"maxLength": 50
},
{
"type": "null"
}
]
},
"email": {
"anyOf": [
{
"type": "string",
"maxLength": 320
},
{
"type": "null"
}
]
}
},
"additionalProperties": false,
"description": "The vendor, supplier or office to call about this task. Send null instead of an object to remove the contact."
}
},
"required": [
"title",
"status",
"priority",
"category",
"phase"
],
"additionalProperties": false
}Response
Success status: 201
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"data": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"reference": {
"type": "string",
"pattern": "^[A-Z][A-Z0-9]{0,7}-[1-9]\\d*$"
},
"organizationId": {
"type": [
"string",
"null"
]
},
"eventId": {
"type": [
"string",
"null"
]
},
"eventTitle": {
"type": [
"string",
"null"
]
},
"projectId": {
"type": [
"string",
"null"
]
},
"projectName": {
"type": [
"string",
"null"
]
},
"title": {
"type": "string"
},
"description": {
"type": [
"string",
"null"
]
},
"status": {
"type": "string",
"enum": [
"not_started",
"in_progress",
"blocked",
"completed"
],
"description": "not_started, in_progress, blocked (open work stuck until something outside it changes; still open) or completed. Cancelled tasks read as completed."
},
"priority": {
"type": "string",
"enum": [
"low",
"medium",
"high"
]
},
"category": {
"type": "string"
},
"phase": {
"type": "string",
"enum": [
"planning",
"setup",
"live",
"teardown",
"closeout"
]
},
"parkedAt": {
"anyOf": [
{
"type": "string",
"format": "date-time",
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
},
{
"type": "null"
}
]
},
"waitingExternalAt": {
"anyOf": [
{
"type": "string",
"format": "date-time",
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
},
{
"type": "null"
}
]
},
"dueDate": {
"anyOf": [
{
"type": "string",
"format": "date-time",
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
},
{
"type": "null"
}
]
},
"tags": {
"type": "array",
"items": {
"type": "string"
}
},
"assigneeId": {
"type": [
"string",
"null"
]
},
"assigneeName": {
"type": [
"string",
"null"
]
},
"assignees": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": [
"string",
"null"
]
},
"name": {
"type": "string"
},
"team": {
"description": "The team this person is on the task as part of, or null for someone assigned alone.",
"type": [
"string",
"null"
]
},
"doneAt": {
"anyOf": [
{
"type": "string",
"format": "date-time",
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
},
{
"type": "null"
}
],
"description": "When this team member's own part was done, or null while it is open."
},
"allHands": {
"type": "boolean",
"description": "True on the one assignee of an All hands task (name \"All hands\"): the task is given to everyone on its event's team."
}
},
"required": [
"id",
"name",
"team",
"doneAt",
"allHands"
],
"additionalProperties": false
},
"description": "Everyone on the task. assigneeId/assigneeName repeat the first."
},
"teams": {
"type": "array",
"items": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"done": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
"total": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
}
},
"required": [
"name",
"done",
"total"
],
"additionalProperties": false
},
"description": "Teams that split the task, with each one's parts done; the task completes when every part is done."
},
"contact": {
"anyOf": [
{
"type": "object",
"properties": {
"name": {
"description": "The person to reach.",
"type": [
"string",
"null"
]
},
"organization": {
"description": "The vendor or organization, for example Sunbelt Rentals.",
"type": [
"string",
"null"
]
},
"phone": {
"description": "E.164 (+19165550142) when saved through the API or dashboard; older tasks may keep the text they were given.",
"type": [
"string",
"null"
]
},
"email": {
"type": [
"string",
"null"
]
}
},
"required": [
"name",
"organization",
"phone",
"email"
],
"additionalProperties": false
},
{
"type": "null"
}
],
"description": "Who to call about the task (a vendor or office), or null when it has none."
},
"activity": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"text": {
"type": "string"
},
"type": {
"type": "string"
},
"createdAt": {
"type": "string",
"format": "date-time",
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
},
"editedAt": {
"anyOf": [
{
"type": "string",
"format": "date-time",
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
},
{
"type": "null"
}
]
},
"authorName": {
"type": [
"string",
"null"
]
}
},
"required": [
"id",
"text",
"type",
"createdAt",
"editedAt",
"authorName"
],
"additionalProperties": false
}
},
"attachments": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"name": {
"type": "string"
},
"url": {
"type": "string",
"format": "uri"
},
"size": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
"type": {
"type": "string"
},
"uploadedAt": {
"type": "string",
"format": "date-time",
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
},
"uploadedByName": {
"type": "string"
}
},
"required": [
"id",
"name",
"url",
"size",
"type",
"uploadedAt",
"uploadedByName"
],
"additionalProperties": false
}
},
"createdById": {
"description": "The account that added the task; null when an automation added it (the inbox, an import).",
"type": [
"string",
"null"
]
},
"createdByName": {
"description": "Who added the task, as the dashboard shows it: a person's name, or what added it (\"the inbox\"); null when no name is known.",
"type": [
"string",
"null"
]
},
"createdAt": {
"type": "string",
"format": "date-time",
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
},
"updatedAt": {
"type": "string",
"format": "date-time",
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
}
},
"required": [
"id",
"reference",
"organizationId",
"eventId",
"eventTitle",
"projectId",
"projectName",
"title",
"description",
"status",
"priority",
"category",
"phase",
"parkedAt",
"waitingExternalAt",
"dueDate",
"tags",
"assigneeId",
"assigneeName",
"assignees",
"teams",
"contact",
"activity",
"attachments",
"createdById",
"createdByName",
"createdAt",
"updatedAt"
],
"additionalProperties": false
}
},
"required": [
"data"
],
"additionalProperties": false
}Other surfaces
CLI: ehq tasks create --organization <org_id> --title <title>
MCP tool: ehq_tasks_create