REST Endpoint Reference Template
One REST endpoint: auth, parameter tables, request example, responses per status, RFC 9457 errors, limits, idempotency, paging, deprecation headers
How to use: Use one page per endpoint; for a whole API use the REST API specification template. Generate parameter tables from OpenAPI, keep added prose in an Overlay, then add side effects, limits and real captured examples. The main pitfall is docs that drift from the OpenAPI document.
Preview
Endpoint Reference: [METHOD] [/path]
Reference page for a single REST endpoint: summary, authentication, path, query, header and body parameters, request example, responses for every status with examples, the RFC 9457 error format, rate limits, idempotency, pagination, versioning and changelog. Write one page per endpoint. For a whole API specification, use the REST API specification template instead. Replace every
[bracketed]value and every line marked Example. The examples documentPOST /itemsandGET /items.
| Field | Value |
|---|---|
| Endpoint | POST /v1/items |
| Operation ID | createItem |
| Base URL | https://api.example.com/v1 |
| API version | [v1] |
| OpenAPI document | [openapi.yaml], OpenAPI [3.2.1 / 3.1.x] |
| Used in workflows | [Arazzo workflow IDs, for example createAndShareItem, or "None"] |
| Stability | [Stable / Beta / Deprecated] |
| Required scope | items:write |
| Owner team | [@team] |
| Last updated | YYYY-MM-DD |
Revision history
| Version | Date | Author | Change |
|---|---|---|---|
| 1.0 | YYYY-MM-DD | [@name] | [First published version] |
| 1.1 | 2026-10-24 | [@name] | Updated to state the OpenAPI version (3.2.1 or 3.1.x), keep prose in an Overlay 1.2.0 document, link Arazzo 1.1.0 workflows and cite RFC 9745 and RFC 8594 for deprecation headers |
1. Summary
Creates an item in the caller's workspace and returns it. The item is
visible to other workspace members immediately. Creating an item emits an
item.created webhook event and counts towards the workspace's item quota
([10,000] items on the standard plan).
2. Authentication
Send an OAuth 2.0 access token or API key in the Authorization header:
Authorization: Bearer <token>
The token needs the items:write scope. A missing or expired token
returns 401; a valid token without the scope returns 403. See
[Authentication guide] for obtaining tokens.
3. Request
3.1 Path parameters
This endpoint has no path parameters. For endpoints that do, use this table:
| Name | Type | Required | Description |
|---|---|---|---|
Example: item_id | string, pattern ^it_[A-Za-z0-9]{12}$ | Yes | Identifier of the item, as returned on creation |
3.2 Query parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
expand | string, enum owner, tags | No | none | Embeds related objects in the response; repeatable |
[name] | [type and constraints] | [Yes / No] | [default] | [description] |
3.3 Header parameters
| Name | Required | Description |
|---|---|---|
Authorization | Yes | Bearer <token>, see section 2 |
Content-Type | Yes | Must be application/json |
Idempotency-Key | Recommended | Unique key, 1 to 255 characters, see section 7 |
Accept-Language | No | Language for human-readable error detail text |
3.4 Body parameters
| Field | Type | Required | Constraints | Description |
|---|---|---|---|---|
name | string | Yes | 1 to 120 characters, trimmed | Display name, unique within the workspace |
description | string | No | Up to 2,000 characters | Plain-text description |
price | integer | No | 0 to 100,000,000 | Price in minor currency units, for example cents |
currency | string | When price is set | ISO 4217 code | Currency of price |
tags | array of string | No | Up to 10 items, each 1 to 32 characters | Free-form labels |
Unknown fields are rejected with 400 so that typos are not silently
ignored.
4. Request example
The following request creates a priced item with two tags:
curl -X POST https://api.example.com/v1/items \
-H "Authorization: Bearer $API_TOKEN" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: 6f1c2a8e-3b44-4c1e-9a7d-2f0b5d8e1c90" \
-d '{
"name": "Standing desk",
"description": "Electric, 120 x 60 cm",
"price": 49900,
"currency": "EUR",
"tags": ["furniture", "office"]
}'
5. Responses
5.1 201 Created
The item was created. The Location header holds its URL.
HTTP/1.1 201 Created
Location: https://api.example.com/v1/items/it_8Hk2LmQ9xT4a
ETag: "a1b2c3"
Content-Type: application/json
{
"id": "it_8Hk2LmQ9xT4a",
"name": "Standing desk",
"description": "Electric, 120 x 60 cm",
"price": 49900,
"currency": "EUR",
"tags": ["furniture", "office"],
"created_at": "2026-10-21T09:14:03Z",
"updated_at": "2026-10-21T09:14:03Z"
}
5.2 Error responses
Every error uses the problem details format in section 6.
| Status | type suffix | When it happens | Client action |
|---|---|---|---|
400 | /validation-error | Body fails validation or contains unknown fields | Fix the fields listed in errors |
401 | /unauthenticated | Token missing, malformed or expired | Refresh the token and retry |
403 | /forbidden | Token lacks items:write | Request the scope; do not retry |
409 | /conflict | An item with the same name exists | Choose another name or update the existing item |
413 | /payload-too-large | Body larger than 64 KB | Reduce the payload |
422 | /quota-exceeded | Workspace item quota reached | Delete items or upgrade the plan |
429 | /rate-limited | Rate limit exceeded | Wait for Retry-After seconds |
500 | /internal-error | Unexpected server error | Retry with backoff using the same Idempotency-Key |
503 | /unavailable | Planned maintenance or overload | Retry after Retry-After |
6. Error format (RFC 9457)
Errors are returned as application/problem+json following RFC 9457,
Problem Details for HTTP APIs. The standard members are type, title,
status, detail and instance. This API adds errors for field-level
problems and request_id for support.
{
"type": "https://api.example.com/problems/validation-error",
"title": "Request body is invalid",
"status": 400,
"detail": "2 fields failed validation.",
"instance": "/v1/items",
"request_id": "req_01JB7Z3K9QW",
"errors": [
{ "pointer": "/name", "detail": "Must be between 1 and 120 characters." },
{ "pointer": "/currency", "detail": "Required when price is set." }
]
}
Clients should branch on type, never on title or detail, which may
be reworded or translated.
7. Rate limits and idempotency
Write requests are limited to [100] per minute per token and [1,000] per
minute per workspace. Every response includes RateLimit-Limit,
RateLimit-Remaining and RateLimit-Reset. When the limit is exceeded,
the API returns 429 with a Retry-After header in seconds.
Send an Idempotency-Key header, for example a UUID v4, to make retries
safe. The server stores the first response for a key for [24 hours]. A
retry with the same key and the same body returns the stored response; a
retry with the same key and a different body returns 409. Clients should
retry 429, 500 and 503 with exponential backoff, for example waiting
seconds plus random jitter before attempt .
8. Pagination
POST /items returns one object and is not paginated. The related list
endpoint GET /items uses cursor pagination:
| Parameter | Type | Default | Description |
|---|---|---|---|
limit | integer, 1 to 100 | 20 | Maximum results per page |
cursor | string | none | Opaque cursor from next_cursor of the previous page |
filter | string | none | Filter expression, for example tag:office |
{
"items": [{ "id": "it_8Hk2LmQ9xT4a", "name": "Standing desk" }],
"next_cursor": "eyJpZCI6Iml0XzhIazJMbVE5eFQ0YSJ9"
}
Results are ordered by created_at descending. next_cursor is null
on the last page. Cursors expire after [24 hours].
9. Versioning and deprecation
The major version is part of the path (/v1). Within a major version the
API only adds optional fields, new endpoints and new error type values;
clients must ignore unknown response fields. Removing or renaming a field,
or making an optional field required, is a breaking change and ships only
in a new major version. Deprecated endpoints return Deprecation and
Sunset headers at least [6 months] before removal, and are listed in the
changelog below. The Deprecation header (RFC 9745) carries the date the
endpoint was deprecated; the Sunset header (RFC 8594) carries the date
it stops responding. Mark the operation deprecated: true in the OpenAPI
document at the same time, so generated SDKs and reference pages show it.
Minimum notice periods come from the API Versioning and Deprecation
Policy (architecture/api-deprecation-policy); announce each deprecation
to customers with the Deprecation Notice (docs/deprecation-notice) and
record it in the API Changelog (docs/api-changelog).
10. Changelog
| Date | Version | Change |
|---|---|---|
| YYYY-MM-DD | v1.3 | Example: Added optional tags field (up to 10 labels) |
| YYYY-MM-DD | v1.2 | Example: 409 returned for duplicate names instead of 400 |
| 2026-01-01 | v1 | Initial release |
Standard and licence note
Based on common industry practice for REST endpoint references, the OpenAPI Specification 3.2.1 (2026-09-10; 3.1.x also widely used) for parameter and response structure, the Arazzo Specification 1.1.0 and the Overlay Specification 1.2.0 (OpenAPI Initiative, Apache License 2.0, https://spec.openapis.org/), RFC 9745 and RFC 8594 for deprecation headers, RFC 9457 Problem Details for HTTP APIs for the error format and RFC 9110 for HTTP semantics. Original text written for this collection; the example API is fictional. Template licence: MIT.
Related templates
Architecture Decision Record (ADR) Template
Lightweight Nygard-style ADR: status, context, decision, consequences, alternatives, related decisions, lifecycle and log
Software & EngineeringAGENTS.md Template for AI Coding Agents
Repository instructions for AI coding agents: setup, build and test commands, conventions, architecture map, PR and security rules
Software & EngineeringAI Coding Assistant Policy Template
Policy for AI coding assistants and agents: autonomy levels, tool register, secrets, sandboxing, review of generated code, provenance, OWASP ASI and SSDF mapping