Skip to content
Email API

Email API for Gmail, Outlook and IMAP mailboxes

Otobiz gives you one REST API for Email: 37 endpoints for Gmail, Outlook and IMAP mailboxes, called with one Bearer key.

Start for freeDeveloper docs
  • 37 endpoints
  • One Bearer key
  • Consent checked on every send
Quickstart

Three steps to your first call

Make an API key

In Otobiz, open API keys and make one. It acts with the role you pick, and is shown once.

Check the key
# The key from Otobiz, under API keys
export OTOBIZ_API_KEY="otbz_..."

curl https://app.otobiz.ai/api/v1/account \
  -H "Authorization: Bearer $OTOBIZ_API_KEY"

Connect Email by link

Ask for a connect link and open it. Nothing is connected until you finish the steps there.

What Otobiz does on Email
Get the link
# The answer carries "url": open it to connect Email
curl https://app.otobiz.ai/api/v1/connect-sessions \
  -H "Authorization: Bearer $OTOBIZ_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "kind": "gmail" }'

Make one call

Every call is HTTPS and JSON, with the key as a Bearer token.

Developer docs
Reply
# Reply in an email thread, with a copy to accounts
curl https://app.otobiz.ai/api/v1/conversations/$CHAT_ID/messages \
  -H "Authorization: Bearer $OTOBIZ_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: reply-1042" \
  -d '{ "text": "Your invoice is attached.", "cc": ["accounts@example.com"] }'
Endpoints

Email endpoints by job

37 endpoints work on Email, read from the API's own spec. Every path starts with https://app.otobiz.ai/api/v1.

Chats and messages

19 endpoints
Email: Chats and messages
MethodPathWhat it does
GET/inbox/conversationsList chats
GET/inbox/conversations/{conversationId}/messagesRead a conversation's messages
POST/inbox/conversations/{conversationId}/messagesSend a message
POST/inbox/conversationsStart a chat
PATCH/inbox/conversations/{conversationId}/messages/{messageId}Edit a sent message, or move a scheduled one

Mailbox mail

6 endpoints
Email: Mailbox mail
MethodPathWhat it does
GET/email/threadsList a mailbox's mail threads
GET/email/threads/{threadId}Get a mail thread with its mails
PATCH/email/threads/{threadId}Update a mail thread
GET/email/threads/{threadId}/attachmentGet a mail's attachment

Calendar events

7 endpoints
Email: Calendar events
MethodPathWhat it does
GET/calendar/eventsList a mailbox's calendar events
GET/calendar/events/{eventId}Get a calendar event
PATCH/calendar/events/{eventId}Update a calendar event
POST/calendar/events/{eventId}/rsvpReply to a calendar invitation

Mailbox files

5 endpoints
Email: Mailbox files
MethodPathWhat it does
GET/email/filesList a mailbox's files
POST/email/filesAdd a file from a link, or make a folder
PATCH/email/files/{fileId}Update a drive file
POST/email/files/{fileId}/publishShare a drive file by link

On every channel

The same four jobs sit beside every channel's own endpoints.

  • Connect the channel

    • POST/connect/sessions
    • GET/connect/sessions/{sessionId}
    • GET/connections
    • POST/connections/{connectionId}/disconnect
  • Contacts

    • GET/contacts
    • POST/contacts
    • PATCH/contacts/{contactId}
    • PATCH/contacts/{contactId}/consent
  • Files to attach

    • POST/files
    • GET/files/{fileId}
  • Webhooks

    • POST/webhooks/settings
    • POST/webhooks/test
    • GET/webhooks/logs
Developer docs
Limits

What Email takes

Email's own limits, as Otobiz enforces them on every call.

Message text
Up to 9,999 characters.
Files
Attachments to 25 MB each.
Reply window
No time limit on replies.
Sends a day
Gmail and IMAP: 200 a day for each mailbox; Outlook: 1,000 a day for each mailbox.
Delivery status
Sent only. The platform reports no delivery or read.
Every send

What every send carries

The rules your team works under in Otobiz apply to your code too.

  • Consent checked

    Every send checks the contact's consent first. A refused send answers 409 with the reason.

  • Opt-outs hold

    A person who opted out is on the suppression list, and no call can message them.

  • No double sends

    Send an Idempotency-Key header and a retry is safe. The key is remembered for 24 hours.

  • One answer per customer

    A send takes the chat over from an automation in flight, so the customer never gets two replies.

  • Approval where you ask

    A send from an AI agent's key waits for a reviewer and answers 202 approval_required.

  • Every send recorded

    Each send lands in your activity feed, and validateOnly=true runs every check without sending.

Responses

What comes back

POST /inbox/conversations/{conversationId}/messages answers

200
Sent, a note or a scheduled message written, or, with validateOnly=true, the passed check
202
Accepted: it goes out shortly (status queued)
402
The brand has no active plan. Replies are paused
403
Your role cannot send replies
409
An automated reply is mid-send, this Idempotency-Key is in flight, or this person cannot be messaged here (first_contact_not_allowed, suppressed, reconnect_required)
429
Too many requests (rate_limited)

The event that follows

Otobiz posts each event to your endpoint, signed. The event id is stable, so dedupe on it.

A shortened sample from the API's own examples. The docs list every field.

{
  "id": "evt_00000000008008000000000000",
  "type": "message.received",
  "apiVersion": "v1",
  "createdAt": "2026-10-09T09:30:00.000Z",
  "data": {
    "object": {
      "id": "msg_01j2jxbb4pex5vsknk084sn041",
      "conversationId": "cnv_01j2jxbb4pex5vsknk084sn03g",
      "channel": "gmail",
      "direction": "inbound",
      "role": "reply",
      "status": "received",
      "body": "Is the large box in stock?",
      "createdAt": "2026-11-18T09:30:00.000Z"
    }
  }
}
{
  "id": "evt_00000000008008000000000000",
  "type": "message.sent",
  "apiVersion": "v1",
  "createdAt": "2026-10-09T09:30:00.000Z",
  "data": {
    "object": {
      "id": "msg_01j2jxbb4pex5vsknk084sn040",
      "conversationId": "cnv_01j2jxbb4pex5vsknk084sn03g",
      "channel": "gmail",
      "direction": "outbound",
      "role": "reply",
      "status": "delivered",
      "body": "Yes, the large box is in stock. Shall I keep one for you?",
      "createdAt": "2026-11-18T09:31:00.000Z"
    }
  }
}

Register an endpoint

Name the events you want. A test call sends a sample to check your server.

Developer docs
Subscribe
# Register where the events go
curl https://app.otobiz.ai/api/v1/webhook-endpoints \
  -H "Authorization: Bearer $OTOBIZ_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "name": "My server", "url": "https://example.com/otobiz", "events": ["message.received", "message.sent"] }'
AI apps

Let an AI app do it

The same operations are tools on the Otobiz MCP server, so an AI app can work Email with no code.

Claude

ClaudeAssistantsServer https://mcp.otobiz.ai

Set up Otobiz from otobiz.ai/agents/claude

otobiz registered · https://mcp.otobiz.ai

signed in over OAuth · no key pasted

get_current_brand · your business, your role

Draft replies to my unread DMs. Show me each one before you send it.

list_inbox_conversations · your unread DMs

search_tools "draft replies" · create_reply_draft

call_tool create_reply_draft · one draft per chat

drafts ready · nothing sent until you say yes

See the Gmail MCP server
Pricing

No fee per call. You pay for your plan.

Email comes with Growth, Business and Enterprise. A call pays only for what it causes, such as a message sent. The API and the MCP server come with it.

See the plans
FAQ

Common questions

Make an Otobiz API key, connect Email by link, then call POST /api/v1/conversations/{id}/messages with the key as a Bearer token.

Try it on real customer chats

Connect Instagram, WhatsApp or any other channel and start replying today.