Start a history backfill
const url = 'https://api.inboxcnx.com/v1/grants/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/backfill';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"days":30}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.inboxcnx.com/v1/grants/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/backfill \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "days": 30 }'Starts a history backfill that delivers a grant’s older mail, for an end user who wants mail from before the connect. At most one history backfill runs per grant. It delivers every mail of the range that matches the grant’s folders and labels (effectiveRoles, subscribedLabels), or the part of them given as roles and labels, as message.received with data.origin: "backfill", and stores only mail within the grant’s retention. Mail the grant already received is not delivered or billed again, so overlapping ranges cost nothing twice. Backfill mail counts against the allowance like live mail, but never against the Profile’s limits, which cap new mail only. The run waits while the grant is paused or blocked, or its mailbox needs a reconnect, and continues on its own. Subscribed endpoints receive grant.backfill_completed when it ends. The range is { "since": "<ISO date>" }, { "days": n } or { "all": true } and ends at the time of the request. roles and labels narrow the run to part of the grant’s filter, e.g. one label just added; giving one of them counts the other as empty. Without them the run follows the grant’s filter as it stands while it runs.
Requires the write:connections scope.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Request Body
Section titled “Request Body”Responses
Section titled “Responses”The run, started
object
Example
{ "kind": "history", "status": "running"}Invalid range. invalid_subset: roles or labels name something outside the grant’s filter, or nothing
object
object
Example generated
{ "error": { "code": "example", "message": "example" }}The credential lacks the write:connections scope
object
object
Example generated
{ "error": { "code": "example", "message": "example" }}No such grant for the caller’s organization and application
object
object
Example generated
{ "error": { "code": "example", "message": "example" }}backfill_running: a history backfill is already running. grant_not_processed: the grant is revoked, paused or blocked, or its mailbox needs a reconnect
object
object
Example generated
{ "error": { "code": "example", "message": "example" }}