Misc · Todo · Items
Get todo item
Gets one todo item by organization ID and item ID. You can optionally provide both contextType and contextId to restrict the match. The response includes the item and the current caller’s assignment index; actor details may be masked based on permissions.
Permissions
Send an API key of the organization in the path, using the X-API-Key header.
Who may call it
- The caller must have organization access with
todoItem.read. - Non-contact actors other than the current actor are masked without
user.read. - API actors are masked without
apiKey.read. A non-current API actor also needsuser.readto remain visible. - The legacy permission
contact.readalso allows contact actor details to be visible. - When
contextTypeandcontextIdare supplied, the item must match both to be returned.
Request
Path parameters
-
organizationIdidrequired -
itemIdidrequired
Query parameters
-
contextTypestringteameventresourceconversation -
contextIdid
curl --fail-with-body --silent --show-error --max-time 30 --globoff \
--request GET 'https://cloud.campai.com/api/YOUR_ORGANIZATION_ID/misc/todo/items/YOUR_ITEM_ID' \
--header 'X-API-Key: YOUR_API_KEY'const response = await fetch("https://cloud.campai.com/api/YOUR_ORGANIZATION_ID/misc/todo/items/YOUR_ITEM_ID", {
method: "GET",
headers: {
"X-API-Key": "YOUR_API_KEY"
},
redirect: 'error',
signal: AbortSignal.timeout(30_000),
});
if (!response.ok) throw new Error(`campai HTTP ${response.status}`);
const text = await response.text();
const result = text ? JSON.parse(text) : null;
console.log(JSON.stringify(result, null, 2));<?php
$context = stream_context_create(['http' => [
'method' => 'GET',
'header' => [
'X-API-Key: YOUR_API_KEY',
],
'timeout' => 30,
'follow_location' => 0,
'ignore_errors' => true,
]]);
$text = @file_get_contents('https://cloud.campai.com/api/YOUR_ORGANIZATION_ID/misc/todo/items/YOUR_ITEM_ID', false, $context);
preg_match('/^HTTP\/\S+ (\d{3})/', $http_response_header[0] ?? '', $match);
$status = (int) ($match[1] ?? 0);
if ($text === false || $status < 200 || $status >= 300) {
throw new RuntimeException("campai HTTP $status (0 means no response)");
}
$result = $text === '' ? null : json_decode($text, true, 512, JSON_THROW_ON_ERROR);
echo json_encode($result, JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR), PHP_EOL;
Response
200 Successful response
Content-Type: application/json
-
_idid -
createdAtstring · date-timenullable -
updatedAtstring · date-timenullable -
removedAtstring · date-timenullable -
createdByobjectnullable -
updatedByobjectnullable -
removedByobjectnullable -
__ignoreTriggersstringnullable -
organizationid -
parentItemidnullable -
childrenCountinteger0–100
-
childrenCompletedCountinteger0–100
-
commentsCountintegerat least 0
-
topicobject4 properties
-
_idid -
namestring1–80 characters
-
identifierstring1–4 characters
-
colorstring22 values
slategrayzincneutralstoneredorangeamberyellowlimegreenemeraldtealcyanskyblueindigovioletpurplefuchsiapinkrose
-
-
typeobject3 properties
-
_idid -
namestring1–80 characters
-
emojistringat most 16 characters
-
-
statusobject4 properties
-
_idid -
labelstring1–80 characters
-
colorstring22 values
slategrayzincneutralstoneredorangeamberyellowlimegreenemeraldtealcyanskyblueindigovioletpurplefuchsiapinkrose -
rolestringregularreviewcompleted
-
-
contextobjectnullableVariant 1: 3 properties
-
typestring -
teamIdidnullable -
namestring1–80 characters
Variant 2: 6 properties
-
typestring -
eventIdidnullable -
namestring1–80 characters
-
seriesIdstringnullableexactly 10 characters
-
fromstring · date-time -
tostring · date-time
Variant 3: 3 properties
-
typestring -
resourceIdidnullable -
namestring1–200 characters
Variant 4: 3 properties
-
typestring -
conversationIdidnullable -
namestring1–200 characters
-
-
projectobjectnullable3 properties
-
_idid -
namestring1–64 characters
-
colorstring22 values
slategrayzincneutralstoneredorangeamberyellowlimegreenemeraldtealcyanskyblueindigovioletpurplefuchsiapinkrose
-
-
sequenceNumberinteger -
titlestring1–140 characters
-
descriptionstring1–10000 characters
-
customFieldsobject of one of 7 types | object of one of 7 types | object (recursive)[] | (one of 7 types)[][]The answers of a form, by the ID of each field. A repeating group holds a list of its entries under its own ID.
-
attachmentsobject[]at most 10 items
5 properties
-
resourcestringat least 1 characters
-
fileNamestringat most 128 characters
-
contentTypestringat most 75 characters
-
fileSizeBytesintegerat least 0
-
idstringexactly 6 characters
-
-
attachmentCountinteger0–10
-
assigneesobject[]at most 100 items
4 properties
-
idstringexactly 10 characters
-
actorobject -
completedAtstring · date-timenullable -
timeSpentMinutesintegernullableat least 0
-
-
tagsstring[]at most 20 items · each 1–40 characters
-
dueDatestring · date-timenullable -
reviewerobjectnullable4 properties
-
namestring -
typestring -
userIdstring -
imageobjectnullable4 properties
-
resourcestringat least 1 characters
-
fileNamestringat most 128 characters
-
contentTypestringat most 75 characters
-
fileSizeBytesintegerat least 0
-
-
-
reviewsobject[]17 properties
-
_idid -
createdAtstring · date-timenullable -
updatedAtstring · date-timenullable -
removedAtstring · date-timenullable -
createdByobjectnullable -
updatedByobjectnullable -
removedByobjectnullable -
__ignoreTriggersstringnullable -
roundinteger -
reviewerobject4 properties
-
namestring -
typestring -
userIdstring -
imageobjectnullable4 properties
-
resourcestringat least 1 characters
-
fileNamestringat most 128 characters
-
contentTypestringat most 75 characters
-
fileSizeBytesintegerat least 0
-
-
-
requestedAtstring · date-time -
requestedByobject -
workCompletedAtstring · date-time -
decisionstringpendingacceptedrejectedwithdrawn -
decidedAtstring · date-timenullable -
decidedByobjectnullable -
notestringat most 4000 characters
-
-
statusBeforeReviewobjectnullable4 properties
-
_idid -
labelstring1–80 characters
-
colorstring22 values
slategrayzincneutralstoneredorangeamberyellowlimegreenemeraldtealcyanskyblueindigovioletpurplefuchsiapinkrose -
rolestringregularreviewcompleted
-
-
workCompletedAtstring · date-timenullable -
completedAtstring · date-timenullable -
statusBeforeCompletionobjectnullable4 properties
-
_idid -
labelstring1–80 characters
-
colorstring22 values
slategrayzincneutralstoneredorangeamberyellowlimegreenemeraldtealcyanskyblueindigovioletpurplefuchsiapinkrose -
rolestringregularreviewcompleted
-
-
currentAssignmentIndexintegerat least -1
More about the fields
assignees[].actor.user.image: For a visible contact’s linked user other than the current actor, the user’s image is null and name is replaced when the caller lacksuser.read.
{
"_id": "000000000000000000000001",
"organization": "000000000000000000000001",
"parentItem": "000000000000000000000001",
"childrenCount": 0,
"childrenCompletedCount": 0,
"commentsCount": 0,
"topic": {
"_id": "000000000000000000000001",
"name": "string",
"identifier": "string",
"color": "slate"
},
"type": {
"_id": "000000000000000000000001",
"name": "string",
"emoji": "string"
},
"status": {
"_id": "000000000000000000000001",
"label": "string",
"color": "slate",
"role": "regular"
},
"context": {
"type": "team",
"teamId": "000000000000000000000001",
"name": "string"
},
"project": {
"_id": "000000000000000000000001",
"name": "string",
"color": "slate"
},
"sequenceNumber": 1,
"title": "string",
"description": "string",
"customFields": {
"key": "2026-10-22T12:00:00Z"
},
"attachments": [
{
"resource": "string",
"id": "string"
}
],
"attachmentCount": 0,
"assignees": [
{
"id": "string",
"actor": {
"name": "string",
"type": "user",
"userId": "string",
"image": {
"resource": "string"
}
},
"completedAt": "2026-06-15T22:30:00Z",
"timeSpentMinutes": 0
}
],
"tags": [
"string"
],
"dueDate": "2026-06-15T22:30:00Z",
"reviewer": {
"name": "string",
"type": "user",
"userId": "string",
"image": {
"resource": "string"
}
},
"reviews": [
{
"_id": "000000000000000000000001",
"round": 1,
"reviewer": {
"name": "string",
"type": "user",
"userId": "string",
"image": {
"resource": "string"
}
},
"requestedAt": "2026-06-15T22:30:00Z",
"requestedBy": {
"name": "string",
"type": "user",
"userId": "string",
"image": {
"resource": "string"
}
},
"workCompletedAt": "2026-06-15T22:30:00Z",
"decision": "pending",
"decidedAt": "2026-06-15T22:30:00Z",
"decidedBy": {
"name": "string",
"type": "user",
"userId": "string",
"image": {
"resource": "string"
}
},
"note": "string"
}
],
"statusBeforeReview": {
"_id": "000000000000000000000001",
"label": "string",
"color": "slate",
"role": "regular"
},
"workCompletedAt": "2026-06-15T22:30:00Z",
"completedAt": "2026-06-15T22:30:00Z",
"statusBeforeCompletion": {
"_id": "000000000000000000000001",
"label": "string",
"color": "slate",
"role": "regular"
},
"currentAssignmentIndex": -1
}
Errors
Other errors
| Status | Error | When |
|---|---|---|
| 404 | Todo not found | If no accessible item matches the request, the endpoint returns HTTP 404 with key libCommon.misc.todo.errors.todoNotFound. |
Errors nearly every request can meet are listed under Errors.