API reference

Mailboxes

A connected Gmail or Outlook mailbox, searched now for the receipts of charges that have none.

Guides: Find receipts in your mailbox

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

NameTypeDescription
connection_idPath · Requiredstring

An id that starts with conn_.

Response

200MailboxSearchOut

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
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

NameTypeDescription
last_searched_atRequiredstring (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.

runningRequiredboolean

Whether a search of this mailbox is under way now.

started_atRequiredstring (date-time) or null

When the search under way began; null when none is.

MailboxSearchOut

NameTypeDescription
startedRequiredboolean

Whether a search was started now. False without background work in this deployment: the six-hourly search runs it instead.