FlowDiagram
Security & identityMermaid

API request authentication & authorization template

How a backend validates every API call: key or JWT, scopes, rate limits and audit — useful for API design reviews. This architecture diagram template contains 17 labelled components, branches such as “No”, “Yes”, “API key”.

Open in the editor →
  • Free — no account, no trial, no watermark
  • Fully editable shapes and connectors, not a screenshot
  • Export PNG, SVG or PDF, or share it as a link
  • Private: the diagram never leaves your browser

Components in this architecture diagram

  • API request
  • Auth header present?
  • 401 Unauthorized
  • Token type?
  • Look up hashed key
  • Verify signature with JWKS
  • Key active?
  • Unexpired & correct audience?
  • Load principal & scopes
  • Scope allows endpoint?
  • 403 Forbidden
  • Owns requested resource?
  • Rate limit ok?
  • 429 Too Many Requests
  • Handle request
  • Audit log
  • 200 Response

How to use this architecture diagram template

  1. Click Open in the editor. The architecture diagram opens on a new page in FlowDiagram — nothing is uploaded and there is no sign-up.
  2. Rename, add or delete shapes and drag them where you want; connectors stay attached as things move.
  3. Drop in vendor logos from the library — 1,160 of them, including every AWS, Azure and Google Cloud service icon — or restyle it with the colour and theme controls.
  4. Prefer text? Edit the Mermaid source below and paste it in through ☰ → Import diagram (see the Mermaid editor); it imports as an editable diagram.
  5. Export to PNG, SVG or PDF, or press Ctrl+L for a link that carries the whole diagram.

Mermaid source

The whole template is the text below. Paste it into FlowDiagram, keep it in Git next to the code it describes, or hand it to an AI assistant to extend.

flowchart TD
  A((API request)) --> B{Auth header present?}
  B -->|No| C((401 Unauthorized))
  B -->|Yes| D{Token type?}
  D -->|API key| E[Look up hashed key]
  D -->|JWT| F[Verify signature with JWKS]
  E --> G{Key active?}
  F --> H{Unexpired & correct audience?}
  G -->|No| C
  H -->|No| C
  G -->|Yes| I[Load principal & scopes]
  H -->|Yes| I
  I --> J{Scope allows endpoint?}
  J -->|No| K((403 Forbidden))
  J -->|Yes| L{Owns requested resource?}
  L -->|No| K
  L -->|Yes| M{Rate limit ok?}
  M -->|No| N((429 Too Many Requests))
  M -->|Yes| O[Handle request]
  O --> P[(Audit log)]
  P --> Q((200 Response))

Related: System architecture diagram tool · Mermaid editor · All security & identity templates · All 521 templates