---
title: "Clear a context's state by starting its process again."
method: POST
path: "/v1/sandboxes/{id}/interpreter/contexts/{context}:restart"
tags: ["interpreter"]
---

# Clear a context's state by starting its process again.

`POST /v1/sandboxes/{id}/interpreter/contexts/{context}:restart`

## Request

- Base URL: `https://api.withruntime.com`
- URL: `https://api.withruntime.com/v1/sandboxes/{id}/interpreter/contexts/{context}:restart`
- Auth: HTTP bearer

## Path parameters

- `id` string, required: Resource identifier (UUID).
- `context` string, required: A context's id; each language's name is its default context, started on first use.

## Headers

- `Idempotency-Key` string

## Request body

- object
  - `env` object: Environment variables for the context's process.

## Response `200`

Success

- object
  - `id` string
  - `language` string
  - `processId` string
  - `cwd` string
  - `state` string
  - `startedAt` integer

## Other responses

- `default`: Error

---

[API](https://skmtc.dev/withruntime/apis/runtime-cloud-api.md) · [All operations](https://skmtc.dev/withruntime/apis/runtime-cloud-api/llms.txt) · [OpenAPI document](https://skmtc.dev/withruntime/apis/runtime-cloud-api/revisions/e76cd8f6dcb4?raw)
