logo
Development
検索
データベーステーブルの作成

データベーステーブルの作成

このAPIを使用するとエージェント用の新しいデータベーステーブルとそのフィールドを作成できます。

リクエストメソッド

POST

エンドポイント

https://api-${endpoint}.gptbots.ai/v1/database/create-table

認証

認証方法の説明についてはAPI Overviewをご参照ください。

リクエスト

リクエスト例

curl -X POST 'https://api-${endpoint}.gptbots.ai/v1/database/create-table' \ -H 'Authorization: Bearer ${API Key}' \ -H 'Content-Type: application/json' \ -d '{ "name": "test_api", "description": "Test all database APIs", "fields": [ { "name": "id", "description": "id", "type": "TEXT", "required": true, "unique": true }, { "name": "boolean", "description": "boolean", "type": "BOOLEAN", "required": true, "unique": false }, { "name": "int", "description": "int", "type": "INT", "required": true, "unique": true }, { "name": "datetime", "description": "datetime", "type": "DATETIME", "required": true, "unique": false }, { "name": "float", "description": "float", "type": "FLOAT", "required": false, "unique": false } ] }'
                      
                      curl -X POST 'https://api-${endpoint}.gptbots.ai/v1/database/create-table' \
-H 'Authorization: Bearer ${API Key}' \
-H 'Content-Type: application/json' \
-d '{
    "name": "test_api",
    "description": "Test all database APIs",
    "fields": [
        {
            "name": "id",
            "description": "id",
            "type": "TEXT",
            "required": true,
            "unique": true
        },
        {
            "name": "boolean",
            "description": "boolean",
            "type": "BOOLEAN",
            "required": true,
            "unique": false
        },
        {
            "name": "int",
            "description": "int",
            "type": "INT",
            "required": true,
            "unique": true
        },
        {
            "name": "datetime",
            "description": "datetime",
            "type": "DATETIME",
            "required": true,
            "unique": false
        },
        {
            "name": "float",
            "description": "float",
            "type": "FLOAT",
            "required": false,
            "unique": false
        }
    ]
}'

                    
このコードブロックをポップアップで表示

リクエストヘッダー

フィールド タイプ 説明
Authorization Bearer ${API Key} 認証には Authorization: Bearer ${API Key} を使用してください。トークンはAPIキーページから取得できます。
Content-Type application/json データ形式は application/json を指定してください。

リクエストボディ

フィールド タイプ 必須 説明
name String 必須 テーブル名:32文字以内、小文字アルファベット・数字・アンダースコアを使用し、英字で始める必要があります。
description String 必須 テーブルの説明:128文字以内。LLMがテーブルのデータ構造を理解するための補助情報です。
fields Array 必須 テーブルフィールドの配列
fields[].name String 必須 フィールド名:32文字以内、小文字アルファベット・数字・アンダースコアが使用可能です。
fields[].description String 必須 フィールドの説明:128文字以内。LLMがフィールドの意味や構造を理解するための補助情報です。
fields[].type String 必須 データ型:TEXT/INT/FLOAT/DATETIME/BOOLEANのいずれか。
fields[].required Boolean 任意 必須入力項目:true/false
fields[].unique Boolean 任意 一意制約(Unique: true)