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

# Session feedback

> Submit feedback on a session or individual event.

Submit feedback on a session you own. Use this to report whether the agent completed its task successfully.

**Returns** `204 No Content`.

***

## Path parameters

<ParamField path="id" type="string" required>
  The session ID.
</ParamField>

***

## Request body

<ParamField body="success" type="boolean" required>
  Whether the session completed its task successfully.
</ParamField>

<ParamField body="message" type="string">
  Optional feedback message with details.
</ParamField>

***

## Examples

### Session feedback

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST https://agp.eu.hcompany.ai/api/v2/sessions/$SESSION_ID/feedback \
    -H "Authorization: Bearer $HAI_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "success": true,
      "message": "Task completed correctly"
    }'
  ```

  ```python Python theme={null}
  from hai_agents import Client

  client = Client()

  client.sessions.submit_session_feedback(
      session_id,
      success=True,
      message="Task completed correctly",
  )
  ```

  ```typescript TypeScript theme={null}
  import { HaiAgentsClient } from "hai-agents";

  const client = new HaiAgentsClient();

  await client.sessions.submitSessionFeedback({
    id: sessionId,
    body: {
      success: true,
      message: "Task completed correctly",
    },
  });
  ```
</CodeGroup>

### Event feedback

You can also submit feedback on a specific event within the session:

```
PUT /api/v2/sessions/{id}/events/{event_index}/feedback
```

Same body, with `event_index` identifying the event by its position in the session's [event list](/computer-use-agents/sessions/events). **Returns** `204 No Content`, or `404` when the index is out of range.

<CodeGroup>
  ```bash cURL theme={null}
  curl -X PUT https://agp.eu.hcompany.ai/api/v2/sessions/$SESSION_ID/events/5/feedback \
    -H "Authorization: Bearer $HAI_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "success": false,
      "message": "Agent clicked the wrong button at this step"
    }'
  ```

  ```python Python theme={null}
  from hai_agents import Client

  client = Client()

  client.sessions.submit_event_feedback(
      session_id,
      5,
      success=False,
      message="Agent clicked the wrong button at this step",
  )
  ```

  ```typescript TypeScript theme={null}
  import { HaiAgentsClient } from "hai-agents";

  const client = new HaiAgentsClient();

  await client.sessions.submitEventFeedback({
    id: sessionId,
    eventIndex: 5,
    body: {
      success: false,
      message: "Agent clicked the wrong button at this step",
    },
  });
  ```
</CodeGroup>
