Check an API key
Returns the team and the permission of the key in the Authorization header.
GET
https://app.usenotix.dev/api/v1/auth/checkFull access and sending access keys can call this. Key permissions lists the extra rules some calls have.
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.
Headers
Authorizationstringrequired
Bearer followed by your API key.
Errors
401
No Authorization header was provided.
403
The key is malformed, unknown or revoked; or it has an IP allow list ("IP-locked keys can't be used over SMTP. Use a key without an IP allow list for the SMTP relay."), since the SMTP relay calls from its own address.
Every error has the same shape. See all error codes.
curl -X GET "https://app.usenotix.dev/api/v1/auth/check" \
-H "Authorization: Bearer $NOTIX_API_KEY"
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"
from notix import Notix
notix = Notix() # reads NOTIX_API_KEY
data, _ = notix.auth.check()
print(data["permission"])
use Notix\Notix;
$notix = new Notix(getenv('NOTIX_API_KEY'));
$key = $notix->auth->check();
echo $key['permission'];
Response200
{
"ok": true,
"teamId": 1,
"keyId": 1,
"permission": "SENDING"
}