API reference
Mailboxes
A connected Gmail or Outlook mailbox, searched now for the receipts of charges that have none.
- GET
/v1/mailboxes/{connection_id}/searchGet whether a mailbox is being searched now - POST
/v1/mailboxes/{connection_id}/searchSearch a mailbox for missing receipts now
Guides: Find receipts in your mailbox
Get whether a mailbox is being searched now
GET/v1/mailboxes/{connection_id}/search
client.mailboxes.getSearch()
Whether the mailbox is being searched for missing receipts right now, and when it last was. What each search found, and how it ended, are the connection's runs.
Parameters
| Name | Type | Description |
|---|---|---|
connection_idPath · Required | string | An id that starts with |
Response
Errors
- 400
- The request was malformed or a parameter is invalid.
- 401
- No valid credential was sent.
- 403
- The credential or the member's role does not allow this.
- 404
- No such resource in this ledger.
- 409
- A conflicting request, e.g. one with the same Idempotency-Key still running.
- 422
- A well-formed request a business rule refused.
- 429
- Too many requests; retry after the Retry-After header.
- 500
- Something failed on our side; the request_id identifies it.
Example
curl "https://api.ledgerit.ai/v1/mailboxes/{connection_id}/search" \
-H "Authorization: Bearer $LEDGERIT_TOKEN"Search a mailbox for missing receipts now
POST/v1/mailboxes/{connection_id}/search· Idempotent
client.mailboxes.search()
Search a mailbox now for the receipts of charges that have none, rather than at the next six-hourly search. Charges searched for within the last day are left for later.
Parameters
| Name | Type | Description |
|---|---|---|
connection_idPath · Required | string | An id that starts with |
Response
Errors
- 400
- The request was malformed or a parameter is invalid.
- 401
- No valid credential was sent.
- 403
- The credential or the member's role does not allow this.
- 404
- No such resource in this ledger.
- 409
- A conflicting request, e.g. one with the same Idempotency-Key still running.
- 422
- A well-formed request a business rule refused.
- 429
- Too many requests; retry after the Retry-After header.
- 500
- Something failed on our side; the request_id identifies it.
Example
curl -X POST "https://api.ledgerit.ai/v1/mailboxes/{connection_id}/search" \
-H "Authorization: Bearer $LEDGERIT_TOKEN" \
-H "Idempotency-Key: $(uuidgen)"Objects
The objects these operations take and return.
MailboxSearchStateOut
| Name | Type | Description |
|---|---|---|
last_searched_atRequired | string (date-time) or null | When the last search ended, successfully or not; null before the first. Each search is kept among the connection's runs, with what it found. |
runningRequired | boolean | Whether a search of this mailbox is under way now. |
started_atRequired | string (date-time) or null | When the search under way began; null when none is. |
MailboxSearchOut
| Name | Type | Description |
|---|---|---|
startedRequired | boolean | Whether a search was started now. False without background work in this deployment: the six-hourly search runs it instead. |