Skip to content

Authentication required

What the unauthorized error from the Perafly API means and what to do about it.

On this page
Code
unauthorized
HTTP status
401

What it means

The request had no key, or the key is malformed, revoked or expired, or its owner is no longer a member of the team.

What to do

Send Authorization: Bearer pfa_…. In the CLI run perafly login again, or set PERAFLY_TOKEN in CI. A CLI sign-in key lasts 30 days and lapses after 7 days without use.

Read more: Agents and MCP

Example response

This is the shape of the answer. title and detail are in English, or in Turkish with Accept-Language: tr; detail appears when there's more to say.

{
  "type": "https://perafly.com/docs/errors/unauthorized",
  "title": "Authentication required",
  "status": 401,
  "code": "unauthorized",
  "instance": "/v1/…",
  "requestId": "req_…"
}

All error codes