Inbox-connect plumbing: exchanges the OAuth code for a mailbox grant, links the mailbox to the case and returns it. Tokens are never returned.
POST
/email-data/{caseId}/add-email-provider
curl \
--request POST 'http://api.example.com/email-data/{caseId}/add-email-provider' \
--header "Authorization: Bearer $ACCESS_TOKEN" \
--header "Content-Type: application/json" \
--data '{
"redirectUri": "string",
"code": "string",
"extractionCode": "string"
}'
Request examples
{
"redirectUri": "string",
"code": "string",
"extractionCode": "string"
}
Response examples (201)
{
"data": {
"createdAt": "2026-01-15T14:30:00.000Z",
"updatedAt": "2026-01-15T14:30:00.000Z",
"id": "507f1f77bcf86cd799439011",
"email": "jane.doe@example.com",
"ecCode": "K7Q2-9XPL",
"grantId": "5f0c8b3e-2a41-4d7c-9a51-1c2b3d4e5f60",
"provider": "google",
"isValid": true,
"lastAccessedAt": "2026-01-15T14:30:00.000Z",
"folders": [
{
"backgroundColor": "#ffffff",
"id": "INBOX",
"isSystemFolder": true,
"metadata": {
"grantId": "5f0c8b3e-2a41-4d7c-9a51-1c2b3d4e5f60",
"id": "INBOX",
"name": "INBOX",
"object": "folder",
"systemFolder": true
},
"name": "INBOX"
}
]
},
"statusCode": 201,
"timestamp": "2026-01-15T10:15:00.000Z"
}