canina/.ai_agency/specs/api_contract.md

1.5 KiB

API Contract Specification

1. OpenAPI 3.0 (Swagger) Specification

{
  "openapi": "3.0.3",
  "info": {
    "title": "AI Software House API",
    "version": "1.0.0",
    "description": "Auto-generated API contract for modular frontend/backend mockability"
  },
  "paths": {
    "/api/v1/auth/login": {
      "post": {
        "summary": "Authenticate user credentials",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "email": { "type": "string", "format": "email" },
                  "password": { "type": "string", "format": "password" }
                },
                "required": ["email", "password"]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful authentication",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "token": { "type": "string" },
                    "expires_in": { "type": "integer" }
                  }
                }
              }
            }
          },
          "401": { "description": "Invalid credentials" }
        }
      }
    }
  }
}

2. Endpoint Definitions & Data Types

Exact request/response payloads with typed parameters for deterministic mock generation.