Overview

The Petra Security API uses Bearer token authentication. Every request to the API must include a valid API key in the Authorization header.

Getting Your API Key

The API is in private beta. Please contact us to get access.

Using Your API Key

Include your API key in the Authorization header of every request:
curl -H "Authorization: Bearer YOUR_API_KEY" \
  https://api.petrasecurity.com/beta/usage

Example with different languages

curl -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  https://api.petrasecurity.com/beta/usage

Troubleshooting

401 Unauthorized

This error means your API key is invalid or missing. Check that:
  • You’re including the Bearer prefix before your API key
  • You’re using the correct API key for your environment