Skip to main content
POST
/
api-keys
JavaScript
import Nuntly from '@nuntly/sdk';

const client = new Nuntly({
  apiKey: process.env['NUNTLY_API_KEY'], // This is the default and can be omitted
});

const apiKey = await client.apiKeys.create();

console.log(apiKey.id);
{
  "data": {
    "id": "<string>",
    "apiKey": "<string>",
    "shortToken": "<string>",
    "status": "enabled",
    "name": "<string>"
  }
}

Authorizations

Authorization
string
header
required

Bearer HTTP authentication. Allowed headers Authorization: Bearer <API_KEY>

Body

application/json

New API key with name, permissions, and optional domain scope.

name
string

The name of the api key

status
enum<string>

The status for the api key

Available options:
enabled,
disabled,
revoked
permission
enum<string>
default:fullAccess

The permission type for the api key

Available options:
fullAccess,
sendingAccess
domainIds
string[]

The domain ids to restrict the api key to (only for sendingAccess)

Response

Successful response.

data
object
required