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

# API overview

> A high-level look at Lettuce Stream APIs.

Lettuce Stream APIs are organized around REST conventions and use JSON for request and response payloads.

## Authentication

Use a bearer token with every request:

```
Authorization: Bearer YOUR_API_KEY
```

## Base URL

```
https://www.lettucestream.com
```

## API catalog

The following endpoints are available today. Unless noted, endpoints live under the base URL above.

### Endpoint quick links

* [Get Runtime Config](/api-reference/endpoint/get-runtime-config)
* [List Active Spotlights](/api-reference/endpoint/list-active-spotlights)
* [Revoke API Key](/api-reference/endpoint/revoke-api-key)
* [Create Webhook Subscription](/api-reference/endpoint/create-webhook-subscription)

### Core & configuration

| Endpoint              | Methods                 | Purpose                                                                        |
| --------------------- | ----------------------- | ------------------------------------------------------------------------------ |
| `/api/runtime-config` | `GET`                   | Return public runtime configuration (relay URL, app base URL, public API key). |
| `/api/api-keys`       | `GET`, `POST`, `DELETE` | List, create, or revoke API keys tied to a user.                               |

### Billing & onboarding

| Endpoint                        | Methods | Purpose                                           |
| ------------------------------- | ------- | ------------------------------------------------- |
| `/api/create-payment-intent`    | `POST`  | Create a Stripe payment intent for plan checkout. |
| `/api/create-seat-addon-intent` | `POST`  | Create a Stripe payment intent for seat add-ons.  |
| `/api/cancel-subscription`      | `POST`  | Cancel a Stripe subscription.                     |
| `/api/send-invite-email`        | `POST`  | Send an organization invitation email.            |

### Webhooks

| Endpoint                      | Methods                          | Purpose                       |
| ----------------------------- | -------------------------------- | ----------------------------- |
| `/api/webhooks/subscriptions` | `GET`, `POST`, `PATCH`, `DELETE` | Manage webhook subscriptions. |

### Streaming status & spotlights

| Endpoint                | Methods | Purpose                                       |
| ----------------------- | ------- | --------------------------------------------- |
| `/api/status/is-live`   | `POST`  | Check whether a channel or broadcast is live. |
| `/api/spotlights/list`  | `GET`   | List active spotlights.                       |
| `/api/spotlights/ready` | `GET`   | Confirm spotlight readiness.                  |

### OAuth

| Endpoint                       | Methods | Purpose                            |
| ------------------------------ | ------- | ---------------------------------- |
| `/api/oauth/kick-start`        | `POST`  | Start Kick OAuth flow.             |
| `/api/oauth/kick-callback`     | `GET`   | Handle Kick OAuth callback.        |
| `/api/oauth/twitch-start`      | `POST`  | Start Twitch OAuth flow.           |
| `/api/oauth/twitch-callback`   | `GET`   | Handle Twitch OAuth callback.      |
| `/api/oauth/youtube-start`     | `POST`  | Start YouTube OAuth flow.          |
| `/api/oauth/youtube-callback`  | `GET`   | Handle YouTube OAuth callback.     |
| `/api/oauth/linkedin-start`    | `POST`  | Start LinkedIn OAuth flow.         |
| `/api/oauth/linkedin-callback` | `GET`   | Handle LinkedIn OAuth callback.    |
| `/api/oauth/disconnect`        | `POST`  | Disconnect a linked OAuth account. |
| `/api/linkedin/start`          | `POST`  | LinkedIn OAuth start alias.        |
| `/api/linkedin/callback`       | `GET`   | LinkedIn OAuth callback alias.     |

### YouTube

| Endpoint                            | Methods | Purpose                                   |
| ----------------------------------- | ------- | ----------------------------------------- |
| `/api/youtube/resolve-channel`      | `GET`   | Resolve a YouTube channel based on input. |
| `/api/youtube/analytics`            | `POST`  | Fetch analytics for a YouTube broadcast.  |
| `/api/youtube/broadcast-status`     | `POST`  | Read the current broadcast status.        |
| `/api/youtube/scheduled-list`       | `POST`  | List scheduled YouTube broadcasts.        |
| `/api/youtube/scheduled-create`     | `POST`  | Create a scheduled YouTube broadcast.     |
| `/api/youtube/scheduled-update`     | `POST`  | Update a scheduled YouTube broadcast.     |
| `/api/youtube/start-broadcast`      | `POST`  | Start a YouTube broadcast.                |
| `/api/youtube/transition-broadcast` | `POST`  | Transition a YouTube broadcast state.     |

## GraphQL

A working GraphQL endpoint is available at:

```
POST /api/graphql
```

Current operations include:

* `runtimeConfig`
* `apiKeys` and `webhookSubscriptions`
* `createApiKey`, `revokeApiKey`
* `createWebhookSubscription`, `updateWebhookSubscription`, `deleteWebhookSubscription`

See `docs/graphql-schema.graphql` for the executable SDL.

```graphql theme={null}
"""
Executable GraphQL schema exposed by POST /api/graphql.

This schema is intentionally scoped to currently implemented server behavior:
- runtimeConfig query (public)
- apiKeys + webhookSubscriptions queries (API key required)
- API key and webhook subscription mutations (API key required)
"""

type RuntimeConfig {
  relayUrl: String!
  captionsRelayUrl: String!
  rtmpIngestUrl: String!
  appBaseUrl: String!
  publicApiKey: String!
}

type ApiKey {
  id: ID!
  label: String!
  prefix: String!
  createdAt: String
  lastUsedAt: String
  revokedAt: String
}

type WebhookSubscription {
  id: ID!
  url: String!
  events: [String!]!
  description: String!
  enabled: Boolean!
  createdAt: String
  updatedAt: String
}

type CreateApiKeyPayload {
  key: String!
  keyId: ID!
  keys: [ApiKey!]!
}

type WebhookSubscriptionPayload {
  subscription: WebhookSubscription!
  secret: String
}

type Query {
  runtimeConfig: RuntimeConfig!
  apiKeys: [ApiKey!]!
  webhookSubscriptions: [WebhookSubscription!]!
}

type Mutation {
  createApiKey(label: String!): CreateApiKeyPayload!
  revokeApiKey(keyId: ID!): [ApiKey!]!

  createWebhookSubscription(
    url: String!
    events: [String!]!
    description: String
    secret: String
  ): WebhookSubscriptionPayload!

  updateWebhookSubscription(
    subscriptionId: ID!
    url: String
    events: [String!]
    description: String
    enabled: Boolean
    rotateSecret: Boolean
    secret: String
  ): WebhookSubscriptionPayload!

  deleteWebhookSubscription(subscriptionId: ID!): Boolean!
}
```

## Next steps

* Build your first integration using the webhook guide.
