{
  "openapi": "3.1.0",
  "info": {
    "title": "Artounis Website service intake",
    "version": "1.14.2",
    "description": "Dedicated Website/environment service credential. Request identifiers are stable and retries reconcile the original outcome. Runtime activation and actual email delivery are verified separately."
  },
  "servers": [
    {
      "url": "/",
      "description": "Use the explicitly configured service origin; credentials belong only in the Authorization header."
    }
  ],
  "paths": {
    "/api/integrations/website/v1/requests": {
      "post": {
        "operationId": "createWebsiteBusinessRequest",
        "security": [
          {
            "websiteBearer": []
          }
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Must exactly equal body.requestId."
          }
        ],
        "requestBody": {
          "required": true,
          "description": "Maximum16384UTF8bytes. Origin and Cookie are forbidden on the machine route.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Submission"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Idempotent replay; no second ticket/outbox row.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Receipt"
                }
              }
            }
          },
          "201": {
            "description": "Actual ticket UUID/reference and confirmation status; no ticket body, email contents, files, user session or customer authorization.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Receipt"
                }
              }
            }
          },
          "400": {
            "description": "Stable error code. Retry only 429 with Retry-After or transient503; reconcile unknown outcomes before replay.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Stable error code. Retry only 429 with Retry-After or transient503; reconcile unknown outcomes before replay.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Stable error code. Retry only 429 with Retry-After or transient503; reconcile unknown outcomes before replay.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Stable error code. Retry only 429 with Retry-After or transient503; reconcile unknown outcomes before replay.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Stable error code. Retry only 429 with Retry-After or transient503; reconcile unknown outcomes before replay.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "413": {
            "description": "Stable error code. Retry only 429 with Retry-After or transient503; reconcile unknown outcomes before replay.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "415": {
            "description": "Stable error code. Retry only 429 with Retry-After or transient503; reconcile unknown outcomes before replay.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Stable error code. Retry only 429 with Retry-After or transient503; reconcile unknown outcomes before replay.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Stable error code. Retry only 429 with Retry-After or transient503; reconcile unknown outcomes before replay.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "headers": {
              "Retry-After": {
                "description": "Positive delta-seconds: remaining fixed-window time; the rolling-hour mail quota uses a conservative3600-second upper bound. Rejected fixed-window calls do not extend the anchor. Other new traffic can consume quota again.",
                "schema": {
                  "type": "string",
                  "pattern": "^[1-9][0-9]*$",
                  "example": "199"
                }
              }
            }
          },
          "503": {
            "description": "Stable error code. Retry only 429 with Retry-After or transient503; reconcile unknown outcomes before replay.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "requestId": {
                      "type": "string",
                      "format": "uuid",
                      "description": "Server-generated correlation identifier on unexpected failures. Absent for explicit readiness failures; never contains submitted data."
                    }
                  }
                }
              }
            },
            "headers": {
              "X-Request-ID": {
                "description": "Present on an unexpected service failure; known readiness responses may omit it.",
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              }
            }
          }
        }
      }
    },
    "/api/integrations/website/v1/requests/{requestId}": {
      "get": {
        "operationId": "reconcileWebsiteBusinessRequest",
        "security": [
          {
            "websiteBearer": []
          }
        ],
        "parameters": [
          {
            "name": "requestId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Actual ticket UUID/reference and confirmation status; no ticket body, email contents, files, user session or customer authorization.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Receipt"
                }
              }
            }
          },
          "400": {
            "description": "Stable error code. Retry only 429 with Retry-After or transient503; reconcile unknown outcomes before replay.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Stable error code. Retry only 429 with Retry-After or transient503; reconcile unknown outcomes before replay.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Stable error code. Retry only 429 with Retry-After or transient503; reconcile unknown outcomes before replay.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Stable error code. Retry only 429 with Retry-After or transient503; reconcile unknown outcomes before replay.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Stable error code. Retry only 429 with Retry-After or transient503; reconcile unknown outcomes before replay.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "413": {
            "description": "Stable error code. Retry only 429 with Retry-After or transient503; reconcile unknown outcomes before replay.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "415": {
            "description": "Stable error code. Retry only 429 with Retry-After or transient503; reconcile unknown outcomes before replay.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Stable error code. Retry only 429 with Retry-After or transient503; reconcile unknown outcomes before replay.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Stable error code. Retry only 429 with Retry-After or transient503; reconcile unknown outcomes before replay.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "headers": {
              "Retry-After": {
                "description": "Positive delta-seconds: remaining fixed-window time; the rolling-hour mail quota uses a conservative3600-second upper bound. Rejected fixed-window calls do not extend the anchor. Other new traffic can consume quota again.",
                "schema": {
                  "type": "string",
                  "pattern": "^[1-9][0-9]*$",
                  "example": "199"
                }
              }
            }
          },
          "503": {
            "description": "Stable error code. Retry only 429 with Retry-After or transient503; reconcile unknown outcomes before replay.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "requestId": {
                      "type": "string",
                      "format": "uuid",
                      "description": "Server-generated correlation identifier on unexpected failures. Absent for explicit readiness failures; never contains submitted data."
                    }
                  }
                }
              }
            },
            "headers": {
              "X-Request-ID": {
                "description": "Present on an unexpected service failure; known readiness responses may omit it.",
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Submission": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "requestId",
          "locale",
          "name",
          "email",
          "kinds",
          "message",
          "privacyConsent"
        ],
        "properties": {
          "requestId": {
            "type": "string",
            "format": "uuid"
          },
          "locale": {
            "enum": [
              "de",
              "en",
              "fr",
              "es"
            ]
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "email": {
            "type": "string",
            "format": "email",
            "maxLength": 254
          },
          "company": {
            "type": "string",
            "maxLength": 160
          },
          "phone": {
            "type": "string",
            "maxLength": 60
          },
          "kinds": {
            "type": "array",
            "minItems": 1,
            "maxItems": 5,
            "uniqueItems": true,
            "items": {
              "enum": [
                "software",
                "ai",
                "web",
                "advice",
                "products"
              ]
            }
          },
          "productIntent": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "sales",
              "demo",
              "integration",
              null
            ]
          },
          "message": {
            "type": "string",
            "minLength": 1,
            "maxLength": 5000
          },
          "budget": {
            "type": "string",
            "maxLength": 80
          },
          "desiredStart": {
            "type": "string",
            "maxLength": 80
          },
          "privacyConsent": {
            "const": true
          }
        },
        "allOf": [
          {
            "if": {
              "properties": {
                "kinds": {
                  "contains": {
                    "const": "products"
                  }
                }
              }
            },
            "then": {
              "required": [
                "productIntent"
              ],
              "properties": {
                "productIntent": {
                  "enum": [
                    "sales",
                    "demo",
                    "integration"
                  ]
                }
              }
            },
            "else": {
              "properties": {
                "productIntent": {
                  "type": "null"
                }
              }
            }
          }
        ]
      },
      "Receipt": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "requestId",
          "ticket",
          "confirmation",
          "replayed"
        ],
        "properties": {
          "requestId": {
            "type": "string",
            "format": "uuid"
          },
          "ticket": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "id",
              "reference"
            ],
            "properties": {
              "id": {
                "type": "string",
                "format": "uuid"
              },
              "reference": {
                "type": "string",
                "pattern": "^[0-9]{20,24}$",
                "description": "Current public display number. UUID remains stable when the project/reference changes."
              }
            }
          },
          "confirmation": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "state",
              "locale",
              "inboxDelivery"
            ],
            "properties": {
              "state": {
                "enum": [
                  "queued",
                  "smtp-accepted",
                  "test-captured",
                  "attention-required"
                ]
              },
              "locale": {
                "enum": [
                  "de",
                  "en",
                  "fr",
                  "es"
                ]
              },
              "inboxDelivery": {
                "const": "unverified"
              }
            }
          },
          "replayed": {
            "type": "boolean"
          }
        }
      }
    },
    "securitySchemes": {
      "websiteBearer": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "atw_<key-uuid>.<random-secret>",
        "description": "Never borrow an Owner cookie. One service client and environment; no ticket-reading, mailbox, file or management scope."
      }
    }
  }
}
