Update a grant
const url = 'https://api.inboxcnx.com/v1/grants/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0';const options = { method: 'PATCH', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"subscribedRoles":["inbox"],"subscribedLabels":["Label_12"]}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PATCH \ --url https://api.inboxcnx.com/v1/grants/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0 \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "subscribedRoles": [ "inbox" ], "subscribedLabels": [ "Label_12" ] }'Changes a grant’s settings: moves it to another profile, pauses or resumes it, or sets the folders and labels whose mail it processes.
A profile with a higher retention than the grant’s consent covers needs consent. A lower retention, or a lower deletedRetentionDays, deletes the grant’s stored mail past it once a 7-day hold has passed; switching back within the hold deletes nothing. A paused grant skips all mail until it is unpaused. A mail is processed when it lies in one of the grant’s folders or carries one of its labels; a label covers only itself, not its sub-labels. Folders and labels together need at least one entry. A narrower filter deletes nothing: stored mail stays until the retention deletes it, and mail already delivered keeps receiving message.updated. A wider one fetches no older mail on its own; start a backfill for that. With subscribedLabels, the labels are checked against the mailbox. The response never reveals the profile to a grant token: the route needs write:connections.
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”object
object
The grant’s own folders, replacing the application’s subscribedRoles. null follows the application’s again, [] subscribes no folder, so only subscribedLabels pick mail.
Label ids of the mailbox, as GET /v1/grants/{id}/labels lists them. Replaces the grant’s labels.
Example
{ "subscribedRoles": [ "inbox" ], "subscribedLabels": [ "Label_12" ]}Responses
Section titled “Responses”The grant’s settings
object
The grant’s own folders, or null when it follows the application’s.
The folders that apply: subscribedRoles, else the application’s.
Example generated
{ "grantId": "example", "profile": "example", "paused": true, "blocked": true, "subscribedRoles": [ "example" ], "subscribedLabels": [ "example" ], "effectiveRoles": [ "example" ]}Invalid body. empty_filter: no folder and no label. unknown_labels: labels lists the ids the mailbox does not have
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 or profile
object
object
Example generated
{ "error": { "code": "example", "message": "example" }}The grant is revoked, the profile is archived, or consent is required. connection_unreadable: the mailbox cannot be asked for its labels
object
object
Example generated
{ "error": { "code": "example", "message": "example" }}