Introduction Welcome to the documentation for the Sakari Messaging REST API. Sakari provides an advanced platform to drive large scale customized SMS communication REST is a web-service protocol that...
This is a community listing. If you own this API, you can request ownership.
npm install omnistream-sdkimport { OmniClient } from "omnistream-sdk";
const omni = new OmniClient({ token: process.env.OMNI_KEY! });
// One key reaches every API on the marketplace.
const data = await omni.call("sakari/auth.token");One install, one key - the same client calls every API on the marketplace.
Get token for accessing APIs
Fetch campaigns
Create campaign
Fetch campaign by ID
Updates a campaign
Deletes a campaign
/**
* Sakari - generated by OmniStream from Sakari's OpenAPI spec.
* One typed method per endpoint. A single Omni key reaches the API.
*/
const DEFAULT_BASE = "https://grid.skinvaults.online/v1/proxy/sakari";
export class SakariError extends Error {
status: number;
code?: string;
constructor(status: number, code: string | undefined, message?: string) {
super(message || `Sakari error ${status}`);
this.name = "SakariError";
this.status = status;
this.code = code;
}
}
export interface SakariOptions {
baseUrl?: string;
fetch?: typeof fetch;
timeoutMs?: number;
}
export class Sakari {
/** @param token Your OmniStream key (one key for every API). */
constructor(private token: string, private opts: SakariOptions = {}) {
if (!token) throw new Error("Sakari: token is required");
}
rateLimit: { remainingMinute?: number; remainingDay?: number } | null = null;
private async _request(method: string, path: string, { params, body }: { params?: Record<string, unknown>; body?: unknown } = {}): Promise<any> {
const f = this.opts.fetch ?? globalThis.fetch;
const url = new URL((this.opts.baseUrl ?? DEFAULT_BASE).replace(/\/+$/, "") + path);
if (params) for (const [k, v] of Object.entries(params)) if (v != null) url.searchParams.set(k, String(v));
const headers: Record<string, string> = { "x-omni-key": this.token };
if (body !== undefined) headers["content-type"] = "application/json";
const res = await f(url, { method, headers, body: body !== undefined ? JSON.stringify(body) : undefined });
this.rateLimit = {
remainingMinute: Number(res.headers.get("x-ratelimit-remaining-minute")) || undefined,
remainingDay: Number(res.headers.get("x-ratelimit-remaining-day")) || undefined,
};
const data = await res.json().catch(() => ({}));
if (!res.ok) throw new SakariError(res.status, data?.error?.code, data?.error?.message);
return data.data ?? data;
}
/** Get token for accessing APIs */
authToken(body: unknown): Promise<any> {
return this._request("POST", "/oauth2/token", { body });
}
/** Fetch campaigns */
campaignsFetchAll(params: { "accountId": string; "offset"?: number; "limit"?: number; "name"?: string }): Promise<any> {
return this._request("GET", "/v1/accounts/{accountId}/campaigns", { params });
}
/** Create campaign */
campaignsCreate(body: unknown, params: { "accountId": string }): Promise<any> {
return this._request("POST", "/v1/accounts/{accountId}/campaigns", { body, params });
}
/** Fetch campaign by ID */
campaignsFetch(params: { "accountId": string; "campaignId": string }): Promise<any> {
return this._request("GET", "/v1/accounts/{accountId}/campaigns/{campaignId}", { params });
}
/** Updates a campaign */
campaignsUpdate(params: { "accountId": string; "campaignId": string }): Promise<any> {
return this._request("PUT", "/v1/accounts/{accountId}/campaigns/{campaignId}", { params });
}
/** Deletes a campaign */
campaignsRemove(params: { "accountId": string; "campaignId": string }): Promise<any> {
return this._request("DELETE", "/v1/accounts/{accountId}/campaigns/{campaignId}", { params });
}
/** Fetch contacts */
contactsFetchAll(params: { "accountId": string; "offset"?: number; "limit"?: number; "firstName"?: string; "lastName"?: string; "mobile"?: string; "email"?: string; "tags"?: string }): Promise<any> {
return this._request("GET", "/v1/accounts/{accountId}/contacts", { params });
}
/** Create contact */
contactsCreate(body: unknown, params: { "accountId": string; "mergeStrategy"?: string }): Promise<any> {
return this._request("POST", "/v1/accounts/{accountId}/contacts", { body, params });
}
/** Fetch contact by ID */
contactsFetch(params: { "accountId": string; "contactId": string }): Promise<any> {
return this._request("GET", "/v1/accounts/{accountId}/contacts/{contactId}", { params });
}
/** Updates a contact */
contactsUpdate(params: { "accountId": string; "contactId": string }): Promise<any> {
return this._request("PUT", "/v1/accounts/{accountId}/contacts/{contactId}", { params });
}
/** Deletes a contact */
contactsRemove(params: { "accountId": string; "contactId": string }): Promise<any> {
return this._request("DELETE", "/v1/accounts/{accountId}/contacts/{contactId}", { params });
}
/** Fetch conversations */
conversationsFetchAll(params: { "accountId": string; "offset"?: number; "limit"?: number }): Promise<any> {
return this._request("GET", "/v1/accounts/{accountId}/conversations", { params });
}
/** Fetch conversation by ID */
conversationsFetch(params: { "accountId": string; "conversationId": string }): Promise<any> {
return this._request("GET", "/v1/accounts/{accountId}/conversations/{conversationId}", { params });
}
/** Closes a conversation */
conversationsClose(params: { "accountId": string; "conversationId": string }): Promise<any> {
return this._request("PUT", "/v1/accounts/{accountId}/conversations/{conversationId}/close", { params });
}
/** Fetch messages */
messagesFetchAll(params: { "accountId": string; "offset"?: number; "limit"?: number; "contactId"?: string; "conversationId"?: string }): Promise<any> {
return this._request("GET", "/v1/accounts/{accountId}/messages", { params });
}
/** Send Messages */
messagesSend(body: unknown, params: { "accountId": string }): Promise<any> {
return this._request("POST", "/v1/accounts/{accountId}/messages", { body, params });
}
/** Fetch message by id */
messagesFetch(params: { "accountId": string; "messageId": string }): Promise<any> {
return this._request("GET", "/v1/accounts/{accountId}/messages/{messageId}", { params });
}
/** Fetch templates */
templatesFetchAll(params: { "accountId": string; "offset"?: number; "limit"?: number; "name"?: string }): Promise<any> {
return this._request("GET", "/v1/accounts/{accountId}/templates", { params });
}
/** Create template */
templatesCreate(body: unknown, params: { "accountId": string }): Promise<any> {
return this._request("POST", "/v1/accounts/{accountId}/templates", { body, params });
}
/** Fetch template by ID */
templatesFetch(params: { "accountId": string; "templateId": string }): Promise<any> {
return this._request("GET", "/v1/accounts/{accountId}/templates/{templateId}", { params });
}
/** Updates a template */
templatesUpdate(params: { "accountId": string; "templateId": string }): Promise<any> {
return this._request("PUT", "/v1/accounts/{accountId}/templates/{templateId}", { params });
}
/** Deletes a template */
templatesRemove(params: { "accountId": string; "templateId": string }): Promise<any> {
return this._request("DELETE", "/v1/accounts/{accountId}/templates/{templateId}", { params });
}
/** Fetch active webhooks */
webhooksFetchAll(params: { "accountId": string }): Promise<any> {
return this._request("GET", "/v1/accounts/{accountId}/webhooks", { params });
}
/** Subscribe to message events */
webhooksSubscribe(body: unknown, params: { "accountId": string }): Promise<any> {
return this._request("POST", "/v1/accounts/{accountId}/webhooks", { body, params });
}
/** Unsubscribe to message events */
webhooksUnsubscribe(params: { "accountId": string; "url": string }): Promise<any> {
return this._request("DELETE", "/v1/accounts/{accountId}/webhooks/{url}", { params });
}
/** Share file - use to host a file and generate a short link to be used directly in a message or as a link to media for a MMS */
toolsShareFile(): Promise<any> {
return this._request("POST", "/v1/tools/sharefile", { });
}
}
export default Sakari;
No reviews yet. Be the first to rate this API.
No. Sakari is included with your Omni key, so a single OmniStream key is enough to start calling it. There is no separate signup with the provider and no second key to manage.
Introduction Welcome to the documentation for the Sakari Messaging REST API. Sakari provides an advanced platform to drive large scale customized SMS communication REST is a web-service protocol that... It exposes 26 endpoints over POST, GET, PUT, DELETE, including POST /oauth2/token, GET /v1/accounts/{accountId}/campaigns, POST /v1/accounts/{accountId}/campaigns.
Install the OmniStream SDK for your language and call Sakari through it. The client is generated from this API's OpenAPI spec, so parameters and responses are fully typed, and the same client also calls every other API in the marketplace.
You can start on the free plan. OmniStream charges for the unified SDK, key storage and proxy rather than for Sakari itself.
QuickChart: An API to generate charts and QR codes using QuickChart services.
Fetch contacts
Create contact
Fetch contact by ID
Updates a contact
Deletes a contact
Fetch conversations
Fetch conversation by ID
Closes a conversation
Fetch messages
Send Messages
Fetch message by id
Fetch templates
Create template
Fetch template by ID
Updates a template
Deletes a template
Fetch active webhooks
Subscribe to message events
Unsubscribe to message events
Share file - use to host a file and generate a short link to be used directly in a message or as a link to media for a MMS