# Create an execution context

Launch stage: GA

`POST /api/1.2/contexts/create`

Creates an execution context for running cluster commands.

 If successful, this method returns the ID of the new execution context. The context may still be
 initializing when this method returns, so poll __contextStatus__ until the status is `Running` before
 running commands in it. This method and the other methods of this API require the CAN ATTACH TO
 permission on the cluster.

API scopes: command-execution

## Request body

- `clusterId` (string, optional)
  ID of the cluster to create the execution context on. The cluster must be running.
- `language` (string, optional)
  Programming language of the execution context.
  Possible values:
  - `python`
  - `scala`
  - `sql`
  - `r`

## Returns

- `id` (string, optional)
  ID of the new execution context when returned by __Create__, or of the submitted command when
   returned by __execute__. Pass it to the other methods of this API as `contextId` or `commandId`.

## Request

```json
{
  "clusterId": "0123-456789-abcdefg1",
  "language": "python"
}
```

## Response

```json
{
  "id": "3f2a9c1e8b7d4a6f9e0c1b2d3a4f5e6d"
}
```

