Skip to main content

Tasks

What the team owes a person: a call, an email, a meeting or a to-do, with a due date, pointing at the contact, company or deal it is for. A task may point at nothing — a plain to-do is still a task — which is the one way it differs from an activity.

Scopes and the site rule are shared with every CRM resource — see companies.

The task object

{
"id": "t_5e0d",
"object": "task",
"title": "Call back about the proposal",
"notes": null,
"kind": "call",
"priority": "high",
"status": "open",
"dueAt": "2026-09-10T15:00:00.000Z",
"completedAt": null,
"assigneeUid": "u_9f1c",
"contactId": "k7d2b9f104",
"companyId": null,
"dealId": "d_3c9a",
"siteId": "site_a1b2c3",
"created": "2026-09-05T18:23:23.941Z",
"updated": "2026-09-05T18:23:23.941Z"
}
FieldTypeNotes
idstringOpaque task id.
objectstringAlways "task".
titlestringRequired. Trimmed, truncated to 200 characters. Writable.
notesstring | nullFree text, 5,000 characters. Writable.
kindstringcall, email, meeting or todo. todo when never set. Writable.
prioritystringlow, normal or high. normal when never set. Writable.
statusstringopen or done. open when never set. Writable — marking a task done stamps completedAt; marking it open again clears it, so a reopened task never reads as completed on the day it was first closed.
dueAtstring | nullISO 8601 instant. Writable.
completedAtstring | nullWhen the task was marked done. Read-only.
assigneeUidstring | nullWho owes it. Must be a member of your organization. Writable.
contactId, companyId, dealIdstring | nullWhat the task is for. Each must exist. All optional. Writable.
siteIdstring | nullThe site the task was created from, or null for an organization task — one filed from the organization's console with no site, owed by the organization itself rather than by any of its sites. Read-only. A task created over the API always names a site.
created / updatedstring | nullISO 8601.

Endpoints

List tasks

GET /v1/tasks — scope crm:read. Paginated, ordered by task id unless updatedAfter is given.

ParamNotes
dealId, contactId, companyIdTasks for that record.
assigneeUidTasks owed by this member.
statusopen or done. Anything else is a 400.
updatedAfterTasks updated after this instant, oldest first — the sync filter.
limit, cursorStandard pagination.
# one person's open work
curl "https://app.aglyn.com/api/v1/tasks?assigneeUid=u_9f1c&status=open" \
-H "Authorization: Bearer aglyn_sk_…"

One filter narrows the query — in the order listed, so dealId before status — and the rest are checked on the page, which can come back short.

Retrieve a task

GET /v1/tasks/{taskId} — scope crm:read. Returns a task, or 404 not_found ("No such task").

Add a task

POST /v1/tasks — scope crm:write. Accepts an Idempotency-Key, scoped to the organization. title and consentSiteId are required.

curl -X POST "https://app.aglyn.com/api/v1/tasks" \
-H "Authorization: Bearer aglyn_sk_…" \
-H "Idempotency-Key: 9a41f0c2-…" \
-H "Content-Type: application/json" \
-d '{"title":"Call back about the proposal","kind":"call","dueAt":"2026-09-10T15:00:00Z","assigneeUid":"u_9f1c","dealId":"d_3c9a","consentSiteId":"site_a1b2c3"}'

Returns 201, or 200 with the original when an Idempotency-Key replays. A task created with status: "done" is completed the instant it is created.

Update a task

PATCH /v1/tasks/{taskId} — scope crm:write. No Idempotency-Key. An omitted key is left alone, null clears an optional field, {} is a no-op.

curl -X PATCH "https://app.aglyn.com/api/v1/tasks/t_5e0d" \
-H "Authorization: Bearer aglyn_sk_…" \
-H "Content-Type: application/json" \
-d '{"status":"done"}'

Delete a task

DELETE /v1/tasks/{taskId} — scope crm:write. Accepts an Idempotency-Key, scoped to the organization.

{ "id": "t_5e0d", "object": "task", "deleted": true }

Errors

StatustypeWhen
400bad_requestcode: "validation_failed" — a missing title or consentSiteId, a kind, priority or status outside its list, a dueAt that is not an ISO 8601 instant, an assigneeUid who is not a member, or a contactId, companyId or dealId that does not exist. On the list, a ?status= outside open/done or a malformed ?updatedAfter=. fields names each key.
403insufficient_scopeKey lacks crm:read / crm:write.
404not_found"No such task".
405method_not_allowedAllow: GET, POST on /v1/tasks, GET, PATCH, DELETE on one task.
409conflictcode: "idempotency_in_progress".

See Conventions → Errors for the shared envelope.

  • Activities — what happened, as opposed to what is owed.