{
  "$id": "https://docs.mildport.com/spec/error-registry.v1.json",
  "title": "Mildport error registry v1",
  "description": "The machine-readable error codes the import service emits in error envelopes. These codes are wire contract: adding one is a feature and may happen in any release; renaming or removing one is a breaking change. Requests that fail before routing (malformed body, unknown path) may carry additional transport-level codes — clients must treat unrecognized codes according to the HTTP status they arrive with.",
  "$comment": "License: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Generated from the Mildport contract sources — do not edit by hand.",
  "codes": [
    "BAD_REQUEST",
    "UNAUTHORIZED",
    "FORBIDDEN",
    "NOT_FOUND",
    "PAYLOAD_TOO_LARGE",
    "CONTENT_TOO_LARGE",
    "TOO_MANY_REQUESTS",
    "LICENSE_DEV_MODE",
    "LICENSE_NO_PUBLIC_KEY",
    "LICENSE_REVOKED",
    "ORIGIN_NOT_ALLOWED",
    "ROWS_LIMIT_EXCEEDED",
    "MONTHLY_POOL_EXCEEDED",
    "IMPORT_BLOCKED",
    "AGENT_ACCESS_REQUIRED",
    "AGENT_EXECUTE_DISABLED",
    "OPEN_QUESTIONS_UNRESOLVED",
    "BLOB_IN_MEMORY",
    "BLOB_MISSING",
    "BLOB_S3_NO_BUCKET",
    "BLOB_UNAVAILABLE",
    "NO_BLOB",
    "STAGING_MISSING",
    "CHANGESET_NOT_FOUND",
    "CHANGESET_REVERT_UNSUPPORTED",
    "CHANGESET_STATE_INVALID",
    "CHANGESET_TOO_LARGE",
    "INGEST_JOB_FAILED",
    "JOB_NOT_FOUND",
    "NOT_SPREADSHEET",
    "SHEET_NOT_FOUND",
    "SHEET_WINDOW_UNAVAILABLE",
    "XLSX_DECODE_UNAVAILABLE",
    "NORMALIZATION_FAILED",
    "CATALOG_LIMIT_REACHED",
    "CATALOG_NOT_FOUND",
    "INVALID_CATALOG",
    "INVALID_PATCH",
    "DRAFT_NOT_FOUND",
    "VERSION_ALREADY_LIVE",
    "VERSION_NOT_FOUND",
    "OVERRIDE_NOT_FOUND",
    "AI_FAILED",
    "BUDGET_EXCEEDED",
    "EMPTY_SPEC",
    "NO_SPEC_URL",
    "UNRECOGNIZED_SPEC",
    "DRIFT_UNSUPPORTED",
    "DATASET_FETCH_FAILED",
    "INVALID_URL",
    "BLOCKED_URL",
    "FETCH_FAILED",
    "TOO_LARGE",
    "QUESTION_NOT_FOUND",
    "QUESTION_NOT_OPEN",
    "UNGROUNDED_AGENT_ANSWER",
    "REFERENCE_UNRESOLVED",
    "NO_WEBHOOK_REGISTERED",
    "WEBHOOK_APPLY_REQUIRED",
    "IDEMPOTENCY_KEY_MISMATCH",
    "IDEMPOTENCY_KEY_IN_PROGRESS",
    "EVENT_SINK_NOT_NOOP",
    "AI_ENV_IGNORED",
    "MONGO_NO_URI",
    "CORS_NO_ORIGINS"
  ],
  "envelopes": {
    "ok": {
      "$schema": "https://json-schema.org/draft/2020-12/schema",
      "type": "object",
      "properties": {
        "status": {
          "type": "string",
          "const": "ok"
        },
        "payload": {}
      },
      "required": [
        "status"
      ],
      "additionalProperties": false
    },
    "error": {
      "$schema": "https://json-schema.org/draft/2020-12/schema",
      "type": "object",
      "properties": {
        "status": {
          "type": "string",
          "const": "error"
        },
        "code": {
          "type": "string"
        },
        "message": {
          "type": "string"
        },
        "issues": {
          "type": "array",
          "items": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {}
          }
        }
      },
      "required": [
        "status",
        "code"
      ],
      "additionalProperties": false
    }
  }
}
