---
title: "Ask agent"
---

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

Path: Sureshake API › reports

`POST /v2/reports/{id}/agent/messages`

## Path parameters

- `id` (`report-ask-agent.path.id`; string, required)
  - format `uuid`

## Request body

_Required._

- `message` (`report-ask-agent.message`; string, required)
  - minLength 1; maxLength 4000
- `history` (`report-ask-agent.history`; array<object>, optional)
  - `role` (`report-ask-agent.history.role`; string, required)
    - one of `"user"`, `"assistant"`
  - `content` (`report-ask-agent.history.content`; string, required)

## Example request

```json
{
  "message": "string",
  "history": [
    {
      "role": "user",
      "content": "string"
    }
  ]
}
```

## Code samples

### cURL

```bash
curl --request POST \
  --url 'https://api.sureshake.com/v2/reports/<id>/agent/messages' \
  --header 'Content-Type: application/json' \
  --data '
{
  "message": "string",
  "history": [
    {
      "role": "user",
      "content": "string"
    }
  ]
}
'
```

### TypeScript

```typescript
const url = 'https://api.sureshake.com/v2/reports/<id>/agent/messages';
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json'},
  body: JSON.stringify({message: 'string', history: [{role: 'user', content: 'string'}]})
};

fetch(url, options)
  .then(res => res.json())
  .then(json => console.log(json))
  .catch(err => console.error(err));
```

### Python

```python
import requests

url = "https://api.sureshake.com/v2/reports/<id>/agent/messages"

payload = {
    "message": "string",
    "history": [
        {
            "role": "user",
            "content": "string"
        }
    ]
}
headers = {"Content-Type": "application/json"}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
```

## Responses

### 200

Default Response

#### Example

```json
{
  "data": {
    "message": "string",
    "citations": [
      {
        "id": "string",
        "label": "string",
        "section_key": "string",
        "source_type": "string",
        "provenance": "string",
        "metadata": {
          "property1": null,
          "property2": null
        }
      }
    ],
    "unavailable": [
      "string"
    ]
  }
}
```

- `data` (`report-ask-agent.response.200.data`; object, required)
  - `message` (`report-ask-agent.response.200.data.message`; string, required)
  - `citations` (`report-ask-agent.response.200.data.citations`; array<object>, required)
    - `id` (`report-ask-agent.response.200.data.citations.id`; string, required)
    - `label` (`report-ask-agent.response.200.data.citations.label`; string, required)
    - `section_key` (`report-ask-agent.response.200.data.citations.section_key`; string, required)
    - `source_type` (`report-ask-agent.response.200.data.citations.source_type`; string, required)
    - `provenance` (`report-ask-agent.response.200.data.citations.provenance`; string, optional, nullable)
    - `metadata` (`report-ask-agent.response.200.data.citations.metadata`; map<unknown>, optional)
  - `unavailable` (`report-ask-agent.response.200.data.unavailable`; array<string>, required)

### 400

Default Response

#### Example

```json
{
  "error": {
    "code": "string",
    "message": "string",
    "details": null,
    "traceId": "string"
  }
}
```

- `error` (`report-ask-agent.response.400.error`; object, required)
  - `code` (`report-ask-agent.response.400.error.code`; string, required) — Machine-readable error code (e.g., NOT_FOUND)
  - `message` (`report-ask-agent.response.400.error.message`; string, required) — Human-readable error message
  - `details` (`report-ask-agent.response.400.error.details`; unknown, optional) — Optional structured error details
  - `traceId` (`report-ask-agent.response.400.error.traceId`; string, optional) — Unique ID for log correlation

### 401

Default Response

#### Example

```json
{
  "error": {
    "code": "string",
    "message": "string",
    "details": null,
    "traceId": "string"
  }
}
```

- `error` (`report-ask-agent.response.401.error`; object, required)
  - `code` (`report-ask-agent.response.401.error.code`; string, required) — Machine-readable error code (e.g., NOT_FOUND)
  - `message` (`report-ask-agent.response.401.error.message`; string, required) — Human-readable error message
  - `details` (`report-ask-agent.response.401.error.details`; unknown, optional) — Optional structured error details
  - `traceId` (`report-ask-agent.response.401.error.traceId`; string, optional) — Unique ID for log correlation

### 403

Default Response

#### Example

```json
{
  "error": {
    "code": "string",
    "message": "string",
    "details": null,
    "traceId": "string"
  }
}
```

- `error` (`report-ask-agent.response.403.error`; object, required)
  - `code` (`report-ask-agent.response.403.error.code`; string, required) — Machine-readable error code (e.g., NOT_FOUND)
  - `message` (`report-ask-agent.response.403.error.message`; string, required) — Human-readable error message
  - `details` (`report-ask-agent.response.403.error.details`; unknown, optional) — Optional structured error details
  - `traceId` (`report-ask-agent.response.403.error.traceId`; string, optional) — Unique ID for log correlation

### 404

Default Response

#### Example

```json
{
  "error": {
    "code": "string",
    "message": "string",
    "details": null,
    "traceId": "string"
  }
}
```

- `error` (`report-ask-agent.response.404.error`; object, required)
  - `code` (`report-ask-agent.response.404.error.code`; string, required) — Machine-readable error code (e.g., NOT_FOUND)
  - `message` (`report-ask-agent.response.404.error.message`; string, required) — Human-readable error message
  - `details` (`report-ask-agent.response.404.error.details`; unknown, optional) — Optional structured error details
  - `traceId` (`report-ask-agent.response.404.error.traceId`; string, optional) — Unique ID for log correlation

### 409

Default Response

#### Example

```json
{
  "error": {
    "code": "string",
    "message": "string",
    "details": null,
    "traceId": "string"
  }
}
```

- `error` (`report-ask-agent.response.409.error`; object, required)
  - `code` (`report-ask-agent.response.409.error.code`; string, required) — Machine-readable error code (e.g., NOT_FOUND)
  - `message` (`report-ask-agent.response.409.error.message`; string, required) — Human-readable error message
  - `details` (`report-ask-agent.response.409.error.details`; unknown, optional) — Optional structured error details
  - `traceId` (`report-ask-agent.response.409.error.traceId`; string, optional) — Unique ID for log correlation

### 422

Default Response

#### Example

```json
{
  "error": {
    "code": "string",
    "message": "string",
    "details": null,
    "traceId": "string"
  }
}
```

- `error` (`report-ask-agent.response.422.error`; object, required)
  - `code` (`report-ask-agent.response.422.error.code`; string, required) — Machine-readable error code (e.g., NOT_FOUND)
  - `message` (`report-ask-agent.response.422.error.message`; string, required) — Human-readable error message
  - `details` (`report-ask-agent.response.422.error.details`; unknown, optional) — Optional structured error details
  - `traceId` (`report-ask-agent.response.422.error.traceId`; string, optional) — Unique ID for log correlation

### 500

Default Response

#### Example

```json
{
  "error": {
    "code": "string",
    "message": "string",
    "details": null,
    "traceId": "string"
  }
}
```

- `error` (`report-ask-agent.response.500.error`; object, required)
  - `code` (`report-ask-agent.response.500.error.code`; string, required) — Machine-readable error code (e.g., NOT_FOUND)
  - `message` (`report-ask-agent.response.500.error.message`; string, required) — Human-readable error message
  - `details` (`report-ask-agent.response.500.error.details`; unknown, optional) — Optional structured error details
  - `traceId` (`report-ask-agent.response.500.error.traceId`; string, optional) — Unique ID for log correlation


Source: https://docs.sureshake.com/reference/report-ask-agent/index.md
