{
  "format": "takoform.host-api@v1alpha1",
  "apiGroup": "forms.takoform.com/v1alpha1",
  "discoveryPath": "/.well-known/takoform",
  "wireSchema": "https://forms.takoform.com/schemas/v1alpha1/host-api-wire.schema.json",
  "requiredFeatures": [
    "service_forms",
    "exact_form_ref",
    "optimistic_concurrency",
    "idempotent_lifecycle"
  ],
  "optionalFeatures": ["interface_declarations"],
  "requiredEndpoints": ["api"],
  "optionalEndpoints": ["forms", "interfaces", "oidc_issuer"],
  "resourceVersion": {
    "encoding": "canonical-decimal-string",
    "minimum": "1",
    "maximum": "9223372036854775807",
    "etag": "exactly-one-strong-quoted-resource-version"
  },
  "planBinding": {
    "canonicalization": "RFC8785",
    "portableInputs": [
      "specDigest",
      "resource.apiVersion",
      "resource.kind",
      "resource.metadata.name",
      "resource.metadata.space",
      "resource.metadata.resourceVersion",
      "resource.form.formRef.apiVersion",
      "resource.form.formRef.kind",
      "resource.form.formRef.definitionVersion",
      "resource.form.formRef.schemaDigest",
      "resource.form.packageDigest"
    ],
    "hostPlan": "exact-reviewed-plan",
    "substitutionFailure": "invalid_argument/400-before-mutation",
    "pureBlackBoxInputs": [
      "specDigest",
      "resource.metadata.space",
      "resource.metadata.resourceVersion"
    ],
    "instrumentedAdapter": {
      "scope": "disposable-conformance-adapter-only; production-forbidden",
      "requestHeader": "Takoform-Conformance-Probe-Plan-Binding",
      "resultHeader": "Takoform-Conformance-Probe-Plan-Binding-Result",
      "inputs": [
        "resource.apiVersion",
        "resource.kind",
        "resource.metadata.name",
        "resource.form.formRef.apiVersion",
        "resource.form.formRef.kind",
        "resource.form.formRef.definitionVersion",
        "resource.form.formRef.schemaDigest",
        "resource.form.packageDigest"
      ],
      "bindingPath": "same-canonical-plan-binding-function",
      "rejectedResult": "invalid_argument/400; result=rejected",
      "acceptedNoMutationResult": "204; result=accepted-no-mutation; no-state-mutation",
      "unknownValueFailure": "invalid_argument/400",
      "authorizationOrder": "authenticate-and-authorize-before-probe"
    }
  },
  "idempotency": {
    "scopeDimensions": [
      "authenticated-tenant",
      "authenticated-principal",
      "space",
      "idempotency-key"
    ],
    "fingerprint": [
      "method",
      "request-target",
      "preconditions",
      "request-body-bytes"
    ],
    "replayAuthorization": "authenticate-and-authorize-current-request-before-cache-lookup",
    "crossPrincipalRule": "same-key-is-independent",
    "crossTenantRule": "same-key-is-independent",
    "crossTenantProbe": "same-principal-different-tenant-shared-disposable-resource",
    "revokedRule": "current-authentication-or-authorization-error-not-cached-success",
    "replayDenialCodes": [
      "unauthenticated",
      "permission_denied",
      "policy_denied"
    ],
    "deniedReplayRecordRule": "denial-neither-returns-nor-overwrites-cached-success"
  },
  "wireJSON": {
    "encoding": "UTF-8 I-JSON",
    "rawValidationOrder": "validate-complete-raw-document-before-typed-decode",
    "unknownRequestFieldFailure": "invalid_argument/400-before-mutation",
    "duplicateRequestFailure": "invalid_argument/400-before-mutation",
    "duplicateResponseFailure": "protocol-invalid-before-typed-semantics",
    "duplicateContractFailure": "verification-failure-before-typed-decode"
  },
  "connectionResolution": {
    "sourceSpace": "resource.metadata.space",
    "reference": "Kind/name",
    "crossSpace": "unrepresentable",
    "missing": "resource_not_found/404-before-mutation"
  },
  "exactFormQueryParameters": [
    "apiVersion",
    "definitionVersion",
    "kind",
    "packageDigest",
    "schemaDigest",
    "space"
  ],
  "queryParameterSchemas": {
    "space": "https://forms.takoform.com/schemas/v1alpha1/host-api-wire.schema.json#/$defs/spaceId"
  },
  "operations": [
    {
      "name": "forms",
      "method": "GET",
      "path": "/forms",
      "exactFormQuery": true,
      "precondition": "none",
      "idempotencyKey": false,
      "mutates": false,
      "successStatus": [200],
      "responseSchema": "https://forms.takoform.com/schemas/v1alpha1/host-api-wire.schema.json#/$defs/formsResponse"
    },
    {
      "name": "preview",
      "method": "POST",
      "path": "/resources/preview",
      "exactFormQuery": false,
      "precondition": "if-none-match-on-create-otherwise-if-match",
      "idempotencyKey": false,
      "mutates": false,
      "successStatus": [200],
      "requestSchema": "https://forms.takoform.com/schemas/v1alpha1/host-api-wire.schema.json#/$defs/resourceRequest",
      "responseSchema": "https://forms.takoform.com/schemas/v1alpha1/host-api-wire.schema.json#/$defs/previewResponse"
    },
    {
      "name": "apply",
      "method": "PUT",
      "path": "/resources/{kind}/{name}",
      "exactFormQuery": false,
      "precondition": "if-none-match-on-create-otherwise-if-match",
      "idempotencyKey": true,
      "mutates": true,
      "successStatus": [200, 201],
      "requestSchema": "https://forms.takoform.com/schemas/v1alpha1/host-api-wire.schema.json#/$defs/applyRequest",
      "responseSchema": "https://forms.takoform.com/schemas/v1alpha1/host-api-wire.schema.json#/$defs/resourceResponse"
    },
    {
      "name": "read",
      "method": "GET",
      "path": "/resources/{kind}/{name}",
      "exactFormQuery": true,
      "precondition": "none",
      "idempotencyKey": false,
      "mutates": false,
      "successStatus": [200],
      "responseSchema": "https://forms.takoform.com/schemas/v1alpha1/host-api-wire.schema.json#/$defs/resourceResponse"
    },
    {
      "name": "import",
      "method": "POST",
      "path": "/resources/{kind}/{name}/import",
      "exactFormQuery": false,
      "precondition": "if-none-match-on-create-otherwise-if-match",
      "idempotencyKey": true,
      "mutates": true,
      "successStatus": [200, 201],
      "requestSchema": "https://forms.takoform.com/schemas/v1alpha1/host-api-wire.schema.json#/$defs/importRequest",
      "responseSchema": "https://forms.takoform.com/schemas/v1alpha1/host-api-wire.schema.json#/$defs/resourceEnvelope"
    },
    {
      "name": "observe",
      "method": "POST",
      "path": "/resources/{kind}/{name}/observe",
      "exactFormQuery": true,
      "precondition": "if-match",
      "idempotencyKey": true,
      "mutates": false,
      "successResourceVersion": "equals-if-match",
      "successStatus": [200],
      "responseSchema": "https://forms.takoform.com/schemas/v1alpha1/host-api-wire.schema.json#/$defs/resourceEnvelope"
    },
    {
      "name": "refresh",
      "method": "POST",
      "path": "/resources/{kind}/{name}/refresh",
      "exactFormQuery": true,
      "precondition": "if-match",
      "idempotencyKey": true,
      "mutates": true,
      "successResourceVersion": "equals-if-match",
      "successStatus": [200],
      "responseSchema": "https://forms.takoform.com/schemas/v1alpha1/host-api-wire.schema.json#/$defs/resourceEnvelope"
    },
    {
      "name": "delete",
      "method": "DELETE",
      "path": "/resources/{kind}/{name}",
      "exactFormQuery": true,
      "precondition": "if-match",
      "idempotencyKey": true,
      "mutates": true,
      "successStatus": [204]
    },
    {
      "name": "interfaces",
      "method": "GET",
      "path": "/interfaces",
      "exactFormQuery": false,
      "precondition": "none",
      "idempotencyKey": false,
      "mutates": false,
      "optional": true,
      "requiredQueryParameters": ["space"],
      "optionalQueryParameters": [],
      "successStatus": [200],
      "responseSchema": "https://forms.takoform.com/schemas/v1alpha1/host-api-wire.schema.json#/$defs/interfacesResponse"
    },
    {
      "name": "interface",
      "method": "GET",
      "path": "/interfaces/{name}",
      "exactFormQuery": false,
      "precondition": "none",
      "idempotencyKey": false,
      "mutates": false,
      "optional": true,
      "requiredQueryParameters": ["space"],
      "optionalQueryParameters": ["version", "resourceKind", "resourceName"],
      "pairedQueryParameters": [["resourceKind", "resourceName"]],
      "successStatus": [200],
      "responseSchema": "https://forms.takoform.com/schemas/v1alpha1/host-api-wire.schema.json#/$defs/interfaceDeclaration"
    }
  ],
  "errorEnvelope": {
    "schema": "https://forms.takoform.com/schemas/v1alpha1/host-api-wire.schema.json#/$defs/errorEnvelope",
    "shape": "{\"error\":{\"code\",\"message\",\"requestId\",\"retryable\",\"hostCode?\",\"details?\"}}",
    "codes": [
      "invalid_argument",
      "unauthenticated",
      "permission_denied",
      "form_unknown",
      "form_not_installed",
      "form_unavailable",
      "form_identity_conflict",
      "resource_not_found",
      "resource_version_conflict",
      "resource_busy",
      "import_conflict",
      "policy_denied",
      "backend_unavailable",
      "interface_identity_ambiguous",
      "interface_instance_ambiguous",
      "internal_error"
    ],
    "automaticallyRetryable": ["resource_busy", "backend_unavailable"],
    "httpStatusByCode": {
      "invalid_argument": 400,
      "unauthenticated": 401,
      "permission_denied": 403,
      "form_unknown": 404,
      "form_not_installed": 409,
      "form_unavailable": 503,
      "form_identity_conflict": 409,
      "resource_not_found": 404,
      "resource_version_conflict": 412,
      "resource_busy": 409,
      "import_conflict": 409,
      "policy_denied": 403,
      "backend_unavailable": 503,
      "interface_identity_ambiguous": 409,
      "interface_instance_ambiguous": 409,
      "internal_error": 500
    }
  }
}
