Skip to main content
GET
/
api
/
work-tasks
/
context-search
Search linkable entities
curl --request GET \
  --url https://dev.exante.app/api/work-tasks/context-search \
  --header 'Authorization: Bearer <token>'
{
  "status": "success",
  "status_code": 200,
  "message": "<string>",
  "data": {
    "invoices": [
      {
        "uid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
        "invoice_number": "<string>",
        "counterparty_name": "<string>",
        "amount_due_cents": 123,
        "currency": "<string>"
      }
    ],
    "parties": [
      {
        "uid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
        "name": "<string>"
      }
    ],
    "messages": [
      {
        "uid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
        "subject": "<string>",
        "from_email": "<string>"
      }
    ]
  }
}
Search for entities that can be linked to a work task as context. Use this endpoint to power type-ahead search when adding context entities to a task via Create or Update.

When to use

Call this endpoint as the user types in a context entity picker. The q parameter requires a minimum of 2 characters.
GET /api/work-tasks/context-search?q=acme&entity_type=invoice&per_page=5

Searchable entity types

TypeMatches against
invoiceInvoice number, counterparty name
partyParty/company name
messageEmail subject, sender address
Pass entity_type to restrict results to a single type. When omitted, all types are searched.

Organization scoping

  • If organization_uid is omitted, the API uses your default organization.
  • If organization_uid is invalid, the API returns 400.
  • If you are not a member of the requested organization, the API returns 403.

Response

{
  "status": "success",
  "status_code": 200,
  "message": "Context search results",
  "data": {
    "invoices": [
      {
        "uid": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
        "invoice_number": "INV-2026-0042",
        "counterparty_name": "Acme Corp",
        "amount_due_cents": 150000,
        "currency": "USD"
      },
      {
        "uid": "c3d4e5f6-a7b8-9012-cdef-123456789012",
        "invoice_number": "INV-2026-0089",
        "counterparty_name": "Acme Industries",
        "amount_due_cents": 75000,
        "currency": "USD"
      }
    ],
    "parties": [
      {
        "uid": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
        "name": "Acme Corp"
      }
    ],
    "messages": [
      {
        "uid": "d4e5f6a7-b8c9-0123-defa-234567890123",
        "subject": "RE: Invoice inquiry - Acme Corp",
        "from_email": "billing@acme.com"
      }
    ]
  }
}
Use the returned uid and entity type to populate context_entities when creating or updating a task. For example, selecting the first invoice above would produce { "entity_type": "invoice", "entity_uid": "a1b2c3d4-e5f6-7890-abcd-ef1234567890" }.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Query Parameters

q
string
required

Search query (minimum 2 characters)

Minimum string length: 2
entity_type
enum<string>

Restrict search to a specific entity type

Available options:
invoice,
party,
message
per_page
integer
default:10

Results per page

Required range: 1 <= x <= 50
organization_uid
string<uuid>

Organization to scope the search to

Response

Context search results

status
string
Example:

"success"

status_code
integer
Example:

200

message
string
data
object

Search results grouped by entity type