# Delete a variable

> For the complete documentation index, see [llms.txt](/docs/llms.txt).

DELETE https://dashboard.alchemy.com/api/graphql/variables/{var_name}

Deletes a GraphQL webhook variable and all of its items. Deleting a
variable that does not exist also succeeds.

Reference: https://www.alchemy.com/docs/data/webhooks/webhooks-api-endpoints/delete-graphql-variable

## Headers

| Name | Type | Required | Description |
|------|------|----------|-------------|
| X-Alchemy-Token | string | Yes | Your team's auth token. Find it on the Webhooks page of the Alchemy dashboard. |

## Path Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| var_name | string | Yes | The variable name. |

## Code Examples

### cURL

```bash
curl --request DELETE \
  --url https://dashboard.alchemy.com/api/graphql/variables/string \
  --header 'X-Alchemy-Token: string'
```

### JavaScript

```javascript
const options = {method: 'DELETE', headers: {'X-Alchemy-Token': 'string'}};

fetch('https://dashboard.alchemy.com/api/graphql/variables/string', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
```

### Python

```python
import requests

url = "https://dashboard.alchemy.com/api/graphql/variables/string"

headers = {"X-Alchemy-Token": "string"}

response = requests.delete(url, headers=headers)

print(response.text)
```

### Go

```go
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://dashboard.alchemy.com/api/graphql/variables/string"

	req, _ := http.NewRequest("DELETE", url, nil)

	req.Header.Add("X-Alchemy-Token", "string")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(string(body))

}
```

### Java

```java
HttpResponse<String> response = Unirest.delete("https://dashboard.alchemy.com/api/graphql/variables/string")
  .header("X-Alchemy-Token", "string")
  .asString();
```

### C#

```csharp
using RestSharp;


var options = new RestClientOptions("https://dashboard.alchemy.com/api/graphql/variables/string");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("X-Alchemy-Token", "string");
var response = await client.DeleteAsync(request);

Console.WriteLine("{0}", response.Content);

```


## Operation Specification

```yaml
path: /api/graphql/variables/{var_name}
method: DELETE
operation:
  operationId: DeleteGraphqlVariable
  responses:
    '200':
      description: Deleted the variable
      content:
        application/json:
          schema:
            properties: {}
            type: object
            description: Construct a type with a set of properties K of type T
            additionalProperties: false
          examples:
            Example 1:
              value: {}
    '400':
      description: Invalid variable name
      content:
        application/json:
          schema:
            description: |-
              The error body. `name` is null for the statuses that have no name, such as
              404 and 429.
            properties:
              message:
                type: string
              name:
                type: string
                nullable: true
            required:
              - message
              - name
            type: object
            additionalProperties: false
          examples:
            Example 1:
              value:
                message: Invalid variable name
                name: ValidationError
    '401':
      description: Requires authentication
      content:
        application/json:
          schema:
            description: |-
              The error body. `name` is null for the statuses that have no name, such as
              404 and 429.
            properties:
              message:
                type: string
              name:
                type: string
                nullable: true
            required:
              - message
              - name
            type: object
            additionalProperties: false
          examples:
            Example 1:
              value:
                message: Unauthenticated request.
                name: AuthError
    '503':
      description: Variable service unavailable
      content:
        application/json:
          schema:
            description: |-
              The error body. `name` is null for the statuses that have no name, such as
              404 and 429.
            properties:
              message:
                type: string
              name:
                type: string
                nullable: true
            required:
              - message
              - name
            type: object
            additionalProperties: false
          examples:
            Example 1:
              value:
                message: Error deleting graphQL variable
                name: ServerError
  description: |-
    Deletes a GraphQL webhook variable and all of its items. Deleting a
    variable that does not exist also succeeds.
  summary: Delete a variable
  tags:
    - Webhooks
  security:
    - team_api_key: []
  parameters:
    - description: The variable name.
      in: path
      name: var_name
      required: true
      schema:
        type: string
```
