Search annotations
Search for annotations matching a complex filter.
<Callout type="info"> Please beware that updates of the annotation search data are done asynchronously and are eventually consistent. Search endpoint may return inconsistent results temporarily (for a few seconds). </Callout> <Callout type="info"> Please note that only objects of category `datapoint` are returned when sideloading for `content` is active. Objects of other categories are ignored. </Callout> <Callout type="info"> Sideloading content for this endpoint is deprecated and will be removed in the near future. </Callout>Search Query
A subset of MongoDB Query Language. Query expressions should be defined as a list under a $and key. The following can be used:
- <meta_field> - Matches against annotation attributes according to the <meta_field> - see options below.
- field.<schema_id>.<type> - Matches against annotation content value according to <schema_id> treating it as a <type>. Possible types: string | number | date (in ISO 8601 format). Max. 256 characters long strings are allowed.
The meta_field can be one of:
| Meta Field | Type |
|---|---|
| annotation | URL |
| arrived_at | date |
| assigned_at | date |
| assignees | URL |
| automated | bool |
| automatically_rejected | bool |
| confirmed_at | date |
| confirmed_by__username | string |
| confirmed_by | URL |
| created_at | date |
| creator__username | string |
| creator | URL |
| deleted_at | date |
| deleted_by__username | string |
| deleted_by | URL |
| document | URL |
| exported_at | date |
| exported_by__username | string |
| exported_by | URL |
| has_email_thread_with_new_replies | bool |
| has_email_thread_with_replies | bool |
| has_note | bool |
| has_suggested_edit | bool |
| labels | URL |
| messages | string |
| modified_at | date |
| modifier__username | string |
| modifier | URL |
| original_file_name | string |
| purged_at | date |
| purged_by__username | string |
| purged_by | URL |
| queue | URL |
| rejected_at | date |
| rejected_by__username | string |
| rejected_by | URL |
| relations__key | string |
| relations__parent | URL |
| relations__type | string |
| restricted_access | bool |
| rir_poll_id | string |
| status | string |
| workspace | URL |
| email_thread | URL |
| email_sender | string |
Search Query Objects
| Key | Type | Description |
|---|---|---|
| $startsWith | string | Matches the start of a value. Must be at least 2 characters long. |
| $anyTokenStartsWith | string | Matches the start of each token within a string. Must be at least 2 characters long. |
| $containsPrefixes | string | Same as $anyTokenStartsWith but query is split into tokens (words). Must be at least 2 characters long. Example query quick brown matches quick brown fox but also brown quick dog or quickiest brown fox, but not quick dog. |
| $emptyOrMissing | bool | Matches values that are empty or missing. When false, matches existing non-empty values. |
| $eq | $ne | number | string | date | URL | Default MQL behavior |
| $gt | $lt | $gte | $lte | number | string | date | Default MQL behavior |
| $in | $nin | list[number | string | URL] | Default MQL behavior |
Query parameters
Result ordering. Note: field.<schema_id>.<format> is also supported (where format is one of number, date, string).
Number of results per page. The maximum value is 500. For requests that sideload content, the maximum value is limited to 100. Sideloading content for this endpoint is deprecated and will be removed in the near future.
Encoded value acting as a cursor (do not try to modify, only for internal purposes).
Comma-separated list of attributes to be included in the response. See the Query Field Filtering section for detailed explanation and available options.
Comma-separated list of attributes to be excluded from the response. See the Query Field Filtering section for detailed explanation and available options.
Comma-separated list of related objects to sideload (e.g., modifiers,documents,content). See the Sideloading section for detailed explanation and available options.
Filter sideloaded content by schema_id (comma-separated list).
Request body
Example request
{
"query": {
"$and": [
{
"field.vendor_name.string": {
"$eq": "ACME corp"
}
},
{
"labels": {
"$in": [
"https://example.rossum.app/api/v1/labels/12",
"https://example.rossum.app/api/v1/labels/34"
]
}
}
]
},
"query_string": {
"string": "Large drink"
}
}Response
OK
Example response
{
"pagination": {
"total": 1,
"total_pages": 1
},
"results": [
{
"id": 314528,
"url": "https://example.rossum.app/api/v1/annotations/314159",
"status": "to_review",
"document": "https://example.rossum.app/api/v1/documents/456700",
"queue": "https://example.rossum.app/api/v1/queues/8198",
"schema": "https://example.rossum.app/api/v1/schemas/31336",
"relations": [],
"pages": [
"https://example.rossum.app/api/v1/pages/558598"
],
"creator": "https://example.rossum.app/api/v1/users/10775",
"created_at": "2021-04-26T10:08:03.856648Z",
"modified_by": "https://example.rossum.app/api/v1/users/10775",
"modified_at": "2021-04-26T10:08:03.856648Z",
"rir_poll_id": "54f6b9ecfa751789f71ddf12",
"content": "https://example.rossum.app/api/v1/annotations/314159",
"metadata": {
"some_key": "some_value"
},
"related_emails": [],
"email": "https://example.rossum.app/api/v1/emails/1234",
"email_thread": "https://example.rossum.app/api/v1/email_threads/456",
"has_email_thread_with_replies": true,
"organization": "https://example.rossum.app/api/v1/organizations/406",
"assignees": [
"https://example.rossum.app/api/v1/users/1",
"https://example.rossum.app/api/v1/users/2"
],
"labels": [],
"training_enabled": true
}
]
}Changes
No recorded changes to this endpoint across all 1 revision of this API.