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

# Grain

> Connect your Grain recordings to Cloudglue

Connect your Grain account to use meeting recordings from [Grain](https://grain.com) with Cloudglue APIs.

<Info>
  The OAuth Grain data connector currently supports personal Grain accounts
  only. For workspace-level access, contact the [Cloudglue
  team](mailto:support@cloudglue.dev).
</Info>

## Adding the Grain Data Connector

1. Navigate to the [Data Connectors page](https://app.cloudglue.dev/home/data-connectors) in the Cloudglue app.
2. Click the **Grain** data connector card.
3. Follow the popup to sign in to Grain and authorize Cloudglue (OAuth with PKCE).
4. Verify the connection by checking for the **Connected** indicator on the card.

<Note>
  Ready to set up your Grain data connector? Visit [our
  app](https://app.cloudglue.dev/home/data-connectors) to get started.
</Note>

<Info>
  **Need help setting up your data connector?** Contact our team directly for
  assistance with the setup process.
</Info>

## Using Grain with Cloudglue

To use Grain recordings with Cloudglue, you can use the `grain://recording/` prefix in your Cloudglue API requests.

Example:

```bash theme={null}
grain://recording/00000000-0000-4000-8000-000000000000
```

**Example API Request to get [a multimodal description](/api-reference/endpoint/describe/post) of a recording:**

```bash theme={null}
curl --request POST \
  --url https://api.cloudglue.dev/v1/describe \
  --header 'Authorization: Bearer YOUR_API_KEY' \
  --header 'Content-Type: application/json' \
  --data '{
  "url": "grain://recording/00000000-0000-4000-8000-000000000000",
  "enable_summary": true,
  "enable_speech": true,
  "enable_visual_scene_description": true,
  "enable_scene_text": true
}'
```

When [listing connector files](/api-reference/endpoint/data-connector-files/get) for a Grain connector, optional query parameters such as date range, title search, team, and meeting type follow the [Grain recording filter](https://developers.grain.com/#recording-filter) model.

## Source metadata

When a Grain recording is imported, Cloudglue captures the recording's source
metadata onto the resulting file under `source_metadata`. This includes the
title, participants, teams, meeting type, tags, start/end times, and (when Grain
returns them) the AI summary, action items, calendar event, and HubSpot
associations. The `source_metadata` field is returned on the
[file object](/api-reference/endpoint/files/get-id).

### Sync a recording into a file

[`POST /data-connectors/{id}/sync`](/api-reference/endpoint/data-connectors/sync)
materializes a Grain recording URI into a Cloudglue file — with `source_metadata`
populated — without starting a downstream job. It's idempotent: syncing the same
URI returns the existing file.

```bash theme={null}
curl --request POST \
  --url https://api.cloudglue.dev/v1/data-connectors/YOUR_CONNECTOR_ID/sync \
  --header 'Authorization: Bearer YOUR_API_KEY' \
  --header 'Content-Type: application/json' \
  --data '{
  "url": "grain://recording/00000000-0000-4000-8000-000000000000"
}'
```

### Look up source metadata without importing

[`GET /data-connectors/{id}/source-metadata`](/api-reference/endpoint/data-connectors/source-metadata)
fetches the recording's source metadata directly from Grain without creating a
file — useful for previewing a recording before importing it.

```bash theme={null}
curl --request GET \
  --url 'https://api.cloudglue.dev/v1/data-connectors/YOUR_CONNECTOR_ID/source-metadata?url=grain://recording/00000000-0000-4000-8000-000000000000' \
  --header 'Authorization: Bearer YOUR_API_KEY'
```

## UI Importing for Testing

Use the Cloudglue integration UI to browse Grain recordings and add them to a collection for testing.

To access this flow, visit [our app](https://app.cloudglue.dev/home/data-connectors) and click **Select Videos** on the Grain connector after it shows as connected.

## Managing Access

You maintain full control over your data access. Remove this data connector from the [Data Connectors page](https://app.cloudglue.dev/home/data-connectors).

Once removed:

* You cannot import new recordings into Cloudglue until you reconnect.
* Any recordings you previously imported will remain in Cloudglue. These can be viewed and deleted from [File Management](https://app.cloudglue.dev/home/files).

## Security

Cloudglue connects to Grain using **OAuth** (authorization code with PKCE on the web app, then short-lived access tokens with refresh). You authorize access in Grain; Cloudglue stores tokens scoped to your connector so you can revoke access by disconnecting the connector in Cloudglue and managing or revoking the OAuth client in Grain as needed.

For Grain’s own API behavior, rate limits, and data model details, see the [Grain Public API](https://developers.grain.com/#grain-api).
