/v1/* endpoint must carry a valid API key. Pecta issues two key types with different trust levels, and the @pecta/core SDK optionally signs telemetry payloads with an HMAC signature for additional integrity guarantees.
Key types
Pecta API keys follow the formatpk_live_<32 chars> or sk_live_<32 chars>. The prefix tells you what the key is allowed to do.
Keys are shown only once at creation time and stored as SHA-256 hashes in Pecta’s database.
Authorization header
Pass your key as a Bearer token on every/v1/* request:
HMAC signing for telemetry
When the@pecta/core SDK is configured with a secretKey, it signs every ingest payload with HMAC-SHA256 and includes the signature in the X-Pecta-Signature request header. This lets Pecta verify the payload was not tampered with in transit.
The header format is:
timingSafeEqual) to prevent timing attacks. If the header is present but the digest does not match, the request is rejected:
X-Pecta-Signature header is optional. If you omit it, ingest proceeds without signature verification. Enable HMAC in the SDK with:
401 response
When authentication fails, the API returns401 with a machine-readable code field: