Skip to content

Estimate a history backfill

GET
/v1/grants/{id}/backfill-estimate
curl --request GET \
--url 'https://api.inboxcnx.com/v1/grants/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/backfill-estimate?all=true' \
--header 'Authorization: Bearer <token>'

Counts the mail and the minutes a history backfill of a range would take, so the end user can pick a range before starting one.

Pass exactly one of since, days or all=true, and optionally until (default now) to count a window, e.g. to add up nested ranges without counting twice. messages is the mail in the range that matches the grant’s folders and labels, or the part given as roles and labels (comma-separated), counted id by id. A mail in a folder and a label, or in two labels, counts once for each, so with labels messages is an upper bound. A call counts at most pages pages of 500 (default and maximum 20, 10,000 mails). When it stops early, exact is false, messages is a lower bound, and nextPageToken goes on: pass it as pageToken with the same range and subset and add the counts up. It counts mail the grant already received, so it overestimates a range that overlaps an earlier backfill or live mail. estimatedMinutes assumes the full backfill rate of the mailbox. retentionDays is the grant’s retention: mail of the range older than that is delivered, not stored.

Requires the write:connections scope.

id
required
string format: uuid
since
string format: date-time
days
integer
>= 1 <= 36500
all
string
Allowed values: true
until
string format: date-time
pages
integer
>= 1 <= 20
pageToken
string
<= 2048 characters
roles
string
labels
string

The estimate

Media typeapplication/json
object
messages
required
integer
exact
required
boolean
estimatedMinutes
required
integer
nextPageToken
string
retentionDays
required
integer

Example

{
"messages": 2410,
"exact": true,
"estimatedMinutes": 27,
"retentionDays": 30
}

Invalid range. invalid_subset: roles or labels name something outside the grant’s filter, or nothing. invalid_page_token: not a nextPageToken of this estimate

Media typeapplication/json
object
error
required
object
code
required
string
message
required
string

Example generated

{
"error": {
"code": "example",
"message": "example"
}
}

The credential lacks the write:connections scope

Media typeapplication/json
object
error
required
object
code
required
string
message
required
string

Example generated

{
"error": {
"code": "example",
"message": "example"
}
}

No such grant for the caller’s organization and application

Media typeapplication/json
object
error
required
object
code
required
string
message
required
string

Example generated

{
"error": {
"code": "example",
"message": "example"
}
}

grant_not_processed: the grant is revoked, paused or blocked, or its mailbox needs a reconnect

Media typeapplication/json
object
error
required
object
code
required
string
message
required
string

Example generated

{
"error": {
"code": "example",
"message": "example"
}
}

The provider did not answer

Media typeapplication/json
object
error
required
object
code
required
string
message
required
string

Example generated

{
"error": {
"code": "example",
"message": "example"
}
}