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

> ## Agent Instructions
> Conare's API is at https://api.conare.ai. Authenticate with `Authorization: Bearer $CONARE_API_KEY`.
> The full OpenAPI spec is at https://api.conare.ai/openapi.yaml; each endpoint has a page under /api-reference, and appending .md to any page URL returns its Markdown.
> Embed with model conare-embed-1; send input_type "query" for search queries. Rerank with conare-rerank-1.
> Prefer the TypeScript SDK (`npm install conare`) or plain HTTP in examples.
> Install the Conare skill with `npx skills add https://docs.conare.ai`; search these docs over MCP at https://docs.conare.ai/mcp; the whole site is at https://docs.conare.ai/llms-full.txt.

# ソース

> HubSpot、Gmail、GitHub などのアプリをネームスペースに接続します。各ソースの取得、一覧表示、即時同期、同期間隔の変更、切断を行えます。

ソースはアプリを 1 つのネームスペースに同期します。新規・変更されたレコードは書き込まれ、削除されたレコードは削除されます。ソースには Full access の[キー](https://docs.conare.ai/ja/console.md#キー)が必要です。バケットについては [Google Cloud Storage](https://docs.conare.ai/ja/gcs.md) を参照してください。

## ソースを接続する

`POST /sources`

```bash curl theme={null}
curl https://api.conare.ai/sources \
  -H "Authorization: Bearer $CONARE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"type": "hubspot", "namespace": "crm", "redirect_url": "https://yourapp.com/settings"}'
```

```ts TypeScript theme={null}
const { source, connectUrl } = await conare.sources.connect({
  type: "hubspot",
  namespace: "crm",
  redirectUrl: "https://yourapp.com/settings",
});
```

```json Response theme={null}
{
  "source": {
    "id": "src_1cff2c6ea888bbc8343b6e38",
    "type": "hubspot",
    "name": "HubSpot",
    "namespace": "crm",
    "status": "connecting",
    "error": null,
    "documents": 0,
    "last_synced_at": null,
    "created_at": "2026-10-21T21:40:39.704618Z",
    "sync_interval_s": null,
    "sync_interval_auto": true,
    "next_sync_at": null,
    "cost": { "rows_billed": true, "usd_per_million_rows": 100, "options": [ ... ] }
  },
  "connect_url": "https://..."
}
```

アプリの所有者を `connect_url`(7 日間有効)に案内してください。所有者が接続すると最初の同期が始まります。

| オプション | 型 | 内容 |
| - | - | - |
| `type` | string、必須 | [一覧](#アプリを一覧表示する)にあるアプリ |
| `namespace` | string、必須 | 同期先のネームスペース |
| `name` | string | 表示名(最大 100 文字) |
| `redirect_url` | string | 接続後にユーザーを送る先 |
| `sync_interval_s` | integer | 同期間隔の秒数。300〜2,592,000(30 日)。省略すると Conare が選びます |
| `config` | object | キーで接続するアプリ(Twenty、Granola、GitHub)用。`api_key` と、セルフホストの Twenty では `base_url` を指定します。これらはすぐに同期され、`connect_url` はありません |

ユーザーのアプリを接続するには、`user-42` のようにユーザーごとにネームスペースを割り当てます。完全なスキーマ: [ソースを接続する](https://docs.conare.ai/ja/api-reference/sources/connect-a-source.md)。

## 同期されたドキュメント

| | |
| - | - |
| ID | `<source id>:<schema>:<record key>` |
| メタデータ | `source`、`source_id`、`schema`、`title`。レコードにあれば `url`、`author`、`created_at`、`updated_at` も含みます |
| 1 つのソースを検索 | `source_id` で[フィルター](https://docs.conare.ai/ja/filters.md) |

## ソースを取得する

`GET /sources/:id`

```bash curl theme={null}
curl https://api.conare.ai/sources/src_1cff2c6ea888bbc8343b6e38 \
  -H "Authorization: Bearer $CONARE_API_KEY"
```

| フィールド | 意味 |
| - | - |
| `id`, `type`, `name`, `namespace` | 接続時の値 |
| `status` | `connecting`(サインイン待ち)、`syncing`、`ready`、`error` のいずれか |
| `error` | 失敗した内容、または `null` |
| `documents` | 同期済みのドキュメント数 |
| `progress` | 同期中の、これまでの `records_pulled` |
| `created_at`, `last_synced_at`, `next_sync_at` | 接続日時、最終同期日時、次回同期日時 |
| `sync_interval_s`, `sync_interval_auto` | 同期間隔の秒数と、Conare が選ぶかどうか |
| `cost` | 同期で読み取る内容と、各同期頻度の月額コスト |

完全なスキーマ: [ソースを取得する](https://docs.conare.ai/ja/api-reference/sources/get-a-source.md)。

## ソースを一覧表示する

`GET /sources`

`sources` を返し、各要素は Get と同じ形式です。`files` や `gcs` など `kind` を持つソースには、代わりに `sync` オブジェクトがあります。

| オプション | 型 | 内容 |
| - | - | - |
| `namespace`, `user`, `type` | string | フィールドが値と一致するソースのみ。例: `?namespace=crm&type=hubspot` |

完全なスキーマ: [ソースを一覧表示する](https://docs.conare.ai/ja/api-reference/sources/list-sources.md)。

## 今すぐ同期する

`POST /sources/:id/sync`

数秒以内に同期を開始し、ソースを返します。まだ `connecting` のソースは `409 conflict` を返します。

| オプション | 型 | 内容 |
| - | - | - |
| `full` | boolean、デフォルト `false` | 変更分だけでなくすべてを再度読み取ります(Gmail、Twenty、Granola、GitHub)。Gmail のフル同期は初回同期と同様に課金され、`resync` にそう示されます |

完全なスキーマ: [ソースを今すぐ同期する](https://docs.conare.ai/ja/api-reference/sources/sync-a-source-now.md)。

## 同期間隔を変更する

`PATCH /sources/:id`

| オプション | 型 | 内容 |
| - | - | - |
| `sync_interval_s` | integer または null | 300〜2,592,000 秒。`null` にすると Conare が選びます |

ソースを返します。完全なスキーマ: [ソースの同期頻度を設定する](https://docs.conare.ai/ja/api-reference/sources/set-how-often-a-source-syncs.md)。

## ソースを切断する

`DELETE /sources/:id`

同期を停止し、`{ "deleted": true }` を返します。

| オプション | 型 | 内容 |
| - | - | - |
| `delete_documents` | boolean、デフォルト `false` | 同期したドキュメントも削除します |

完全なスキーマ: [ソースを切断する](https://docs.conare.ai/ja/api-reference/sources/disconnect-a-source.md)。

## アプリを一覧表示する

`GET /sources/types`

```json Response theme={null}
{
  "types": [
    { "type": "affinity", "name": "Affinity", "logo_url": "https://..." },
    { "type": "airtable", "name": "Airtable", "logo_url": "https://..." }
  ]
}
```

* 各要素には接続用の `type`、`name`、`logo_url` があり、`config` で接続するアプリには `auth: "api_key"` があります。
* 一部のアプリしか一覧にできなかった場合、`partial` は `true` になります。後で再試行してください。

完全なスキーマ: [ソースの種類を一覧表示する](https://docs.conare.ai/ja/api-reference/sources/list-source-types.md)。


## Related topics

- [コンソール](https://docs.conare.ai/ja/console.md)
- [ネームスペース](https://docs.conare.ai/ja/namespaces.md)
- [TypeScript SDK](https://docs.conare.ai/ja/sdk.md)
- [Google Cloud Storage](https://docs.conare.ai/ja/gcs.md)
- [クイックスタート](https://docs.conare.ai/ja/quickstart.md)


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