DevelopersAPI referenceEngagement

Mailboxes API

REST endpoints for mailboxes in ServFlo: 5 operations with parameters, request and response fields, permissions and curl examples.

Base URL: https://app.servflo.ai/api. Every call needs Authorization: Bearer sfk_… (Authentication); {organizationId} ($ORGANIZATION_ID in the examples) is your business's id.

OperationEndpointRisk
My connected mailboxGET /organizations/{organizationId}/mailboxes/meread
Send from my mailbox or my ServFlo addressPATCH /organizations/{organizationId}/mailboxes/mewrite
Disconnect my mailboxDELETE /organizations/{organizationId}/mailboxes/mesensitive
Connect my Gmail or OutlookPOST /organizations/{organizationId}/mailboxes/me/connectsensitive
Check my mailbox nowPOST /organizations/{organizationId}/mailboxes/me/syncwrite

My connected mailbox

GET /organizations/{organizationId}/mailboxes/me

The signed-in person's connected Gmail or Outlook (null when none) and which of the two this server can connect. Read-only.

Permission: inbox.reply (Owner, Admin, Dispatcher, Technician (own jobs)); risk read (OAuth scope servflo.read).

Permissioninbox.reply
Riskread, OAuth scope servflo.read. Read: reads only.
MCP toolmailboxes_mine (toolset marketing)

Example

curl "https://app.servflo.ai/api/organizations/$ORGANIZATION_ID/mailboxes/me" \
  -H "Authorization: Bearer $SERVFLO_API_KEY"

Response

200: the answer's fields
FieldTypeDescription
mailboxobject or null
mailbox.providerenumOne of GMAIL, OUTLOOK.
mailbox.addressstring
mailbox.statusenumOne of CONNECTED, ERROR, DISCONNECTED.
mailbox.sendFromMailboxbooleanTheir Inbox emails go out through this mailbox (else their ServFlo address).
mailbox.lastSyncAtstring (date-time) or null
mailbox.lastErrorstring or null
mailbox.fakeboolean
providersarray of object
providers[].providerenumOne of GMAIL, OUTLOOK.
providers[].availableboolean
providers[].reasonstring or null

Send from my mailbox or my ServFlo address

PATCH /organizations/{organizationId}/mailboxes/me

Whether the signed-in person's Inbox emails go out through their connected mailbox (their real address) or their ServFlo address.

Permission: inbox.reply (Owner, Admin, Dispatcher, Technician (own jobs)); risk write (OAuth scope servflo.write).

Permissioninbox.reply
Riskwrite, OAuth scope servflo.write. Write: creates or changes records inside the business; nothing leaves it.
MCP toolmailboxes_setSending (toolset marketing)

Request body

FieldTypeRequiredDescription
sendFromMailboxbooleanYes

Example

curl -X PATCH "https://app.servflo.ai/api/organizations/$ORGANIZATION_ID/mailboxes/me" \
  -H "Authorization: Bearer $SERVFLO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"sendFromMailbox":true}'

Response

200: the answer's fields
FieldTypeDescription
providerenumOne of GMAIL, OUTLOOK.
addressstring
statusenumOne of CONNECTED, ERROR, DISCONNECTED.
sendFromMailboxbooleanTheir Inbox emails go out through this mailbox (else their ServFlo address).
lastSyncAtstring (date-time) or null
lastErrorstring or null
fakeboolean

Disconnect my mailbox

DELETE /organizations/{organizationId}/mailboxes/me

Stops using the signed-in person's connected mailbox and forgets its tokens; what already came into the Inbox stays.

Permission: inbox.reply (Owner, Admin, Dispatcher, Technician (own jobs)); risk sensitive (OAuth scope servflo.sensitive).

Permissioninbox.reply
Risksensitive, OAuth scope servflo.sensitive. Sensitive: moves money, deletes, sends or shows something to a customer, or grants or revokes access.
MCP toolmailboxes_disconnect (toolset marketing)
ApprovalOver MCP, this tool always waits for your approval in ServFlo. See Approvals.

Example

curl -X DELETE "https://app.servflo.ai/api/organizations/$ORGANIZATION_ID/mailboxes/me" \
  -H "Authorization: Bearer $SERVFLO_API_KEY"

Response

200: the answer's fields
FieldTypeDescription
disconnectedboolean

Connect my Gmail or Outlook

POST /organizations/{organizationId}/mailboxes/me/connect

Starts connecting the signed-in person's own mailbox: answers Google's or Microsoft's consent page (authorizeUrl) for the person to open. Once connected, their mail with customers comes into the Inbox and their Inbox emails go out through it. Nothing changes until they allow it.

Permission: inbox.reply (Owner, Admin, Dispatcher, Technician (own jobs)); risk sensitive (OAuth scope servflo.sensitive).

Permissioninbox.reply
Risksensitive, OAuth scope servflo.sensitive. Sensitive: moves money, deletes, sends or shows something to a customer, or grants or revokes access.
MCP toolmailboxes_connect (toolset marketing)
ApprovalWaits for your approval in ServFlo when called with an API key or a connected app: the first call answers 428 APPROVAL_REQUIRED; once you approve it, repeat the call with the X-ServFlo-Approval header. See Approvals.

Request body

FieldTypeRequiredDescription
providerenumYesOne of GMAIL, OUTLOOK.

Example

curl -X POST "https://app.servflo.ai/api/organizations/$ORGANIZATION_ID/mailboxes/me/connect" \
  -H "Authorization: Bearer $SERVFLO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"provider":"GMAIL"}'

Response

200: the answer's fields
FieldTypeDescription
authorizeUrlstring
modeenumOne of live, fake.

Check my mailbox now

POST /organizations/{organizationId}/mailboxes/me/sync

Brings in the signed-in person's new mail with customers now, instead of waiting for the next check (every few minutes). Only email with a customer's address, or continuing an Inbox thread, comes in.

Permission: inbox.reply (Owner, Admin, Dispatcher, Technician (own jobs)); risk write (OAuth scope servflo.write).

Permissioninbox.reply
Riskwrite, OAuth scope servflo.write. Write: creates or changes records inside the business; nothing leaves it.
MCP toolmailboxes_sync (toolset marketing)

Example

curl -X POST "https://app.servflo.ai/api/organizations/$ORGANIZATION_ID/mailboxes/me/sync" \
  -H "Authorization: Bearer $SERVFLO_API_KEY"

Response

200: the answer's fields
FieldTypeDescription
importedinteger
skippedinteger

On this page