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

# Delete API Key

> Permanently delete an API key

## Path Parameters

<ParamField path="organizationId" type="string" required>
  Organization ID
</ParamField>

<ParamField path="projectId" type="string" required>
  Project ID
</ParamField>

<ParamField path="id" type="string" required>
  API Key ID
</ParamField>

## Response

```json theme={null}
{
  "message": "API key successfully deleted",
  "id": "afd8012b-d81e-41c6-92cd-eed0c6cb3676"
}
```

<Warning>
  Deleting an API key is permanent and cannot be undone. Any applications using this key will immediately lose access. Consider revoking the key first (setting status to `revoked`) if you need time to migrate applications to a new key.
</Warning>

## Error Responses

### API Key Not Found

```json theme={null}
{
  "error": {
    "code": "APIKEY_NOT_FOUND",
    "message": "API key not found"
  }
}
```

## Code Examples

<CodeGroup>
  ```bash cURL theme={null}
  curl -X DELETE "https://api.metabind.ai/app/v1/organizations/org123/projects/proj456/api-keys/key123" \
    -H "Authorization: Bearer YOUR_JWT"
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch(
    'https://api.metabind.ai/app/v1/organizations/org123/projects/proj456/api-keys/key123',
    {
      method: 'DELETE',
      headers: {
        'Authorization': 'Bearer YOUR_JWT'
      }
    }
  );

  const result = await response.json();
  console.log(result.message);
  ```

  ```swift Swift theme={null}
  var request = URLRequest(url: URL(string: "https://api.metabind.ai/app/v1/organizations/org123/projects/proj456/api-keys/key123")!)
  request.httpMethod = "DELETE"
  request.setValue("Bearer YOUR_JWT", forHTTPHeaderField: "Authorization")

  let (data, _) = try await URLSession.shared.data(for: request)
  ```

  ```kotlin Kotlin theme={null}
  val response = client.delete("https://api.metabind.ai/app/v1/organizations/org123/projects/proj456/api-keys/key123") {
      header("Authorization", "Bearer YOUR_JWT")
  }

  println("Deleted API key")
  ```
</CodeGroup>
