> ## Documentation Index
> Fetch the complete documentation index at: https://docs.tiro.ooo/llms.txt
> Use this file to discover all available pages before exploring further.

# Authentication

> How account, workspace, and organization API keys differ from OAuth tokens, how to create keys, narrow them with scopes, and fix authentication errors.

The Tiro API authenticates with an API key or an OAuth access token. Either way, you send it in the `Authorization: Bearer <value>` header of every request.

## Which credential should you use?

Choose based on whose permissions each call should use. Use an OAuth app for each member's own permissions, an account API key for your own permissions, and a workspace or organization API key for server-to-server calls with no user.

```mermaid theme={"system"}
flowchart TD
    Q1{"Whose permissions does the call use?"}
    Q1 -->|"Each signed-in member"| OAUTH["OAuth app<br/>Access token issued with member consent"]
    Q1 -->|"Just me"| USER["Account API key<br/>Workspaces selected at creation"]
    Q1 -->|"Server to server, no user"| Q2{"How broad is the access?"}
    Q2 -->|"One workspace"| WS["Workspace API key"]
    Q2 -->|"Whole organization, managing members and workspaces"| ORG["Organization API key"]
```

The key type sets the outer limit of what a key can reach. [Scopes](#scope) and note access permissions then narrow which APIs and notes each call can actually reach.

> [!NOTE]
>
> To connect your company's systems with a one-time consent from each member, instead of having every member create a key, use an OAuth app. See [OAuth app integration](https://docs.tiro.ooo/en/developers/fundamentals/oauth.md) for registration and the token flow.

## How do you create an API key?

Create an account API key at [Tiro Platform](https://platform.tiro.ooo/me/api-keys).

**1. Sign in**

Go to [platform.tiro.ooo/me/api-keys](https://platform.tiro.ooo/me/api-keys).

**2. Create an account API key**

Click **Create API key**, give it a name, and copy the full key, including both sides of the dot (`abc123.xR7mK9pL2qW4...`).

**3. Store it**

Save it as an environment variable. The secret is shown once, and you can't view it again after you close the dialog.

For server-to-server integrations that don't need a user identity, create a system API key on the workspace or organization management screen.

> [!WARNING]
>
> Keep API keys on your server only. If you put a key in browser or mobile app code, anyone can extract and use it.

## API key format

A Tiro API key is a Key ID and a Secret joined by a dot, in the form `{id}.{secret}`.

Example: `abc123.xR7mK9pL2qW4...`

| Part | Example | Description |
| - | - | - |
| **Key ID** (`{id}`) | `abc123` | Visible in the Platform dashboard. Use it to tell which key sent a request. |
| **Secret** (`{secret}`) | `xR7mK9pL2qW4...` | Shown only once at creation. The server stores only a hash, so it can't be recovered. |
| **Full API key** | `abc123.xR7mK9pL2qW4...` | The **entire string, including both sides of the dot**. Send this value as the Bearer token. |

## Make authenticated requests

Put your API key in the `Authorization` header of every request. The examples below list a workspace's notes. Get the workspace `guid` from `GET /v1/external/workspaces` and store it in the `TIRO_WORKSPACE_GUID` environment variable. The [Quickstart](https://docs.tiro.ooo/en/developers/getting-started/quickstart.md) shows how.

```bash cURL theme={"system"}
curl -H "Authorization: Bearer $TIRO_API_KEY" \
     -H "Content-Type: application/json" \
     "https://api.tiro.ooo/v1/external/workspaces/$TIRO_WORKSPACE_GUID/notes"
```

```javascript Node.js theme={"system"}
const response = await fetch(
  `https://api.tiro.ooo/v1/external/workspaces/${process.env.TIRO_WORKSPACE_GUID}/notes`,
  {
    method: "GET",
    headers: {
      "Authorization": `Bearer ${process.env.TIRO_API_KEY}`,
      "Content-Type": "application/json",
    },
  },
);

const notes = await response.json();
```

```python Python theme={"system"}
import os
import requests

headers = {
    'Authorization': f'Bearer {os.getenv("TIRO_API_KEY")}',
    'Content-Type': 'application/json'
}

workspace_guid = os.getenv("TIRO_WORKSPACE_GUID")
response = requests.get(
    f'https://api.tiro.ooo/v1/external/workspaces/{workspace_guid}/notes',
    headers=headers,
)
notes = response.json()
```

```go Go theme={"system"}
import (
    "fmt"
    "net/http"
    "os"
)

func makeAuthenticatedRequest() (*http.Response, error) {
    client := &http.Client{}
    url := fmt.Sprintf(
        "https://api.tiro.ooo/v1/external/workspaces/%s/notes",
        os.Getenv("TIRO_WORKSPACE_GUID"),
    )
    req, err := http.NewRequest("GET", url, nil)
    if err != nil {
        return nil, err
    }
    
    apiKey := os.Getenv("TIRO_API_KEY")
    req.Header.Set("Authorization", fmt.Sprintf("Bearer %s", apiKey))
    req.Header.Set("Content-Type", "application/json")
    
    return client.Do(req)
}
```

```kotlin Kotlin + Spring theme={"system"}
@Service
class TiroApiService {
    
    @Value("\${tiro.api.key}")
    private lateinit var apiKey: String

    @Value("\${tiro.workspace.guid}")
    private lateinit var workspaceGuid: String
    
    private val restTemplate = RestTemplate()
    
    fun getNotes(): ResponseEntity<String> {
        val headers = HttpHeaders()
        headers.set("Authorization", "Bearer $apiKey")
        headers.contentType = MediaType.APPLICATION_JSON
        
        val entity = HttpEntity<String>(headers)
        
        return restTemplate.exchange(
            "https://api.tiro.ooo/v1/external/workspaces/$workspaceGuid/notes",
            HttpMethod.GET,
            entity,
            String::class.java
        )
    }
}
```

## What does each API key type reach?

The key type decides who a request runs as and which notes it can reach.

| Type | Who it acts as | Notes it can reach | Where to create it |
| - | - | - | - |
| **Account API key** | The user who created the key | Notes that user can see in the app, including notes in their private folders. Limited to the workspaces selected at creation (all accessible workspaces if none were selected). | [Tiro Platform](https://platform.tiro.ooo/me/api-keys) |
| **Workspace API key** | The workspace, with no user | Notes in folders shared with all members of the connected workspace. | Workspace management screen |
| **Organization API key** | The organization, with no user | Notes in folders shared with all members, in the organization workspaces selected at creation (all of the organization's workspaces if none were selected). It can also call organization management APIs. | Organization management screen |

Because workspace and organization API keys run without a user, they're collectively called **system API keys**.

A system API key works only with notes in folders shared with all members. This range applies not only to reads but also to requests that change a note, such as updating a note title, creating a share link, or generating a document. Notes in private folders, notes in folders shared with only some members, and notes in no folder at all are outside this range. If you need those notes, use an account API key.

> [!NOTE]
>
> **Transition period.** Workspace API keys created before this range took effect keep their previous behavior for now and are being migrated in stages. If a newly created key returns fewer notes than an older key, that's expected. See [What notes a system API key reads](https://docs.tiro.ooo/en/developers/fundamentals/system-key-note-scope.md) for each key type's range and how notes outside it appear in responses.

### Listing folders from the CLI

`tiro folders list` and `tiro folders tree` need a user identity, so they work only with OAuth sign-in or an [account API key](https://platform.tiro.ooo/me/api-keys). Granting a system API key `folder:read`, or even every permission, doesn't give it a user identity. Find the target workspace `guid` with `tiro wiki workspaces`, then pass it as `--workspace <guid>`.

| Symptom | Cause | Fix |
| - | - | - |
| `401` with `User API key is required for folder access` | You called with a system API key | Check your credential source with `tiro auth status`. `TIRO_TOKEN`, if set, takes precedence over a saved OAuth login. To use OAuth, unset `TIRO_TOKEN` and run `tiro auth login`. To use an API key, set `TIRO_TOKEN` to an account API key. Adding scopes doesn't fix this. |
| `403` with `insufficient_scope` | The `folder:read` permission is missing. `folder:write` also includes `folder:read` | For OAuth, sign in again and grant folder permissions on the consent screen. You don't need to add a scope to the request URL yourself. For an API key, update its permissions or switch to a new key. |
| 0 notes returned | The notes are outside the key's range | See [What notes a system API key reads](https://docs.tiro.ooo/en/developers/fundamentals/system-key-note-scope.md). |

## How do you narrow permissions with scopes?

Scopes narrow which APIs a key can call. A key with scopes can call only the APIs for those scopes, and other APIs are rejected with `403` `insufficient_scope`. A key without scopes can call every API within the resources it can reach, including APIs added later. To follow least privilege, set scopes.

* You choose scopes when you create the key, and you can change them later.
* A `write` scope includes `read` for the same resource. This also applies to existing keys with `write` scopes.
* Scopes apply to account, workspace, and organization API keys alike.

### Scope list

These are the scopes you can choose.

| Scope | Description |
| - | - |
| `note:read` | Read note metadata, lists, and transcripts |
| `note:write` | Update note metadata, edit, restore, and undo transcript paragraphs and speakers, create and delete share links |
| `note_summary:read` | Read note summaries (one-page documents) |
| `note_summary:write` | Includes `note_summary:read`. No production API requires this scope yet |
| `note_document:read` | Read generated documents |
| `note_document:write` | Create documents from custom templates |
| `note_document_template:read` | List and read note document templates |
| `folder:read` | Read folders |
| `folder:write` | Create, update, and delete folders |
| `wiki:read` | Read and search the wiki |
| `word_memory:read` | Read word memory |
| `word_memory:write` | Create, update, and delete word memory |
| `organization_member:read` | Read organization members and workspace assignments |
| `organization_member:write` | Suspend and resume member recording, and manage workspace assignments |
| `session:write` | Revoke organization members' Tiro sessions |
| `workspace:read` | List and read organization workspaces |
| `workspace:write` | Create, rename, set usage limits for, and delete organization workspaces |
| `voice_file_job:read` | Read Voice File Job status, transcripts, translations, and summaries |
| `voice_file_job:write` | Create, start, and delete Voice File Jobs |
| `realtime_transcription:read` | Get and list realtime transcription sessions |
| `realtime_transcription:write` | Create and end realtime transcription sessions |

### Required scope per API

A key with scopes can call only the APIs whose scope it holds, as listed below. Keys without scopes are still limited by key type and resource access.

| API | Required scope |
| - | - |
| `GET /v1/external/notes`, `POST /v1/external/notes/search` | `note:read` |
| `GET /v1/external/notes/{guid}`, `GET /v1/external/notes/{guid}/folders` | `note:read` |
| `GET /v1/external/notes/{guid}/paragraphs` | `note:read` |
| `GET /v1/external/notes/{guid}/summaries`, `.../summaries/{id}` | `note_summary:read` |
| `GET /v1/external/notes/{guid}/share-link` | `note:read` |
| `PATCH /v1/external/notes/{guid}`, `PUT /v1/external/notes/{guid}/share-link`, `DELETE .../share-link` | `note:write` |
| `PUT`/`DELETE /v1/external/notes/{guid}/paragraphs/{paragraphUuid}/contents/{field}/user-content`, `POST .../paragraphs:reset`, `POST .../paragraphs/{paragraphUuid}/contents/{field}:undo`, `POST .../paragraphs/{paragraphUuid}:reset`, `POST .../transcript:undoSpeakers` | `note:write` |
| `GET /v1/external/organizations/me/notes` | `note:read` |
| `GET /v1/external/workspaces/{ws}/notes`, `POST .../workspaces/{ws}/notes/search` | `note:read` |
| `GET /v1/external/notes/{guid}/documents`, `.../documents/{id}` | `note_document:read` |
| `POST /v1/external/notes/{guid}/documents` | `note_document:write` |
| `GET /v1/external/note-document-templates`, `.../managed`, `.../{id}`, `GET /v1/external/{users/me,workspaces/me,workspaces/{ws},workspaces/-,organizations/me}/note-document-templates` | `note_document_template:read` |
| `GET .../folders` (read folders) | `folder:read` |
| `POST/PATCH/PUT/DELETE .../folders` (modify folders) | `folder:write` |
| `GET /v1/external/workspaces/{ws}/wiki/**` | `wiki:read` |
| `GET .../word-memories`, `.../word-memories/{id}` (users·workspaces·organizations) | `word_memory:read` |
| `POST/PATCH/DELETE .../word-memories`, `POST .../word-memories/bulk`, `PATCH .../word-memories/bulk`, `POST .../word-memories/bulk-delete` | `word_memory:write` |
| `GET /v1/external/organizations/me/members`, `GET .../members/{userGuid}` | `organization_member:read` |
| `PUT/DELETE .../members/{userGuid}/recording-suspension`, `PUT/DELETE .../workspaces/{ws}/members/{userGuid}` | `organization_member:write` |
| `DELETE .../members/{userGuid}/sessions` | `session:write` |
| `GET /v1/external/organizations/me/workspaces`, `.../workspaces/{ws}` | `workspace:read` |
| `POST /v1/external/organizations/me/workspaces`, `PATCH .../{ws}`, `PATCH .../{ws}/quota`, `DELETE .../{ws}` | `workspace:write` |
| `GET /v1/external/voice-file/jobs/{jobId}`, `GET .../transcript`, `GET .../translations/**`, `GET .../paragraph-summary` | `voice_file_job:read` |
| `POST /v1/external/voice-file/jobs`, `PUT .../{jobId}/upload-complete`, `DELETE .../{jobId}` | `voice_file_job:write` |
| `GET /v1/external/realtime-transcriptions`, `GET .../realtime-transcriptions/{id}` | `realtime_transcription:read` |
| `POST /v1/external/realtime-transcriptions`, `POST .../realtime-transcriptions/{id}/end` | `realtime_transcription:write` |
| `GET /v1/external/auth/me`, `.../organizations/me`, `.../workspaces`, `.../workspaces/me` | (no scope — any key) |

## What should you check when you get a 401?

When authentication fails, you get `401` with a body in the same format as [Error handling](https://docs.tiro.ooo/en/developers/fundamentals/error-handling.md). `errorType` is `unauthorized`.

```json theme={"system"}
{
  "error": {
    "code": 401001,
    "errorType": "unauthorized",
    "message": "API key is required for this operation",
    "detail": null
  }
}
```

Here's what to check for each cause.

| Cause | What to check |
| - | - |
| Missing `Authorization` header | Check that every request includes the `Authorization: Bearer <key>` header. |
| Malformed key | Check that you didn't send only the Key ID. Send the full `{id}.{secret}`, including both sides of the dot. |
| Unknown Key ID | Check that no characters were dropped or cut off when you copied the key. |
| Inactive, expired, or deleted key | Check the key's status and expiry date in Platform. |
| Workspace API key not connected to a workspace | Check which workspace the key is connected to and which screen it was created on. |
| A system API key called an API that needs a user identity | If `message` is `User API key is required ...`, switch to an account API key or OAuth. Adding scopes doesn't fix this. |
| Expired OAuth access token | If `detail.reason` is `TOKEN_EXPIRED`, get a new access token with the refresh token. For details, see [OAuth app integration](https://docs.tiro.ooo/en/developers/fundamentals/oauth.md). |

## Security best practices

### Environment variables

Keep API keys in environment variables, not in code.

```bash .env theme={"system"}
# .env file (never commit this!)
TIRO_API_KEY=abc123.XYZ...
TIRO_WORKSPACE_GUID=your-workspace-guid
```

```javascript Node.js theme={"system"}
// Load from environment
const apiKey = process.env.TIRO_API_KEY;
if (!apiKey) {
  throw new Error('TIRO_API_KEY environment variable is required');
}
```

```python Python theme={"system"}
import os

# Load from environment with validation
api_key = os.getenv('TIRO_API_KEY')
if not api_key:
    raise ValueError('TIRO_API_KEY environment variable is required')
```

```go Go theme={"system"}
import (
    "fmt"
    "os"
)

func getAPIKey() (string, error) {
    apiKey := os.Getenv("TIRO_API_KEY")
    if apiKey == "" {
        return "", fmt.Errorf("TIRO_API_KEY environment variable is required")
    }
    return apiKey, nil
}
```

```kotlin Kotlin + Spring theme={"system"}
# application.properties
tiro.api.key=${TIRO_API_KEY}
tiro.workspace.guid=${TIRO_WORKSPACE_GUID}

# Or application.yml
tiro:
  api:
    key: ${TIRO_API_KEY}
  workspace:
    guid: ${TIRO_WORKSPACE_GUID}
```

### Additional security guidelines

* **Rotate keys regularly**: Delete keys you don't use and create new ones
* **Separate keys per environment**: Use different keys for development and production
* **Monitor usage**: Track API key usage and rotate keys when you see anomalies
* **Never log API keys**: Make sure keys don't appear in application logs
* **Use HTTPS only**: Always send requests over a secure connection


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.