Knowledge CenterAPI References

Task Relations

A Task Relation (taskTarget) links a Task to a Person, Company, or Opportunity. First create the task at /rest/tasks, then link it here. Note: the list endpoint does not support filter — use depth=1 on the parent record to find tasks for a specific person or company.

Source:apiDocs/task-relation.md
MethodPathDescription
POST/rest/taskTargetsCreate a task relation
GET/rest/taskTargets/{id}Get a task relation by ID
GET/rest/taskTargetsList task relations
PATCH/rest/taskTargets/{id}Update a task relation
DELETE/rest/taskTargets/{id}Delete a task relation
POST/rest/taskTargets

Link a task to a person, company, or opportunity. Provide taskId plus at least one target ID. Create separate relations to link to multiple records.

Body

taskIdrequiredUUID

The task to link

personIdUUID

Person to link the task to

companyIdUUID

Company to link the task to

opportunityIdUUID

Opportunity to link the task to

Requestcurl
# Link a task to a person
curl -X POST "https://app.usedalil.ai/rest/taskTargets" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "taskId": "task-uuid-here",
    "personId": "person-uuid-here"
  }'

# Link the same task to an opportunity (separate relation)
curl -X POST "https://app.usedalil.ai/rest/taskTargets" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "taskId": "task-uuid-here",
    "opportunityId": "opportunity-uuid-here"
  }'
GET/rest/taskTargets/{id}

Get a single task relation. Default depth is 1 — includes the linked task and target record automatically.

Parameters

idrequiredUUID

Task relation ID

depthnumber

Default is 1 — includes linked task and target

Requestcurl
curl -G "https://app.usedalil.ai/rest/taskTargets/uuid-here" \
  -H "Authorization: Bearer YOUR_API_KEY"
GET/rest/taskTargets

List task relations. Supports order_by and pagination but NOT filter. To find tasks for a specific person/company, use depth=1 on the parent record instead.

💡 filter is not supported on this endpoint. To get tasks for a specific person, fetch GET /rest/people/{id}?depth=1 instead.

Parameters

limitnumber

Records per page (default 60)

starting_afterUUID

Pagination cursor

order_bystring

Sort field and direction

depthnumber

Default is 1

Requestcurl
# List all task relations sorted by date
curl -G "https://app.usedalil.ai/rest/taskTargets" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  --data-urlencode "order_by=createdAt[DescNullsLast]" \
  --data-urlencode "limit=20"

# Get tasks for a person (use depth=1 on the person instead)
curl -G "https://app.usedalil.ai/rest/people/person-uuid" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  --data-urlencode "depth=1"
PATCH/rest/taskTargets/{id}

Change which task or target record a relation points to.

Parameters

idrequiredUUID

Task relation ID

Requestcurl
curl -X PATCH "https://app.usedalil.ai/rest/taskTargets/relation-uuid" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "personId": "different-person-uuid" }'
DELETE/rest/taskTargets/{id}

Remove the link between a task and a target record. The task itself is not deleted.

Parameters

idrequiredUUID

Task relation ID

Requestcurl
curl -X DELETE "https://app.usedalil.ai/rest/taskTargets/relation-uuid" \
  -H "Authorization: Bearer YOUR_API_KEY"

Key Difference from Note Relations

The task relation list endpoint does not support filter. You cannot query "all task relations for person X" directly. Use GET /rest/people/{id}?depth=1 on the parent record to retrieve linked tasks.