Create key
Creates a new API key with an optional expiry. The full key value is only returned once in the response.
Authorization
bearerAuth API key authentication: send your Zernio API key in the Authorization header, prefixed with Bearer.
In: header
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
import Zernio from '@zernio/node';const zernio = new Zernio({ apiKey: process.env.ZERNIO_API_KEY });const { data } = await zernio.apiKeys.createApiKey({ body: { name: 'Example', },});console.log(data);{ "message": "API key created successfully", "apiKey": { "id": "6507a1b2c3d4e5f6a7b8c9d0", "name": "No Private Messages Key", "keyPreview": "zrk_12345678...90abcdef", "key": "zrk_1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef", "expiresAt": null, "createdAt": "2024-01-15T10:30:00Z", "scope": "full", "profileIds": [], "permission": "read-write", "disabledResourceGroups": [ "messages", "contacts", "webhooks" ] }}List keys
Returns API keys with a preview only, not the full key value. For a regular team member this is their own keys; for the team owner this is every team member's keys, each carrying a `createdBy` field.
Delete key
Permanently revokes and deletes an API key. The team owner can revoke any team member's key; a non-owner member can only revoke their own.