---
title: "Get prompt logs"
method: GET
path: "/v1/{organization}/admin/get_prompt_logs/"
tags: ["Admin"]
---

# Get prompt logs

`GET /v1/{organization}/admin/get_prompt_logs/`

Download all rendered prompt logs whose log keys match the supplied prefix that are produced in the past 30 days. Only prefixes corresponding to less than or equal to 1000 prompt logs are allowed.
The 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.

## Path parameters

- `organization` string, required

## Query parameters

- `prompt_log_prefix` string, required — The prefix of the prompt log to retrieve.

## Headers

- `x-mongo-cluster-name` string, nullable — 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.
- `Sec-WebSocket-Protocol` string[]

## Response `200`

Succeeded.

## Other responses

- `401` — Invalid authorization credentials.
- `403` — Missing required permissions.
- `404` — No prompt logs found matching the supplied prefix
- `422` — Invalid request path parameter or query parameter failed validation.
- `429` — The user has exceeded the rate limit of 20 requests per minute for this endpoint.
- `503` — The service is going through temporary maintenance.

---

[API](https://skmtc.net/amigo/apis/amigo-api.md) · [All operations](https://skmtc.net/amigo/apis/amigo-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/amigo/amigo-api/revisions/f0f28319e448/schema)
