Skip to content
Skip to main content
POST
https://api.us.nylas.com/v3/admin/applications/{application_id}/api-keys

Create API keyBeta

⚠️ Before you can use the Manage API Keys endpoints, you need to create a Nylas Service Account.

Creates an API key for the specified Nylas application.

Authenticate with the X-Nylas-Signature, X-Nylas-Kid, X-Nylas-Nonce, and X-Nylas-Timestamp headers only. Don't send an Authorization header.

No authentication needed.

Parameters

Path parameters

application_id*string

ID of the Nylas application to access.

Header parameters

X-Nylas-Signature*string

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

The private_key_id from your Service Account JSON file.

X-Nylas-Nonce*string

A randomly generated nonce. Each request needs to have a unique nonce. If you try to reuse a nonce, Nylas rejects the request. For Create API key requests, the nonce must be 16 to 20 characters long.

X-Nylas-Timestamp*integer

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. The value must be a whole number.

Request body

namestring

A short, descriptive name for the API key. Nylas trims leading and trailing spaces, and the trimmed name must be 1 to 256 characters long. The name must be unique within the application. If you omit name or send an empty string, Nylas generates a name in the format APIKey <application_id> <UTC date and time>.

Example: "example-key"
minLength: 1maxLength: 256
expires_ininteger

How long the API key will be valid, in days. Accepts 1 to 9125. If you leave it out, the key is valid for 9125 days (25 years).

Example: 90
min: 1max: 9125

Responses

request_idstring

ID of the request.

Example: "5fa64c92-e840-4357-86b9-2aa364d35b88"
dataobject
POSThttps://api.us.nylas.com/v3/admin/applications/{application_id}/api-keys
application_idrequiredstring

ID of the Nylas application to access.

Loading editor...

Autocomplete and validation come from this endpoint's request schema.