Admin

Get prompt logs

get
/v1/{organization}/admin/get_prompt_logs/

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.

Authorizations
Path parameters
organizationstringRequired
Query parameters
prompt_log_prefixstringRequired

The prefix of the prompt log to retrieve.

Header parameters
x-mongo-cluster-nameany ofOptional

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.

stringOptional
or
nullOptional
Sec-WebSocket-Protocolstring[]OptionalDefault: []
Responses
200

Succeeded.

application/json
Responseany
get
/v1/{organization}/admin/get_prompt_logs/
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

Submit a SQL query

post
/v1/{organization}/admin/sql_query

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.

Authorizations
Path parameters
organizationstringRequired
Header parameters
x-mongo-cluster-nameany ofOptional

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.

stringOptional
or
nullOptional
Sec-WebSocket-Protocolstring[]OptionalDefault: []
Body
sql_querystring · min: 1Required

The SQL query to execute.

async_querybooleanRequired

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.

Responses
200

Succeeded.

application/json
post
/v1/{organization}/admin/sql_query
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?