Quickstart

Get an API key and make your first request to Sanka.

Last updated: November 8, 2026

One API and one key work across Sanka Desk, Sanka Flow, Sanka Migrate and Sanka Cloud. This guide shows how to get a key and make your first requests in TypeScript or Python.

Get an API key

  1. Sign up, or sign in to your Sanka workspace.
  2. Open Workspace → API & Developers. The API Tokens page in Sanka Desk, opened from Workspace → API & Developers
  3. Select Create Token, enter a name, then select Create Access Token.
  4. Copy the token. It is shown only once.
Sanka calls this key an access token, and only workspace admins can create one. A new token can read but not write, which is all this guide needs. Leave Advanced options as they are: a token limited to named capabilities can't call the request below. Authentication covers write access. Save the key in your environment, and never commit it to source control:
Bash
export SANKA_API_KEY="<access_token>"

Install the SDK

npm install sanka-sdk
The Python SDK needs Python 3.10 or newer. You can also call the API over HTTP from any language, at https://api.sanka.com/v2.

Make your first request

This request asks Sanka which workspace your key belongs to. It changes nothing.
import Sanka from "sanka-sdk";

const sanka = new Sanka({ apiKey: process.env.SANKA_API_KEY });

const { result } = await sanka.publicAuth.getCurrentIdentity();
console.log(result.data.workspaceName, result.data.permissionLevel);
Save the code as first-request.mts and run npx tsx first-request.mts, or save it as first_request.py and run python first_request.py. It prints your workspace name and your key's access level:
Text
Acme regular
If the key is wrong or has been deleted, the API answers 401.

Call Sanka Desk

The SDKs cover Sanka Flow, Sanka Migrate and Sanka Cloud. For Sanka Desk, send the same key over HTTP. This request lists your IT tickets, and a new workspace has none yet:
const res = await fetch("https://api.sanka.com/v2/public/desk/tickets?page_size=5", {
  headers: { Authorization: `Bearer ${process.env.SANKA_API_KEY}` },
});
const { data } = await res.json();

console.log(`${data.total} tickets`);
for (const ticket of data.items) {
  console.log(ticket.number, ticket.state, ticket.title);
}

Next steps

esc