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

# Check envd (E2B envd)

envd's `GET /health`, which the SDKs call after a failed envd request. `204` while the sandbox runs and the token is valid, `409` while it is paused (envd never resumes a sandbox), and the envd `401` otherwise.

` GET /compat/e2b/envd/health `

Check envd (E2B envd)

envd's `GET /health`, which the SDKs call after a failed envd request. `204` while the sandbox runs and the token is valid, `409` while it is paused (envd never resumes a sandbox), and the envd `401` otherwise.

## Servers

- ` https://beta-api.b3os.org ` — API (API keys and CLI tokens)

- ` https://beta.b3os.org ` — Dashboard (session cookie and CSRF header; same paths)

## Parameters

### ` X-Access-Token ` (header, required)

The sandbox's envd access token (`b3os_et_…`), from the create or connect answer.

- ` value `: type ` string `

### ` E2b-Sandbox-Id ` (header, required)

The sandbox the call is for (`sandboxID` of the create answer). The token must be this sandbox's.

- ` value `: type ` string `

## Responses

### ` 204 ` — Running.

Response header ` x-request-id ` — The request ID (`req_…`). It is the `instance` of any problem and the key for `GET /v1/requests/{request_id}`.

- ` value `: type ` string `

  - pattern: ` "^req_[0-9a-hjkmnp-tv-z]{26}$" `

Response header ` Server-Timing ` — Phase durations in milliseconds (W3C Server Timing); the handler's phases break the request down. For a
response whose body size is known, `total` runs from reading the request head to writing the response head.
Streaming responses (event streams, WebSockets, chunked bodies) carry no `total` here: they report their
final phases in the terminal event (`job.succeeded`, `job.failed`, `job.canceled`) or the final job. The
time from the first request byte to the last response byte is recorded in the node's metrics and request
log (`GET /v1/requests/{request_id}`). The edge prepends `edge_auth` and `edge_upstream`.


- ` value `: type ` string `

### ` 401 ` — The envd call is refused (`envd_token_invalid`), the same answer on every envd path whatever the reason, in E2B's error shape (Connect clients read the 401 as `unauthenticated`).

Content type: ` application/json `

- ` value `: type ` object ` — E2B's error body.

  - Required fields: ` code `, ` message `

  - ` code `: type ` integer ` — The HTTP status.

  - ` message `: type ` string `

Response header ` x-request-id ` — The request ID (`req_…`). It is the `instance` of any problem and the key for `GET /v1/requests/{request_id}`.

- ` value `: type ` string `

  - pattern: ` "^req_[0-9a-hjkmnp-tv-z]{26}$" `

Response header ` Server-Timing ` — Phase durations in milliseconds (W3C Server Timing); the handler's phases break the request down. For a
response whose body size is known, `total` runs from reading the request head to writing the response head.
Streaming responses (event streams, WebSockets, chunked bodies) carry no `total` here: they report their
final phases in the terminal event (`job.succeeded`, `job.failed`, `job.canceled`) or the final job. The
time from the first request byte to the last response byte is recorded in the node's metrics and request
log (`GET /v1/requests/{request_id}`). The edge prepends `edge_auth` and `edge_upstream`.


- ` value `: type ` string `

Example:

```json
{
  "code": 401,
  "message": "envd_token_invalid: the envd access token is missing, expired or not for this sandbox"
}
```

### ` 409 ` — The sandbox is already paused (`sandbox_not_running`), or an `Idempotency-Key` was used for another body (`idempotency_key_conflict`).

Content type: ` application/json `

- ` value `: type ` object ` — E2B's error body.

  - Required fields: ` code `, ` message `

  - ` code `: type ` integer ` — The HTTP status.

  - ` message `: type ` string `

Response header ` x-request-id ` — The request ID (`req_…`). It is the `instance` of any problem and the key for `GET /v1/requests/{request_id}`.

- ` value `: type ` string `

  - pattern: ` "^req_[0-9a-hjkmnp-tv-z]{26}$" `

Response header ` Server-Timing ` — Phase durations in milliseconds (W3C Server Timing); the handler's phases break the request down. For a
response whose body size is known, `total` runs from reading the request head to writing the response head.
Streaming responses (event streams, WebSockets, chunked bodies) carry no `total` here: they report their
final phases in the terminal event (`job.succeeded`, `job.failed`, `job.canceled`) or the final job. The
time from the first request byte to the last response byte is recorded in the node's metrics and request
log (`GET /v1/requests/{request_id}`). The edge prepends `edge_auth` and `edge_upstream`.


- ` value `: type ` string `

Example:

```json
{
  "code": 409,
  "message": "sbx_01m5t68q1b590rj801nbzsqzkk is paused"
}
```

## Request examples

### cURL

```curl
curl -X GET 'https://beta-api.b3os.org/compat/e2b/envd/health' \
  -H 'Authorization: Bearer YOUR_API_TOKEN' \
  -H 'X-Access-Token: string' \
  -H 'E2b-Sandbox-Id: string'
```

### JavaScript

```javascript
const response = await fetch('https://beta-api.b3os.org/compat/e2b/envd/health', {
  method: 'GET',
  headers: {
      "Authorization": "Bearer YOUR_API_TOKEN",
      "X-Access-Token": "string",
      "E2b-Sandbox-Id": "string"
  }
});

const data = await response.json();
console.log(data);
```

### Python

```python
import requests

headers = {
    'Authorization': 'Bearer YOUR_API_TOKEN',
    'X-Access-Token': 'string',
    'E2b-Sandbox-Id': 'string'
}

response = requests.get('https://beta-api.b3os.org/compat/e2b/envd/health', headers=headers)
print(response.json())
```