{ "openapi": "3.1.1", "info": { "title": "Template API", "version": "v1" }, "paths": { "/api/v1/auth/capabilities": { "get": { "tags": [ "Template.Api" ], "operationId": "GetAuthCapabilities", "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiResponseOfAuthCapabilitiesResponse" } } } }, "404": { "description": "Not Found", "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" } } } }, "405": { "description": "Method Not Allowed", "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" } } } }, "500": { "description": "Internal Server Error", "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" } } } } } } }, "/api/v1/auth/session": { "get": { "tags": [ "Template.Api" ], "operationId": "GetAuthSession", "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiResponseOfAuthSessionResponse" } } } }, "404": { "description": "Not Found", "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" } } } }, "405": { "description": "Method Not Allowed", "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" } } } }, "500": { "description": "Internal Server Error", "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" } } } } } } }, "/api/v1/auth/csrf": { "get": { "tags": [ "Template.Api" ], "operationId": "GetAuthCsrf", "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiResponseOfAuthCsrfResponse" } } } }, "404": { "description": "Not Found", "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" } } } }, "405": { "description": "Method Not Allowed", "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" } } } }, "500": { "description": "Internal Server Error", "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" } } } } } } }, "/api/v1/auth/logout": { "post": { "tags": [ "Template.Api" ], "operationId": "Logout", "parameters": [ { "name": "X-CSRF-TOKEN", "in": "header", "description": "Request token returned by GET /api/v1/auth/csrf.", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiResponseOfAuthSessionResponse" } } } }, "400": { "description": "Bad Request", "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" } } } }, "401": { "description": "Unauthorized", "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" } } } }, "403": { "description": "Forbidden", "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" } } } }, "404": { "description": "Not Found", "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" } } } }, "405": { "description": "Method Not Allowed", "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" } } } }, "500": { "description": "Internal Server Error", "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" } } } } }, "security": [ { "cookieAuth": [ ] } ] } }, "/api/v1/system/status": { "get": { "tags": [ "Template.Api" ], "summary": "Returns API status and echoes a validated optional value.", "operationId": "GetSystemStatus", "parameters": [ { "name": "echo", "in": "query", "schema": { "maxLength": 64, "minLength": 1, "type": "string" } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiResponseOfSystemStatusResponse" } } } }, "400": { "description": "Bad Request", "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/HttpValidationProblemDetails" } } } }, "404": { "description": "Not Found", "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" } } } }, "405": { "description": "Method Not Allowed", "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" } } } }, "500": { "description": "Internal Server Error", "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" } } } } } } }, "/api/v1/system/authenticated": { "get": { "tags": [ "Template.Api" ], "summary": "Confirms that cookie authentication and authorization succeeded.", "operationId": "GetAuthenticatedStatus", "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiResponseOfAuthenticatedResponse" } } } }, "401": { "description": "Unauthorized", "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" } } } }, "403": { "description": "Forbidden", "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" } } } }, "404": { "description": "Not Found", "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" } } } }, "405": { "description": "Method Not Allowed", "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" } } } }, "500": { "description": "Internal Server Error", "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" } } } } }, "security": [ { "cookieAuth": [ ] } ] } }, "/api/local-auth/scenario": { "post": { "tags": [ "local-only" ], "operationId": "CreateLocalAutomationScenario", "parameters": [ { "name": "X-CSRF-TOKEN", "in": "header", "description": "Request token returned by GET /api/v1/auth/csrf.", "required": true, "schema": { "type": "string" } } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateLocalAutomationScenarioRequest" } } } }, "responses": { "201": { "description": "Created", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiResponseOfLocalAutomationScenarioResponse" } } } }, "400": { "description": "Bad Request", "content": { "application/problem+json": { "schema": { "oneOf": [ { "$ref": "#/components/schemas/ProblemDetails" }, { "$ref": "#/components/schemas/HttpValidationProblemDetails" } ] } } } }, "409": { "description": "Conflict", "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" } } } }, "429": { "description": "Too Many Requests", "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" } } } }, "404": { "description": "Not Found", "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" } } } }, "405": { "description": "Method Not Allowed", "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" } } } }, "500": { "description": "Internal Server Error", "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" } } } } }, "x-local-only": true }, "delete": { "tags": [ "local-only" ], "operationId": "DeleteLocalAutomationScenario", "parameters": [ { "name": "X-CSRF-TOKEN", "in": "header", "description": "Request token returned by GET /api/v1/auth/csrf.", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiResponseOfLocalAutomationCleanupResponse" } } } }, "400": { "description": "Bad Request", "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" } } } }, "401": { "description": "Unauthorized", "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" } } } }, "403": { "description": "Forbidden", "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" } } } }, "404": { "description": "Not Found", "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" } } } }, "405": { "description": "Method Not Allowed", "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" } } } }, "500": { "description": "Internal Server Error", "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" } } } } }, "security": [ { "cookieAuth": [ ] } ], "x-local-only": true } }, "/api/local-auth/sign-in": { "post": { "tags": [ "local-only" ], "operationId": "SignInLocalAutomation", "parameters": [ { "name": "X-CSRF-TOKEN", "in": "header", "description": "Request token returned by GET /api/v1/auth/csrf.", "required": true, "schema": { "type": "string" } } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/LocalAutomationSignInRequest" } } }, "required": true }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiResponseOfAuthSessionResponse" } } } }, "400": { "description": "Bad Request", "content": { "application/problem+json": { "schema": { "oneOf": [ { "$ref": "#/components/schemas/ProblemDetails" }, { "$ref": "#/components/schemas/HttpValidationProblemDetails" } ] } } } }, "401": { "description": "Unauthorized", "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" } } } }, "429": { "description": "Too Many Requests", "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" } } } }, "404": { "description": "Not Found", "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" } } } }, "405": { "description": "Method Not Allowed", "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" } } } }, "500": { "description": "Internal Server Error", "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" } } } } }, "x-local-only": true } }, "/api/health": { "get": { "tags": [ "Template.Api" ], "summary": "Reports whether the API is ready to receive traffic.", "operationId": "GetHealth", "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiResponseOfHealthResponse" } } } }, "503": { "description": "Service Unavailable", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiResponseOfHealthResponse" } } } }, "404": { "description": "Not Found", "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" } } } }, "405": { "description": "Method Not Allowed", "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" } } } }, "500": { "description": "Internal Server Error", "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" } } } } } } }, "/api/health/live": { "get": { "tags": [ "Template.Api" ], "summary": "Reports whether the API process can answer requests.", "operationId": "GetLiveness", "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiResponseOfHealthResponse" } } } }, "503": { "description": "Service Unavailable", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiResponseOfHealthResponse" } } } }, "404": { "description": "Not Found", "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" } } } }, "405": { "description": "Method Not Allowed", "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" } } } }, "500": { "description": "Internal Server Error", "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" } } } } } } }, "/api/health/ready": { "get": { "tags": [ "Template.Api" ], "summary": "Reports whether the API is ready to receive traffic.", "operationId": "GetReadiness", "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiResponseOfHealthResponse" } } } }, "503": { "description": "Service Unavailable", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiResponseOfHealthResponse" } } } }, "404": { "description": "Not Found", "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" } } } }, "405": { "description": "Method Not Allowed", "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" } } } }, "500": { "description": "Internal Server Error", "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" } } } } } } } }, "components": { "schemas": { "ApiResponseOfAuthCapabilitiesResponse": { "required": [ "data" ], "type": "object", "properties": { "data": { "$ref": "#/components/schemas/AuthCapabilitiesResponse" } } }, "ApiResponseOfAuthCsrfResponse": { "required": [ "data" ], "type": "object", "properties": { "data": { "$ref": "#/components/schemas/AuthCsrfResponse" } } }, "ApiResponseOfAuthenticatedResponse": { "required": [ "data" ], "type": "object", "properties": { "data": { "$ref": "#/components/schemas/AuthenticatedResponse" } } }, "ApiResponseOfAuthSessionResponse": { "required": [ "data" ], "type": "object", "properties": { "data": { "$ref": "#/components/schemas/AuthSessionResponse" } } }, "ApiResponseOfHealthResponse": { "required": [ "data" ], "type": "object", "properties": { "data": { "$ref": "#/components/schemas/HealthResponse" } } }, "ApiResponseOfLocalAutomationCleanupResponse": { "required": [ "data" ], "type": "object", "properties": { "data": { "$ref": "#/components/schemas/LocalAutomationCleanupResponse" } } }, "ApiResponseOfLocalAutomationScenarioResponse": { "required": [ "data" ], "type": "object", "properties": { "data": { "$ref": "#/components/schemas/LocalAutomationScenarioResponse" } } }, "ApiResponseOfSystemStatusResponse": { "required": [ "data" ], "type": "object", "properties": { "data": { "$ref": "#/components/schemas/SystemStatusResponse" } } }, "AuthCapabilitiesResponse": { "required": [ "localAutomationEnabled", "providers" ], "type": "object", "properties": { "localAutomationEnabled": { "type": "boolean" }, "providers": { "type": "array", "items": { "$ref": "#/components/schemas/AuthProviderResponse" } } } }, "AuthCsrfResponse": { "required": [ "requestToken" ], "type": "object", "properties": { "requestToken": { "type": "string" } } }, "AuthenticatedResponse": { "required": [ "status" ], "type": "object", "properties": { "status": { "type": "string" } } }, "AuthProviderResponse": { "required": [ "id", "displayName" ], "type": "object", "properties": { "id": { "type": "string" }, "displayName": { "type": "string" } } }, "AuthSessionMetadataResponse": { "required": [ "id", "createdAt", "updatedAt", "expiresAt" ], "type": "object", "properties": { "id": { "type": "string", "format": "uuid" }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" }, "expiresAt": { "type": "string", "format": "date-time" } } }, "AuthSessionResponse": { "required": [ "authenticated", "user", "session" ], "type": "object", "properties": { "authenticated": { "type": "boolean" }, "user": { "oneOf": [ { "type": "null" }, { "$ref": "#/components/schemas/AuthUserResponse" } ] }, "session": { "oneOf": [ { "type": "null" }, { "$ref": "#/components/schemas/AuthSessionMetadataResponse" } ] } } }, "AuthUserResponse": { "required": [ "id", "name", "email", "emailVerified", "image" ], "type": "object", "properties": { "id": { "type": "string", "format": "uuid" }, "name": { "type": "string" }, "email": { "type": "string" }, "emailVerified": { "type": "boolean" }, "image": { "type": [ "null", "string" ] } } }, "CreateLocalAutomationScenarioRequest": { "type": "object", "properties": { "name": { "type": [ "null", "string" ], "description": "Trimmed before use; the trimmed name must contain 2 to 50 characters.", "x-trimmed-min-length": 2, "x-trimmed-max-length": 50 }, "email": { "type": [ "null", "string" ], "description": "Trimmed and lowercased before use; the trimmed value must be a valid email of at most 254 characters in the case-insensitive local-agent+...@local-agent.test namespace.", "x-trimmed-max-length": 254, "x-trimmed-format": "email", "x-trimmed-pattern": "^[lL][oO][cC][aA][lL]-[aA][gG][eE][nN][tT]\\+[^@\\s]+@[lL][oO][cC][aA][lL]-[aA][gG][eE][nN][tT]\\.[tT][eE][sS][tT]$" }, "password": { "maxLength": 128, "minLength": 12, "type": [ "null", "string" ] } }, "additionalProperties": false }, "HealthResponse": { "required": [ "status", "timestamp" ], "type": "object", "properties": { "status": { "type": "string" }, "timestamp": { "type": "string", "format": "date-time" } } }, "HttpValidationProblemDetails": { "required": [ "type", "title", "status", "detail", "instance", "code", "traceId", "errors" ], "type": "object", "properties": { "type": { "type": "string" }, "title": { "type": "string" }, "status": { "pattern": "^-?(?:0|[1-9]\\d*)$", "type": [ "integer", "string" ], "format": "int32" }, "detail": { "type": "string" }, "instance": { "type": "string" }, "errors": { "type": "object", "additionalProperties": { "type": "array", "items": { "type": "string" } } }, "code": { "type": "string" }, "traceId": { "type": "string" } } }, "LocalAutomationCleanupResponse": { "required": [ "deletedOrganizations" ], "type": "object", "properties": { "deletedOrganizations": { "pattern": "^-?(?:0|[1-9]\\d*)$", "type": [ "integer", "string" ], "format": "int32" } } }, "LocalAutomationScenarioResponse": { "required": [ "user", "email", "password", "cleanupUrl" ], "type": "object", "properties": { "user": { "$ref": "#/components/schemas/AuthUserResponse" }, "email": { "type": "string" }, "password": { "type": "string" }, "cleanupUrl": { "type": "string" } } }, "LocalAutomationSignInRequest": { "required": [ "email", "password" ], "type": "object", "properties": { "email": { "type": "string" }, "password": { "maxLength": 128, "minLength": 12, "type": "string" } }, "additionalProperties": false }, "ProblemDetails": { "required": [ "type", "title", "status", "detail", "instance", "code", "traceId" ], "type": "object", "properties": { "type": { "type": "string" }, "title": { "type": "string" }, "status": { "pattern": "^-?(?:0|[1-9]\\d*)$", "type": [ "integer", "string" ], "format": "int32" }, "detail": { "type": "string" }, "instance": { "type": "string" }, "code": { "type": "string" }, "traceId": { "type": "string" } } }, "SystemStatusResponse": { "required": [ "status", "apiVersion", "timestamp", "echo" ], "type": "object", "properties": { "status": { "type": "string" }, "apiVersion": { "type": "string" }, "timestamp": { "type": "string", "format": "date-time" }, "echo": { "type": [ "null", "string" ] } } } }, "securitySchemes": { "cookieAuth": { "type": "apiKey", "description": "Secure HttpOnly same-origin session cookie.", "name": "__Host-template.session", "in": "cookie" } } }, "tags": [ { "name": "Template.Api" }, { "name": "local-only" } ] }