Adds tags to emails chosen by id, or to every email matching a search. By id, the tags are added right away; by search, a background job is queued and its id returned (see bulk-tag-jobs).
POST
/local-emails/{caseId}/emails/tags
curl \
--request POST 'http://api.example.com/local-emails/{caseId}/emails/tags' \
--header "Authorization: Bearer $ACCESS_TOKEN" \
--header "Content-Type: application/json" \
--data '{
"addMode": "by_id",
"tags": [
"string"
],
"ids": [
"string"
],
"search": {
"page": 1,
"perPage": 10,
"skip": 42.0,
"limit": 42.0,
"sortOrder": "asc",
"searchText": "(discriminate OR racist) AND (\"Larry Graham\" OR Robinson)",
"folders": [
"string"
],
"domains": [
"string"
],
"excludeDomains": [
"string"
],
"tags": [
"string"
],
"excludeTags": [
"string"
],
"untagged": true,
"participants": [
"string"
],
"excludeEmails": [
"string"
],
"startDate": "2024-01-01T00:00:00.000Z",
"endDate": "2024-12-31T23:59:59.999Z",
"sourceEmails": [
"string"
],
"sortBy": "date"
}
}'
Request examples
{
"addMode": "by_id",
"tags": [
"string"
],
"ids": [
"string"
],
"search": {
"page": 1,
"perPage": 10,
"skip": 42.0,
"limit": 42.0,
"sortOrder": "asc",
"searchText": "(discriminate OR racist) AND (\"Larry Graham\" OR Robinson)",
"folders": [
"string"
],
"domains": [
"string"
],
"excludeDomains": [
"string"
],
"tags": [
"string"
],
"excludeTags": [
"string"
],
"untagged": true,
"participants": [
"string"
],
"excludeEmails": [
"string"
],
"startDate": "2024-01-01T00:00:00.000Z",
"endDate": "2024-12-31T23:59:59.999Z",
"sourceEmails": [
"string"
],
"sortBy": "date"
}
}
Response examples (200)
{
"data": {
"mode": "by_id",
"status": "completed",
"requested": 2,
"matchedDocuments": 2,
"skippedDocuments": 0,
"resolvedTagIds": [
"65a1b2c3d4e5f6a7b8c9d0a1"
],
"attachmentsCreated": 2,
"emailsMatched": 0,
"emailAttachmentsCreated": 0,
"jobId": "65a1b2c3d4e5f6a7b8c9d0f2"
},
"statusCode": 200,
"timestamp": "2026-01-15T10:15:00.000Z"
}