RealOffice.AIOnline · replies in seconds

    Today

    How do we send a WhatsApp message from our system?

    The supervisor spotted a technical question and routed it to developer support

    Developer support · AI

    With one POST request. Send the number, the template name and its parameters to /api/whatsapp/send-template, and your API key identifies your office.

    The RealOffice.AI WhatsApp API is a REST API on top of the official Meta WhatsApp Business API. Send WhatsApp templates and text messages, schedule sends, manage contacts and campaigns, and read conversations and call transcripts. Want an AI assistant to work with your office data instead of code? See Office MCP.

    From signup to your first message

    1. 1Create an API key

      In app.realoffice.ai, open Integration, then API Accounts, create an API account and copy its key. You can restrict it to a single IP address.

    2. 2Pick a WhatsApp number

      GET /api/whatsapp/accounts returns your office WhatsApp numbers. Keep the id and pass it as whatsappAccountId. Without it, the message goes out from the first active number.

    3. 3Send a template

      The first message to a customer goes out as a Meta-approved template through POST /api/whatsapp/send-template. WhatsApp templates

    4. 4Continue in free text

      When the customer replies, a 24-hour window opens, and you can send plain text with POST /api/whatsapp/send-message.

    Send a WhatsApp template

    Pass the key in an Authorization: Bearer header or an X-API-Key header. Template parameters are a dictionary: body-1, body-2 for positional variables, or body-name for named ones. For templates with a media header or buttons, send componentsJson in the Meta format instead.

    curl -X POST https://api.realoffice.ai/api/whatsapp/send-template \
      -H "Authorization: Bearer $REALOFFICE_API_KEY" \
      -H "Content-Type: application/json" \
      -d '{
        "to": "972501234567",
        "templateName": "appointment_reminder",
        "language": "he",
        "parameters": { "body-1": "Dana", "body-2": "10:00" }
      }'

    A text message inside the 24-hour window

    Free text only goes through if the customer wrote to the number in the last 24 hours. That is a WhatsApp rule; outside the window, send a template. The body is simple: to, message and an optional whatsappAccountId.

    curl -X POST https://api.realoffice.ai/api/whatsapp/send-message \
      -H "Authorization: Bearer $REALOFFICE_API_KEY" \
      -H "Content-Type: application/json" \
      -d '{
        "to": "972501234567",
        "message": "Thanks Dana, see you tomorrow at 10:00",
        "whatsappAccountId": "YOUR_WHATSAPP_ACCOUNT_ID"
      }'

    Every endpoint

    The base URL is https://api.realoffice.ai/api. Every call except the health check needs an API key, and every response comes in the same JSON envelope.

    WhatsApp

    • GET/api/whatsapp/accountsYour office WhatsApp numbers, with id, phone number and status.
    • GET/api/whatsapp/accounts/{accountId}Details of one WhatsApp number.
    • GET/api/whatsapp/templates?accountId=All templates for the number from Meta, with approval status. accountId is optional.
    • GET/api/whatsapp/templates/{templateId}One template by id.
    • POST/api/whatsapp/templatesCreate a template and submit it to Meta: name, category, language, bodyText, plus optional header and footer.
    • DELETE/api/whatsapp/templates/{templateId}/{templateName}Delete a template.
    • POST/api/whatsapp/send-templateSend a template: to, templateName, language, parameters or componentsJson, whatsappAccountId.
    • POST/api/whatsapp/send-messageSend free text inside the 24-hour window: to, message, whatsappAccountId.
    • POST/api/whatsapp/schedule-templateSchedule a template for the number's local time with scheduledSendTimeLocal.

    Contacts and tags

    • GET/api/contactsYour contacts with their tags.
    • GET/api/contacts/{contactId}One contact.
    • POST/api/contactsCreate a contact.
    • PUT/api/contacts/{contactId}Update a contact by id.
    • PUT/api/contacts/phone/{phoneNumber}Update a contact by phone number.
    • POST/api/contacts/searchSearch contacts with filters.
    • POST/api/contacts/syncSync contacts from an external system.
    • POST/api/contacts/{contactId}/tagsAdd tags to a contact.
    • DELETE/api/contacts/{contactId}/tagsRemove tags from a contact.
    • GET/api/contacts/tagsAll tags in your office.
    • POST/api/contacts/tagsCreate a tag.

    Campaigns

    • GET/api/campaignsAll campaigns in your office.
    • GET/api/campaigns/{campaignId}Campaign details.
    • POST/api/campaignsCreate a campaign: number, template, target and excluded tags, and sending pace.
    • POST/api/campaigns/{campaignId}/startStart a campaign.
    • POST/api/campaigns/{campaignId}/stopStop a campaign.
    • POST/api/campaigns/{campaignId}/scheduleSchedule a campaign.
    • POST/api/campaigns/{campaignId}/add-tasksAdd recipients to a continuous campaign that is already running.
    • GET/api/campaigns/{campaignId}/progressSending progress.
    • GET/api/campaigns/{campaignId}/tasksRecipients and the status of each.
    • GET/api/campaigns/{campaignId}/respondersWho replied to the campaign, with their last message.

    Conversations and transcripts

    • GET/api/conversationsA summary of your recent conversations.
    • GET/api/conversations/{phoneNumber}WhatsApp message history with a phone number.
    • GET/api/conversations/{phoneNumber}/summaryMessage count, first and last dates, and a preview of the last message.
    • GET/api/transcriptions/recentRecent call transcripts.
    • POST/api/transcriptions/searchSearch transcripts with filters.
    • GET/api/transcriptions/{transcriptionId}One transcript.

    AI agents

    • GET/api/agentsYour office agents.
    • GET/api/agents/{agentId}One agent.
    • POST/api/agents/{agentId}/activateActivate an agent on a conversation; returns an activation id.

    Health

    • GET/api/healthService status, no API key needed.
    • GET/api/health/pingA quick check that the API responds.

    Rules worth knowing

    • The 24-hour windowFree text is delivered only within 24 hours of the customer's last message. Before that, or after it, send an approved template.
    • Rate limitsUp to 100 requests per minute and 1,000 per hour from each IP address. Beyond that you get HTTP 429; wait and retry.
    • One response envelopeEvery response has success, data, message, errors and timestamp. On an error, success is false and message says what happened.
    • Several WhatsApp numbersWithout whatsappAccountId, the message goes out from the first active number. When scheduling with several active numbers, the number is required.
    • One key per systemEach API account has its own key, with optional IP restriction. A disabled account gets 403, and a regenerated key stops the old one at once.
    • Request logSend requests and their responses are stored, and you can review them in the app on the API Messages screen.

    Developer questions

    How do I get access to the WhatsApp API?

    You need a RealOffice.AI office with a connected WhatsApp number. Create the key in the app on the API Accounts screen. WhatsApp Business API

    Can I message a customer who hasn't written to us yet?

    Yes, but only with a Meta-approved template through send-template. Free text is allowed only after the customer writes, within 24 hours.

    How do I pass template variables?

    In parameters, as a dictionary with keys like body-1 and header-1, or body-name for named variables. For complex templates, send componentsJson in the Meta format.

    Can I schedule a WhatsApp message through the API?

    Yes. POST /api/whatsapp/schedule-template takes the same fields as sending a template, plus scheduledSendTimeLocal in the number's local time. Scheduled messages

    Where can I see every field of every call?

    In the API Swagger docs at https://api.realoffice.ai/swagger.

    What's the difference between the API and Office MCP?

    The API is for your code: sending, scheduling and syncing. Office MCP lets AI assistants such as Claude or Cursor read your office data and update the CRM. Office MCP

    Let's talk

    RealOffice.AI

    Hi, this is the RealOffice.AI agent. Leave your details and we'll get back to you with a demo built around your business.

    Prefer to talk now? 053-5908627 · sales@realoffice.ai