The Prompt API allows you to manage prompts that are used to generate SQL queries and natural language responses. This API provides endpoints for creating, retrieving, updating, and deleting prompts.
POST /api/v1/prompts
Content-Type: application/json
{
"text": "Generate a sales report for the last month",
"db_connection_id": "db123",
"schemas": ["public"],
"context": [{"user": "admin"}],
"metadata": {"created_by": "admin"}
}
{
"id": "prompt123",
"text": "Generate a sales report for the last month",
"db_connection_id": "db123",
"schemas": ["public"],
"context": [{"user": "admin"}],
"metadata": {"created_by": "admin"},
"created_at": "2024-09-09T12:34:56Z"
}
GET /api/v1/prompts
[
{
"id": "prompt123",
"text": "Generate a sales report for the last month",
"db_connection_id": "db123",
"schemas": ["public"],
"context": [{"user": "admin"}],
"metadata": {"created_by": "admin"},
"created_at": "2024-09-09T12:34:56Z"
}
]
GET /api/v1/prompts/prompt123
{
"id": "prompt123",
"text": "Generate a sales report for the last month",
"db_connection_id": "db123",
"schemas": ["public"],
"context": [{"user": "admin"}],
"metadata": {"created_by": "admin"},
"created_at": "2024-09-09T12:34:56Z"
}
PUT /api/v1/prompts/prompt123
Content-Type: application/json
{
"text": "Generate a detailed sales report for the last quarter",
"db_connection_id": "db123",
"schemas": ["public"],
"context": [{"user": "admin"}],
"metadata": {"updated_by": "admin"}
}
{
"id": "prompt123",
"text": "Generate a detailed sales report for the last quarter",
"db_connection_id": "db123",
"schemas": ["public"],
"context": [{"user": "admin"}],
"metadata": {"updated_by": "admin"},
"created_at": "2024-09-09T12:34:56Z"
}
DELETE /api/v1/prompts/prompt123
{
"id": "prompt123",
"text": "Generate a detailed sales report for the last quarter",
"db_connection_id": "db123",
"schemas": ["public"],
"context": [{"user": "admin"}],
"metadata": {"updated_by": "admin"},
"created_at": "2024-09-09T12:34:56Z"
}