Search invoices or emails within an organization to find entities for sandbox testing. Results are scoped to the agent’s organization and sorted by recency.
Use this endpoint to power an entity picker in the sandbox UI. Pass the returned entity_uid to Sandbox run.
Path parameters
UUID of the agent whose organization is searched.
Query parameters
Entity type to search. One of: invoice, email_received.
Search text (minimum 2 characters). Matches against:
- Invoices: invoice number, customer name, or invoice UID
- Emails: subject, sender email, sender name, or message UID
Maximum results to return. Range: 1–50.
Response
Returns 200 with a data array of matching entities. The shape of each item depends on trigger_type.
Invoice results
{
"status": "success",
"status_code": 200,
"message": "Sandbox entities retrieved",
"data": [
{
"entity_type": "invoice",
"entity_uid": "d4e5f6a7-b8c9-0d1e-2f3a-4b5c6d7e8f90",
"label": "INV-2026-0042",
"description": "Acme Corp",
"total_cents": 150000,
"due_date": "2026-04-15",
"status": "sent",
"customer": {
"uid": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"name": "Acme Corp"
}
}
]
}
| Field | Type | Description |
|---|
entity_type | string | Always "invoice" |
entity_uid | string | Invoice UUID |
label | string | Invoice number (falls back to UID) |
description | string | null | Customer name |
total_cents | integer | null | Invoice total in cents |
due_date | string | null | ISO 8601 date |
status | string | null | Invoice status (e.g. sent, overdue, paid) |
customer | object | null | Customer uid and name |
Email results
{
"status": "success",
"status_code": 200,
"message": "Sandbox entities retrieved",
"data": [
{
"entity_type": "message",
"entity_uid": "f1e2d3c4-b5a6-9788-7069-504132241506",
"label": "RE: Invoice inquiry",
"description": "billing@acme.com",
"from_name": "John Doe",
"sent_at": "2026-03-20T10:30:00",
"snippet": "Please find the invoice attached..."
}
]
}
| Field | Type | Description |
|---|
entity_type | string | Always "message" |
entity_uid | string | Email message UUID |
label | string | Subject line (falls back to sender email or UID) |
description | string | null | Sender email address |
from_name | string | null | Sender display name |
sent_at | string | null | ISO 8601 datetime |
snippet | string | null | Email body preview |
Errors
| Status | Reason |
|---|
400 | Missing or invalid query parameters (e.g. q shorter than 2 characters) |
404 | Agent not found |
422 | Unsupported trigger_type |
500 | Internal server error |