API reference
Auth.
Check which team and permission an API key has. Every request needs an API key in the Authorization header; the reference overview covers keys, errors and rate limits.
Check an API key
GET/v1/auth/checkSending or full access key
Returns the team and the permission of the key in the Authorization header. It grants nothing, so a sending access key may call it too. The SMTP relay uses it to check a key at AUTH time.
terminal
curl -X GET "https://app.usenotix.dev/api/v1/auth/check" \
-H "Authorization: Bearer $NOTIX_API_KEY"
notix-js
import { Notix } from "notix-js";
const notix = new Notix(process.env.NOTIX_API_KEY);
const { data, error } = await notix.auth.check();
console.log(data?.permission); // "FULL" or "SENDING"
notix-sdk
from notix import Notix
notix = Notix() # reads NOTIX_API_KEY
data, _ = notix.auth.check()
print(data["permission"])
usenotix/notix-php
use Notix\Notix;
$notix = new Notix(getenv('NOTIX_API_KEY'));
$key = $notix->auth->check();
echo $key['permission'];
Responses
200The key is valid; the team, key and permission it names.
| Field | Type | About |
|---|---|---|
okrequired | boolean | Always true on a 200. One of |
teamIdrequired | number | The team the key belongs to. |
keyIdrequired | number | The id of the key presented. |
permissionrequired | string | FULL or SENDING. |