1MSG SDK: call the WhatsApp API from your language
A 1MSG client for TypeScript, Python, Go, Java, C#, and more. Same WhatsApp API: install from the registry, call methods, skip handwritten HTTP.
If you already call 1MSG over HTTP, that still works. Endpoints, tokens, and response shapes do not change. What’s new is you can stop assembling those requests yourself.
Why this exists
Without an SDK every call is a handwritten HTTP request: URL, token, JSON body, your own types and error handling. You copy it from the API docs and you keep it correct. The SDK is that layer as a package in your language — you call methods against the same API.
The clients are generated from the same OpenAPI contract as the server, so they follow the API instead of drifting from a copied curl. That was the point of the backend rebuild.
Start here
You need three values from the channel page: baseUrl, instanceId, and token. After that you call a method, not a URL. If you don’t have a channel yet, the Quick start covers account, test channel, and the first message.
TypeScript is the shortest path. Install with npm install @1msg/sdk, then:
import { createClient } from '@1msg/sdk';
const client = createClient({
baseUrl: 'https://api.1msg.io',
instanceId: 'YOUR_INSTANCE_ID',
token: process.env.MSG_API_TOKEN!,
});
await client.sendMessage({ body: 'Hello', chatId: '[email protected]' });The other languages work the same way: same three credentials, same sendMessage call. Install commands and repos are below.
Install
Most languages install from a package registry. PHP and C++ are source-only for now.
| Language | Install | Source |
|---|---|---|
| TypeScript | npm install @1msg/sdk | https://github.com/1msg/1msg-sdk/tree/main/typescript |
| Python | pip install one-msg-sdk | https://github.com/1msg/1msg-sdk/tree/main/python |
| Java | implementation("io.1msg:sdk") | https://github.com/1msg/1msg-sdk/tree/main/java |
| Kotlin | implementation("io.1msg:sdk-kotlin") | https://github.com/1msg/1msg-sdk/tree/main/kotlin |
| Scala | "io.1msg" %% "sdk-scala" | https://github.com/1msg/1msg-sdk/tree/main/scala |
| C# | dotnet add package OneMsg.Sdk | https://github.com/1msg/1msg-sdk/tree/main/csharp |
| Ruby | gem install one_msg_sdk | https://github.com/1msg/1msg-sdk/tree/main/ruby |
| Rust | cargo add one-msg-sdk | https://github.com/1msg/1msg-sdk/tree/main/rust |
| Go | go get github.com/1msg/1msg-sdk-go | https://github.com/1msg/1msg-sdk-go |
| Swift | SwiftPM: 1msg-sdk-swift | https://github.com/1msg/1msg-sdk-swift |
| PHP | composer require 1msg/sdk from GitHub (Packagist not published yet) | https://github.com/1msg/1msg-sdk-php |
| C++ | git clone + CMake (no registry yet) | https://github.com/1msg/1msg-sdk-cpp |
PHP from GitHub:
composer config repositories.1msg vcs https://github.com/1msg/1msg-sdk-php
composer require 1msg/sdkC++: git clone https://github.com/1msg/1msg-sdk-cpp.git
Pick your language, install the package, and send the first message with baseUrl, instanceId, and token from the channel page. Raw HTTP is unchanged — the SDK is the same API, as a client.
