> For the complete documentation index, see [llms.txt](https://bugpilot.gitbook.io/api-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://bugpilot.gitbook.io/api-docs/http-api/api-reference/session-info.md).

# Session Info

The Session Info endpoint provides information about a recording started with the SDK.

## Returns information about a Report that has been previously requested via API.

<mark style="color:blue;">`GET`</mark> `https://widget-api.bugpilot.io/api/v1/session-info/<workspaceId>/<sessionToken>`

This endpoint

#### Path Parameters

| Name                                           | Type   | Description                                                   |
| ---------------------------------------------- | ------ | ------------------------------------------------------------- |
| workspaceId<mark style="color:red;">\*</mark>  | String | The id of the workspace you are fetching information from     |
| sessionToken<mark style="color:red;">\*</mark> | String | A session token, as returned from one of the Action endpoints |

#### Headers

| Name   | Type   | Description                                                                                                                                          |
| ------ | ------ | ---------------------------------------------------------------------------------------------------------------------------------------------------- |
| Accept | String | <p>Either <code>text/html</code> or <code>application/json</code><br>This changes the behavior of the endpoint in case of a successful response.</p> |

{% tabs %}
{% tab title="400: Bad Request workspaceId or sessionToken are not correct or refer to a " %}
{% code overflow="wrap" %}

```javascript
{"error":"INVALID_SESSION_TOKEN","error_message":"Invalid workspace or session token","ts":1669740566422}
```

{% endcode %}
{% endtab %}

{% tab title="404: Not Found The report is not (yet) generated, for example beacuse the user is not active on the web page" %}
{% code overflow="wrap" %}

```javascript
{"error":"REPORT_NOT_FOUND","error_message":"The report identified by the session token was not found. Probably the report was deleted, not correctly saved from the client, or canceled by the user.","ts":1669740591980}
```

{% endcode %}
{% endtab %}

{% tab title="200: OK The report has been generated" %}
The success response includes a `reportUrl` property. ReportUrl is a string to a Bugpilot Report that you can access. It's the same URL you would see from the reports list in the dashboard.

**IMPORTANT:** If the `HTTP Accept` header includes `text/html`, then a successful response will redirect to the dashboard page for the report. You could, for example, open the session info URL directly in the browser, and you would be redirected to the report page.

{% code overflow="wrap" %}

```javascript
{
  "ok":true,
  "reportUrl":"https://dash.bugpilot.io/report/r1-report-id",
  "ts": 1669740636649
}
```

{% endcode %}
{% endtab %}

{% tab title="302: Found The report has been generated and you are being redirected to the report page" %}
Same as `200 OK`, but presented when the `Accept` header in the HTTP request to this endpoint includes `text/html`.

```
Location: https://dash.bugpilot.io/report/r1-report-id
```

{% endtab %}
{% endtabs %}


---

# 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://bugpilot.gitbook.io/api-docs/http-api/api-reference/session-info.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.
