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

# Delete a Credential

> Delete a credential using a mutation and variables with the Validio SDK.

## Overview

Delete a credential by using a mutation and variables.

> [!NOTE]
>
> When you create, update, or delete an object, you use a `mutation` operation instead of a `query`.

## Steps

**1. Write the mutation**

Write a `credentialsDelete` mutation. The variables in the mutation, which start with `$`, map one-to-one to the keys of the Python dictionary you send with the request.

**2. Send the mutation**

Send the mutation with the credential ID. The key `ids` in the dictionary maps to the `$ids` variable in the mutation.

**3. Ensure there were no errors**

If the list of errors is empty, the request was processed successfully.

## Full code sample

```python title="Python" theme={null}
import os

from validio_sdk.client import Client


async def example(credential_id: str = os.environ["EXAMPLE_CREDENTIAL_ID"]):
    client = Client()
    query = """
    mutation CredentialsDelete($ids: [CredentialId!]!) {
      credentialsDelete(ids: $ids) {
        errors {
          message
        }
      }
    }
    """

    result = await client.execute(
        query,
        variable_values={"ids": [credential_id]},
    )

    assert not result["credentialsDelete"]["errors"]
```

## Example response

```json title="JSON" theme={null}
{
  "credentialsDelete": {
    "errors": []
  }
}
```
