npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@1msg/sdk

v1.0.4

Published

TypeScript SDK for the 1msg WhatsApp API

Readme

@1msg/sdk

Official TypeScript/JavaScript SDK for the 1MSG WhatsApp Business API.

This document is auto-generated from the public OpenAPI contract plus generated TypeScript client signatures. It is intended to be exhaustive: every public operation, parameter, response code, type export, and common integration pattern is documented.

| | | |---|---| | npm | @1msg/sdk | | Source | github.com/1msg/1msg-sdk | | API docs | docs.1msg.io | | Platform | platform.1msg.io | | Support | [email protected] | | OpenAPI version | 1.0.0 | | Operations | 62 | | Exported models | 98 | | AI agent guide | AGENTS.md |


Table of contents

  1. Install
  2. Requirements
  3. Quick start
  4. Configuration
  5. Authentication
  6. Environments
  7. Recipient addressing
  8. 24-hour messaging window
  9. Client architecture
  10. Convenience helpers
  11. API reference
  12. messaging
  13. profile
  14. groups
  15. flows
  16. templates
  17. calling
  18. catalog
  19. channel
  20. users
  21. webhooks
  22. Exported types — full reference
  23. Cookbook
  24. FAQ
  25. Troubleshooting
  26. Error handling
  27. Low-level access
  28. Regeneration and versioning
  29. License

Install

npm install @1msg/sdk
yarn add @1msg/sdk
pnpm add @1msg/sdk

Runtime: Node.js >= 18 (uses native fetch).

Requirements

| Variable | Where to get it | Example | |----------|-----------------|---------| | baseUrl | Platform → channel → API host | https://api.1msg.io | | instanceId | Platform → channel id | ODI371267300 | | token | Platform → channel → API token | JWT or API key |

Use environment variables (MSG_API_TOKEN, MSG_INSTANCE_ID). Never commit tokens.

Quick start

import { createClient } from '@1msg/sdk';

const client = createClient({
  baseUrl: 'https://api.1msg.io',
  instanceId: process.env.MSG_INSTANCE_ID!,
  token: process.env.MSG_API_TOKEN!,
});

await client.sendMessage({ body: 'Hello', chatId: '[email protected]' });
const profile = await client.profile.getMe(client.config.token);

Configuration

createClient({ baseUrl: string; instanceId: string; token: string; });

ClientConfig fields

| Field | Type | Description | |-------|------|-------------| | baseUrl | string | API root, no trailing slash | | instanceId | string | Channel instance id | | token | string | Channel API token | | basePath | getter | {baseUrl}/{instanceId} | | buildRequestUrl(path) | method | Builds URL with ?token= |

Authentication

https://{baseUrl}/{instanceId}/{path}?token={token}

Every generated method accepts token as the first argument.

Environments

| Environment | baseUrl | |-------------|---------| | Production | https://api.1msg.io | | Staging | https://api.stage.1msg.io | | Trial sandbox | See platform SDK page |

Recipient addressing

| Format | Example | When | |--------|---------|------| | Individual chatId | [email protected] | Known chat from API/webhook | | Group chatId | [email protected] | Group conversations | | phone | 12020721369 | First message, no chatId yet |

Provide either chatId or phone, not both.

24-hour messaging window

Session messages (sendMessage, sendFile, sendList, etc.) require an open customer service window (user messaged you within 24 hours).

Outside the window use sendTemplate with an approved Meta template.

Client architecture

createClient() → Client
  ├─ config: ClientConfig
  ├─ messaging: MessagingApi   (16 operations)
  ├─ profile: ProfileApi       (1 operation)
  ├─ groups: GroupsApi         (7 operations)
  ├─ flows: FlowsApi           (8 operations)
  └─ templates: TemplatesApi   (1 operation)

Convenience helpers

client.sendMessage(request: SendMessageRequest)

Wrapper around client.messaging.sendMessage. Prefer this for text messages.

await client.sendMessage({ body: "Hi", chatId: "[email protected]" });

API reference

62 operations documented below with HTTP mapping, schemas, SDK and cURL examples.

messaging

Namespace: client.messagingMessagingApi (23 operations)

createReadMessage

Mark message as read

| | | |---|---| | HTTP | POST /readMessage | | SDK group | client.messaging | | API class | MessagingApi | | operationId | createReadMessage | | Signature | createReadMessage(token: string, messageId?: string, msgId?: string, typingIndicator?: boolean, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<CreateReadMessage200Response> |

Authentication

  • Query parameter token (required on every call)
  • SDK: pass client.config.token as the first method argument

Request

  • token (string, required) — channel API token

Request body schema

| Field | Type | Required | Description | |-------|------|----------|-------------| | messageId | string | optional | | | msgId | string | optional | | | typingIndicator | boolean | optional | Show WhatsApp typing indicator (max 25s or until reply) |

Responses

| Status | Description | Schema | |--------|-------------|--------| | 200 | Server response example | | | 401 | Invalid token | |

SDK example

await client.messaging.createReadMessage(client.config.token, {
  chatId: '[email protected]',
  messageId: 'wamid.HBgNMTIwMjA3MjEzNjkVAgARGBI5RTBCNUY0QUE2RjZBQzhGNDkA',
});

cURL equivalent

curl -X POST 'https://api.1msg.io/{instanceId}/readMessage?token={token}' \
  -H 'Content-Type: application/json' \
  -d '{}'

createUploadMedia

Upload media

Upload a file to WhatsApp media storage and get a numeric mediaId for later use with send_file / send_sticker (mediaId field, not body). Pass the file as body or url — an HTTP(S) URL or a base64 data URI. The mediaId in the response is a numeric string (keep it as a string).

| | | |---|---| | HTTP | POST /uploadMedia | | SDK group | client.messaging | | API class | MessagingApi | | operationId | createUploadMedia | | Signature | createUploadMedia(token: string, createUploadMediaRequest: CreateUploadMediaRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<CreateUploadMedia200Response> |

Authentication

  • Query parameter token (required on every call)
  • SDK: pass client.config.token as the first method argument

Request

  • token (string, required) — channel API token

Request body schema

| Field | Type | Required | Description | |-------|------|----------|-------------| | body | string | optional | File HTTP(S) URL or base64 data URI (data:<mime>;base64,...) | | url | string | optional | Alias for body — public HTTP(S) URL of the file to upload |

OpenAPI example body

{
  "body": "https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf"
}

Responses

| Status | Description | Schema | |--------|-------------|--------| | 200 | OK | |

SDK example

await client.messaging.createUploadMedia(client.config.token, {
  file: 'https://example.com/image.jpg',
});

cURL equivalent

curl -X POST 'https://api.1msg.io/{instanceId}/uploadMedia?token={token}' \
  -H 'Content-Type: application/json' \
  -d '{
    "body": "https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf"
  }'

deleteMedia

Delete media from WABA storage

Delete previously uploaded media by numeric mediaId (from /uploadMedia). This is the canonical deletion endpoint and uses the REST DELETE verb on the media resource path. The older POST /deleteMedia is a deprecated alias.

| | | |---|---| | HTTP | DELETE /media/{mediaId} | | SDK group | client.messaging | | API class | MessagingApi | | operationId | deleteMedia | | Signature | deleteMedia(token: string, mediaId: string, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<SuccessResponse> |

Authentication

  • Query parameter token (required on every call)
  • SDK: pass client.config.token as the first method argument

Path / query parameters

  • mediaId (path, string, required) — Numeric WABA media id

Request

  • token (string, required) — channel API token

Responses

| Status | Description | Schema | |--------|-------------|--------| | 200 | Operation successful | SuccessResponse | | 400 | Invalid request parameters | ErrorResponse | | 401 | Invalid or missing authentication token | ErrorResponse | | 500 | Internal server error | ErrorResponse |

SDK example

await client.messaging.deleteMedia(client.config.token, undefined);

cURL equivalent

curl -X DELETE 'https://api.1msg.io/{instanceId}/media/{mediaId}?token={token}'

deleteMediaLegacy

Delete media from WABA storage (deprecated alias)

Deprecated. Use DELETE /media/{mediaId} instead. This POST alias is kept for backward compatibility with earlier integrations. New integrations should call DELETE /media/{mediaId}: 1msg follows REST conventions for resource deletion going forward (delete a resource with the DELETE verb on its resource path).

| | | |---|---| | HTTP | POST /deleteMedia | | SDK group | client.messaging | | API class | MessagingApi | | operationId | deleteMediaLegacy | | Signature | deleteMediaLegacy(token: string, deleteMediaLegacyRequest: DeleteMediaLegacyRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<SuccessResponse> |

Authentication

  • Query parameter token (required on every call)
  • SDK: pass client.config.token as the first method argument

Request

  • token (string, required) — channel API token

Request body schema

| Field | Type | Required | Description | |-------|------|----------|-------------| | mediaId | string | required | Numeric WABA media id |

Responses

| Status | Description | Schema | |--------|-------------|--------| | 200 | Operation successful | SuccessResponse | | 400 | Invalid request parameters | ErrorResponse | | 401 | Invalid or missing authentication token | ErrorResponse | | 500 | Internal server error | ErrorResponse |

SDK example

await client.messaging.deleteMediaLegacy(client.config.token, {});

cURL equivalent

curl -X POST 'https://api.1msg.io/{instanceId}/deleteMedia?token={token}' \
  -H 'Content-Type: application/json' \
  -d '{}'

getMmLiteStatus

Get MM Lite availability and status

| | | |---|---| | HTTP | GET /mmLiteStatus | | SDK group | client.messaging | | API class | MessagingApi | | operationId | getMmLiteStatus | | Signature | getMmLiteStatus(token: string, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<GetMmLiteStatus200Response> |

Authentication

  • Query parameter token (required on every call)
  • SDK: pass client.config.token as the first method argument

Request

  • token (string, required) — channel API token

Responses

| Status | Description | Schema | |--------|-------------|--------| | 200 | MM Lite status for the channel | | | 401 | Invalid or missing authentication token | ErrorResponse | | 500 | Internal server error | ErrorResponse |

SDK example

await client.messaging.getMmLiteStatus(client.config.token);

cURL equivalent

curl -X GET 'https://api.1msg.io/{instanceId}/mmLiteStatus?token={token}'

listMessages

Get messages list

List stored chat history for this channel (requires history storage). Filter with chatId, limit, last, message numbers, or time bounds.

| | | |---|---| | HTTP | GET /messages | | SDK group | client.messaging | | API class | MessagingApi | | operationId | listMessages | | Signature | listMessages(token: string, chatId?: string, limit?: number, last?: boolean, lastMessageNumber?: number, firstMessageNumber?: number, minTime?: number, maxTime?: number, msgId?: string, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ListMessages200Response> |

Authentication

  • Query parameter token (required on every call)
  • SDK: pass client.config.token as the first method argument

Path / query parameters

  • chatId (query, string, optional) — Filter messages for one chat ([email protected], group @g.us, or BSUID @lid)
  • limit (query, integer, optional) — Max rows to return (default 100)
  • last (query, boolean, optional) — If true, return the latest messages (DESC). Default false.
  • lastMessageNumber (query, integer, optional) — lastMessageNumber
  • firstMessageNumber (query, integer, optional) — firstMessageNumber
  • min_time (query, integer, optional) — Unix timestamp lower bound
  • max_time (query, integer, optional) — Unix timestamp upper bound
  • msgId (query, string, optional) — Filter by stored message id

Request

  • token (string, required) — channel API token

Responses

| Status | Description | Schema | |--------|-------------|--------| | 200 | OK | |

SDK example

const page = await client.messaging.listMessages(
  client.config.token,
  50,
  undefined,
  '[email protected]',
);

cURL equivalent

curl -X GET 'https://api.1msg.io/{instanceId}/messages?token={token}'

retrieveMedia

Retrieve uploaded media metadata

Get WABA media URL and metadata by mediaId (from uploadMedia). The returned url is temporary and typically expires within ~5 minutes.

| | | |---|---| | HTTP | GET /retrieveMedia | | SDK group | client.messaging | | API class | MessagingApi | | operationId | retrieveMedia | | Signature | retrieveMedia(token: string, mediaId: string, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<RetrieveMedia200Response> |

Authentication

  • Query parameter token (required on every call)
  • SDK: pass client.config.token as the first method argument

Path / query parameters

  • mediaId (query, string, required) — mediaId

Request

  • token (string, required) — channel API token

Responses

| Status | Description | Schema | |--------|-------------|--------| | 200 | Media metadata | | | 400 | Invalid request parameters | ErrorResponse | | 401 | Invalid or missing authentication token | ErrorResponse | | 500 | Internal server error | ErrorResponse |

SDK example

await client.messaging.retrieveMedia(client.config.token, undefined);

cURL equivalent

curl -X GET 'https://api.1msg.io/{instanceId}/retrieveMedia?token={token}'

sendAddressMessage

Send address request message

Request shipping address from the user (WhatsApp interactive address_message). India and Singapore only. Requires: - Business WhatsApp number registered in that country - Recipient phone matching the country (+91IN, +65SG) Pass country: "IN" or country: "SG". Eligibility is validated upstream; mismatches (e.g. Singapore phone with country: "IN") return errors such as Unsupported Interactive Message type (HTTP 200 with sent: false). Optional action parameters: values, saved_addresses, validation_errors.

| | | |---|---| | HTTP | POST /sendAddressMessage | | SDK group | client.messaging | | API class | MessagingApi | | operationId | sendAddressMessage | | Signature | sendAddressMessage(token: string, sendAddressMessageRequest: SendAddressMessageRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<MessageSentResponse> |

Authentication

  • Query parameter token (required on every call)
  • SDK: pass client.config.token as the first method argument

Request

  • token (string, required) — channel API token

Request body schema

| Field | Type | Required | Description | |-------|------|----------|-------------| | phone | integer | optional | Recipient phone (E.164 digits, no +). Must match country. | | chatId | string | optional | | | body | string | required | Body text shown with the address request | | country | enum("IN" | "SG") | optional | Address form country. Defaults to IN if omitted. (example="SG") | | values | object | optional | Optional prefilled address fields | | saved_addresses | array | optional | Optional previously saved addresses for the user | | validation_errors | object | optional | Optional field validation errors when re-prompting | | quotedMsgId | string | optional | |

Responses

| Status | Description | Schema | |--------|-------------|--------| | 200 | Message sent successfully | MessageSentResponse | | 400 | Invalid request parameters | ErrorResponse | | 401 | Invalid or missing authentication token | ErrorResponse | | 429 | Rate limit exceeded | ErrorResponse | | 500 | Internal server error | ErrorResponse |

SDK example

await client.messaging.sendAddressMessage(client.config.token, {});

cURL equivalent

curl -X POST 'https://api.1msg.io/{instanceId}/sendAddressMessage?token={token}' \
  -H 'Content-Type: application/json' \
  -d '{}'

sendButton

Send Reply Buttons Message

| | | |---|---| | HTTP | POST /sendButton | | SDK group | client.messaging | | API class | MessagingApi | | operationId | sendButton | | Signature | sendButton(token: string, sendButtonRequest?: SendButtonRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<MessageSentResponse> |

Authentication

  • Query parameter token (required on every call)
  • SDK: pass client.config.token as the first method argument

Request

  • token (string, required) — channel API token

Request body schema

| Field | Type | Required | Description | |-------|------|----------|-------------| | phone | string | optional | Recipient phone with country code. Use phone or chatId. | | chatId | string | optional | Recipient chat ID ([email protected], group @g.us, or BSUID @lid). Use phone or chatId. | | quotedMsgId | string | optional | Optional Cloud API wamid to quote | | body | string | optional | | | footer | string | optional | | | header | object | optional | Optional interactive header (text/image/video/document) | | buttons | array | optional | Legacy alias for sections ([{id,title}]) | | sections | array | optional | |

OpenAPI example body

{
  "phone": "{{testPhone}}",
  "body": "This is a buttons message",
  "footer": "Footer",
  "sections": [
    {
      "type": "reply",
      "reply": {
        "id": "1",
        "title": "Button 1"
      }
    }
  ]
}

Responses

| Status | Description | Schema | |--------|-------------|--------| | 200 | Message sent successfully | MessageSentResponse | | 400 | Invalid request parameters | ErrorResponse | | 401 | Invalid or missing authentication token | ErrorResponse | | 429 | Rate limit exceeded | ErrorResponse | | 500 | Internal server error | ErrorResponse |

SDK example

await client.messaging.sendButton(client.config.token, {
  phone: '12020721369',
  body: 'This is a buttons message',
  footer: 'Footer',
  sections: [{ type: 'reply', reply: { id: '1', title: 'Button 1' } }],
});

cURL equivalent

curl -X POST 'https://api.1msg.io/{instanceId}/sendButton?token={token}' \
  -H 'Content-Type: application/json' \
  -d '{
    "phone": "{{testPhone}}",
    "body": "This is a buttons message",
    "footer": "Footer",
    "sections": [
      {
        "type": "reply",
        "reply": {
          "id": "1",
          "title": "Button 1"
        }
      }
    ]
  }'

sendCarousel

Send Carousel

You can send product cards via Carousel in two ways: Template messages: do not require a 24-hour customer service window between you and the recipient. Use sendTemplate. Free-form messages: can be sent only when a customer service window is open between you and the recipient. Use sendCarousel. The message structure in /sendCarousel is largely similar to sending a template. However, in this case you must explicitly specify all elements that are created in advance when working with templates. This is because the message is sent without using a template. In /sendCarousel, for a Catalog Carousel there can be either 1 URL button or one or more quick reply buttons. Prefer the simple cards array (2–10 cards). Each card needs a header media/product plus a CTA URL or quick-reply buttons. Example: json { "phone": "79001234567", "body": "Pick a product", "cards": [ { "header": { "type": "image", "image": { "link": "https://example.com/1.jpg" } }, "body": { "text": "Card one" }, "type": "cta_url", "action": { "name": "cta_url", "parameters": { "url": "https://example.com/p1", "display_text": "Open" } } }, { "header": { "type": "image", "image": { "link": "https://example.com/2.jpg" } }, "body": { "text": "Card two" }, "type": "cta_url", "action": { "name": "cta_url", "parameters": { "url": "https://example.com/p2", "display_text": "Open" } } } ] } params with a CAROUSEL component is the template-like alternative.

| | | |---|---| | HTTP | POST /sendCarousel | | SDK group | client.messaging | | API class | MessagingApi | | operationId | sendCarousel | | Signature | sendCarousel(token: string, body?: string, cards?: Array<{ [key: string]: any; }>, params?: Array<object>, quotedMsgId?: string, chatId?: string, phone?: number, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<MessageSentResponse> |

Authentication

  • Query parameter token (required on every call)
  • SDK: pass client.config.token as the first method argument

Request

  • token (string, required) — channel API token

Request body schema

| Field | Type | Required | Description | |-------|------|----------|-------------| | body | string | optional | Text shown above the carousel | | cards | array | optional | Preferred. 2–10 carousel cards. | | params | array | optional | Template-like alternative — include a CAROUSEL component with cards | | quotedMsgId | string | optional | | | chatId | string | optional | | | phone | integer | optional | |

Responses

| Status | Description | Schema | |--------|-------------|--------| | 200 | Message sent successfully | MessageSentResponse | | 400 | Invalid request parameters | ErrorResponse | | 401 | Invalid or missing authentication token | ErrorResponse | | 429 | Rate limit exceeded | ErrorResponse | | 500 | Internal server error | ErrorResponse |

SDK example

await client.messaging.sendCarousel(client.config.token, {
  phone: '12020721369',
  body: 'Choose a product',
  cards: [],
});

cURL equivalent

curl -X POST 'https://api.1msg.io/{instanceId}/sendCarousel?token={token}' \
  -H 'Content-Type: application/json' \
  -d '{}'

sendContact

Send a Contact

Send a WhatsApp contact card. Preferred simple body (legacy-compatible): json { "phone": "79001234567", "contact": { "name": "Lida", "phone": "+79181976551" } } Cloud API shape also works: contacts is an array of objects with name.formatted_name and phones[].phone (E.164 string, not a timestamp).

| | | |---|---| | HTTP | POST /sendContact | | SDK group | client.messaging | | API class | MessagingApi | | operationId | sendContact | | Signature | sendContact(token: string, sendContactRequest?: SendContactRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<MessageSentResponse> |

Authentication

  • Query parameter token (required on every call)
  • SDK: pass client.config.token as the first method argument

Request

  • token (string, required) — channel API token

Request body schema

| Field | Type | Required | Description | |-------|------|----------|-------------| | phone | string | optional | Recipient phone with country code. Use phone or chatId. | | chatId | string | optional | Recipient chat ID ([email protected], group @g.us, or BSUID @lid). Use phone or chatId. | | quotedMsgId | string | optional | | | contact | object | optional | Simple contact card. Use this or contacts. | | name | string | object | required | Display name (string) or Cloud API name object | | phone | string | required | Contact phone in E.164 (+79181976551), not a timestamp | | email | string | optional | | | org | object | optional | | | url | string | optional | | | contacts | array | optional | |

OpenAPI example body

{
  "phone": "{{testPhone}}",
  "contact": {
    "name": "John Doe",
    "phone": "+1234567890"
  }
}

Responses

| Status | Description | Schema | |--------|-------------|--------| | 200 | Message sent successfully | MessageSentResponse | | 400 | Invalid request parameters | ErrorResponse | | 401 | Invalid or missing authentication token | ErrorResponse | | 429 | Rate limit exceeded | ErrorResponse | | 500 | Internal server error | ErrorResponse |

SDK example

await client.messaging.sendContact(client.config.token, {
  phone: '12020721369',
  contacts: [{
    name: {
      formatted_name: 'John Doe',
      first_name: 'John',
      last_name: 'Doe',
    },
    phones: [{ phone: '+1234567890', type: 'HOME', wa_id: '' }],
  }],
});

cURL equivalent

curl -X POST 'https://api.1msg.io/{instanceId}/sendContact?token={token}' \
  -H 'Content-Type: application/json' \
  -d '{
    "phone": "{{testPhone}}",
    "contact": {
      "name": "John Doe",
      "phone": "+1234567890"
    }
  }'

sendCtaUrl

Send CTA URL interactive message

Send an interactive message with a single call-to-action URL button.

| | | |---|---| | HTTP | POST /sendCtaUrl | | SDK group | client.messaging | | API class | MessagingApi | | operationId | sendCtaUrl | | Signature | sendCtaUrl(token: string, sendCtaUrlRequest: SendCtaUrlRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<MessageSentResponse> |

Authentication

  • Query parameter token (required on every call)
  • SDK: pass client.config.token as the first method argument

Request

  • token (string, required) — channel API token

Request body schema

| Field | Type | Required | Description | |-------|------|----------|-------------| | phone | integer | optional | | | chatId | string | optional | | | body | string | required | | | displayText | string | required | Button label | | url | string | required | | | header | object | optional | | | footer | string | optional | | | quotedMsgId | string | optional | |

Responses

| Status | Description | Schema | |--------|-------------|--------| | 200 | Message sent successfully | MessageSentResponse | | 400 | Invalid request parameters | ErrorResponse | | 401 | Invalid or missing authentication token | ErrorResponse | | 429 | Rate limit exceeded | ErrorResponse | | 500 | Internal server error | ErrorResponse |

SDK example

await client.messaging.sendCtaUrl(client.config.token, {});

cURL equivalent

curl -X POST 'https://api.1msg.io/{instanceId}/sendCtaUrl?token={token}' \
  -H 'Content-Type: application/json' \
  -d '{}'

sendFile

Send a File

Send a file to an existing chat. (Only if the dialogue has an Open Session). Only one of two parameters is needed to determine the destination - chatId or phone.

| | | |---|---| | HTTP | POST /sendFile | | SDK group | client.messaging | | API class | MessagingApi | | operationId | sendFile | | Signature | sendFile(token: string, body?: string, filename?: string, mediaId?: string, mediaType?: SendFileMediaTypeEnum, voice?: boolean, caption?: string, quotedMsgId?: string, chatId?: string, phone?: number, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<MessageSentResponse> |

Authentication

  • Query parameter token (required on every call)
  • SDK: pass client.config.token as the first method argument

Request

  • token (string, required) — channel API token

Request body schema

| Field | Type | Required | Description | |-------|------|----------|-------------| | body | string | optional | File source (required unless mediaId is set): - HTTP/HTTPS URL - Base64 data URI | | filename | string | optional | File name with extension (required with body, not with mediaId) | | mediaId | string | optional | WABA media id from uploadMedia (alternative to body) | | mediaType | enum("image" | "video" | "audio" | "document") | optional | Required when using mediaId | | voice | boolean | optional | Native WhatsApp voice note (audio/ogg only) | | caption | string | optional | (maxLength=1024) | | quotedMsgId | string | optional | | | chatId | string | optional | | | phone | integer | optional | |

OpenAPI example body

{
  "phone": 12020721369,
  "body": "https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf",
  "filename": "dummy.pdf",
  "caption": "Here is the file"
}

Responses

| Status | Description | Schema | |--------|-------------|--------| | 200 | Message sent successfully | MessageSentResponse | | 400 | Invalid request parameters | ErrorResponse | | 401 | Invalid or missing authentication token | ErrorResponse | | 429 | Rate limit exceeded | ErrorResponse | | 500 | Internal server error | ErrorResponse |

SDK example

await client.messaging.sendFile(
  client.config.token,
  'https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf',
  'dummy.pdf',
  'Here is your document',
  undefined,
  '[email protected]',
);

cURL equivalent

curl -X POST 'https://api.1msg.io/{instanceId}/sendFile?token={token}' \
  -H 'Content-Type: application/json' \
  -d '{
    "phone": 12020721369,
    "body": "https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf",
    "filename": "dummy.pdf",
    "caption": "Here is the file"
  }'

sendFlow

Send WhatsApp Flow Message

Send Interactive WhatsApp Flow message to an existing chat. (Only if the dialogue has an Open Session). Only one of two parameters is needed to determine the destination - chatId or phone. Use this method to send a published WhatsApp Flow as a service (interactive) message. If the 24-hour window is closed, send a template with a FLOW button via /sendTemplate.

| | | |---|---| | HTTP | POST /sendFlow | | SDK group | client.messaging | | API class | MessagingApi | | operationId | sendFlow | | Signature | sendFlow(token: string, body: string, flowId: string, flowToken: string, flowCta: string, header?: SendFlowRequestHeader, footer?: string, flowAction?: SendFlowFlowActionEnum, flowActionPayload?: object, flowMessageVersion?: string, mode?: SendFlowModeEnum, flowActionData?: object, flowActionScreen?: string, quotedMsgId?: string, chatId?: string, phone?: number, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<MessageSentResponse> |

Authentication

  • Query parameter token (required on every call)
  • SDK: pass client.config.token as the first method argument

Request

  • token (string, required) — channel API token

Request body schema

| Field | Type | Required | Description | |-------|------|----------|-------------| | body | string | required | | | header | string | object | optional | | | footer | string | optional | | | flowId | string | required | | | flowToken | string | required | | | flowCta | string | required | | | flowAction | enum("navigate" | "data_exchange") | optional | | | flowActionPayload | object | optional | | | flowMessageVersion | string | optional | | | mode | enum("draft" | "published") | optional | | | flowActionData | object | optional | | | flowActionScreen | string | optional | | | quotedMsgId | string | optional | | | chatId | string | optional | | | phone | integer | optional | |

Responses

| Status | Description | Schema | |--------|-------------|--------| | 200 | Message sent successfully | MessageSentResponse | | 400 | Invalid request parameters | ErrorResponse | | 401 | Invalid or missing authentication token | ErrorResponse | | 429 | Rate limit exceeded | ErrorResponse | | 500 | Internal server error | ErrorResponse |

SDK example

await client.messaging.sendFlow(
  client.config.token,
  'Tap below to complete the form',
  'FLOW_ID',
  'flow-token-from-your-backend',
  'Open form',
  undefined,
  'Powered by 1MSG',
  'navigate',
  { screen: 'WELCOME' },
  '3',
  undefined,
  undefined,
  undefined,
  undefined,
  '[email protected]',
);

cURL equivalent

curl -X POST 'https://api.1msg.io/{instanceId}/sendFlow?token={token}' \
  -H 'Content-Type: application/json' \
  -d '{}'

sendList

Send List Message

| | | |---|---| | HTTP | POST /sendList | | SDK group | client.messaging | | API class | MessagingApi | | operationId | sendList | | Signature | sendList(token: string, sendListRequest?: SendListRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<MessageSentResponse> |

Authentication

  • Query parameter token (required on every call)
  • SDK: pass client.config.token as the first method argument

Request

  • token (string, required) — channel API token

Request body schema

| Field | Type | Required | Description | |-------|------|----------|-------------| | phone | string | optional | Recipient phone with country code. Use phone or chatId. | | chatId | string | optional | Recipient chat ID ([email protected], group @g.us, or BSUID @lid). Use phone or chatId. | | quotedMsgId | string | optional | | | body | string | optional | | | buttonText | string | optional | | | action | string | optional | | | sections | array | optional | |

OpenAPI example body

{
  "phone": "{{testPhone}}",
  "body": "This is a list message",
  "buttonText": "Click me",
  "action": "Action",
  "sections": [
    {
      "title": "Section 1",
      "rows": [
        {
          "id": "1",
          "title": "Row 1",
          "description": "Description for Row 1"
        }
      ]
    }
  ]
}

Responses

| Status | Description | Schema | |--------|-------------|--------| | 200 | Message sent successfully | MessageSentResponse | | 400 | Invalid request parameters | ErrorResponse | | 401 | Invalid or missing authentication token | ErrorResponse | | 429 | Rate limit exceeded | ErrorResponse | | 500 | Internal server error | ErrorResponse |

SDK example

await client.messaging.sendList(client.config.token, {
  phone: '12020721369',
  body: 'This is a list message',
  buttonText: 'Click me',
  action: 'Action',
  sections: [{
    title: 'Section 1',
    rows: [{ id: '1', title: 'Row 1', description: 'Description for Row 1' }],
  }],
});

cURL equivalent

curl -X POST 'https://api.1msg.io/{instanceId}/sendList?token={token}' \
  -H 'Content-Type: application/json' \
  -d '{
    "phone": "{{testPhone}}",
    "body": "This is a list message",
    "buttonText": "Click me",
    "action": "Action",
    "sections": [
      {
        "title": "Section 1",
        "rows": [
          {
            "id": "1",
            "title": "Row 1",
            "description": "Description for Row 1"
          }
        ]
      }
    ]
  }'

sendLocation

Send a Location

Send a location to an existing chat. (Only if the dialogue has an Open Session). Only one of two parameters is needed to determine the destination - chatId or phone.

| | | |---|---| | HTTP | POST /sendLocation | | SDK group | client.messaging | | API class | MessagingApi | | operationId | sendLocation | | Signature | sendLocation(token: string, lat: string, lng: string, address?: string, name?: string, quotedMsgId?: string, chatId?: string, phone?: number, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<MessageSentResponse> |

Authentication

  • Query parameter token (required on every call)
  • SDK: pass client.config.token as the first method argument

Request

  • token (string, required) — channel API token

Request body schema

| Field | Type | Required | Description | |-------|------|----------|-------------| | lat | string | required | | | lng | string | required | | | address | string | optional | | | name | string | optional | | | quotedMsgId | string | optional | | | chatId | string | optional | | | phone | integer | optional | |

OpenAPI example body

{
  "lat": "45.018337",
  "lng": "-73.968285",
  "name": "Facebook HQ",
  "address": "9766 Valley View St., New York, NY 10024",
  "phone": 12020721369
}

Responses

| Status | Description | Schema | |--------|-------------|--------| | 200 | Message sent successfully | MessageSentResponse | | 400 | Invalid request parameters | ErrorResponse | | 401 | Invalid or missing authentication token | ErrorResponse | | 429 | Rate limit exceeded | ErrorResponse | | 500 | Internal server error | ErrorResponse |

SDK example

await client.messaging.sendLocation(
  client.config.token,
  '45.018337',
  '-73.968285',
  '9766 Valley View St., New York, NY 10024',
  'Facebook HQ',
  undefined,
  '[email protected]',
);

cURL equivalent

curl -X POST 'https://api.1msg.io/{instanceId}/sendLocation?token={token}' \
  -H 'Content-Type: application/json' \
  -d '{
    "lat": "45.018337",
    "lng": "-73.968285",
    "name": "Facebook HQ",
    "address": "9766 Valley View St., New York, NY 10024",
    "phone": 12020721369
  }'

sendLocationRequest

Send Location Request Message

| | | |---|---| | HTTP | POST /sendLocationRequest | | SDK group | client.messaging | | API class | MessagingApi | | operationId | sendLocationRequest | | Signature | sendLocationRequest(token: string, sendLocationRequestRequest?: SendLocationRequestRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<MessageSentResponse> |

Authentication

  • Query parameter token (required on every call)
  • SDK: pass client.config.token as the first method argument

Request

  • token (string, required) — channel API token

Request body schema

| Field | Type | Required | Description | |-------|------|----------|-------------| | phone | string | optional | Recipient phone with country code. Use phone or chatId. | | chatId | string | optional | Recipient chat ID ([email protected], group @g.us, or BSUID @lid). Use phone or chatId. | | quotedMsgId | string | optional | | | body | string | optional | |

OpenAPI example body

{
  "phone": "{{testPhone}}",
  "body": "Text"
}

Responses

| Status | Description | Schema | |--------|-------------|--------| | 200 | Message sent successfully | MessageSentResponse | | 400 | Invalid request parameters | ErrorResponse | | 401 | Invalid or missing authentication token | ErrorResponse | | 429 | Rate limit exceeded | ErrorResponse | | 500 | Internal server error | ErrorResponse |

SDK example

await client.messaging.sendLocationRequest(client.config.token, {
  phone: '12020721369',
  body: 'Please share your location',
});

cURL equivalent

curl -X POST 'https://api.1msg.io/{instanceId}/sendLocationRequest?token={token}' \
  -H 'Content-Type: application/json' \
  -d '{
    "phone": "{{testPhone}}",
    "body": "Text"
  }'

sendMessage

Send a Message

Send a message to an existing chat. (Only if the dialogue has an Open Session). The message will be added to the queue for sending and delivered even if the phone is disconnected from the Internet or authorization is not passed. Only one of two parameters is needed to determine the destination - chatId or phone.

| | | |---|---| | HTTP | POST /sendMessage | | SDK group | client.messaging | | API class | MessagingApi | | operationId | sendMessage | | Signature | sendMessage(token: string, body: string, quotedMsgId?: string, chatId?: string, phone?: number, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<MessageSentResponse> |

Authentication

  • Query parameter token (required on every call)
  • SDK: pass client.config.token as the first method argument

Request

  • token (string, required) — channel API token

Request body schema

| Field | Type | Required | Description | |-------|------|----------|-------------| | body | string | required | Message text, UTF-8 or UTF-16 string with emoji (minLength=1, maxLength=4096, example="Hello World 🌍") | | quotedMsgId | string | optional | Message ID to quote/reply to (Cloud API wamid) (pattern=^wamid\..+$, example="wamid.HBgNMTIwMjA3MjEzNjkVAgARGBI5RTBCNUY0QUE2RjZBQzhGNDkA") | | chatId | string | optional | Recipient chat ID: [email protected], [email protected], or BSUID@lid (example="[email protected]") | | phone | integer | optional | Phone number starting with country code (alternative to chatId) (example=12020721369) |

OpenAPI example body

{
  "body": "Hello World",
  "phone": 12020721369
}

Responses

| Status | Description | Schema | |--------|-------------|--------| | 200 | Message sent successfully | MessageSentResponse | | 400 | Invalid request parameters | ErrorResponse | | 401 | Invalid or missing authentication token | ErrorResponse | | 429 | Rate limit exceeded | ErrorResponse | | 500 | Internal server error | ErrorResponse |

SDK example

await client.sendMessage({
  body: 'Hello from 1MSG SDK',
  chatId: '[email protected]',
});

cURL equivalent

curl -X POST 'https://api.1msg.io/{instanceId}/sendMessage?token={token}' \
  -H 'Content-Type: application/json' \
  -d '{
    "body": "Hello World",
    "phone": 12020721369
  }'

sendOrderDetails

Send order details (India payments template)

Send a WhatsApp order details payment / invoice message using a pre-approved Utility template that has an ORDER_DETAILS button. India only (WhatsApp Payments India). Requires: - India WhatsApp Business number - Commerce enabled on the channel (GET/POST /commerce) - Approved template with an ORDER_DETAILS button Use this method when you need structured fields (order, referenceId, currency, paymentSettings). The API appends a template button sub_type: order_details and sends via the same path as POST /sendTemplate. Works outside the 24-hour session window (template message). You can also send the same payload yourself with POST /sendTemplate by including a button component in params: json { "type": "button", "sub_type": "order_details", "index": 0, "parameters": [{ "type": "action", "action": { "order_details": { "reference_id": "order-123", "currency": "INR", "order": { "status": "pending", "items": [], "subtotal": { "offset": 100, "value": 50000 } } } } }] }

| | | |---|---| | HTTP | POST /sendOrderDetails | | SDK group | client.messaging | | API class | MessagingApi | | operationId | sendOrderDetails | | Signature | sendOrderDetails(token: string, sendOrderDetailsRequest: SendOrderDetailsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<MessageSentResponse> |

Authentication

  • Query parameter token (required on every call)
  • SDK: pass client.config.token as the first method argument

Request

  • token (string, required) — channel API token

Request body schema

| Field | Type | Required | Description | |-------|------|----------|-------------| | phone | integer | optional | Recipient phone (India E.164 digits, no +). Use phone or chatId. (example=919876543210) | | chatId | string | optional | Recipient chatId (e.g. [email protected]). Use phone or chatId. | | template | string | required | Approved Utility template name that includes an ORDER_DETAILS button (example="order_details_utility") | | namespace | string | required | Template namespace from the channel / template list (example="your_namespace_uuid") | | language | object | required | Template language | | code | string | required | Language code (example="en") | | policy | string | optional | Optional language policy (example="deterministic") | | params | array | optional | Extra template components (HEADER / BODY / etc.). If an order_details button is missing, the API appends one from order / referenceId / currency / paymentSettings. | | referenceId | string | optional | Unique order / payment reference id (maps to reference_id) (example="order-123") | | currency | string | optional | Currency code for India payments (example="INR") | | paymentSettings | object | optional | Optional payment settings (UPI / payment gateway / payment link). Forwarded as payment_settings on the order_details action. | | order | object | required | Order payload for the ORDER_DETAILS button. Typical fields: status, items[], subtotal, tax, shipping, discount. Amount objects use { "offset": 100, "value": <minor_units> } (e.g. value 50000 with offset 100 = ₹500.00). | | status | string | optional | Order status (example="pending") | | items | array | required | Line items | | subtotal | object | optional | | | offset | integer | optional | (example=100) | | value | integer | optional | (example=50000) | | tax | object | optional | | | shipping | object | optional | | | discount | object | optional | |

OpenAPI example body

{
  "phone": 919876543210,
  "template": "order_details_utility",
  "namespace": "your_namespace_uuid",
  "language": {
    "code": "en"
  },
  "referenceId": "order-123",
  "currency": "INR",
  "order": {
    "status": "pending",
    "items": [
      {
        "retailer_id": "SKU-1",
        "name": "Item",
        "amount": {
          "offset": 100,
          "value": 50000
        },
        "quantity": 1
      }
    ],
    "subtotal": {
      "offset": 100,
      "value": 50000
    }
  }
}

Responses

| Status | Description | Schema | |--------|-------------|--------| | 200 | Message sent successfully | MessageSentResponse | | 400 | Invalid request parameters | ErrorResponse | | 401 | Invalid or missing authentication token | ErrorResponse | | 500 | Internal server error | ErrorResponse |

SDK example

await client.messaging.sendOrderDetails(client.config.token, {});

cURL equivalent

curl -X POST 'https://api.1msg.io/{instanceId}/sendOrderDetails?token={token}' \
  -H 'Content-Type: application/json' \
  -d '{
    "phone": 919876543210,
    "template": "order_details_utility",
    "namespace": "your_namespace_uuid",
    "language": {
      "code": "en"
    },
    "referenceId": "order-123",
    "currency": "INR",
    "order": {
      "status": "pending",
      "items": [
        {
          "retailer_id": "SKU-1",
          "name": "Item",
          "amount": {
            "offset": 100,
            "value": 50000
          },
          "quantity": 1
        }
      ],
      "subtotal": {
        "offset": 100,
        "value": 50000
      }
    }
  }'

sendPaymentRequest

Send payment request (regional)

Send a regional payment request interactive message (beta scaffold). region must be IN, SG, or BR. Payload shape follows Meta regional payments docs; verify on stage before production use. Full regional builders are not implemented yet.

| | | |---|---| | HTTP | POST /sendPaymentRequest | | SDK group | client.messaging | | API class | MessagingApi | | operationId | sendPaymentRequest | | Signature | sendPaymentRequest(token: string, sendPaymentRequestRequest: SendPaymentRequestRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<MessageSentResponse> |

Authentication

  • Query parameter token (required on every call)
  • SDK: pass client.config.token as the first method argument

Request

  • token (string, required) — channel API token

Request body schema

| Field | Type | Required | Description | |-------|------|----------|-------------| | phone | integer | required | | | region | enum("IN" | "SG" | "BR") | required | | | body | string | optional | | | interactive | object | optional | | | action | object | optional | |

Responses

| Status | Description | Schema | |--------|-------------|--------| | 200 | Message sent successfully | MessageSentResponse | | 400 | Invalid request parameters | ErrorResponse | | 401 | Invalid or missing authentication token | ErrorResponse | | 500 | Internal server error | ErrorResponse |

SDK example

await client.messaging.sendPaymentRequest(client.config.token, {});

cURL equivalent

curl -X POST 'https://api.1msg.io/{instanceId}/sendPaymentRequest?token={token}' \
  -H 'Content-Type: application/json' \
  -d '{}'

sendProduct

Send a Product

Send a single catalog product or a product list. Destination is chatId or phone. action is required: - single product: { "catalog_id": "...", "product_retailer_id": "..." } - product list: { "catalog_id": "...", "sections": [{ "title": "...", "product_items": [{ "product_retailer_id": "..." }] }] }

| | | |---|---| | HTTP | POST /sendProduct | | SDK group | client.messaging | | API class | MessagingApi | | operationId | sendProduct | | Signature | sendProduct(token: string, sendProductRequest: SendProductRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<MessageSentResponse> |

Authentication

  • Query parameter token (required on every call)
  • SDK: pass client.config.token as the first method argument

Request

  • token (string, required) — channel API token

Request body schema

| Field | Type | Required | Description | |-------|------|----------|-------------| | phone | string | optional | Recipient phone with country code. Use phone or chatId. | | chatId | string | optional | Recipient chat ID ([email protected], group @g.us, or BSUID @lid). Use phone or chatId. | | quotedMsgId | string | optional | | | body | string | optional | Optional message text shown with the product | | footer | string | optional | | | header | string | optional | Text header (product list only) | | action | object | required | Catalog action (catalog_id + product_retailer_id, or sections for a list) |

OpenAPI example body

{
  "chatId": "[email protected]",
  "body": "Have a look",
  "action": {
    "catalog_id": "448008021021719",
    "product_retailer_id": "0001"
  }
}

Responses

| Status | Description | Schema | |--------|-------------|--------| | 200 | Message sent successfully | MessageSentResponse | | 400 | Invalid request parameters | ErrorResponse | | 401 | Invalid or missing authentication token | ErrorResponse | | 429 | Rate limit exceeded | ErrorResponse | | 500 | Internal server error | ErrorResponse |

SDK example

await client.messaging.sendProduct(client.config.token, {
  phone: '12020721369',
  catalogId: 'CATALOG_ID',
  productRetailerId: 'SKU-001',
});

cURL equivalent

curl -X POST 'https://api.1msg.io/{instanceId}/sendProduct?token={token}' \
  -H 'Content-Type: application/json' \
  -d '{
    "chatId": "[email protected]",
    "body": "Have a look",
    "action": {
      "catalog_id": "448008021021719",
      "product_retailer_id": "0001"
    }
  }'

sendReaction

Send Reaction

| | | |---|---| | HTTP | POST /sendReaction | | SDK group | client.messaging | | API class | MessagingApi | | operationId | sendReaction | | Signature | sendReaction(token: string, sendReactionRequest?: SendReactionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<MessageSentResponse> |

Authentication

  • Query parameter token (required on every call)
  • SDK: pass client.config.token as the first method argument

Request

  • token (string, required) — channel API token

Request body schema

| Field | Type | Required | Description | |-------|------|----------|-------------| | phone | string | optional | Recipient phone with country code. Use phone or chatId. | | chatId | string | optional | Recipient chat ID ([email protected], group @g.us, or BSUID @lid). Use phone or chatId. | | body | string | optional | | | quotedMsgId | string | optional | |

OpenAPI example body

{
  "phone": "{{testPhone}}",
  "body": "😀",
  "quotedMsgId": "{{lastMessageId}}"
}

Responses

| Status | Description | Schema | |--------|-------------|--------| | 200 | Message sent successfully | MessageSentResponse | | 400 | Invalid request parameters | ErrorResponse | | 401 | Invalid or missing authentication token | ErrorResponse | | 429 | Rate limit exceeded | ErrorResponse | | 500 | Internal server error | ErrorResponse |

SDK example

await client.messaging.sendReaction(
  client.config.token,
  '👍',
  'wamid.HBgNMTIwMjA3MjEzNjkVAgARGBI5RTBCNUY0QUE2RjZBQzhGNDkA',
  '[email protected]',
);

cURL equivalent

curl -X POST 'https://api.1msg.io/{instanceId}/sendReaction?token={token}' \
  -H 'Content-Type: application/json' \
  -d '{
    "phone": "{{testPhone}}",
    "body": "😀",
    "quotedMsgId": "{{lastMessageId}}"
  }'

sendSticker

Send sticker message

Send a WhatsApp sticker by mediaId or link URL.

| | | |---|---| | HTTP | POST /sendSticker | | SDK group | client.messaging | | API class | MessagingApi | | operationId | sendSticker | | Signature | sendSticker(token: string, sendStickerRequest: SendStickerRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<MessageSentResponse> |

Authentication

  • Query parameter token (required on every call)
  • SDK: pass client.config.token as the first method argument

Request

  • token (string, required) — channel API token

Request body schema

| Field | Type | Required | Description | |-------|------|----------|-------------| | phone | integer | optional | | | chatId | string | optional | | | mediaId | string | optional | WABA media id from uploadMedia | | link | string | optional | Public URL to webp sticker | | quotedMsgId | string | optional | |

Responses

| Status | Description | Schema | |--------|-------------|--------| | 200 | Message sent successfully | MessageSentResponse | | 400 | Invalid request parameters | ErrorResponse | | 401 | Invalid or missing authentication token | ErrorResponse | | 429 | Rate limit exceeded | ErrorResponse | | 500 | Internal server error | ErrorResponse |

SDK example

await client.messaging.sendSticker(client.config.token, {});

cURL equivalent

curl -X POST 'https://api.1msg.io/{instanceId}/sendSticker?token={token}' \
  -H 'Content-Type: application/json' \
  -d '{}'

profile

Namespace: client.profileProfileApi (2 operations)

getMe

Get Profile Info

Return the WhatsApp Business profile for this channel: About, address, description, email, phone, websites, industry (vertical), and profile photo URL.

| | | |---|---| | HTTP | GET /me | | SDK group | client.profile | | API class | ProfileApi | | operationId | getMe | | Signature | getMe(token: string, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ProfileInfo> |

Authentication

  • Query parameter token (required on every call)
  • SDK: pass client.config.token as the first method argument

Request

  • token (string, required) — channel API token

Responses

| Status | Description | Schema | |--------|-------------|--------| | 200 | Profile information | ProfileInfo | | 401 | Invalid or missing authentication token | ErrorResponse | | 500 | Internal server error | ErrorResponse |

SDK example

const profile = await client.profile.getMe(client.config.token);

cURL equivalent

curl -X GET 'https://api.1msg.io/{instanceId}/me?token={token}'

updateMe

Update profile info

Update WhatsApp Business Account profile fields. At least one of about, description, email, photo, address, vertical, websites is required. Blocked when the channel subscription limit is exceeded.

| | | |---|---| | HTTP | POST /me | | SDK group | client.profile | | API class | ProfileApi | | operationId | updateMe | | Signature | updateMe(token: string, updateMeRequest: UpdateMeRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<UpdateMe200Response> |

Authentication

  • Query parameter token (required on every call)
  • SDK: pass client.config.token as the first method argument

Request

  • token (string, required) — channel API token

Request body schema

| Field | Type | Required | Description | |-------|------|----------|-------------| | about | string | optional | Profile About section (WhatsApp status text) (example="Available 9–18") | | address | string | optional | Business address shown on the profile | | description | string | optional | Business description (max 256 characters) | | email | string | optional | Business email shown on the profile (example="[email protected]") | | vertical | string | optional | Industry of the business | | photo | string | optional | HTTPS URL or data:image/...;base64,... payload | | websites | array | optional | Business website URLs |

OpenAPI example body

{
  "about": "Available 9–18",
  "email": "[email protected]"
}

Responses

| Status | Description | Schema | |--------|-------------|--------| | 200 | Profile updated | | | 401 | Invalid or missing authentication token | ErrorResponse | | 422 | Wrong request (no updatable fields) | ErrorResponse | | 500 | Internal server error | ErrorResponse |

SDK example

await client.profile.updateMe(client.config.token, {});

cURL equivalent

curl -X POST 'https://api.1msg.io/{instanceId}/me?token={token}' \
  -H 'Content-Type: application/json' \
  -d '{
    "about": "Available 9–18",
    "email": "[email protected]"
  }'

groups

Namespace: client.groupsGroupsApi (7 operations)

createGroups

Create Group

| | | |---|---| | HTTP | POST /groups | | SDK group | client.groups | | API class | GroupsApi | | operationId | createGroups | | Signature | createGroups(token: string, createGroupsRequest: CreateGroupsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<CreateGroups200Response> |

Authentication

  • Query parameter token (required on every call)
  • SDK: pass client.config.token as the first method argument

Request

  • token (string, required) — channel API token

Request body schema

| Field | Type | Required | Description | |-------|------|----------|-------------| | groupName | string | required | Group subject / name | | description | string | optional | Optional group description |

Responses

| Status | Description | Schema | |--------|-------------|--------| | 200 | OK | |

SDK example

await client.groups.createGroups(client.config.token, {
  subject: 'Support Group',
  participants: ['12020721369'],
});

cURL equivalent

curl -X POST 'https://api.1msg.io/{instanceId}/groups?token={token}' \
  -H 'Content-Type: application/json' \
  -d '{}'

createGroupsGroupId

Update Group Info

Update group subject, description, and/or profile picture. Path groupId is the WABA group id (without @g.us).

| | | |---|---| | HTTP | POST /groups/{groupId} | | SDK group | client.groups | | API class | GroupsApi | | operationId | createGroupsGroupId | | Signature | createGroupsGroupId(groupId: string, token: string, createGroupsGroupIdRequest: CreateGroupsGroupIdRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<{ [key: string]: any; }> |

Authentication

  • Query parameter token (required on every call)
  • SDK: pass client.config.token as the first method argument

Request

  • token (string, required) — channel API token

Request body schema

| Field | Type | Required | Description | |-------|------|----------|-------------| | subject | string | optional | New group subject / name | | description | string | optional | New group description | | profile_picture_file | string | optional | Image URL or base64 data URI for the group profile picture |

OpenAPI example body

{
  "subject": "Support team",
  "description": "Customer support"
}

Responses

| Status | Description | Schema | |--------|-------------|--------| | 200 | OK | |

SDK example

await client.groups.createGroupsGroupId('GROUPID', client.config.token, {});

cURL equivalent

curl -X POST 'https://api.1msg.io/{instanceId}/groups/{groupId}?token={token}' \
  -H 'Content-Type: application/json' \
  -d '{
    "subject": "Support team",
    "description": "Customer support"
  }'

createGroupsGroupIdInvitelink

Reset Invite Link

| | | |---|---| | HTTP | POST /groups/{groupId}/inviteLink | | SDK group | client.groups | | API class | GroupsApi | | operationId | createGroupsGroupIdInvitelink | | Signature | createGroupsGroupIdInvitelink(groupId: string, token: string, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<{ [key: string]: any; }> |

Authentication

  • Query parameter token (required on every call)
  • SDK: pass client.config.token as the first method argument

Request

  • token (string, required) — channel API token

Responses

| Status | Description | Schema | |--------|-------------|--------| | 200 | OK | |

SDK example

await client.groups.createGroupsGroupIdInvitelink('GROUPID', client.config.token);

cURL equivalent

curl -X POST 'https://api.1msg.io/{instanceId}/groups/{groupId}/inviteLink?token={token}'

deleteGroupsGroupId

Delete Group

| | | |---|---| | HTTP | DELETE /groups/{groupId} | | SDK group | client.groups | | API class | GroupsApi | | operationId | deleteGroupsGroupId | | Signature | deleteGroupsGroupId(groupId: string, token: string, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<DeleteGroupsGroupId200Response> |

Authentication

  • Query parameter token (required on every call)
  • SDK: pass client.config.token as the first method argument

Request

  • token (string, required) — channel API token

Responses

| Status | Description | Schema | |--------|-------------|--------| | 200 | OK | |

SDK example

await client.groups.deleteGroupsGroupId('GROUPID', client.config.token);

cURL equivalent

curl -X DELETE 'https://api.1msg.io/{instanceId}/groups/{groupId}?token={token}'

getGroupsGroupId

Get Group Info

| | | |---|---| | HTTP | GET /groups/{groupId} | | SDK group | client.groups | | API class | GroupsApi | | operationId | getGroupsGroupId | | Signature | getGroupsGroupId(groupId: string, token: string, fields?: string, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<{ [key: string]: any; }> |

Authentication

  • Query parameter token (required on every call)
  • SDK: pass client.config.token as the first method argument

Path / query parameters

  • fields (query, string, optional) — Comma-separated group fields to return

Request

  • token (string, required) — channel API token

Responses

| Status | Description | Schema | |--------|-------------|--------| | 200 | OK | |

SDK example

await client.groups.getGroupsGroupId('GROUPID', client.config.token, undefined);

cURL equivalent

curl -X GET 'https://api.1msg.io/{instanceId}/groups/{groupId}?token={token}'

getGroupsGroupIdInvitelink

Get Invite Lin