# Get a request

> One request by id, with every log line it wrote, oldest first.

<div class="g1t-endpoint"><span class="g1t-method" data-method="get">GET</span><code>/workspaces/{workspace}/projects/{project}/observability/requests/{id}</code></div>

Needs a role on the project's repository.

`404` when the project has no request with that id, or it is older than the project's retention.

- **Authentication:** Required. Send an [access token](/reference/api/#authentication) as `Authorization: Bearer`.
- **MCP tool:** [`observability`](/reference/mcp/#observability) with `action` `request`, and the same inputs
- **Scope:** An access token needs [`observability:read`](/guides/authentication/#scopes).

## Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `workspace` | string | Yes | The workspace's slug, e.g. "flagon-io". |
| `project` | string | Yes | The project's slug, as in g1t.sh/{workspace}/{project}. |
| `id` | string | Yes | The request's id. |

## Example request

```sh
curl https://api.g1t.sh/workspaces/flagon-io/projects/g1t/observability/requests/req_01kq9b7d9f1h3k5m7p9r1t3v5x \
  -H "Authorization: Bearer $G1T_TOKEN"
```

## Example response

A successful request answers `200` with:

```json
{
  "request": {
    "id": "req_01kq9b7d9f1h3k5m7p9r1t3v5x",
    "time_us": 1791813807418000,
    "duration_us": 842000,
    "trigger": "fetch",
    "method": "GET",
    "url": "g1t.sh/flagon-io/g1t/pulls/412",
    "route": "/:workspace/:repo/pulls/:number",
    "status": 500,
    "outcome": "exception",
    "cpu_ms": 31.4,
    "region": "IAD",
    "country": "US",
    "trace_id": "4bf92f3577b34da6a3ce929d0e0e4736",
    "log_count": 2,
    "error": {
      "name": "TypeError",
      "message": "Cannot read properties of undefined (reading 'head')"
    },
    "service": "g1t-web",
    "environment": "production",
    "deployment_id": "dpl_01kq9a2c4e6g8j0m2p4r6t8v0x",
    "commit_sha": "7c1e9a4b2d6f80135ac9e2b7d4f6a8c0e1b3d5f7",
    "source": "cloudflare"
  },
  "logs": [
    {
      "id": "log_01kq9b7d9f1h3k5m7p9r1t3v5y",
      "time_us": 1791813808251000,
      "severity": "error",
      "severity_number": 17,
      "body": "loading pull request 412 failed: Cannot read properties of undefined (reading 'head')",
      "trace_id": "4bf92f3577b34da6a3ce929d0e0e4736",
      "span_id": "00f067aa0ba902b7",
      "request_id": "req_01kq9b7d9f1h3k5m7p9r1t3v5x",
      "attributes": {
        "code.function": "loadPull",
        "http.route": "/:workspace/:repo/pulls/:number"
      },
      "service": "g1t-web",
      "environment": "production",
      "deployment_id": "dpl_01kq9a2c4e6g8j0m2p4r6t8v0x",
      "commit_sha": "7c1e9a4b2d6f80135ac9e2b7d4f6a8c0e1b3d5f7",
      "source": "cloudflare"
    }
  ]
}
```

## Errors

A failed request answers with one of these statuses and a body like `{"error": {"code": "not_found", "message": "Repository not found."}}`. See [errors](/reference/api/#errors).

| Status | Code | When |
| --- | --- | --- |
| 401 | `unauthenticated` | A token is required, or the one sent is not valid. |
| 403 | `forbidden` | The token is valid but not allowed to do this, such as a member-only change, or a token without the scope it needs. |
| 404 | `not_found` | It does not exist, or you cannot see it. |
| 422 | `invalid` | The input is not valid. `message` says which field and why. |
