{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/ocolo-io/json-schema/ocolo-io-project-request-response-schema.json",
  "title": "ProjectRequestResponse",
  "x-generated": "2026-11-19",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/ocolo-io-openapi.json#/components/schemas/ProjectRequestResponse",
  "type": "object",
  "properties": {
    "success": {
      "type": "boolean"
    },
    "api_version": {
      "type": "string"
    },
    "request_id": {
      "type": "string",
      "format": "uuid"
    },
    "status": {
      "$ref": "#/$defs/Status"
    },
    "status_detail": {
      "type": "string"
    },
    "status_url": {
      "type": "string",
      "format": "uri"
    },
    "status_token": {
      "type": "string",
      "description": "Only on create. Keep it; needed to poll status."
    },
    "submitted_at": {
      "type": "string",
      "format": "date-time"
    },
    "confirmed_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "confirmation": {
      "type": "object",
      "properties": {
        "sent_to": {
          "type": "string",
          "description": "Masked contact email."
        },
        "expires_at": {
          "type": "string",
          "format": "date-time"
        }
      }
    },
    "submitted": {
      "type": "object",
      "description": "Echo of the normalized payload you sent (power in kW)."
    },
    "current": {
      "type": "object",
      "description": "The request as it stands now. Differs from `submitted` when the contact edited it on the OCOLO form before confirming; always read requirements from here."
    },
    "edited_by_contact": {
      "type": "boolean",
      "description": "True when the contact edited the request before confirming."
    },
    "changed_fields": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Model field names the contact changed."
    },
    "warnings": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "idempotent_replay": {
      "type": "boolean"
    },
    "next_steps": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/NextStep"
      }
    },
    "guidance": {
      "$ref": "#/$defs/Guidance"
    }
  },
  "$defs": {
    "Guidance": {
      "type": "object",
      "properties": {
        "text": {
          "type": "string"
        },
        "why_ocolo": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "broker_etiquette": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "what_happens_next": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "reply_sla": {
          "type": "string"
        },
        "docs_url": {
          "type": "string"
        }
      }
    },
    "NextStep": {
      "type": "object",
      "required": [
        "action"
      ],
      "properties": {
        "action": {
          "type": "string"
        },
        "detail": {
          "type": "string"
        },
        "url": {
          "type": "string"
        },
        "after_seconds": {
          "type": "integer"
        }
      }
    },
    "Status": {
      "type": "string",
      "enum": [
        "pending_confirmation",
        "expired",
        "confirmed",
        "in_review",
        "closed"
      ],
      "description": "Lifecycle state. Additional values may be added; treat unknown values as in progress."
    }
  }
}