データベースの REST API
外部システムからデータベースの行を読み書きできます。認証は他の API と同じく X-API-Key ヘッダーです(→ API の概要)。
テーブルごとの API リファレンス
Section titled “テーブルごとの API リファレンス”行の API は、テーブルのフィールド定義に合わせてリクエスト・レスポンスの形が変わります。そのため テーブルごとのリファレンス を画面から確認できます。
テーブルの詳細画面 →「REST API ドキュメント」タブ
OpenAPI 仕様そのものを取得することもできます(こちらはテーブルID のみ指定できます)。
GET /api/tables/{tableId}/openapiテーブルの指定方法
Section titled “テーブルの指定方法”行の API の URL の {tableIdOrCode} には、テーブルID(UUID)と テーブルコード のどちらでも指定できます。テーブルコードは「基本情報」タブで設定します。→ テーブルとフィールドを設計する
curl https://api.synqlet.com/api/tables/customers/rows \ -H "X-API-Key: sk_synqlet_..."エンドポイント
Section titled “エンドポイント”テーブルの詳細画面 →「REST API ドキュメント」タブで確認してください
テーブル自体の管理(/api/tables の一覧・作成・更新・削除)は APIリファレンス を参照してください。
{ "id": "019e8310-1f6c-7f1e-9f18-2a17b0d1a111", "createdAt": "2026-07-30T02:11:43.123Z", "updatedAt": "2026-07-30T02:11:43.123Z", "createdBy": "0197bfe7-85da-7de7-b884-45c269f182b1", "updatedBy": "0197bfe7-85da-7de7-b884-45c269f182b1", "values": { "name": "株式会社サンプル", "score": 80, "closedAt": null }}日時は ISO 8601 形式の文字列、日付は 2026-07-30、時刻は 12:34:56、年月は 2026-07 の形式です。
一覧取得(フィルター・並び替え・ページング)
Section titled “一覧取得(フィルター・並び替え・ページング)”GET /api/tables/{tableIdOrCode}/rows のクエリパラメータです。
| パラメータ | 説明 |
|---|---|
pageSize | 1ページの件数(1〜200、既定 50) |
filter | 絞り込み条件(JSON 文字列) |
sort | 並び替え(JSON 文字列) |
cursor | 次ページの位置。レスポンスの nextUrl に含まれます |
レスポンスは data(行の配列)と nextUrl(次ページのURL。無ければ null)です。Link: <...>; rel="next" ヘッダーにも同じURLが入ります。
{ "data": [{ "id": "...", "values": { "name": "株式会社サンプル" } }], "nextUrl": "https://api.synqlet.com/api/tables/customers/rows?pageSize=50&cursor=..."}filter
Section titled “filter”filter には JSON を URL エンコードして渡します。
{ "values": { "name": { "_contains": "サンプル" }, "score": { "_gte": 50 } }, "createdAt": { "_gte": "2026-07-01T00:00:00Z" }}指定できる演算子(_eq / _gt / _gte / _lt / _lte / _contains / _startsWith / _endsWith / _isNull)と、_and / _or / _not の組み合わせはスクリプトから使う場合と同じです。→ フィルター
curl -G https://api.synqlet.com/api/tables/customers/rows \ -H "X-API-Key: sk_synqlet_..." \ --data-urlencode 'filter={"values":{"status":{"_eq":"active"}}}' \ --data-urlencode 'sort=[{"createdAt":{"direction":"desc","nulls":"nullsLast"}}]'sort は条件の配列です。1件につき1項目を指定し、direction(asc / desc)と nulls(nullsFirst / nullsLast)を必ず指定します。配列の先頭が優先されます。
作成(POST /rows)では values を指定します。id を省略すると自動で割り振られます。options.upsert を true にすると、同じIDの行が既にある場合は更新します(既定はエラー)。
curl -X POST https://api.synqlet.com/api/tables/customers/rows \ -H "X-API-Key: sk_synqlet_..." \ -H "Content-Type: application/json" \ -d '{"id":"customer-001","values":{"name":"株式会社サンプル","status":"active"},"options":{"upsert":true}}'更新(PATCH /rows/{rowId})は部分更新です。指定しなかったフィールドは変更されません。値を空にするには null を指定します(必須フィールドは null にできません)。
curl -X PATCH https://api.synqlet.com/api/tables/customers/rows/customer-001 \ -H "X-API-Key: sk_synqlet_..." \ -H "Content-Type: application/json" \ -d '{"values":{"status":"archived"}}'一括作成・更新は rows-bulk に data の配列を渡します。
{ "data": [{ "id": "customer-001", "values": { "status": "archived" } }] }一括削除は DELETE /rows-bulk に ids を渡します。
{ "ids": ["customer-001", "customer-002"] }ファイルを添付する
Section titled “ファイルを添付する”ファイル型フィールドには、次の手順でファイルを添付します。
-
アップロードURLを発行する
Terminal window curl -X POST https://api.synqlet.com/api/tables/customers/rows/customer-001/file-upload-url \-H "X-API-Key: sk_synqlet_..." \-H "Content-Type: application/json" \-d '{"count":1}'dataに{ "id": "...", "url": "..." }がcount件返ります(1回で最大50件)。 -
返ってきた
urlにファイル本体をPUTするTerminal window curl -X PUT "<発行されたURL>" \-H "Content-Type: text/csv" \--data-binary @report.csv -
行の作成 / 更新でファイル情報を指定する
{"values": {"attachment": { "id": "<発行されたID>", "name": "report.csv" }}}
行に紐づけられなかったファイルは、あとで自動的に削除されます。
取得時のファイル型フィールドの値には、ファイル名・MIMEタイプ・サイズと、1時間だけ有効なダウンロード用URL が入ります。