Copilot

List Agents

get

Route for listing AI agents.

Responses
200

Successful Response

application/json
get
GET /copilot/v1/agent/ HTTP/1.1
Host: api.skysql.com/
Accept: */*
200

Successful Response

[
  {
    "context_id": null,
    "created_on": "2025-10-06T10:53:09.495Z",
    "datasource_id": null,
    "description": null,
    "id": "123e4567-e89b-12d3-a456-426614174000",
    "index_status": "INSYNC",
    "name": "text",
    "status": "DEVELOPMENT",
    "type": "SYSTEM"
  }
]

Create Agent

post

Route for creating a new AI agent.

Body

Request for creating a new agent.

context_idstring · uuidRequired
descriptionanyRequired
namestringRequired
Responses
200

Successful Response

application/json
post
POST /copilot/v1/agent/ HTTP/1.1
Host: api.skysql.com/
Content-Type: application/json
Accept: */*
Content-Length: 86

{
  "context_id": "123e4567-e89b-12d3-a456-426614174000",
  "description": null,
  "name": "text"
}
{
  "context_id": null,
  "created_on": "2025-10-06T10:53:09.495Z",
  "datasource_id": null,
  "description": null,
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "index_status": "INSYNC",
  "name": "text",
  "status": "DEVELOPMENT",
  "type": "SYSTEM"
}

Import Agent

post

Import an agent from JSON

Body

Request for importing an agent.

datasource_idstring · uuidRequired
Responses
200

Successful Response

application/json
post
POST /copilot/v1/agent/import HTTP/1.1
Host: api.skysql.com/
Content-Type: application/json
Accept: */*
Content-Length: 267

{
  "data": {
    "context": {
      "description": null,
      "name": "text",
      "tables": [
        {
          "columns": [
            {
              "data_role": null,
              "description": null,
              "name": "text",
              "type": "text"
            }
          ],
          "description": null,
          "name": "text"
        }
      ]
    },
    "description": null,
    "name": "text"
  },
  "datasource_id": "123e4567-e89b-12d3-a456-426614174000"
}
{
  "context_id": null,
  "created_on": "2025-10-06T10:53:09.495Z",
  "datasource_id": null,
  "description": null,
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "index_status": "INSYNC",
  "name": "text",
  "status": "DEVELOPMENT",
  "type": "SYSTEM"
}

Get Agent

get

Route for retrieving an AI agent.

Path parameters
agent_idstring · uuidRequired
Responses
200

Successful Response

application/json
get
GET /copilot/v1/agent/{agent_id} HTTP/1.1
Host: api.skysql.com/
Accept: */*
{
  "context_id": null,
  "created_on": "2025-10-06T10:53:09.495Z",
  "datasource_id": null,
  "description": null,
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "index_status": "INSYNC",
  "name": "text",
  "status": "DEVELOPMENT",
  "type": "SYSTEM"
}

Delete Agent

delete

Route for deleting an AI agent.

Path parameters
agent_idstring · uuidRequired
Responses
200

Successful Response

application/json
Responseany
delete
DELETE /copilot/v1/agent/{agent_id} HTTP/1.1
Host: api.skysql.com/
Accept: */*

No content

Update Agent

patch

Route for updating an AI agent.

Path parameters
agent_idstring · uuidRequired
Body

Request for updating a agent.

context_idanyOptional
descriptionanyOptional
nameanyOptional
statusanyOptional
Responses
200

Successful Response

application/json
patch
PATCH /copilot/v1/agent/{agent_id} HTTP/1.1
Host: api.skysql.com/
Content-Type: application/json
Accept: */*
Content-Length: 64

{
  "context_id": null,
  "description": null,
  "name": null,
  "status": null
}
{
  "context_id": null,
  "created_on": "2025-10-06T10:53:09.495Z",
  "datasource_id": null,
  "description": null,
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "index_status": "INSYNC",
  "name": "text",
  "status": "DEVELOPMENT",
  "type": "SYSTEM"
}

Export Agent

get

Export agent to JSON

Path parameters
agent_idstring · uuidRequired
Responses
200

Successful Response

application/json
get
GET /copilot/v1/agent/{agent_id}/export HTTP/1.1
Host: api.skysql.com/
Accept: */*
{
  "context": {
    "description": null,
    "name": "text",
    "tables": [
      {
        "columns": [
          {
            "data_role": null,
            "description": null,
            "name": "text",
            "type": "text"
          }
        ],
        "description": null,
        "name": "text"
      }
    ]
  },
  "description": null,
  "name": "text"
}

Generate Agent

post

Generate semantics for the agent context based on the description

Path parameters
agent_idstring · uuidRequired
Responses
200

Successful Response

application/json
post
POST /copilot/v1/agent/{agent_id}/generate HTTP/1.1
Host: api.skysql.com/
Accept: */*
{
  "created_on": "2025-10-06T10:53:09.495Z",
  "datasource_id": "123e4567-e89b-12d3-a456-426614174000",
  "description": null,
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "name": "text",
  "tables": [
    {
      "available_columns": [
        {
          "data_role": null,
          "description": null,
          "id": null,
          "name": "text",
          "type": "text"
        }
      ],
      "columns": [
        {
          "data_role": null,
          "description": null,
          "id": null,
          "name": "text",
          "type": "text"
        }
      ],
      "context_id": "123e4567-e89b-12d3-a456-426614174000",
      "created_on": "2025-10-06T10:53:09.495Z",
      "description": null,
      "id": "123e4567-e89b-12d3-a456-426614174000",
      "name": "text"
    }
  ]
}

Rebuild Agent

post

Rebuild agent LLM context

Path parameters
agent_idstring · uuidRequired
Responses
200

Successful Response

application/json
Responseany
post
POST /copilot/v1/agent/{agent_id}/rebuild HTTP/1.1
Host: api.skysql.com/
Accept: */*

No content

Chat

post

Chat with an AI agent

Body

Request for the app chat API.

agent_idstring · uuidRequired
configobject · ConfigOptionalDefault: {}
promptstringRequired
Responses
200

Successful Response

application/json
post
POST /copilot/v1/chat/ HTTP/1.1
Host: api.skysql.com/
Content-Type: application/json
Accept: */*
Content-Length: 79

{
  "agent_id": "123e4567-e89b-12d3-a456-426614174000",
  "config": {},
  "prompt": "text"
}
{
  "prompt": "text",
  "response": {
    "col_keys": [
      "text"
    ],
    "content": null,
    "error_text": "text",
    "sql_text": "text"
  }
}

List Datasources

get

List all datasources.

Responses
200

Successful Response

application/json
get
GET /copilot/v1/data-source/ HTTP/1.1
Host: api.skysql.com/
Accept: */*
200

Successful Response

[
  {
    "host": "text",
    "created_on": "2025-10-06T10:53:09.495Z",
    "id": "123e4567-e89b-12d3-a456-426614174000",
    "name": "text",
    "port": 1,
    "type": "SYSTEM",
    "username": "text"
  }
]

Create Datasource

post

Create a new data source connection.

Body

Request for creating a new data source connection

hoststringRequired
namestringRequired
passwordstringRequired
portintegerRequired
usernamestringRequired
Responses
200

Successful Response

application/json
post
POST /copilot/v1/data-source/ HTTP/1.1
Host: api.skysql.com/
Content-Type: application/json
Accept: */*
Content-Length: 74

{
  "host": "text",
  "name": "text",
  "password": "text",
  "port": 1,
  "username": "text"
}
{
  "host": "text",
  "created_on": "2025-10-06T10:53:09.495Z",
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "name": "text",
  "port": 1,
  "schemas": [
    {
      "name": "text",
      "tables": [
        "text"
      ]
    }
  ],
  "type": "SYSTEM",
  "username": "text"
}

Get Datasource

get

Retrieve a data source connection.

Path parameters
datasource_idstring · uuidRequired
Responses
200

Successful Response

application/json
get
GET /copilot/v1/data-source/{datasource_id} HTTP/1.1
Host: api.skysql.com/
Accept: */*
{
  "host": "text",
  "created_on": "2025-10-06T10:53:09.495Z",
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "name": "text",
  "port": 1,
  "schemas": [
    {
      "name": "text",
      "tables": [
        "text"
      ]
    }
  ],
  "type": "SYSTEM",
  "username": "text"
}

Delete Datasource

delete

Delete a data source connection.

Path parameters
datasource_idstring · uuidRequired
Responses
200

Successful Response

application/json
Responseany
delete
DELETE /copilot/v1/data-source/{datasource_id} HTTP/1.1
Host: api.skysql.com/
Accept: */*

No content

Update Datasource

patch

Update a data source connection.

Path parameters
datasource_idstring · uuidRequired
Body

Request for updating a data source connection

nameanyOptional
passwordanyOptional
usernameanyOptional
Responses
200

Successful Response

application/json
patch
PATCH /copilot/v1/data-source/{datasource_id} HTTP/1.1
Host: api.skysql.com/
Content-Type: application/json
Accept: */*
Content-Length: 45

{
  "name": null,
  "password": null,
  "username": null
}
{
  "host": "text",
  "created_on": "2025-10-06T10:53:09.495Z",
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "name": "text",
  "port": 1,
  "schemas": [
    {
      "name": "text",
      "tables": [
        "text"
      ]
    }
  ],
  "type": "SYSTEM",
  "username": "text"
}

Get Quota

get

Get the current quota usage.

Query parameters
startstringOptional
endstring · date-timeOptional
eventstringOptional
Responses
200

Successful Response

application/json
get
GET /copilot/v1/quota/ HTTP/1.1
Host: api.skysql.com/
Accept: */*
[
  {
    "description": "text",
    "name": "text",
    "unit": "text",
    "usage": 1,
    "value": 1
  }
]

List Sessions

get

Route for chat session management.

Responses
200

Successful Response

application/json
get
GET /copilot/v1/session/ HTTP/1.1
Host: api.skysql.com/
Accept: */*
[
  {
    "agent_config": {},
    "agent_id": null,
    "created_on": "2025-10-06T10:53:09.495Z",
    "id": "123e4567-e89b-12d3-a456-426614174000",
    "summary": null
  }
]

Create Session

post

Route for creating a new chat session.

Body

Request for creating a new session

agent_idstring · uuidRequired
chatanyOptional
Responses
200

Successful Response

application/json
post
POST /copilot/v1/session/ HTTP/1.1
Host: api.skysql.com/
Content-Type: application/json
Accept: */*
Content-Length: 107

{
  "agent_id": "123e4567-e89b-12d3-a456-426614174000",
  "chat": null,
  "config": {
    "ANY_ADDITIONAL_PROPERTY": "text"
  }
}
{
  "agent_config": {},
  "agent_id": null,
  "created_on": "2025-10-06T10:53:09.495Z",
  "entries": [
    {
      "chat": {
        "prompt": "text",
        "response": {
          "col_keys": [
            "text"
          ],
          "content": null,
          "error_text": "text",
          "sql_text": "text"
        }
      },
      "confidence": null,
      "created_on": "2025-10-06T10:53:09.495Z",
      "feedback": null,
      "id": "123e4567-e89b-12d3-a456-426614174000"
    }
  ],
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "summary": null
}

Get Session

get

Retrieve a chat session

Path parameters
session_idstring · uuidRequired
Responses
200

Successful Response

application/json
get
GET /copilot/v1/session/{session_id} HTTP/1.1
Host: api.skysql.com/
Accept: */*
{
  "agent_config": {},
  "agent_id": null,
  "created_on": "2025-10-06T10:53:09.495Z",
  "entries": [
    {
      "chat": {
        "prompt": "text",
        "response": {
          "col_keys": [
            "text"
          ],
          "content": null,
          "error_text": "text",
          "sql_text": "text"
        }
      },
      "confidence": null,
      "created_on": "2025-10-06T10:53:09.495Z",
      "feedback": null,
      "id": "123e4567-e89b-12d3-a456-426614174000"
    }
  ],
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "summary": null
}
Deprecated

Update Session

put

Update a chat session

Path parameters
session_idstring · uuidRequired
Body

Request for chatting with a session

promptstringRequired
Responses
200

Successful Response

application/json
put
PUT /copilot/v1/session/{session_id} HTTP/1.1
Host: api.skysql.com/
Content-Type: application/json
Accept: */*
Content-Length: 17

{
  "prompt": "text"
}
{
  "agent_config": {},
  "agent_id": null,
  "created_on": "2025-10-06T10:53:09.495Z",
  "entries": [
    {
      "chat": {
        "prompt": "text",
        "response": {
          "col_keys": [
            "text"
          ],
          "content": null,
          "error_text": "text",
          "sql_text": "text"
        }
      },
      "confidence": null,
      "created_on": "2025-10-06T10:53:09.495Z",
      "feedback": null,
      "id": "123e4567-e89b-12d3-a456-426614174000"
    }
  ],
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "summary": null
}

Delete Session

delete

Delete a chat session

Path parameters
session_idstring · uuidRequired
Responses
200

Successful Response

application/json
Responseany
delete
DELETE /copilot/v1/session/{session_id} HTTP/1.1
Host: api.skysql.com/
Accept: */*

No content

Add Session Entry

post

Add a chat entry to a session

Path parameters
session_idstring · uuidRequired
Body

Request for chatting with a session

promptstringRequired
Responses
200

Successful Response

application/json
post
POST /copilot/v1/session/{session_id}/entry HTTP/1.1
Host: api.skysql.com/
Content-Type: application/json
Accept: */*
Content-Length: 17

{
  "prompt": "text"
}
{
  "chat": {
    "prompt": "text",
    "response": {
      "col_keys": [
        "text"
      ],
      "content": null,
      "error_text": "text",
      "sql_text": "text"
    }
  },
  "confidence": null,
  "created_on": "2025-10-06T10:53:09.495Z",
  "feedback": null,
  "id": "123e4567-e89b-12d3-a456-426614174000"
}

Delete Session Entry

delete

Delete all chat entries from a session

Path parameters
session_idstring · uuidRequired
Responses
200

Successful Response

application/json
Responseany
delete
DELETE /copilot/v1/session/{session_id}/entry HTTP/1.1
Host: api.skysql.com/
Accept: */*

No content

Patch Session Entry

patch

Patch a chat entry in a session

Path parameters
session_idstring · uuidRequired
entry_idstring · uuidRequired
Body

Request for patching a session entry

chatanyOptional
feedbackanyOptional
Responses
200

Successful Response

application/json
patch
PATCH /copilot/v1/session/{session_id}/entry/{entry_id} HTTP/1.1
Host: api.skysql.com/
Content-Type: application/json
Accept: */*
Content-Length: 29

{
  "chat": null,
  "feedback": null
}
{
  "chat": {
    "prompt": "text",
    "response": {
      "col_keys": [
        "text"
      ],
      "content": null,
      "error_text": "text",
      "sql_text": "text"
    }
  },
  "confidence": null,
  "created_on": "2025-10-06T10:53:09.495Z",
  "feedback": null,
  "id": "123e4567-e89b-12d3-a456-426614174000"
}

Was this helpful?