> For the complete documentation index, see [llms.txt](https://api-docs.helloaviary.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://api-docs.helloaviary.ai/output.md).

# Output

Return CSV-shaped JSON for a given client/use-case or call id. Served from `/getOutputFile` and `/getOutputFileByCallID`.

## Get Output File

> Returns the results as CSV data.\
> By default the export covers “today.” Pass \`callAttemptDate\` (YYYY-MM-DD) to export a specific day instead.\
> \*\*Disclaimer:\*\* “Today” is evaluated in \*\*UTC\*\*. The date rolls over at midnight UTC (\~8 PM Eastern during EDT, \~7 PM during EST), so US Eastern “evening” may already fall on the next API calendar date—use \`callAttemptDate\` for a fixed civil day.<br>

```json
{"openapi":"3.0.3","info":{"title":"Aviary v1 API (merged — Osprey v1 + legacy clientApi)","version":"1.0.0"},"tags":[{"name":"Output","description":"Return CSV-shaped JSON for a given client/use-case\nor call id. Served from `/getOutputFile` and\n`/getOutputFileByCallID`.\n"}],"servers":[{"url":"https://osprey.helloaviary.com/api","description":"Production"},{"url":"https://osprey-dev.helloaviary.com/api","description":"Development"}],"security":[{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"X-Api-Key","description":"API key for authentication"}},"schemas":{"GetOutputFileResponse":{"type":"object","required":["message","csvData"],"properties":{"message":{"type":"string"},"csvData":{"type":"array","items":{"type":"object","additionalProperties":{"type":"string"}},"description":"Array of objects where each object represents a row of data with column names as keys"}}},"ErrorResponse":{"type":"object","required":["message"],"description":"Legacy clientApi error shape. Distinct from `ErrorEnvelope` —\nthe legacy routes return a flat `{message, error?}` payload\nwithout a stable code or request_id.\n","properties":{"message":{"type":"string","description":"Error message"},"error":{"type":"string","description":"Detailed error information"}}}}},"paths":{"/getOutputFile":{"get":{"summary":"Get Output File","description":"Returns the results as CSV data.\nBy default the export covers “today.” Pass `callAttemptDate` (YYYY-MM-DD) to export a specific day instead.\n**Disclaimer:** “Today” is evaluated in **UTC**. The date rolls over at midnight UTC (~8 PM Eastern during EDT, ~7 PM during EST), so US Eastern “evening” may already fall on the next API calendar date—use `callAttemptDate` for a fixed civil day.\n","operationId":"getOutputFile","tags":["Output"],"parameters":[{"name":"clientName","in":"query","description":"The name of the client (case-insensitive, partial match supported)","required":true,"schema":{"type":"string"}},{"name":"useCaseName","in":"query","description":"The name of the use case (case-insensitive, partial match supported)","required":true,"schema":{"type":"string"}},{"name":"callAttemptDate","in":"query","required":false,"description":"If set, must be `YYYY-MM-DD`. Filters the export to calls with that `call_attempt_date`.\nIf omitted, the export uses the current day (UTC).\n","schema":{"type":"string","format":"date"}}],"requestBody":{"description":"Optional request body (not currently used)","required":false,"content":{"application/json":{"schema":{"type":"object"}}}},"responses":{"200":{"description":"SQL executed successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetOutputFileResponse"}}}},"400":{"description":"Bad request - missing parameters or invalid configuration","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Use case not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

## Get Output File By Call ID

> Executes a custom SQL query stored in Azure Blob Storage filtered by a specific call ID and returns the results as CSV data. The SQL query is automatically modified to include \`WHERE c.id = callID\` (or \`AND c.id = callID\` if a WHERE clause already exists).

```json
{"openapi":"3.0.3","info":{"title":"Aviary v1 API (merged — Osprey v1 + legacy clientApi)","version":"1.0.0"},"tags":[{"name":"Output","description":"Return CSV-shaped JSON for a given client/use-case\nor call id. Served from `/getOutputFile` and\n`/getOutputFileByCallID`.\n"}],"servers":[{"url":"https://osprey.helloaviary.com/api","description":"Production"},{"url":"https://osprey-dev.helloaviary.com/api","description":"Development"}],"security":[{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"X-Api-Key","description":"API key for authentication"}},"schemas":{"GetOutputFileResponse":{"type":"object","required":["message","csvData"],"properties":{"message":{"type":"string"},"csvData":{"type":"array","items":{"type":"object","additionalProperties":{"type":"string"}},"description":"Array of objects where each object represents a row of data with column names as keys"}}},"ErrorResponse":{"type":"object","required":["message"],"description":"Legacy clientApi error shape. Distinct from `ErrorEnvelope` —\nthe legacy routes return a flat `{message, error?}` payload\nwithout a stable code or request_id.\n","properties":{"message":{"type":"string","description":"Error message"},"error":{"type":"string","description":"Detailed error information"}}}}},"paths":{"/getOutputFileByCallID":{"get":{"summary":"Get Output File By Call ID","description":"Executes a custom SQL query stored in Azure Blob Storage filtered by a specific call ID and returns the results as CSV data. The SQL query is automatically modified to include `WHERE c.id = callID` (or `AND c.id = callID` if a WHERE clause already exists).","operationId":"getOutputFileByCallID","tags":["Output"],"parameters":[{"name":"callID","in":"query","description":"The unique identifier of the call","required":true,"schema":{"type":"integer","format":"int64"}}],"responses":{"200":{"description":"SQL executed successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetOutputFileResponse"}}}},"400":{"description":"Bad request - missing parameters or invalid configuration","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Call or use case not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://api-docs.helloaviary.ai/output.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
