> ## Documentation Index
> Fetch the complete documentation index at: https://slatehq.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Run Details

> Retrieve the full AI response, metrics, and context for a completed query run.

Returns the complete details of a query run, including the raw AI response and computed metrics. Use this after a run reaches `SUCCESS` status to see what the AI platform returned. If the run's AI response isn't stored yet, the endpoint returns `404`.

## Parameters

**id** `number` *required*

Unique identifier for the query run.

**Authorization** `string` *required*

Bearer token. Format: `Bearer slat_<your-token>`.

## Response

Returns `200 OK` with the run summary, AI response, and metrics.

**queryRun** `object` *required*

Summary of the query run with prompt and topic context.

**query run summary**

**id** `number` *required*

Query run ID.

**platform** `string` *required*

AI platform used.

**status** `string`

Run status. One of: `IN_PROGRESS`, `RETRYING`, `SUCCESS`, `FAILED`, `TIMEOUT`, or `null`.

**completedAt** `string`

Completion timestamp. ISO 8601 format.

**promptText** `string` *required*

The prompt text that was queried.

**topicName** `string` *required*

Name of the associated topic.

**active** `boolean` *required*

Whether the prompt is currently active.

**location** `string`

Country code filter used for the run.

**errorMessage** `string`

Error details if the run failed.

**aiResponse** `object`

The raw response from the AI platform. Structure varies by platform.

**metrics** `object[]`

One entry per brand or competitor mentioned in the response, ordered by where it first appears. Empty if no entities were found. `null` if metrics couldn't be loaded.

**metric object**

**entityName** `string` *required*

Brand or competitor name.

**entityType** `string` *required*

One of: `BRAND`, `COMPETITOR`, `OTHER`.

**brandMentions** `integer` *required*

Always `1`. Each entity is counted once per run.

**position** `integer` *required*

Order of first appearance in the response. `1` is the first entity mentioned.

**visibility** `integer` *required*

Visibility score for this run: `110 - 10 × position` for positions 1–10, otherwise `0`.

**shareOfVoice** `number` *required*

`100` divided by the number of entities in the response, rounded to two decimals.

## Example

```bash cURL theme={null}
curl -s "https://api.slatehq.ai/ai-analytics-service/api/public/v1/query-runs/2048/details" \
  -H "Authorization: Bearer slat_YOUR_TOKEN"
```

```python Python theme={null}
import requests

response = requests.get(
    "https://api.slatehq.ai/ai-analytics-service/api/public/v1/query-runs/2048/details",
    headers={
        "Authorization": "Bearer slat_YOUR_TOKEN",
    },
)
details = response.json()
print(details["queryRun"]["promptText"])
print(details["queryRun"]["status"])
```

```javascript JavaScript theme={null}
const response = await fetch(
  "https://api.slatehq.ai/ai-analytics-service/api/public/v1/query-runs/2048/details",
  {
    headers: {
      "Authorization": "Bearer slat_YOUR_TOKEN",
    },
  }
);
const details = await response.json();
console.log(details.queryRun.promptText);
console.log(details.queryRun.status);
```

### Response

```json theme={null}
{
  "queryRun": {
    "id": 2048,
    "platform": "CHATGPT",
    "status": "SUCCESS",
    "completedAt": "2026-02-11T14:31:15Z",
    "promptText": "What is the best project management tool for remote teams?",
    "topicName": "Project Management Tools",
    "active": true,
    "location": "US",
    "errorMessage": null
  },
  "aiResponse": {
    "text": "Based on my analysis, the top project management tools for remote teams include...",
    "citations": [
      "https://example.com/pm-tools-comparison"
    ]
  },
  "metrics": [
    {
      "entityName": "Asana",
      "entityType": "COMPETITOR",
      "brandMentions": 1,
      "position": 1,
      "visibility": 100,
      "shareOfVoice": 33.33
    },
    {
      "entityName": "MyBrand",
      "entityType": "BRAND",
      "brandMentions": 1,
      "position": 2,
      "visibility": 90,
      "shareOfVoice": 33.33
    },
    {
      "entityName": "Jira",
      "entityType": "COMPETITOR",
      "brandMentions": 1,
      "position": 3,
      "visibility": 80,
      "shareOfVoice": 33.33
    }
  ]
}
```

> [!NOTE]
>
> The `aiResponse` structure varies by AI platform. The example above is illustrative — the actual shape depends on the platform's response format.

## Status codes

| Status | Description |
| - | - |
| `200` | Run details returned. |
| `400` | The run ID is invalid (`invalid run id`). |
| `401` | Missing or invalid Bearer token. See [Authentication](https://slatehq.com/docs/api-reference/authentication.md). |
| `403` | A `workspaceId` query parameter doesn't match the token's workspace. |
| `404` | Query run not found (the ID doesn't exist or doesn't belong to this workspace), or the run's AI response isn't available yet (`run payload not found`). |
| `500` | Internal server error. |

## What's next

* [Get Trends](https://slatehq.com/docs/api-reference/aeo-tracker/analytics/get-trends.md) — View visibility trends over time.
* [Get Metrics](https://slatehq.com/docs/api-reference/aeo-tracker/analytics/get-metrics.md) — Get aggregated performance metrics.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.