---
title: "Create API key"
method: POST
path: "/v3/admin/applications/{application_id}/api-keys"
tags: ["Manage API keys"]
---

# Create API key

`POST /v3/admin/applications/{application_id}/api-keys`

<div id="admonition-warning">⚠️ <b>Before you can use the Manage API Keys endpoints, you need to <a href="/docs/reference/api/manage-api-keys/">create a Nylas Service Account</a></b>.</div>

Creates an API key for the specified Nylas application.

## Request body

- object
  - `name` string — A short, descriptive name for the API key.
  - `expires_in` number — How long the API key will be valid, in days.

## Response `200`

OK

- object
  - `request_id` string — ID of the request.
  - `data` object
    - `api_key` string — The API key.
    - `application_id` string — The application ID associated with the API key.
    - `created_at` number — When the API key was created, in seconds using the Unix timestamp format.
    - `expires_at` number — When the API key will expire, in seconds using the Unix timestamp format.
    - `id` string — The API key ID.
    - `name` string — The name of the API key.
    - `permissions` unknown[] — The scopes assigned to the API key.
      - unknown
    - `status` string — The status of the API key.
    - `updated_at` number — When the API key was last updated, in seconds using the Unix timestamp format. For new API keys, this value is the same as `created_at`.

## Other responses

- `400` — Bad Request
- `401` — Unauthorized
- `429` — Rate Limit

---

[API](https://skmtc.dev/nylas/apis/nylas-api.md) · [All operations](https://skmtc.dev/nylas/apis/nylas-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/nylas/nylas-api/revisions/51c2c1b4ecff/schema)
