{
  "info": {
    "title": "Amakora Integration Sandbox API",
    "version": "v1.0",
    "description": "A controlled API for validating Amakora integration behavior without production impact."
  },
  "tags": [
    {
      "name": "Sandbox",
      "description": "Safe integration validation operations."
    }
  ],
  "paths": {
    "/v1/sandbox/echo": {
      "post": {
        "tags": [
          "Sandbox"
        ],
        "summary": "Echo a validated sandbox payload",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EchoResponse"
                },
                "example": {
                  "message": "Hello from Amakora Developers",
                  "accepted": true,
                  "reference": "example-001"
                }
              }
            },
            "description": "Validated payload"
          },
          "401": {
            "description": "Missing or invalid sandbox credential"
          },
          "422": {
            "description": "Payload validation failed"
          }
        },
        "operationId": "echoSandboxPayload",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EchoRequest"
              },
              "example": {
                "message": "Hello from Amakora Developers",
                "reference": "example-001"
              }
            }
          },
          "required": true
        }
      }
    },
    "/v1/sandbox/health": {
      "get": {
        "tags": [
          "Sandbox"
        ],
        "summary": "Check sandbox service availability",
        "security": [],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HealthResponse"
                },
                "example": {
                  "status": "ok",
                  "environment": "sandbox"
                }
              }
            },
            "description": "Sandbox service is available"
          }
        },
        "operationId": "getSandboxHealth"
      }
    },
    "/v1/sandbox/validate": {
      "post": {
        "tags": [
          "Sandbox"
        ],
        "summary": "Validate an integration payload without executing it",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "valid": true,
                  "errors": []
                }
              }
            },
            "description": "Validation result"
          },
          "422": {
            "description": "Payload validation failed"
          }
        },
        "operationId": "validateSandboxPayload",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true
              },
              "example": {
                "payload": {
                  "name": "Sample integration"
                },
                "operation": "create-example"
              }
            }
          },
          "required": true
        }
      }
    }
  },
  "openapi": "3.1.0",
  "servers": [
    {
      "url": "https://sandbox.api.amakoragroup.com",
      "description": "Sandbox"
    }
  ],
  "components": {
    "schemas": {
      "EchoRequest": {
        "type": "object",
        "required": [
          "message"
        ],
        "properties": {
          "message": {
            "type": "string",
            "maxLength": 500
          },
          "reference": {
            "type": "string",
            "maxLength": 100
          }
        },
        "additionalProperties": false
      },
      "EchoResponse": {
        "allOf": [
          {
            "$ref": "#/components/schemas/EchoRequest"
          },
          {
            "type": "object",
            "required": [
              "accepted"
            ],
            "properties": {
              "accepted": {
                "type": "boolean"
              }
            }
          }
        ]
      },
      "HealthResponse": {
        "type": "object",
        "required": [
          "status",
          "environment"
        ],
        "properties": {
          "status": {
            "type": "string",
            "example": "ok"
          },
          "environment": {
            "type": "string",
            "const": "sandbox"
          }
        }
      }
    },
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "Amakora sandbox API key"
      }
    }
  }
}