ApiKeys
Create an API key
Creates a new API key for the organization and returns the created key, including the plaintext secret, with a 201 response.
POST
Creates a new API key for the organization and returns the created key, including the plaintext secret, with a 201 response.
apiKeyheader
x-api-key<token>application/json- body
name*stringLength
1 <= length <= 32description?string|nullexpiresAt?string|nullaccess?||Defaults to full access. A restricted API key creating a key defaults to its own grants and cannot issue full access.
Success
application/json- response
id*stringname*stringkey*stringstart*string|nullend*string|nulldescription?string|nullcreatedAt*stringexpiresAt*string|nulllastUsedAt*string|nullisActive*booleanaccess*|owner*|nullimport { createClient } from "samva";const samva = createClient({ apiKey: process.env.SAMVA_API_KEY! });const result = await samva.apiKeys.create({ "name": "example"});Example Response
{ "id": "string", "name": "string", "key": "string", "start": "string", "end": "string", "description": "string", "createdAt": "string", "expiresAt": "string", "lastUsedAt": "string", "isActive": true, "access": { "mode": "full" }, "owner": { "id": "string", "name": "string", "email": "string" }}Related documentation
Update a webhook
Updates a webhook's name, URL, subscribed events, channels, custom headers, mailbox scope, or status and returns the updated endpoint.
Get an API key
Returns the API key with the given ID, including its metadata and access. Use this endpoint to get an API key through the Samva email API.