API_DOC_TEMP - BevvyTech/BrewskiDocs GitHub Wiki

API Doc Template

Use this template when adding new endpoint documentation to the Brewski Docs wiki. Replace placeholder text and remove sections that do not apply.

Overview

  • Endpoint Group: e.g. Orders / Payments
  • Purpose: Single sentence explaining what the endpoint does.
  • Availability: Public, Requires team membership, or Internal (internal endpoints must stay in the root README, not the wiki).

Endpoint Summary

Method Path Description
POST /example/:id/action Short human-readable description.

Authentication

  • Required scopes/roles.
  • Any feature flags or plan entitlements needed.

Request

URL Parameters

  • :id (uuid, required) — description.

Query Parameters

  • filter (string, optional, values: ...) — description.

Headers

  • Authorization: Bearer <token> — describe when required.
  • Content-Type: application/json

Body

{
  "sampleField": "value",
  "optionalField": 123,
  "nested": {
    "flag": true
  }
}
  • Document each field with type, requirement, validation limits, and default behaviour if omitted.

Response

Success 201 Created

{
  "id": "uuid",
  "createdAt": "2025-02-06T12:00:00.000Z",
  "status": "example",
  "related": {
    "id": "uuid",
    "name": "Sample"
  }
}
  • Explain derived values, computed flags, pagination metadata, etc.

Error Codes

Status Body Example When It Happens
400 Bad Request { "message": "validation_error" } Input missing required field.
401 Unauthorized { "message": "unauthorized" } Missing/invalid token.
403 Forbidden { "message": "forbidden" } Role lacks permissions.
404 Not Found { "message": "not_found" } Resource ID not visible to user.

Side Effects & Events

  • List database writes, emitted events, background jobs, or cache invalidations.

Rate Limiting & Idempotency

  • Mention idempotency keys, rate buckets, or retry strategies when applicable.

Examples

  • Provide curl example, client SDK snippet, or workflow diagram if useful.

Changelog

Date Author Change
2025-02-06 Your Name Initial draft.
⚠️ **GitHub.com Fallback** ⚠️