# Quickstart

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

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](https://desk.sanka.com/signup?next=%2F), or sign in to your Sanka workspace.
2. Open **Workspace → API & Developers**.

   ![The API Tokens page in Sanka Desk, opened from Workspace → API & Developers](https://static.sanka.com/static/docs/816b01d740a52b485947094c131f03abb6ac7ca435ee6a59f53f1fd2e282ee94.png)

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](/docs/developers/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

<CodeGroup>

```
npm install sanka-sdk
```

```
pip install sanka-sdk
```

</CodeGroup>

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.

<CodeGroup>

```typescript
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);
```

```python
import os

from sanka_sdk import SankaClient

sanka = SankaClient(token=os.environ["SANKA_API_KEY"])

me = sanka.public_auth.get_public_auth_whoami_api()
print(me.data.workspace_name, me.data.permission_level)
```

</CodeGroup>

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:

<CodeGroup>

```typescript
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);
}
```

```python
import os

import httpx

res = httpx.get(
    "https://api.sanka.com/v2/public/desk/tickets",
    params={"page_size": 5},
    headers={"Authorization": f"Bearer {os.environ['SANKA_API_KEY']}"},
)
data = res.json()["data"]

print(data["total"], "tickets")
for ticket in data["items"]:
    print(ticket["number"], ticket["state"], ticket["title"])
```

</CodeGroup>

## Next steps

<div className="grid sm:grid-cols-2 lg:grid-cols-3 gap-4">
  <Card title="File IT tickets" icon="ticket" href="/developer/tickets/">
    File a request and let Sanka Desk resolve it with AI.
  </Card>
  <Card title="API reference" icon="book" href="/docs/api-reference/desk-api/">
    Every endpoint for Sanka Desk, Flow, Migrate and Cloud.
  </Card>
  <Card title="Authentication" icon="key" href="/docs/developers/authentication/">
    Add write access, and rotate or delete a key.
  </Card>
  <Card title="Sanka MCP" icon="robot" href="/docs/developers/mcp/">
    Connect Claude Code, Codex and other agents with browser sign-in, no API key.
  </Card>
  <Card title="Sanka CLI" icon="terminal" href="/docs/developers/quickstart/cli/">
    Migrate code on your machine, with no account or API key.
  </Card>
</div>
