FlowDiagram
UML: sequence, class & stateMermaid

API gateway request sequence diagram template

Traces one REST call from a client through an API gateway, auth service, backend service, cache and database, including the cache-miss path; useful for API design reviews. This sequence diagram template contains 6 labelled participants.

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

Participants in this sequence diagram

  • Client
  • API gateway
  • Auth service
  • Orders service
  • Redis cache
  • Postgres

How to use this sequence diagram template

  1. Click Open in the editor. The sequence 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.

sequenceDiagram
  autonumber
  actor U as Client
  participant GW as API gateway
  participant AuthZ as Auth service
  participant Svc as Orders service
  participant Cache as Redis cache
  participant DB as Postgres
  U->>GW: GET /v1/orders/42 + API key
  GW->>GW: Rate limit check
  GW->>AuthZ: Validate token and scopes
  AuthZ-->>GW: Allowed (orders:read)
  GW->>+Svc: Forward request with user context
  Svc->>Cache: GET order:42
  alt Cache hit
    Cache-->>Svc: Cached order JSON
  else Cache miss
    Cache-->>Svc: nil
    Svc->>DB: SELECT * FROM orders WHERE id = 42
    DB-->>Svc: Order row
    Svc->>Cache: SET order:42 TTL 300s
  end
  Svc-->>-GW: 200 order
  GW-->>U: 200 order + rate-limit headers
  Note right of GW: Gateway also logs and traces every request

Related: Mermaid editor · All uml: sequence, class & state templates · All 521 templates