Outcome
Start connecting a Google or Microsoft mailbox to a seat through Nexus (app_topolo_nexus.email.mailboxes.connect_oauth) as the signed-in person: the mailbox belongs to them, and allowed_app_ids [app_topolo_engage] lets Engage send from it in the background. Returns authorizeUrl: open it, approve access, and Nexus redirects to returnUrl (the Engage seats page, https) with mailbox_status=connected and mailbox_id; finish with seats.bind_mailbox. Nothing is bound or sent by this call. 401 user_credential_required without a signed-in person's token; 424 mailbox_directory_not_configured when this deploy has no Nexus mailbox connection; 422 mailbox_connect_refused with details.nexusCode (oauth_client_not_configured until the platform registers that provider's OAuth client: use IMAP meanwhile); 502 mailbox_directory_unavailable when Nexus cannot be reached.
Before you start
- Verify the intended environment, signed-in credential, authorized organization and the action permission workspace:write.
- Discover and select an authorized canonical Engage workspace. Pass resourceType=workspace and resourceId separately from action input.
- Review the exact effects and obtain approval before CLI --confirm or MCP confirm:true. A local capture does not authorize a live mutation.
Discover the target
topolo whoami --json
topolo actions get app_topolo_engage.seats.connect_mailbox_oauth --json
topolo workspaces list topolo-engage --json
Set ENGAGE_WORKSPACE_ID to the identifier of the selected authorized workspace.
Input contract
| Field | Required | Declared constraints |
|---|---|---|
id | Yes | {"type":"string","minLength":1,"maxLength":128} |
provider | Yes | {"type":"string","enum":["google","microsoft"]} |
returnUrl | Yes | {"type":"string","maxLength":2000,"pattern":"^https:\\/\\/"} |
fromName | No | {"type":"string","minLength":1,"maxLength":120} |
Validate, plan and execute
Build payload.json from the current schema and discovered identifiers. The action description above defines its behavior, limits, side effects and declared errors.
: "${ENGAGE_WORKSPACE_ID:?Set ENGAGE_WORKSPACE_ID to your selected workspace identifier}"
topolo actions validate app_topolo_engage.seats.connect_mailbox_oauth --data @payload.json --json
topolo actions plan app_topolo_engage.seats.connect_mailbox_oauth --resource-type workspace --resource-id "$ENGAGE_WORKSPACE_ID" --data @payload.json --confirm --json
Review the plan and approve its exact effects before executing the unchanged request.
: "${ENGAGE_WORKSPACE_ID:?Set ENGAGE_WORKSPACE_ID to your selected workspace identifier}"
topolo actions call app_topolo_engage.seats.connect_mailbox_oauth --resource-type workspace --resource-id "$ENGAGE_WORKSPACE_ID" --data @payload.json --confirm --json
For MCP, use topolo_get_action, topolo_validate_action, topolo_plan_action and topolo_call_action. Pass resource context separately where required; confirm:true is required for mutations.
Captured successful requests and responses
Captured HTTP 200 · seat mailbox actions > starts an OAuth connection with the seat name as the sender name, binding nothing
Action input
{
"id": "eng_seat_1",
"provider": "microsoft",
"returnUrl": "https://engage.test/seats?seat_id=eng_seat_1"
}
Actual local response
{
"authorizeUrl": "https://accounts.example/consent"
}
Source test: seat mailbox actions > starts an OAuth connection with the seat name as the sender name, binding nothing. Actual route handlers with SQLite repositories; synthetic identity/workspace grants and provider ports.
Captured HTTP 200 · seat mailbox actions > starts an OAuth connection with the seat name as the sender name, binding nothing
Action input
{
"id": "eng_seat_1",
"provider": "google",
"returnUrl": "https://engage.test/seats?seat_id=eng_seat_1",
"fromName": "Ashley"
}
Actual local response
{
"authorizeUrl": "https://accounts.example/consent"
}
Source test: seat mailbox actions > starts an OAuth connection with the seat name as the sender name, binding nothing. Actual route handlers with SQLite repositories; synthetic identity/workspace grants and provider ports.
Effects and response meaning
- Start connecting a Google or Microsoft mailbox to a seat through Nexus (app_topolo_nexus.email.mailboxes.connect_oauth) as the signed-in person: the mailbox belongs to them, and allowed_app_ids [app_topolo_engage] lets Engage send from it in the background. Returns authorizeUrl: open it, approve access, and Nexus redirects to returnUrl (the Engage seats page, https) with mailbox_status=connected and mailbox_id; finish with seats.bind_mailbox. Nothing is bound or sent by this call. 401 user_credential_required without a signed-in person's token; 424 mailbox_directory_not_configured when this deploy has no Nexus mailbox connection; 422 mailbox_connect_refused with details.nexusCode (oauth_client_not_configured until the platform registers that provider's OAuth client: use IMAP meanwhile); 502 mailbox_directory_unavailable when Nexus cannot be reached.
Verify the outcome
- Check the response against the declared output schema and the requested operation. For mutations, use the action-specific read described in the action description before any dependent operation.
Recover
For an uncertain result, inspect current retained state with a read action before retrying. Do not replay a mutation unless its contract explicitly guarantees idempotency.
Refused requests
Captured HTTP 422 · seat mailbox actions > starts an OAuth connection with the seat name as the sender name, binding nothing
Refused input; do not execute
{
"provider": "google",
"returnUrl": "http://engage.test/seats",
"id": "eng_seat_1"
}
Actual local response
{
"error": {
"code": "invalid_action_input",
"message": "Input for seats.connect_mailbox_oauth is invalid.",
"details": [
{
"origin": "string",
"code": "invalid_format",
"format": "regex",
"pattern": "/^https:\\/\\//",
"path": [
"returnUrl"
],
"message": "Use an https URL."
}
]
}
}
Source test: seat mailbox actions > starts an OAuth connection with the seat name as the sender name, binding nothing. Actual route handlers with SQLite repositories; synthetic identity/workspace grants and provider ports.
Captured HTTP 401 · seat mailbox actions > connects and reads mailboxes only as the signed-in person: without their token it refuses before calling Nexus
Action input
{
"id": "eng_seat_1",
"provider": "google",
"returnUrl": "https://engage.test/seats"
}
Actual local response
{
"error": {
"code": "user_credential_required",
"message": "Connect a mailbox while signed in as the person it belongs to."
}
}
Source test: seat mailbox actions > connects and reads mailboxes only as the signed-in person: without their token it refuses before calling Nexus. Actual route handlers with SQLite repositories; synthetic identity/workspace grants and provider ports.
Captured HTTP 422 · seat mailbox actions > shows Nexus's oauth_client_not_configured refusal as its code
Action input
{
"id": "eng_seat_1",
"provider": "google",
"returnUrl": "https://engage.test/seats"
}
Actual local response
{
"error": {
"code": "mailbox_connect_refused",
"message": "Nexus refused the mailbox request.",
"details": {
"nexusCode": "oauth_client_not_configured"
}
}
}
Source test: seat mailbox actions > shows Nexus's oauth_client_not_configured refusal as its code. Actual route handlers with SQLite repositories; synthetic identity/workspace grants and provider ports.
Error recovery
- HTTP 422
invalid_action_input: Correct the request against the current action input schema, then validate it again before planning. - HTTP 401
user_credential_required: Read the refusal details and current action contract, correct the stated cause, then validate and plan again. Do not retry unchanged or infer success. - HTTP 422
mailbox_connect_refused: Read the refusal details and current action contract, correct the stated cause, then validate and plan again. Do not retry unchanged or infer success.
Related actions
- List sending seats
- Create sending seat
- Get sending seat
- Update sending seat
- Pause sending seat
- Resume sending seat
- Connect IMAP/SMTP mailbox
- Bind mailbox to seat
- Check seat mailbox
- Set seat WhatsApp number
- List seat health
- Get seat health
Evidence and limits
-
/api/seats/{id}/mailbox/connect-oauth -
Actual route handlers with SQLite repositories; synthetic identity/workspace grants and provider ports.
-
Widget/bootstrap use actual app handler but mocked worker runtime and app identity.
-
No gateway execution, live permissions, external delivery or deployed proof.
These are local route captures with synthetic identity and simulated dependencies. They do not prove live authorization, gateway execution, production state, or external delivery.