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

# API

> API reference for Streamtime: every `streamtime.api.*` operation with input and output types.

Every `streamtime.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas.

> [!NOTE]
>
> **New to Corsair?** See [API access](https://docs.corsair.dev/concepts/api.md), [authentication](https://docs.corsair.dev/concepts/auth.md), and [error handling](https://docs.corsair.dev/concepts/error-handling).

## Organisation

### get

`organisation.get`

Retrieve the organisation's details

**Risk:** `read`

```ts theme={null}
await corsair.streamtime.api.organisation.get({});
```

**Input:** *empty object*

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `name` | `string` | Yes | Organisation name |
| `domain` | `string` | Yes | Organisation domain |
| `currency` | `object` | Yes | Default customer currency |
| `address` | `string` | Yes | Organisation address (default branch) |
| `country` | `object` | Yes | Organisation country |

> [accordion] currency full type
>
> ```ts theme={null}
> {
>   id: string,
>   name: string,
>   symbol: string
> }
> ```

> [accordion] country full type
>
> ```ts theme={null}
> {
>   id: string,
>   name: string
> }
> ```

***

## Roles

### get

`roles.get`

Retrieve a role by ID

**Risk:** `read`

```ts theme={null}
await corsair.streamtime.api.roles.get({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `role_id` | `number` | Yes | Role ID |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `number` | Yes | The ID of the role |
| `name` | `string` | Yes | The name of the role |
| `active` | `boolean` | Yes | Whether the role is active or archived |

***

### list

`roles.list`

Retrieve all roles in the organisation

**Risk:** `read`

```ts theme={null}
await corsair.streamtime.api.roles.list({});
```

**Input:** *empty object*

**Output:** `object[]`

> [accordion] Output full type
>
> ```ts theme={null}
> {
>   id: number,
>   name: string,
>   active: boolean
> }[]
> ```

***

## Users

### listSavedSegments

`users.listSavedSegments`

Retrieve saved segments for a specific user

**Risk:** `read`

```ts theme={null}
await corsair.streamtime.api.users.listSavedSegments({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `user_id` | `number` | Yes | User ID |

**Output:** `object[]`

> [accordion] Output full type
>
> ```ts theme={null}
> {
>   id?: number | null,
>   userId: number,
>   savedSegmentType: {
>     id: number,
>     name?: string
>   },
>   name: string,
>   value: string
> }[]
> ```

***


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