---
type: api
title: Get script contexts
description: Get a list of supported script contexts and their methods.
url: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/elasticsearch/v9/operation/operation-get-script-context
resource: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/elasticsearch/v9/operation/operation-get-script-context
products:
  - Elasticsearch
---

# Get script contexts

Availability:

## Paths

- `GET` `/_script_context`

- [Api key auth](/elastic/docs-builder/docs/4371/api/doc/elasticsearch/v9/authentication#apikeyauth)
- [Basic auth](/elastic/docs-builder/docs/4371/api/doc/elasticsearch/v9/authentication#basicauth)
- [Bearer auth](/elastic/docs-builder/docs/4371/api/doc/elasticsearch/v9/authentication#bearerauth)

## Description

Get a list of supported script contexts and their methods.

## Required authorization

* Cluster privileges: `manage`

## Response

`application/json`

- `contexts` ([] Context)
  - `methods` ([] ContextMethod)
    - `name` (string Name)
    - `return_type` (string)
    - `params` ([] ContextMethodParam)
      - `name` (string Name)
      - `type` (string)
  - `name` (string Name)
## Code Examples

#### Console

```console
GET _script_context
```

#### JavaScript

```javascript
const response = await client.getScriptContext();
```

#### Python

```python
resp = client.get_script_context()
```

#### curl

```curl
curl -X GET "$ELASTICSEARCH_URL/_script_context" \
  -H "Authorization: ApiKey $ELASTIC_API_KEY"
```

#### Java

```java
client.getScriptContext();
```

#### C#

```c#
var response = await client.GetScriptContextAsync();
```

#### PHP

```php
$resp = $client->getScriptContext();
```

#### Ruby

```ruby
response = client.get_script_context
```

