# {Feature Name} API Contract **Spec:** {NNN}-{feature_slug} **Version:** 1.0.0 **Base Path:** /api/v1/{resource} --- ## Overview {Brief description of what this API does} --- ## Versioning Strategy - **Strategy:** {URL path versioning | Header versioning (Accept-Version) | Query parameter} - **Current Version:** 1.0.0 - **Supported Versions:** 1.0.0 - **Deprecation Policy:** {e.g., "Previous major version supported for 6 months after new release"} --- ## Breaking Changes {Include only if this is not the initial version} | Version | Change | Migration Path | |---------|--------|----------------| | {from} → {to} | {What changed: removed field, renamed endpoint, etc.} | {How clients should migrate} | --- ## Authentication {Auth method: Bearer token, API key, OAuth2, etc.} --- ## Endpoints ### {HTTP_METHOD} {/path} **Description:** {What this endpoint does} **Request:** | Parameter | Location | Type | Required | Description | |-----------|----------|------|----------|-------------| | `{param}` | path/query/body | string | Yes/No | {Description} | **Request Body:** ```json { "field": "type - description" } ``` **Response:** | Status | Description | |--------|-------------| | 200 | Success | | 400 | Bad Request - {when} | | 401 | Unauthorized | | 404 | Not Found | | 500 | Internal Server Error | **Success Response (200):** ```json { "id": "string", "field": "type" } ``` **Error Response:** ```json { "error": "string", "message": "string", "details": {} } ``` --- ## Data Types ### {TypeName} | Field | Type | Required | Description | |-------|------|----------|-------------| | `id` | string (UUID) | Yes | Unique identifier | | `{field}` | {type} | Yes/No | {Description} | --- ## Rate Limits {Rate limiting rules if applicable} --- ## OpenAPI Schema **File:** `{path/to/openapi.yaml}` (generated from code annotations) {Or note about schema generation: "Schema auto-generated by {framework} on build"} --- ## Example Requests ### Create {Resource} ```bash curl -X POST {base_url}/api/v1/{resource} \ -H "Content-Type: application/json" \ -H "Authorization: Bearer $TOKEN" \ -d '{ "field": "value" }' ``` **Response:** ```json { "id": "uuid", "field": "value", "createdAt": "2024-01-01T00:00:00Z" } ``` ### Get {Resource} ```bash curl -X GET {base_url}/api/v1/{resource}/{id} \ -H "Authorization: Bearer $TOKEN" ``` ### List {Resources} ```bash curl -X GET "{base_url}/api/v1/{resource}?page=1&limit=20" \ -H "Authorization: Bearer $TOKEN" ``` --- ## Changelog | Version | Date | Changes | Breaking | |---------|------|---------|----------| | 1.0.0 | {date} | Initial version | - |