# Get a Genie conversation

> One conversation: its messages and the customer-visible steps the Genie took. Internal steps and raw prompts are never returned.

Source: https://docs.stacksync.com/api-reference/genies/conversations/get_genie_conversation

`GET https://api.stacksync.com/v1/workspaces/{workspace_id}/genies/conversations/{genie_conversation_id}`

- Operation: `get_genie_conversation`
- Resource: Genie conversations
- Access: read-only

## Authentication

- `Authorization: Bearer <key>`: A workspace API key (workspace_…, created by a workspace owner under Workspace settings > Stacksync API) acts with editor rights on that workspace only; a user API key (user_…, created under Profile > Stacksync API) acts as that user in every workspace they belong to. POST, PUT and PATCH requests must send Content-Type: application/json. Every authentication failure answers 403.

## Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `workspace_id` | integer | Yes | The workspace. List the ones your key can reach with GET /v1/workspaces. |
| `genie_conversation_id` | string (uuid) | Yes | The Genie conversation. |

## Query parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `region` | string (besg \| usnv) | Yes | Region of the genie: besg (Europe) or usnv (United States) |

## Returns

### 200 OK

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `conversation_id` | string | Yes |  |
| `region` | string (besg \| usnv) | Yes |  |
| `messages` | array of object (GenieMessage) | Yes |  |
| `messages[].message_id` | string | Yes |  |
| `messages[].created_time` | string \| null | No |  |
| `messages[].channel` | string \| null | No |  |
| `messages[].sender_role` | string \| null | No | customer or genie |
| `messages[].sender_name` | string \| null | No |  |
| `messages[].body` | string \| null | No |  |
| `messages[].attachments` | array of object (GenieMessageAttachment) | No |  |
| `messages[].attachments[].name` | string | Yes |  |
| `messages[].attachments[].mime_type` | string \| null | No |  |
| `messages[].attachments[].size_bytes` | integer \| null | No |  |
| `messages[].attachments[].file_id` | string \| null | No | The workspace file, once stored |
| `messages[].approval` | object (GenieApproval) \| null | No |  |
| `messages[].approval.approval_id` | string | Yes |  |
| `messages[].approval.status` | string \| null | No |  |
| `messages[].approval.module_id` | string \| null | No |  |
| `messages[].approval.module_name` | string \| null | No |  |
| `messages[].approval.channel_type` | string \| null | No |  |
| `messages[].approval.target` | string \| null | No |  |
| `messages[].approval.instructions` | string \| null | No |  |
| `messages[].approval.requested_at` | string \| null | No |  |
| `messages[].approval.decision_at` | string \| null | No |  |
| `messages[].approval.approver_name` | string \| null | No |  |
| `steps` | array of object (GenieStep) | Yes |  |
| `steps[].description` | string \| null | No |  |
| `steps[].execution_status` | string \| null | No |  |
| `steps[].error_message` | string \| null | No |  |
| `steps[].log_type` | string \| null | No |  |
| `steps[].execution_log_id` | string \| null | No | Open the tool run with the tool-executions route |
| `steps[].started_time` | string \| null | No |  |
| `steps[].finished_time` | string \| null | No |  |
| `steps[].duration_ms` | integer \| null | No |  |

## Example request

```bash
curl -X GET "https://api.stacksync.com/v1/workspaces/{workspace_id}/genies/conversations/{genie_conversation_id}?region=besg" \
  -H "Authorization: Bearer $STACKSYNC_API_KEY"
```

## Example response (200)

```json
{
  "conversation_id": "<conversation_id>",
  "region": "besg",
  "messages": [
    {
      "message_id": "<message_id>",
      "created_time": "<created_time>",
      "channel": "<channel>",
      "sender_role": "<sender_role>",
      "sender_name": "<sender_name>",
      "body": "<body>",
      "attachments": [
        {
          "name": "<name>",
          "mime_type": "<mime_type>",
          "size_bytes": 0,
          "file_id": "<file_id>"
        }
      ],
      "approval": {
        "approval_id": "<approval_id>",
        "status": "<status>",
        "module_id": "<module_id>",
        "module_name": "<module_name>",
        "channel_type": "<channel_type>",
        "target": "<target>",
        "instructions": "<instructions>",
        "requested_at": "<requested_at>",
        "decision_at": "<decision_at>",
        "approver_name": "<approver_name>"
      }
    }
  ],
  "steps": [
    {
      "description": "<description>",
      "execution_status": "<execution_status>",
      "error_message": "<error_message>",
      "log_type": "<log_type>",
      "execution_log_id": "<execution_log_id>",
      "started_time": "<started_time>",
      "finished_time": "<finished_time>",
      "duration_ms": 0
    }
  ]
}
```

## Errors

| Status | Meaning | Body |
| --- | --- | --- |
| 400 | Bad Request | `{ "error": string, "msg": string, "field": string \| null }` |
| 403 | Forbidden | `{ "error": string, "msg": string, "field": string \| null }` |
| 404 | Not Found | `{ "error": string, "msg": string, "field": string \| null }` |

## Related

- [API Reference overview](https://docs.stacksync.com/api-reference): base URLs, regions, pagination, idempotency and errors
- [Authentication](https://docs.stacksync.com/api-reference/authentication): API keys and the 403 answers
- OpenAPI document: https://docs.stacksync.com/openapi.json
- [List Genie conversations](https://docs.stacksync.com/api-reference/genies/conversations/list_genie_conversations)
- [Get a Genie tool execution](https://docs.stacksync.com/api-reference/genies/conversations/get_genie_tool_execution)
- [Get a Genie browser session](https://docs.stacksync.com/api-reference/genies/conversations/get_genie_browser_session)