# Delete API key

> **DELETE** `https://api.us.nylas.com/v3/admin/applications/{application_id}/api-keys/{api_key_id}`

Source: https://developer.nylas.com/docs/reference/api/manage-api-keys/delete-api-key/

<div id="admonition-warning">⚠️ <b>Before you can use the Manage API Keys endpoints, you need to <a href="/docs/api/v3/admin/#tag--Manage-API-keys--nylas-service-account">create a Nylas Service Account</a></b>.</div>

Deletes the specified API key.

**Authentication:** NYLAS_API_KEY, ACCESS_TOKEN

## Parameters

### Path parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `application_id` | string | Yes | ID of the Nylas application to access. |
| `api_key_id` | string | Yes | ID of the API key to access. |

### Header parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `X-Nylas-Signature` | string | Yes | A Base64-encoded signature using your private key's RSA with a 2048-bit key and an SHA-256 hashed string of the path, method, timestamp, nonce, and payload. |
| `X-Nylas-Kid` | string | Yes | The `private_key_id` from your Service Account JSON file. |
| `X-Nylas-Nonce` | string | Yes | A randomly generated nonce. Each request needs to have a unique nonce. If you try to reuse a nonce, Nylas rejects the request. |
| `X-Nylas-Timestamp` | number | Yes | The time when you submit your request, in seconds using the Unix timestamp format. This timestamp should fall within a 5-minute window of your real request time. |

## Responses

### 200 - OK

- `request_id` (string) - ID of the request.

### 400 - Bad Request

- `request_id` (string) - The request ID.
- `error` (object) - The response error object.
  - `type` (string) - The error type.
  - `message` (string) - The error message.
  - `provider_error` (object) - The error from the provider.

### 401 - Unauthorized

- `request_id` (string) - The request ID.
- `error` (object) - The response error object.
  - `type` (string) - The error type.
  - `message` (string) - The error message.
  - `provider_error` (object) - The error from the provider.

### 429 - Rate Limit

- `request_id` (string) - The request ID.
- `error` (object) - The response error object.
  - `type` (string) - The error type.
  - `message` (string) - The error message.

## Code samples

### cURL

```bash
curl --location --globoff --request DELETE "https://api.us.nylas.com/v3/admin/applications/<NYLAS_APPLICATION_ID>/api-keys/<API_KEY_ID>" \
  --header "Content-Type: application/json" \
  --header "X-Nylas-Kid: <SERVICE_ACCOUNT_ID>" \
  --header "X-Nylas-Nonce: <NONCE>" \
  --header "X-Nylas-Timestamp: 1676412353123" \
  --header "X-Nylas-Signature: <BASE64_SIGNATURE>"
```
