Permission

Valid credentials, but not allowed to do this. 403.

Pattern

permission.*

Raised with

Intents

Statuses

403

Intents

Signed in, but not allowed to do this

Raising one

Name what went wrong. The intent sets the status, the message the caller sees, and any log it writes.

TS
// Signed in, but not allowed to do this
return fail('permission.denied', 'Only the page owner can do that.');
The caller gets (permission.denied)
Terminal
HTTP 403

{
"ok": false,
"error": "Only the page owner can do that.",
"code": "permission.denied"
}

Is it a permission error?

Find the row that describes your case, and use the domain on the right.

  • If the problem is

    Use

  • The caller’s request was wrong: unreadable, incomplete, or a value that breaks a rule. 400 or 422.

    request.*
  • No valid credentials: nobody signed in, an expired session, a bad token or secret. 401.

    auth.*
  • Valid credentials, but not allowed to do this. 403.

    permission.* this page
  • The thing asked for is not there, as far as the caller may know. 404.

    record.*
  • The request clashes with the current state: it already exists, or it is not possible yet. 409.

    conflict.*
  • Too many requests, or an allowance used up. 429.

    limit.*
  • Our fault or a dependency’s. The caller sees a generic message; the details are logged. 5xx.

    failure.*

For registry authors

Starter intents. These are the intents prongs add errors puts in your registry, raised with fail(). Change the messages to suit your app, and the statuses through the status.* intents they are built from.