Admin
Download all rendered prompt logs whose log keys match the supplied prefix. Up to a 1000 prompt logs will be returned in a zip file format, with each prompt log corresponding to at most 2 files -- {log_key}-system
for the rendered system prompt, and {log_key}-history
for the rendered history prompts, where each history prompt is separated by ---
.
If an error is encountered during the download stream that is scoped to an individual prompt log, a {log_key}-error
file will be generated which contains a description of the error. If an error is encountered that causes the generation to stop completely, no error message will be returned. Instead, the stream will end, and the transmitted bytes wouldn't constitute a valid zip file.
Permissions
This endpoint may be impacted by the following permissions:
Each prompt log requires its own set of permissions. If the authenticated user does not have the required permissions, a
{log_key}-error
file will be generated in place of the actual prompt log.
The prefix of the prompt log to retrieve.
The Mongo cluster name to perform this request in. This is usually not needed unless the organization does not exist yet in the Amigo organization infra config database.
[]
Succeeded.
Invalid authorization credentials.
Missing required permissions.
No prompt logs found matching the supplied prefix
Invalid request path parameter or query parameter failed validation.
The user has exceeded the rate limit of 20 requests per minute for this endpoint.
The service is going through temporary maintenance.
GET /v1/{organization}/admin/get_prompt_logs/?prompt_log_prefix=text HTTP/1.1
Host: api.amigo.ai
Authorization: Bearer YOUR_SECRET_TOKEN
X-ORG-ID: YOUR_API_KEY
Accept: */*
No content
Execute a read-only SQL query on Amigo's databases for the specified organization.
Permissions
This endpoint requires the authenticated user to have greater privileges than the DefaultAdministratorRole
.
The Mongo cluster name to perform this request in. This is usually not needed unless the organization does not exist yet in the Amigo organization infra config database.
[]
The SQL query to execute.
Whether the query is asynchronous. If true, a signed URL will be returned to download the results once the query is complete. If false, the results will be returned in the response, but at most 1000 rows will be returned, and the query is subject to a 30 second execution timeout.
Succeeded.
This endpoint is not supported in the current environment, or the SQL query is invalid.
Invalid authorization credentials.
Missing required permissions.
The specified organization does not exist.
The supplied query cannot be executed within the time limit.
Invalid request path parameter or request body failed validation.
The user has exceeded the rate limit of 6 requests per minute for this endpoint.
The service is going through temporary maintenance.
POST /v1/{organization}/admin/sql_query HTTP/1.1
Host: api.amigo.ai
Authorization: Bearer YOUR_SECRET_TOKEN
X-ORG-ID: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 39
{
"sql_query": "text",
"async_query": true
}
{
"execution_time_ms": 1,
"result": [
[]
],
"truncated": true,
"columns": [
{
"name": "text",
"type": "text"
}
]
}
Last updated
Was this helpful?