{
  "openapi": "3.1.0",
  "jsonSchemaDialect": "https://json-schema.org/draft/2020-12/schema",
  "info": {
    "title": "CoursePan Management API",
    "version": "1.0.0",
    "summary": "Tenant-bound server-to-server administration for a CoursePan school.",
    "description": "Every request is authenticated by a one-time CoursePan API key and resolved to exactly one school. Monetary values are integer minor units, byte quantities are exact integers, and timestamps are ISO 8601. Mutation requests require Idempotency-Key. Mutations of existing resources also require the latest ETag in If-Match. Raw secrets are returned only when a key or webhook signing secret is first issued or rotated."
  },
  "servers": [
    {
      "url": "https://{host}/api",
      "description": "CoursePan deployment",
      "variables": {
        "host": {
          "default": "app.coursekit.test",
          "description": "The deployment host supplied by CoursePan."
        }
      }
    }
  ],
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "tags": [
    {"name": "Courses"},
    {"name": "Learners"},
    {"name": "Contacts"},
    {"name": "Enrollments"},
    {"name": "Usage"},
    {"name": "Offers"},
    {"name": "Orders"},
    {"name": "Subscriptions"},
    {"name": "Campaigns"},
    {"name": "Automations"},
    {"name": "Community"},
    {"name": "Webhooks"}
  ],
  "paths": {
    "/v1/management/courses": {
      "get": {
        "operationId": "listCourses",
        "tags": ["Courses"],
        "summary": "List courses",
        "x-coursepan-scope": "courses:read",
        "parameters": [
          {"$ref": "#/components/parameters/Page"},
          {"$ref": "#/components/parameters/PerPage"},
          {"name": "status", "in": "query", "schema": {"$ref": "#/components/schemas/CourseStatus"}},
          {"$ref": "#/components/parameters/UpdatedAfter"}
        ],
        "responses": {"200": {"$ref": "#/components/responses/CourseList"}, "401": {"$ref": "#/components/responses/Unauthorized"}, "403": {"$ref": "#/components/responses/Forbidden"}}
      },
      "post": {
        "operationId": "createCourse",
        "tags": ["Courses"],
        "summary": "Create a course",
        "x-coursepan-scope": "courses:write",
        "x-idempotency-required": true,
        "parameters": [{"$ref": "#/components/parameters/IdempotencyKey"}],
        "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CourseCreate"}}}},
        "responses": {"201": {"$ref": "#/components/responses/Course"}, "401": {"$ref": "#/components/responses/Unauthorized"}, "403": {"$ref": "#/components/responses/Forbidden"}, "409": {"$ref": "#/components/responses/Conflict"}, "422": {"$ref": "#/components/responses/ValidationFailed"}}
      }
    },
    "/v1/management/courses/{course}": {
      "parameters": [{"$ref": "#/components/parameters/CourseId"}],
      "get": {
        "operationId": "getCourse",
        "tags": ["Courses"],
        "summary": "Get a course",
        "x-coursepan-scope": "courses:read",
        "responses": {"200": {"$ref": "#/components/responses/Course"}, "404": {"$ref": "#/components/responses/NotFound"}}
      },
      "patch": {
        "operationId": "updateCourse",
        "tags": ["Courses"],
        "summary": "Update a course",
        "x-coursepan-scope": "courses:write",
        "x-idempotency-required": true,
        "x-etag-required": true,
        "parameters": [{"$ref": "#/components/parameters/IdempotencyKey"}, {"$ref": "#/components/parameters/IfMatch"}],
        "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CoursePatch"}}}},
        "responses": {"200": {"$ref": "#/components/responses/Course"}, "404": {"$ref": "#/components/responses/NotFound"}, "412": {"$ref": "#/components/responses/PreconditionFailed"}, "422": {"$ref": "#/components/responses/ValidationFailed"}, "428": {"$ref": "#/components/responses/PreconditionRequired"}}
      }
    },
    "/v1/management/students": {
      "get": {
        "operationId": "listStudents",
        "tags": ["Learners"],
        "summary": "List learners",
        "x-coursepan-scope": "students:read",
        "parameters": [{"$ref": "#/components/parameters/Page"}, {"$ref": "#/components/parameters/PerPage"}],
        "responses": {"200": {"$ref": "#/components/responses/StudentList"}, "401": {"$ref": "#/components/responses/Unauthorized"}, "403": {"$ref": "#/components/responses/Forbidden"}}
      }
    },
    "/v1/management/students/{student}": {
      "parameters": [{"$ref": "#/components/parameters/StudentId"}],
      "get": {
        "operationId": "getStudent",
        "tags": ["Learners"],
        "summary": "Get a learner",
        "x-coursepan-scope": "students:read",
        "responses": {"200": {"$ref": "#/components/responses/Student"}, "404": {"$ref": "#/components/responses/NotFound"}}
      },
      "patch": {
        "operationId": "updateStudent",
        "tags": ["Learners"],
        "summary": "Update learner identity or account state",
        "x-coursepan-scope": "students:write",
        "x-idempotency-required": true,
        "x-etag-required": true,
        "parameters": [{"$ref": "#/components/parameters/IdempotencyKey"}, {"$ref": "#/components/parameters/IfMatch"}],
        "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/StudentPatch"}}}},
        "responses": {"200": {"$ref": "#/components/responses/Student"}, "404": {"$ref": "#/components/responses/NotFound"}, "412": {"$ref": "#/components/responses/PreconditionFailed"}, "422": {"$ref": "#/components/responses/ValidationFailed"}, "428": {"$ref": "#/components/responses/PreconditionRequired"}}
      }
    },
    "/v1/management/contacts": {
      "get": {
        "operationId": "listContacts",
        "tags": ["Contacts"],
        "summary": "List CRM contacts",
        "x-coursepan-scope": "contacts:read",
        "parameters": [
          {"$ref": "#/components/parameters/Page"},
          {"$ref": "#/components/parameters/PerPage"},
          {"name": "status", "in": "query", "schema": {"type": "string", "enum": ["active", "unsubscribed", "bounced", "complained", "archived"]}},
          {"name": "email", "in": "query", "schema": {"type": "string", "format": "email"}},
          {"$ref": "#/components/parameters/UpdatedAfter"}
        ],
        "responses": {"200": {"$ref": "#/components/responses/ContactList"}, "401": {"$ref": "#/components/responses/Unauthorized"}, "403": {"$ref": "#/components/responses/Forbidden"}}
      },
      "post": {
        "operationId": "createContact",
        "tags": ["Contacts"],
        "summary": "Create a CRM contact without inferring consent",
        "x-coursepan-scope": "contacts:write",
        "x-idempotency-required": true,
        "parameters": [{"$ref": "#/components/parameters/IdempotencyKey"}],
        "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ContactCreate"}}}},
        "responses": {"201": {"$ref": "#/components/responses/Contact"}, "422": {"$ref": "#/components/responses/ValidationFailed"}}
      }
    },
    "/v1/management/contacts/{contact}": {
      "parameters": [{"$ref": "#/components/parameters/ContactId"}],
      "get": {
        "operationId": "getContact",
        "tags": ["Contacts"],
        "summary": "Get a CRM contact",
        "x-coursepan-scope": "contacts:read",
        "responses": {"200": {"$ref": "#/components/responses/Contact"}, "404": {"$ref": "#/components/responses/NotFound"}}
      },
      "patch": {
        "operationId": "updateContact",
        "tags": ["Contacts"],
        "summary": "Update a CRM contact",
        "x-coursepan-scope": "contacts:write",
        "x-idempotency-required": true,
        "x-etag-required": true,
        "parameters": [{"$ref": "#/components/parameters/IdempotencyKey"}, {"$ref": "#/components/parameters/IfMatch"}],
        "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ContactPatch"}}}},
        "responses": {"200": {"$ref": "#/components/responses/Contact"}, "404": {"$ref": "#/components/responses/NotFound"}, "412": {"$ref": "#/components/responses/PreconditionFailed"}, "422": {"$ref": "#/components/responses/ValidationFailed"}, "428": {"$ref": "#/components/responses/PreconditionRequired"}}
      }
    },
    "/v1/management/contacts/{contact}/archive": {
      "parameters": [{"$ref": "#/components/parameters/ContactId"}, {"$ref": "#/components/parameters/IdempotencyKey"}, {"$ref": "#/components/parameters/IfMatch"}],
      "post": {
        "operationId": "archiveContact",
        "tags": ["Contacts"],
        "summary": "Archive a contact without deleting consent history",
        "x-coursepan-scope": "contacts:write",
        "x-idempotency-required": true,
        "x-etag-required": true,
        "responses": {"200": {"$ref": "#/components/responses/Contact"}, "404": {"$ref": "#/components/responses/NotFound"}, "412": {"$ref": "#/components/responses/PreconditionFailed"}, "428": {"$ref": "#/components/responses/PreconditionRequired"}}
      }
    },
    "/v1/management/enrollments": {
      "get": {
        "operationId": "listEnrollments",
        "tags": ["Enrollments"],
        "summary": "List enrollments",
        "x-coursepan-scope": "enrollments:read",
        "parameters": [
          {"$ref": "#/components/parameters/Page"},
          {"$ref": "#/components/parameters/PerPage"},
          {"name": "student_id", "in": "query", "schema": {"$ref": "#/components/schemas/Uuid"}},
          {"name": "course_id", "in": "query", "schema": {"$ref": "#/components/schemas/Uuid"}},
          {"name": "status", "in": "query", "schema": {"type": "string", "enum": ["active", "completed", "expired", "cancelled"]}}
        ],
        "responses": {"200": {"$ref": "#/components/responses/EnrollmentList"}}
      }
    },
    "/v1/management/enrollments/{enrollment}": {
      "parameters": [{"$ref": "#/components/parameters/EnrollmentId"}],
      "get": {
        "operationId": "getEnrollment",
        "tags": ["Enrollments"],
        "summary": "Get an enrollment",
        "x-coursepan-scope": "enrollments:read",
        "responses": {"200": {"$ref": "#/components/responses/Enrollment"}, "404": {"$ref": "#/components/responses/NotFound"}}
      }
    },
    "/v1/management/enrollment-grants": {
      "post": {
        "operationId": "grantEnrollmentAccess",
        "tags": ["Enrollments"],
        "summary": "Grant course access from an explicit external source",
        "x-coursepan-scope": "enrollments:grant",
        "x-idempotency-required": true,
        "parameters": [{"$ref": "#/components/parameters/IdempotencyKey"}],
        "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/EnrollmentGrantCreate"}}}},
        "responses": {"201": {"$ref": "#/components/responses/EnrollmentGrant"}, "422": {"$ref": "#/components/responses/ValidationFailed"}}
      }
    },
    "/v1/management/enrollments/{enrollment}/revoke": {
      "parameters": [{"$ref": "#/components/parameters/EnrollmentId"}, {"$ref": "#/components/parameters/IdempotencyKey"}, {"$ref": "#/components/parameters/IfMatch"}],
      "post": {
        "operationId": "revokeEnrollmentGrant",
        "tags": ["Enrollments"],
        "summary": "Revoke only the named API-managed access source",
        "x-coursepan-scope": "enrollments:revoke",
        "x-idempotency-required": true,
        "x-etag-required": true,
        "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/EnrollmentGrantRevoke"}}}},
        "responses": {"200": {"$ref": "#/components/responses/EnrollmentGrant"}, "404": {"$ref": "#/components/responses/NotFound"}, "412": {"$ref": "#/components/responses/PreconditionFailed"}, "428": {"$ref": "#/components/responses/PreconditionRequired"}}
      }
    },
    "/v1/management/usage": {
      "get": {
        "operationId": "getUsage",
        "tags": ["Usage"],
        "summary": "Get plan and reconciled video usage",
        "x-coursepan-scope": "usage:read",
        "responses": {"200": {"$ref": "#/components/responses/Usage"}}
      }
    },
    "/v1/management/offers": {
      "get": {
        "operationId": "listOffers",
        "tags": ["Offers"],
        "summary": "List offers",
        "x-coursepan-scope": "offers:read",
        "parameters": [
          {"$ref": "#/components/parameters/Page"},
          {"$ref": "#/components/parameters/PerPage"},
          {"name": "status", "in": "query", "schema": {"$ref": "#/components/schemas/OfferStatus"}},
          {"name": "slug", "in": "query", "schema": {"type": "string"}},
          {"$ref": "#/components/parameters/UpdatedAfter"}
        ],
        "responses": {"200": {"$ref": "#/components/responses/OfferList"}}
      },
      "post": {
        "operationId": "createOffer",
        "tags": ["Offers"],
        "summary": "Create an offer and its catalogue",
        "x-coursepan-scope": "offers:write",
        "x-idempotency-required": true,
        "parameters": [{"$ref": "#/components/parameters/IdempotencyKey"}],
        "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/OfferCreate"}}}},
        "responses": {"201": {"$ref": "#/components/responses/Offer"}, "422": {"$ref": "#/components/responses/ValidationFailed"}}
      }
    },
    "/v1/management/offers/{offer}": {
      "parameters": [{"$ref": "#/components/parameters/OfferId"}],
      "get": {
        "operationId": "getOffer",
        "tags": ["Offers"],
        "summary": "Get an offer",
        "x-coursepan-scope": "offers:read",
        "responses": {"200": {"$ref": "#/components/responses/Offer"}, "404": {"$ref": "#/components/responses/NotFound"}}
      },
      "patch": {
        "operationId": "updateOffer",
        "tags": ["Offers"],
        "summary": "Update an offer; purchased catalogues cannot be replaced",
        "x-coursepan-scope": "offers:write",
        "x-idempotency-required": true,
        "x-etag-required": true,
        "parameters": [{"$ref": "#/components/parameters/IdempotencyKey"}, {"$ref": "#/components/parameters/IfMatch"}],
        "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/OfferPatch"}}}},
        "responses": {"200": {"$ref": "#/components/responses/Offer"}, "409": {"$ref": "#/components/responses/Conflict"}, "412": {"$ref": "#/components/responses/PreconditionFailed"}, "422": {"$ref": "#/components/responses/ValidationFailed"}, "428": {"$ref": "#/components/responses/PreconditionRequired"}}
      }
    },
    "/v1/management/offers/{offer}/publish": {
      "parameters": [{"$ref": "#/components/parameters/OfferId"}, {"$ref": "#/components/parameters/IdempotencyKey"}, {"$ref": "#/components/parameters/IfMatch"}],
      "post": {"operationId": "publishOffer", "tags": ["Offers"], "summary": "Publish an offer", "x-coursepan-scope": "offers:write", "x-idempotency-required": true, "x-etag-required": true, "responses": {"200": {"$ref": "#/components/responses/Offer"}, "409": {"$ref": "#/components/responses/Conflict"}, "412": {"$ref": "#/components/responses/PreconditionFailed"}, "422": {"$ref": "#/components/responses/ValidationFailed"}, "428": {"$ref": "#/components/responses/PreconditionRequired"}}}
    },
    "/v1/management/offers/{offer}/archive": {
      "parameters": [{"$ref": "#/components/parameters/OfferId"}, {"$ref": "#/components/parameters/IdempotencyKey"}, {"$ref": "#/components/parameters/IfMatch"}],
      "post": {"operationId": "archiveOffer", "tags": ["Offers"], "summary": "Archive an offer", "x-coursepan-scope": "offers:write", "x-idempotency-required": true, "x-etag-required": true, "responses": {"200": {"$ref": "#/components/responses/Offer"}, "409": {"$ref": "#/components/responses/Conflict"}, "412": {"$ref": "#/components/responses/PreconditionFailed"}, "428": {"$ref": "#/components/responses/PreconditionRequired"}}}
    },
    "/v1/management/offers/{offer}/draft": {
      "parameters": [{"$ref": "#/components/parameters/OfferId"}, {"$ref": "#/components/parameters/IdempotencyKey"}, {"$ref": "#/components/parameters/IfMatch"}],
      "post": {"operationId": "moveOfferToDraft", "tags": ["Offers"], "summary": "Return an unpublished offer to draft", "x-coursepan-scope": "offers:write", "x-idempotency-required": true, "x-etag-required": true, "responses": {"200": {"$ref": "#/components/responses/Offer"}, "409": {"$ref": "#/components/responses/Conflict"}, "412": {"$ref": "#/components/responses/PreconditionFailed"}, "428": {"$ref": "#/components/responses/PreconditionRequired"}}}
    },
    "/v1/management/orders": {
      "get": {
        "operationId": "listOrders",
        "tags": ["Orders"],
        "summary": "List retained order and entitlement facts",
        "x-coursepan-scope": "orders:read",
        "parameters": [
          {"$ref": "#/components/parameters/Page"},
          {"$ref": "#/components/parameters/PerPage"},
          {"name": "status", "in": "query", "schema": {"type": "string"}},
          {"name": "student_id", "in": "query", "schema": {"$ref": "#/components/schemas/Uuid"}},
          {"name": "offer_id", "in": "query", "schema": {"$ref": "#/components/schemas/Uuid"}},
          {"name": "created_after", "in": "query", "schema": {"type": "string", "format": "date-time"}}
        ],
        "responses": {"200": {"$ref": "#/components/responses/OrderList"}}
      }
    },
    "/v1/management/orders/{order}": {
      "parameters": [{"$ref": "#/components/parameters/OrderId"}],
      "get": {"operationId": "getOrder", "tags": ["Orders"], "summary": "Get an order", "x-coursepan-scope": "orders:read", "responses": {"200": {"$ref": "#/components/responses/Order"}, "404": {"$ref": "#/components/responses/NotFound"}}}
    },
    "/v1/management/subscriptions": {
      "get": {
        "operationId": "listSubscriptions",
        "tags": ["Subscriptions"],
        "summary": "List subscription lifecycle records",
        "x-coursepan-scope": "subscriptions:read",
        "parameters": [
          {"$ref": "#/components/parameters/Page"},
          {"$ref": "#/components/parameters/PerPage"},
          {"name": "status", "in": "query", "schema": {"type": "string"}},
          {"name": "student_id", "in": "query", "schema": {"$ref": "#/components/schemas/Uuid"}},
          {"name": "offer_id", "in": "query", "schema": {"$ref": "#/components/schemas/Uuid"}},
          {"$ref": "#/components/parameters/UpdatedAfter"}
        ],
        "responses": {"200": {"$ref": "#/components/responses/SubscriptionList"}}
      }
    },
    "/v1/management/subscriptions/{subscription}": {
      "parameters": [{"$ref": "#/components/parameters/SubscriptionId"}],
      "get": {"operationId": "getSubscription", "tags": ["Subscriptions"], "summary": "Get a subscription and immutable billing cycles", "x-coursepan-scope": "subscriptions:read", "responses": {"200": {"$ref": "#/components/responses/Subscription"}, "404": {"$ref": "#/components/responses/NotFound"}}}
    },
    "/v1/management/campaigns": {
      "get": {
        "operationId": "listCampaigns",
        "tags": ["Campaigns"],
        "summary": "List campaigns and aggregate delivery outcomes",
        "x-coursepan-scope": "campaigns:read",
        "parameters": [{"$ref": "#/components/parameters/Page"}, {"$ref": "#/components/parameters/PerPage"}, {"name": "state", "in": "query", "schema": {"$ref": "#/components/schemas/CampaignState"}}, {"$ref": "#/components/parameters/UpdatedAfter"}],
        "responses": {"200": {"$ref": "#/components/responses/CampaignList"}}
      },
      "post": {
        "operationId": "createCampaign",
        "tags": ["Campaigns"],
        "summary": "Create a draft campaign",
        "x-coursepan-scope": "campaigns:write",
        "x-idempotency-required": true,
        "parameters": [{"$ref": "#/components/parameters/IdempotencyKey"}],
        "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CampaignCreate"}}}},
        "responses": {"201": {"$ref": "#/components/responses/Campaign"}, "422": {"$ref": "#/components/responses/ValidationFailed"}}
      }
    },
    "/v1/management/campaigns/{campaign}": {
      "parameters": [{"$ref": "#/components/parameters/CampaignId"}],
      "get": {"operationId": "getCampaign", "tags": ["Campaigns"], "summary": "Get a campaign", "x-coursepan-scope": "campaigns:read", "responses": {"200": {"$ref": "#/components/responses/Campaign"}, "404": {"$ref": "#/components/responses/NotFound"}}},
      "patch": {
        "operationId": "updateCampaign",
        "tags": ["Campaigns"],
        "summary": "Update a draft campaign before audience confirmation",
        "x-coursepan-scope": "campaigns:write",
        "x-idempotency-required": true,
        "x-etag-required": true,
        "parameters": [{"$ref": "#/components/parameters/IdempotencyKey"}, {"$ref": "#/components/parameters/IfMatch"}],
        "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CampaignPatch"}}}},
        "responses": {"200": {"$ref": "#/components/responses/Campaign"}, "409": {"$ref": "#/components/responses/Conflict"}, "412": {"$ref": "#/components/responses/PreconditionFailed"}, "422": {"$ref": "#/components/responses/ValidationFailed"}, "428": {"$ref": "#/components/responses/PreconditionRequired"}}
      }
    },
    "/v1/management/campaigns/{campaign}/confirm": {
      "parameters": [{"$ref": "#/components/parameters/CampaignId"}, {"$ref": "#/components/parameters/IdempotencyKey"}, {"$ref": "#/components/parameters/IfMatch"}],
      "post": {"operationId": "confirmCampaign", "tags": ["Campaigns"], "summary": "Freeze the audience and campaign configuration", "x-coursepan-scope": "campaigns:write", "x-idempotency-required": true, "x-etag-required": true, "responses": {"200": {"$ref": "#/components/responses/Campaign"}, "409": {"$ref": "#/components/responses/Conflict"}, "412": {"$ref": "#/components/responses/PreconditionFailed"}, "428": {"$ref": "#/components/responses/PreconditionRequired"}}}
    },
    "/v1/management/campaigns/{campaign}/send": {
      "parameters": [{"$ref": "#/components/parameters/CampaignId"}, {"$ref": "#/components/parameters/IdempotencyKey"}, {"$ref": "#/components/parameters/IfMatch"}],
      "post": {"operationId": "sendCampaign", "tags": ["Campaigns"], "summary": "Start or reschedule confirmed campaign delivery now", "x-coursepan-scope": "campaigns:write", "x-idempotency-required": true, "x-etag-required": true, "responses": {"200": {"$ref": "#/components/responses/Campaign"}, "409": {"$ref": "#/components/responses/Conflict"}, "412": {"$ref": "#/components/responses/PreconditionFailed"}, "428": {"$ref": "#/components/responses/PreconditionRequired"}}}
    },
    "/v1/management/campaigns/{campaign}/pause": {
      "parameters": [{"$ref": "#/components/parameters/CampaignId"}, {"$ref": "#/components/parameters/IdempotencyKey"}, {"$ref": "#/components/parameters/IfMatch"}],
      "post": {"operationId": "pauseCampaign", "tags": ["Campaigns"], "summary": "Pause a sending campaign", "x-coursepan-scope": "campaigns:write", "x-idempotency-required": true, "x-etag-required": true, "responses": {"200": {"$ref": "#/components/responses/Campaign"}, "409": {"$ref": "#/components/responses/Conflict"}, "412": {"$ref": "#/components/responses/PreconditionFailed"}, "428": {"$ref": "#/components/responses/PreconditionRequired"}}}
    },
    "/v1/management/campaigns/{campaign}/resume": {
      "parameters": [{"$ref": "#/components/parameters/CampaignId"}, {"$ref": "#/components/parameters/IdempotencyKey"}, {"$ref": "#/components/parameters/IfMatch"}],
      "post": {"operationId": "resumeCampaign", "tags": ["Campaigns"], "summary": "Resume a paused campaign", "x-coursepan-scope": "campaigns:write", "x-idempotency-required": true, "x-etag-required": true, "responses": {"200": {"$ref": "#/components/responses/Campaign"}, "409": {"$ref": "#/components/responses/Conflict"}, "412": {"$ref": "#/components/responses/PreconditionFailed"}, "428": {"$ref": "#/components/responses/PreconditionRequired"}}}
    },
    "/v1/management/campaigns/{campaign}/cancel": {
      "parameters": [{"$ref": "#/components/parameters/CampaignId"}, {"$ref": "#/components/parameters/IdempotencyKey"}, {"$ref": "#/components/parameters/IfMatch"}],
      "post": {"operationId": "cancelCampaign", "tags": ["Campaigns"], "summary": "Cancel unsent campaign work while retaining history", "x-coursepan-scope": "campaigns:write", "x-idempotency-required": true, "x-etag-required": true, "responses": {"200": {"$ref": "#/components/responses/Campaign"}, "409": {"$ref": "#/components/responses/Conflict"}, "412": {"$ref": "#/components/responses/PreconditionFailed"}, "428": {"$ref": "#/components/responses/PreconditionRequired"}}}
    },
    "/v1/management/automations": {
      "get": {
        "operationId": "listAutomations",
        "tags": ["Automations"],
        "summary": "List versioned automations and aggregate run outcomes",
        "x-coursepan-scope": "automations:read",
        "parameters": [{"$ref": "#/components/parameters/Page"}, {"$ref": "#/components/parameters/PerPage"}, {"name": "state", "in": "query", "schema": {"$ref": "#/components/schemas/AutomationState"}}, {"$ref": "#/components/parameters/UpdatedAfter"}],
        "responses": {"200": {"$ref": "#/components/responses/AutomationList"}}
      },
      "post": {
        "operationId": "createAutomation",
        "tags": ["Automations"],
        "summary": "Create a draft automation version",
        "x-coursepan-scope": "automations:write",
        "x-idempotency-required": true,
        "parameters": [{"$ref": "#/components/parameters/IdempotencyKey"}],
        "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/AutomationCreate"}}}},
        "responses": {"201": {"$ref": "#/components/responses/Automation"}, "422": {"$ref": "#/components/responses/ValidationFailed"}}
      }
    },
    "/v1/management/automations/{automation}": {
      "parameters": [{"$ref": "#/components/parameters/AutomationId"}],
      "get": {"operationId": "getAutomation", "tags": ["Automations"], "summary": "Get an automation and its latest definition", "x-coursepan-scope": "automations:read", "responses": {"200": {"$ref": "#/components/responses/Automation"}, "404": {"$ref": "#/components/responses/NotFound"}}},
      "patch": {
        "operationId": "updateAutomation",
        "tags": ["Automations"],
        "summary": "Rename an automation or replace its complete draft definition",
        "description": "When changing a definition, send trigger, conditions, actions, and rate_limit_per_hour together. Published versions are immutable.",
        "x-coursepan-scope": "automations:write",
        "x-idempotency-required": true,
        "x-etag-required": true,
        "parameters": [{"$ref": "#/components/parameters/IdempotencyKey"}, {"$ref": "#/components/parameters/IfMatch"}],
        "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/AutomationPatch"}}}},
        "responses": {"200": {"$ref": "#/components/responses/Automation"}, "409": {"$ref": "#/components/responses/Conflict"}, "412": {"$ref": "#/components/responses/PreconditionFailed"}, "422": {"$ref": "#/components/responses/ValidationFailed"}, "428": {"$ref": "#/components/responses/PreconditionRequired"}}
      }
    },
    "/v1/management/automations/{automation}/dry-test": {
      "parameters": [{"$ref": "#/components/parameters/AutomationId"}, {"$ref": "#/components/parameters/IdempotencyKey"}, {"$ref": "#/components/parameters/IfMatch"}],
      "post": {
        "operationId": "dryTestAutomation",
        "tags": ["Automations"],
        "summary": "Validate the latest draft without executing side effects",
        "x-coursepan-scope": "automations:write",
        "x-idempotency-required": true,
        "x-etag-required": true,
        "requestBody": {"required": false, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/AutomationDryTestRequest"}}}},
        "responses": {"200": {"$ref": "#/components/responses/AutomationDryTest"}, "409": {"$ref": "#/components/responses/Conflict"}, "412": {"$ref": "#/components/responses/PreconditionFailed"}, "422": {"$ref": "#/components/responses/ValidationFailed"}, "428": {"$ref": "#/components/responses/PreconditionRequired"}}
      }
    },
    "/v1/management/automations/{automation}/publish": {
      "parameters": [{"$ref": "#/components/parameters/AutomationId"}, {"$ref": "#/components/parameters/IdempotencyKey"}, {"$ref": "#/components/parameters/IfMatch"}],
      "post": {"operationId": "publishAutomation", "tags": ["Automations"], "summary": "Publish the successfully tested latest draft", "x-coursepan-scope": "automations:write", "x-idempotency-required": true, "x-etag-required": true, "responses": {"200": {"$ref": "#/components/responses/Automation"}, "409": {"$ref": "#/components/responses/Conflict"}, "412": {"$ref": "#/components/responses/PreconditionFailed"}, "428": {"$ref": "#/components/responses/PreconditionRequired"}}}
    },
    "/v1/management/automations/{automation}/pause": {
      "parameters": [{"$ref": "#/components/parameters/AutomationId"}, {"$ref": "#/components/parameters/IdempotencyKey"}, {"$ref": "#/components/parameters/IfMatch"}],
      "post": {"operationId": "pauseAutomation", "tags": ["Automations"], "summary": "Pause a live automation", "x-coursepan-scope": "automations:write", "x-idempotency-required": true, "x-etag-required": true, "responses": {"200": {"$ref": "#/components/responses/Automation"}, "409": {"$ref": "#/components/responses/Conflict"}, "412": {"$ref": "#/components/responses/PreconditionFailed"}, "428": {"$ref": "#/components/responses/PreconditionRequired"}}}
    },
    "/v1/management/automations/{automation}/resume": {
      "parameters": [{"$ref": "#/components/parameters/AutomationId"}, {"$ref": "#/components/parameters/IdempotencyKey"}, {"$ref": "#/components/parameters/IfMatch"}],
      "post": {"operationId": "resumeAutomation", "tags": ["Automations"], "summary": "Resume a paused automation", "x-coursepan-scope": "automations:write", "x-idempotency-required": true, "x-etag-required": true, "responses": {"200": {"$ref": "#/components/responses/Automation"}, "409": {"$ref": "#/components/responses/Conflict"}, "412": {"$ref": "#/components/responses/PreconditionFailed"}, "428": {"$ref": "#/components/responses/PreconditionRequired"}}}
    },
    "/v1/management/automations/{automation}/versions": {
      "parameters": [{"$ref": "#/components/parameters/AutomationId"}, {"$ref": "#/components/parameters/IdempotencyKey"}, {"$ref": "#/components/parameters/IfMatch"}],
      "post": {"operationId": "createAutomationVersion", "tags": ["Automations"], "summary": "Copy the live version into a new editable draft", "x-coursepan-scope": "automations:write", "x-idempotency-required": true, "x-etag-required": true, "responses": {"200": {"$ref": "#/components/responses/Automation"}, "409": {"$ref": "#/components/responses/Conflict"}, "412": {"$ref": "#/components/responses/PreconditionFailed"}, "428": {"$ref": "#/components/responses/PreconditionRequired"}}}
    },
    "/v1/management/automations/{automation}/archive": {
      "parameters": [{"$ref": "#/components/parameters/AutomationId"}, {"$ref": "#/components/parameters/IdempotencyKey"}, {"$ref": "#/components/parameters/IfMatch"}],
      "post": {"operationId": "archiveAutomation", "tags": ["Automations"], "summary": "Archive an automation and cancel unfinished work", "x-coursepan-scope": "automations:write", "x-idempotency-required": true, "x-etag-required": true, "responses": {"200": {"$ref": "#/components/responses/Automation"}, "409": {"$ref": "#/components/responses/Conflict"}, "412": {"$ref": "#/components/responses/PreconditionFailed"}, "428": {"$ref": "#/components/responses/PreconditionRequired"}}}
    },
    "/v1/management/community-spaces": {
      "get": {
        "operationId": "listCommunitySpaces",
        "tags": ["Community"],
        "summary": "List community spaces and operational counts",
        "x-coursepan-scope": "community:read",
        "parameters": [{"$ref": "#/components/parameters/Page"}, {"$ref": "#/components/parameters/PerPage"}, {"name": "archived", "in": "query", "schema": {"type": "boolean"}}, {"$ref": "#/components/parameters/UpdatedAfter"}],
        "responses": {"200": {"$ref": "#/components/responses/CommunitySpaceList"}}
      }
    },
    "/v1/management/community-spaces/{space}": {
      "parameters": [{"$ref": "#/components/parameters/SpaceId"}],
      "get": {"operationId": "getCommunitySpace", "tags": ["Community"], "summary": "Get a community space", "x-coursepan-scope": "community:read", "responses": {"200": {"$ref": "#/components/responses/CommunitySpace"}, "404": {"$ref": "#/components/responses/NotFound"}}}
    },
    "/v1/management/community-posts": {
      "get": {
        "operationId": "listCommunityPosts",
        "tags": ["Community"],
        "summary": "List posts; private conversations are never included",
        "x-coursepan-scope": "community:read",
        "parameters": [{"$ref": "#/components/parameters/Page"}, {"$ref": "#/components/parameters/PerPage"}, {"name": "space_id", "in": "query", "schema": {"$ref": "#/components/schemas/Uuid"}}, {"name": "state", "in": "query", "schema": {"$ref": "#/components/schemas/CommunityContentState"}}, {"$ref": "#/components/parameters/UpdatedAfter"}],
        "responses": {"200": {"$ref": "#/components/responses/CommunityPostList"}}
      }
    },
    "/v1/management/community-posts/{post}": {
      "parameters": [{"$ref": "#/components/parameters/PostId"}],
      "get": {"operationId": "getCommunityPost", "tags": ["Community"], "summary": "Get a post and safe attachment metadata", "x-coursepan-scope": "community:read", "responses": {"200": {"$ref": "#/components/responses/CommunityPost"}, "404": {"$ref": "#/components/responses/NotFound"}}}
    },
    "/v1/management/community-comments": {
      "get": {
        "operationId": "listCommunityComments",
        "tags": ["Community"],
        "summary": "List community comments",
        "x-coursepan-scope": "community:read",
        "parameters": [{"$ref": "#/components/parameters/Page"}, {"$ref": "#/components/parameters/PerPage"}, {"name": "post_id", "in": "query", "schema": {"$ref": "#/components/schemas/Uuid"}}, {"name": "space_id", "in": "query", "schema": {"$ref": "#/components/schemas/Uuid"}}, {"name": "state", "in": "query", "schema": {"$ref": "#/components/schemas/CommunityContentState"}}, {"$ref": "#/components/parameters/UpdatedAfter"}],
        "responses": {"200": {"$ref": "#/components/responses/CommunityCommentList"}}
      }
    },
    "/v1/management/community-comments/{comment}": {
      "parameters": [{"$ref": "#/components/parameters/CommentId"}],
      "get": {"operationId": "getCommunityComment", "tags": ["Community"], "summary": "Get a community comment", "x-coursepan-scope": "community:read", "responses": {"200": {"$ref": "#/components/responses/CommunityComment"}, "404": {"$ref": "#/components/responses/NotFound"}}}
    },
    "/v1/management/community-events": {
      "get": {
        "operationId": "listCommunityEvents",
        "tags": ["Community"],
        "summary": "List events without exposing private join URLs",
        "x-coursepan-scope": "community:read",
        "parameters": [{"$ref": "#/components/parameters/Page"}, {"$ref": "#/components/parameters/PerPage"}, {"name": "space_id", "in": "query", "schema": {"$ref": "#/components/schemas/Uuid"}}, {"name": "state", "in": "query", "schema": {"type": "string", "enum": ["scheduled", "cancelled", "completed"]}}, {"name": "starts_after", "in": "query", "schema": {"type": "string", "format": "date-time"}}, {"name": "starts_before", "in": "query", "schema": {"type": "string", "format": "date-time"}}],
        "responses": {"200": {"$ref": "#/components/responses/CommunityEventList"}}
      }
    },
    "/v1/management/community-events/{event}": {
      "parameters": [{"$ref": "#/components/parameters/EventId"}],
      "get": {"operationId": "getCommunityEvent", "tags": ["Community"], "summary": "Get a community event without its private join URL", "x-coursepan-scope": "community:read", "responses": {"200": {"$ref": "#/components/responses/CommunityEvent"}, "404": {"$ref": "#/components/responses/NotFound"}}}
    },
    "/v1/management/community-memberships": {
      "get": {
        "operationId": "listCommunityMemberships",
        "tags": ["Community"],
        "summary": "List memberships needed for community operations and moderation",
        "x-coursepan-scope": "community:read",
        "parameters": [{"$ref": "#/components/parameters/Page"}, {"$ref": "#/components/parameters/PerPage"}, {"name": "space_id", "in": "query", "schema": {"$ref": "#/components/schemas/Uuid"}}, {"name": "student_id", "in": "query", "schema": {"$ref": "#/components/schemas/Uuid"}}, {"name": "state", "in": "query", "schema": {"type": "string"}}, {"$ref": "#/components/parameters/UpdatedAfter"}],
        "responses": {"200": {"$ref": "#/components/responses/CommunityMembershipList"}}
      }
    },
    "/v1/management/community-memberships/{membership}": {
      "parameters": [{"$ref": "#/components/parameters/MembershipId"}],
      "get": {"operationId": "getCommunityMembership", "tags": ["Community"], "summary": "Get a community membership", "x-coursepan-scope": "community:read", "responses": {"200": {"$ref": "#/components/responses/CommunityMembership"}, "404": {"$ref": "#/components/responses/NotFound"}}}
    },
    "/v1/management/community-reports": {
      "get": {
        "operationId": "listCommunityReports",
        "tags": ["Community"],
        "summary": "List encrypted-at-rest learner reports",
        "x-coursepan-scope": "community:read",
        "parameters": [{"$ref": "#/components/parameters/Page"}, {"$ref": "#/components/parameters/PerPage"}, {"name": "space_id", "in": "query", "schema": {"$ref": "#/components/schemas/Uuid"}}, {"name": "state", "in": "query", "schema": {"type": "string", "enum": ["open", "reviewing", "resolved", "dismissed"]}}, {"name": "target_type", "in": "query", "schema": {"type": "string", "enum": ["post", "comment", "message", "profile", "event", "membership"]}}, {"name": "created_after", "in": "query", "schema": {"type": "string", "format": "date-time"}}],
        "responses": {"200": {"$ref": "#/components/responses/CommunityReportList"}}
      }
    },
    "/v1/management/community-reports/{report}": {
      "parameters": [{"$ref": "#/components/parameters/ReportId"}],
      "get": {"operationId": "getCommunityReport", "tags": ["Community"], "summary": "Get a community report", "x-coursepan-scope": "community:read", "responses": {"200": {"$ref": "#/components/responses/CommunityReport"}, "404": {"$ref": "#/components/responses/NotFound"}}}
    },
    "/v1/management/community-moderation-actions": {
      "get": {
        "operationId": "listCommunityModerationActions",
        "tags": ["Community"],
        "summary": "List the immutable moderation ledger",
        "x-coursepan-scope": "community:read",
        "parameters": [{"$ref": "#/components/parameters/Page"}, {"$ref": "#/components/parameters/PerPage"}, {"name": "space_id", "in": "query", "schema": {"$ref": "#/components/schemas/Uuid"}}, {"name": "target_type", "in": "query", "schema": {"$ref": "#/components/schemas/CommunityModerationTargetType"}}, {"name": "target_id", "in": "query", "schema": {"$ref": "#/components/schemas/Uuid"}}, {"name": "created_after", "in": "query", "schema": {"type": "string", "format": "date-time"}}],
        "responses": {"200": {"$ref": "#/components/responses/CommunityModerationActionList"}}
      },
      "post": {
        "operationId": "createCommunityModerationAction",
        "tags": ["Community"],
        "summary": "Apply a reasoned, immutable moderation decision",
        "description": "The API key issuer must still belong to the school and be the owner or an assigned moderator for the target space. A correlation_id makes the decision ledger idempotent beyond the HTTP replay window.",
        "x-coursepan-scope": "community:moderate",
        "x-idempotency-required": true,
        "x-etag-required": true,
        "parameters": [{"$ref": "#/components/parameters/IdempotencyKey"}, {"$ref": "#/components/parameters/IfMatch"}],
        "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CommunityModerationCreate"}}}},
        "responses": {"201": {"$ref": "#/components/responses/CommunityModerationCreated"}, "403": {"$ref": "#/components/responses/Forbidden"}, "409": {"$ref": "#/components/responses/Conflict"}, "412": {"$ref": "#/components/responses/PreconditionFailed"}, "422": {"$ref": "#/components/responses/ValidationFailed"}, "428": {"$ref": "#/components/responses/PreconditionRequired"}}
      }
    },
    "/v1/management/community-moderation-actions/{action}": {
      "parameters": [{"$ref": "#/components/parameters/ModerationActionId"}],
      "get": {"operationId": "getCommunityModerationAction", "tags": ["Community"], "summary": "Get one immutable moderation decision", "x-coursepan-scope": "community:read", "responses": {"200": {"$ref": "#/components/responses/CommunityModerationAction"}, "404": {"$ref": "#/components/responses/NotFound"}}}
    },
    "/v1/management/webhook-events": {
      "get": {"operationId": "listWebhookEvents", "tags": ["Webhooks"], "summary": "List supported outbound event names and versions", "x-coursepan-scope": "webhooks:manage", "responses": {"200": {"$ref": "#/components/responses/WebhookEventList"}}}
    },
    "/v1/management/webhook-endpoints": {
      "get": {
        "operationId": "listWebhookEndpoints",
        "tags": ["Webhooks"],
        "summary": "List outbound webhook endpoints",
        "x-coursepan-scope": "webhooks:manage",
        "parameters": [{"$ref": "#/components/parameters/Page"}, {"$ref": "#/components/parameters/PerPage"}],
        "responses": {"200": {"$ref": "#/components/responses/WebhookEndpointList"}}
      },
      "post": {
        "operationId": "createWebhookEndpoint",
        "tags": ["Webhooks"],
        "summary": "Create a signed outbound webhook endpoint",
        "description": "The signing_secret is returned once in this response and is never readable later.",
        "x-coursepan-scope": "webhooks:manage",
        "x-idempotency-required": true,
        "parameters": [{"$ref": "#/components/parameters/IdempotencyKey"}],
        "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/WebhookEndpointCreate"}}}},
        "responses": {"201": {"$ref": "#/components/responses/WebhookEndpointIssued"}, "422": {"$ref": "#/components/responses/ValidationFailed"}}
      }
    },
    "/v1/management/webhook-endpoints/{endpoint}": {
      "parameters": [{"$ref": "#/components/parameters/WebhookEndpointId"}],
      "get": {"operationId": "getWebhookEndpoint", "tags": ["Webhooks"], "summary": "Get an outbound webhook endpoint", "x-coursepan-scope": "webhooks:manage", "responses": {"200": {"$ref": "#/components/responses/WebhookEndpoint"}, "404": {"$ref": "#/components/responses/NotFound"}}},
      "patch": {
        "operationId": "updateWebhookEndpoint",
        "tags": ["Webhooks"],
        "summary": "Update endpoint name, URL, or event subscriptions",
        "x-coursepan-scope": "webhooks:manage",
        "x-idempotency-required": true,
        "x-etag-required": true,
        "parameters": [{"$ref": "#/components/parameters/IdempotencyKey"}, {"$ref": "#/components/parameters/IfMatch"}],
        "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/WebhookEndpointPatch"}}}},
        "responses": {"200": {"$ref": "#/components/responses/WebhookEndpoint"}, "412": {"$ref": "#/components/responses/PreconditionFailed"}, "422": {"$ref": "#/components/responses/ValidationFailed"}, "428": {"$ref": "#/components/responses/PreconditionRequired"}}
      }
    },
    "/v1/management/webhook-endpoints/{endpoint}/rotate": {
      "parameters": [{"$ref": "#/components/parameters/WebhookEndpointId"}, {"$ref": "#/components/parameters/IdempotencyKey"}, {"$ref": "#/components/parameters/IfMatch"}],
      "post": {"operationId": "rotateWebhookEndpointSecret", "tags": ["Webhooks"], "summary": "Rotate the signing secret and return the new secret once", "x-coursepan-scope": "webhooks:manage", "x-idempotency-required": true, "x-etag-required": true, "responses": {"200": {"$ref": "#/components/responses/WebhookEndpointIssued"}, "412": {"$ref": "#/components/responses/PreconditionFailed"}, "428": {"$ref": "#/components/responses/PreconditionRequired"}}}
    },
    "/v1/management/webhook-endpoints/{endpoint}/pause": {
      "parameters": [{"$ref": "#/components/parameters/WebhookEndpointId"}, {"$ref": "#/components/parameters/IdempotencyKey"}, {"$ref": "#/components/parameters/IfMatch"}],
      "post": {"operationId": "pauseWebhookEndpoint", "tags": ["Webhooks"], "summary": "Pause outbound delivery", "x-coursepan-scope": "webhooks:manage", "x-idempotency-required": true, "x-etag-required": true, "responses": {"200": {"$ref": "#/components/responses/WebhookEndpoint"}, "412": {"$ref": "#/components/responses/PreconditionFailed"}, "428": {"$ref": "#/components/responses/PreconditionRequired"}}}
    },
    "/v1/management/webhook-endpoints/{endpoint}/resume": {
      "parameters": [{"$ref": "#/components/parameters/WebhookEndpointId"}, {"$ref": "#/components/parameters/IdempotencyKey"}, {"$ref": "#/components/parameters/IfMatch"}],
      "post": {"operationId": "resumeWebhookEndpoint", "tags": ["Webhooks"], "summary": "Resume outbound delivery", "x-coursepan-scope": "webhooks:manage", "x-idempotency-required": true, "x-etag-required": true, "responses": {"200": {"$ref": "#/components/responses/WebhookEndpoint"}, "412": {"$ref": "#/components/responses/PreconditionFailed"}, "428": {"$ref": "#/components/responses/PreconditionRequired"}}}
    },
    "/v1/management/webhook-endpoints/{endpoint}/test": {
      "parameters": [{"$ref": "#/components/parameters/WebhookEndpointId"}, {"$ref": "#/components/parameters/IdempotencyKey"}, {"$ref": "#/components/parameters/IfMatch"}],
      "post": {"operationId": "testWebhookEndpoint", "tags": ["Webhooks"], "summary": "Queue a harmless signed test delivery", "x-coursepan-scope": "webhooks:manage", "x-idempotency-required": true, "x-etag-required": true, "responses": {"202": {"$ref": "#/components/responses/WebhookDelivery"}, "412": {"$ref": "#/components/responses/PreconditionFailed"}, "428": {"$ref": "#/components/responses/PreconditionRequired"}}}
    },
    "/v1/management/webhook-endpoints/{endpoint}/deliveries": {
      "parameters": [{"$ref": "#/components/parameters/WebhookEndpointId"}],
      "get": {
        "operationId": "listWebhookDeliveries",
        "tags": ["Webhooks"],
        "summary": "List delivery outcomes and sanitized attempts",
        "x-coursepan-scope": "webhooks:manage",
        "parameters": [{"$ref": "#/components/parameters/Page"}, {"$ref": "#/components/parameters/PerPage"}],
        "responses": {"200": {"$ref": "#/components/responses/WebhookDeliveryList"}, "404": {"$ref": "#/components/responses/NotFound"}}
      }
    },
    "/v1/management/webhook-deliveries/{delivery}/replay": {
      "parameters": [{"$ref": "#/components/parameters/WebhookDeliveryId"}, {"$ref": "#/components/parameters/IdempotencyKey"}, {"$ref": "#/components/parameters/IfMatch"}],
      "post": {"operationId": "replayWebhookDelivery", "tags": ["Webhooks"], "summary": "Queue a new delivery that references a terminal source delivery", "description": "If-Match must contain the current ETag of the source delivery's endpoint.", "x-coursepan-scope": "webhooks:manage", "x-idempotency-required": true, "x-etag-required": true, "responses": {"202": {"$ref": "#/components/responses/WebhookDelivery"}, "409": {"$ref": "#/components/responses/Conflict"}, "412": {"$ref": "#/components/responses/PreconditionFailed"}, "428": {"$ref": "#/components/responses/PreconditionRequired"}}}
    }
  },
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "CoursePan API key",
        "description": "Send the complete one-time key as Authorization: Bearer <key>. Keys are school-bound, scope-limited, revocable, expirable, optionally IP-restricted, and rate-limited."
      }
    },
    "headers": {
      "ETag": {"description": "Opaque current resource version. Return it unchanged in If-Match before a mutation.", "schema": {"type": "string", "examples": ["\"v1-cf83e1357eefb8bdf1542850d66d8007\""]}},
      "IdempotentReplayed": {"description": "true when CoursePan replayed the stored response for this key and request fingerprint.", "schema": {"type": "string", "enum": ["true", "false"]}}
    },
    "parameters": {
      "Page": {"name": "page", "in": "query", "schema": {"type": "integer", "minimum": 1, "default": 1}},
      "PerPage": {"name": "per_page", "in": "query", "schema": {"type": "integer", "minimum": 1, "maximum": 100, "default": 25}},
      "UpdatedAfter": {"name": "updated_after", "in": "query", "description": "Return records updated strictly after this timestamp.", "schema": {"type": "string", "format": "date-time"}},
      "IdempotencyKey": {"name": "Idempotency-Key", "in": "header", "required": true, "description": "Opaque 8–191 character key. Reusing it with a different route, method, If-Match value, or canonical JSON body returns 409.", "schema": {"type": "string", "minLength": 8, "maxLength": 191, "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{7,190}$"}},
      "IfMatch": {"name": "If-Match", "in": "header", "required": true, "description": "Exact ETag from the most recent GET or successful mutation.", "schema": {"type": "string"}},
      "CourseId": {"name": "course", "in": "path", "required": true, "schema": {"$ref": "#/components/schemas/Uuid"}},
      "StudentId": {"name": "student", "in": "path", "required": true, "schema": {"$ref": "#/components/schemas/Uuid"}},
      "ContactId": {"name": "contact", "in": "path", "required": true, "schema": {"$ref": "#/components/schemas/Uuid"}},
      "EnrollmentId": {"name": "enrollment", "in": "path", "required": true, "schema": {"$ref": "#/components/schemas/Uuid"}},
      "OfferId": {"name": "offer", "in": "path", "required": true, "schema": {"$ref": "#/components/schemas/Uuid"}},
      "OrderId": {"name": "order", "in": "path", "required": true, "schema": {"$ref": "#/components/schemas/Uuid"}},
      "SubscriptionId": {"name": "subscription", "in": "path", "required": true, "schema": {"$ref": "#/components/schemas/Uuid"}},
      "CampaignId": {"name": "campaign", "in": "path", "required": true, "schema": {"$ref": "#/components/schemas/Uuid"}},
      "AutomationId": {"name": "automation", "in": "path", "required": true, "schema": {"$ref": "#/components/schemas/Uuid"}},
      "SpaceId": {"name": "space", "in": "path", "required": true, "schema": {"$ref": "#/components/schemas/Uuid"}},
      "PostId": {"name": "post", "in": "path", "required": true, "schema": {"$ref": "#/components/schemas/Uuid"}},
      "CommentId": {"name": "comment", "in": "path", "required": true, "schema": {"$ref": "#/components/schemas/Uuid"}},
      "EventId": {"name": "event", "in": "path", "required": true, "schema": {"$ref": "#/components/schemas/Uuid"}},
      "MembershipId": {"name": "membership", "in": "path", "required": true, "schema": {"$ref": "#/components/schemas/Uuid"}},
      "ReportId": {"name": "report", "in": "path", "required": true, "schema": {"$ref": "#/components/schemas/Uuid"}},
      "ModerationActionId": {"name": "action", "in": "path", "required": true, "schema": {"$ref": "#/components/schemas/Uuid"}},
      "WebhookEndpointId": {"name": "endpoint", "in": "path", "required": true, "schema": {"$ref": "#/components/schemas/Uuid"}},
      "WebhookDeliveryId": {"name": "delivery", "in": "path", "required": true, "schema": {"$ref": "#/components/schemas/Uuid"}}
    },
    "responses": {
      "Unauthorized": {"description": "The API key is missing, malformed, expired, or revoked.", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorEnvelope"}}}},
      "Forbidden": {"description": "The key lacks the exact scope, the feature is unavailable, or the key issuer cannot moderate the target space.", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorEnvelope"}}}},
      "NotFound": {"description": "The tenant-bound resource does not exist. Cross-school identifiers also return this response.", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorEnvelope"}}}},
      "Conflict": {"description": "The requested state transition, idempotency key reuse, or immutable-history rule conflicts with current state.", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorEnvelope"}}}},
      "PreconditionFailed": {"description": "If-Match is stale. Fetch the resource and retry with its current ETag.", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorEnvelope"}}}},
      "ValidationFailed": {"description": "The request is invalid. Field errors are included when applicable.", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorEnvelope"}}}},
      "PreconditionRequired": {"description": "A current If-Match header is required.", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorEnvelope"}}}},
      "CourseList": {"description": "Paginated courses.", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CoursePage"}}}},
      "Course": {"description": "Course resource.", "headers": {"ETag": {"$ref": "#/components/headers/ETag"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CourseEnvelope"}}}},
      "StudentList": {"description": "Paginated learners.", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/StudentPage"}}}},
      "Student": {"description": "Learner resource.", "headers": {"ETag": {"$ref": "#/components/headers/ETag"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/StudentEnvelope"}}}},
      "ContactList": {"description": "Paginated CRM contacts.", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ContactPage"}}}},
      "Contact": {"description": "CRM contact resource.", "headers": {"ETag": {"$ref": "#/components/headers/ETag"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ContactEnvelope"}}}},
      "EnrollmentList": {"description": "Paginated enrollments.", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/EnrollmentPage"}}}},
      "Enrollment": {"description": "Enrollment resource.", "headers": {"ETag": {"$ref": "#/components/headers/ETag"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/EnrollmentEnvelope"}}}},
      "EnrollmentGrant": {"description": "Enrollment and named access grant.", "headers": {"ETag": {"$ref": "#/components/headers/ETag"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/EnrollmentGrantEnvelope"}}}},
      "Usage": {"description": "Current plan and video-usage snapshot.", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/UsageEnvelope"}}}},
      "OfferList": {"description": "Paginated offers.", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/OfferPage"}}}},
      "Offer": {"description": "Offer resource.", "headers": {"ETag": {"$ref": "#/components/headers/ETag"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/OfferEnvelope"}}}},
      "OrderList": {"description": "Paginated orders.", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/OrderPage"}}}},
      "Order": {"description": "Order resource.", "headers": {"ETag": {"$ref": "#/components/headers/ETag"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/OrderEnvelope"}}}},
      "SubscriptionList": {"description": "Paginated subscriptions.", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/SubscriptionPage"}}}},
      "Subscription": {"description": "Subscription resource.", "headers": {"ETag": {"$ref": "#/components/headers/ETag"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/SubscriptionEnvelope"}}}},
      "CampaignList": {"description": "Paginated campaigns.", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CampaignPage"}}}},
      "Campaign": {"description": "Campaign resource.", "headers": {"ETag": {"$ref": "#/components/headers/ETag"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CampaignEnvelope"}}}},
      "AutomationList": {"description": "Paginated automations.", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/AutomationPage"}}}},
      "Automation": {"description": "Automation resource.", "headers": {"ETag": {"$ref": "#/components/headers/ETag"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/AutomationEnvelope"}}}},
      "AutomationDryTest": {"description": "Automation resource plus side-effect-free validation result.", "headers": {"ETag": {"$ref": "#/components/headers/ETag"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/AutomationDryTestEnvelope"}}}},
      "CommunitySpaceList": {"description": "Paginated community spaces.", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CommunitySpacePage"}}}},
      "CommunitySpace": {"description": "Community space.", "headers": {"ETag": {"$ref": "#/components/headers/ETag"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CommunitySpaceEnvelope"}}}},
      "CommunityPostList": {"description": "Paginated posts.", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CommunityPostPage"}}}},
      "CommunityPost": {"description": "Community post.", "headers": {"ETag": {"$ref": "#/components/headers/ETag"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CommunityPostEnvelope"}}}},
      "CommunityCommentList": {"description": "Paginated comments.", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CommunityCommentPage"}}}},
      "CommunityComment": {"description": "Community comment.", "headers": {"ETag": {"$ref": "#/components/headers/ETag"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CommunityCommentEnvelope"}}}},
      "CommunityEventList": {"description": "Paginated events.", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CommunityEventPage"}}}},
      "CommunityEvent": {"description": "Community event without its private join URL.", "headers": {"ETag": {"$ref": "#/components/headers/ETag"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CommunityEventEnvelope"}}}},
      "CommunityMembershipList": {"description": "Paginated memberships.", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CommunityMembershipPage"}}}},
      "CommunityMembership": {"description": "Community membership.", "headers": {"ETag": {"$ref": "#/components/headers/ETag"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CommunityMembershipEnvelope"}}}},
      "CommunityReportList": {"description": "Paginated reports.", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CommunityReportPage"}}}},
      "CommunityReport": {"description": "Community report.", "headers": {"ETag": {"$ref": "#/components/headers/ETag"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CommunityReportEnvelope"}}}},
      "CommunityModerationActionList": {"description": "Paginated immutable moderation decisions.", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CommunityModerationActionPage"}}}},
      "CommunityModerationAction": {"description": "Immutable moderation decision.", "headers": {"ETag": {"$ref": "#/components/headers/ETag"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CommunityModerationActionEnvelope"}}}},
      "CommunityModerationCreated": {"description": "New immutable moderation decision and the target's resulting safe state.", "headers": {"ETag": {"$ref": "#/components/headers/ETag"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CommunityModerationCreatedEnvelope"}}}},
      "WebhookEventList": {"description": "Supported event names.", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/WebhookEventListEnvelope"}}}},
      "WebhookEndpointList": {"description": "Paginated webhook endpoints.", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/WebhookEndpointPage"}}}},
      "WebhookEndpoint": {"description": "Webhook endpoint without signing secrets.", "headers": {"ETag": {"$ref": "#/components/headers/ETag"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/WebhookEndpointEnvelope"}}}},
      "WebhookEndpointIssued": {"description": "Webhook endpoint with a one-time plaintext signing secret.", "headers": {"ETag": {"$ref": "#/components/headers/ETag"}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/WebhookEndpointIssuedEnvelope"}}}},
      "WebhookDeliveryList": {"description": "Paginated sanitized delivery evidence.", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/WebhookDeliveryPage"}}}},
      "WebhookDelivery": {"description": "Queued webhook delivery evidence.", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/WebhookDeliveryEnvelope"}}}}
    },
    "schemas": {
      "Uuid": {"type": "string", "format": "uuid"},
      "DateTime": {"type": ["string", "null"], "format": "date-time"},
      "MoneyMinor": {"type": "integer", "minimum": 0, "maximum": 4294967295, "description": "Amount in the currency's smallest unit."},
      "PageMeta": {
        "type": "object",
        "additionalProperties": false,
        "required": ["page", "per_page", "total", "last_page"],
        "properties": {
          "page": {"type": "integer", "minimum": 1},
          "per_page": {"type": "integer", "minimum": 1, "maximum": 100},
          "total": {"type": "integer", "minimum": 0},
          "last_page": {"type": "integer", "minimum": 1}
        }
      },
      "ErrorEnvelope": {
        "type": "object",
        "additionalProperties": false,
        "required": ["error"],
        "properties": {
          "error": {
            "type": "object",
            "additionalProperties": false,
            "required": ["code", "message"],
            "properties": {
              "code": {"type": "string"},
              "message": {"type": "string"},
              "fields": {"type": "object", "additionalProperties": {"type": "array", "items": {"type": "string"}}}
            }
          }
        }
      },
      "CourseStatus": {"type": "string", "enum": ["draft", "published", "archived"]},
      "OfferStatus": {"type": "string", "enum": ["draft", "published", "archived"]},
      "CampaignState": {"type": "string", "enum": ["draft", "confirmed", "scheduled", "sending", "paused", "completed", "cancelled", "failed"]},
      "AutomationState": {"type": "string", "enum": ["draft", "published", "paused", "archived"]},
      "CommunityContentState": {"type": "string", "enum": ["published", "hidden", "removed", "spam"]},
      "CommunityModerationTargetType": {"type": "string", "enum": ["post", "comment", "attachment", "membership", "report"]},
      "IdentitySummary": {
        "type": ["object", "null"],
        "additionalProperties": false,
        "required": ["id", "name"],
        "properties": {"id": {"oneOf": [{"$ref": "#/components/schemas/Uuid"}, {"type": "integer"}]}, "name": {"type": "string"}}
      },
      "Course": {
        "type": "object",
        "required": ["id", "slug", "title", "content_language", "status", "price_minor", "certificate_enabled", "version", "created_at", "updated_at"],
        "properties": {
          "id": {"$ref": "#/components/schemas/Uuid"}, "slug": {"type": "string"}, "title": {"type": "string"}, "content_language": {"type": "string"},
          "subtitle": {"type": ["string", "null"]}, "excerpt": {"type": ["string", "null"]}, "content": {"type": ["string", "null"]},
          "status": {"$ref": "#/components/schemas/CourseStatus"}, "price_minor": {"$ref": "#/components/schemas/MoneyMinor"}, "compare_at_minor": {"oneOf": [{"$ref": "#/components/schemas/MoneyMinor"}, {"type": "null"}]},
          "access_days": {"type": ["integer", "null"], "minimum": 1}, "certificate_enabled": {"type": "boolean"}, "published_at": {"$ref": "#/components/schemas/DateTime"},
          "version": {"type": "integer", "minimum": 1}, "created_at": {"type": "string", "format": "date-time"}, "updated_at": {"type": "string", "format": "date-time"}
        }
      },
      "CourseMutationFields": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "slug": {"type": "string", "maxLength": 255, "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"}, "title": {"type": "string", "maxLength": 255}, "content_language": {"type": "string"},
          "subtitle": {"type": ["string", "null"], "maxLength": 255}, "excerpt": {"type": ["string", "null"], "maxLength": 16000}, "content": {"type": ["string", "null"]},
          "status": {"$ref": "#/components/schemas/CourseStatus"}, "price_minor": {"$ref": "#/components/schemas/MoneyMinor"}, "compare_at_minor": {"oneOf": [{"$ref": "#/components/schemas/MoneyMinor"}, {"type": "null"}]},
          "access_days": {"type": ["integer", "null"], "minimum": 1}, "certificate_enabled": {"type": "boolean"}, "published_at": {"$ref": "#/components/schemas/DateTime"}
        }
      },
      "CourseCreate": {"allOf": [{"$ref": "#/components/schemas/CourseMutationFields"}], "required": ["slug", "title", "content_language", "status", "price_minor"]},
      "CoursePatch": {"allOf": [{"$ref": "#/components/schemas/CourseMutationFields"}], "minProperties": 1},
      "Student": {
        "type": "object",
        "required": ["id", "email", "name", "status", "version", "created_at", "updated_at"],
        "properties": {"id": {"$ref": "#/components/schemas/Uuid"}, "email": {"type": "string", "format": "email"}, "name": {"type": "string"}, "locale": {"type": ["string", "null"]}, "status": {"type": "string", "enum": ["active", "blocked"]}, "email_verified_at": {"$ref": "#/components/schemas/DateTime"}, "last_login_at": {"$ref": "#/components/schemas/DateTime"}, "version": {"type": "integer", "minimum": 1}, "created_at": {"type": "string", "format": "date-time"}, "updated_at": {"type": "string", "format": "date-time"}}
      },
      "StudentPatch": {"type": "object", "additionalProperties": false, "minProperties": 1, "properties": {"email": {"type": "string", "format": "email", "maxLength": 255}, "name": {"type": "string", "maxLength": 255}, "locale": {"type": ["string", "null"]}, "status": {"type": "string", "enum": ["active", "blocked"]}}},
      "Contact": {
        "type": "object",
        "required": ["id", "email", "status", "source", "version", "created_at", "updated_at"],
        "properties": {"id": {"$ref": "#/components/schemas/Uuid"}, "student_id": {"oneOf": [{"$ref": "#/components/schemas/Uuid"}, {"type": "null"}]}, "email": {"type": "string", "format": "email"}, "name": {"type": ["string", "null"]}, "locale": {"type": ["string", "null"]}, "timezone": {"type": ["string", "null"]}, "status": {"type": "string"}, "source": {"type": "string"}, "version": {"type": "integer", "minimum": 1}, "created_at": {"type": "string", "format": "date-time"}, "updated_at": {"type": "string", "format": "date-time"}}
      },
      "ContactCreate": {"type": "object", "additionalProperties": false, "required": ["email"], "properties": {"email": {"type": "string", "format": "email", "maxLength": 254}, "name": {"type": ["string", "null"], "maxLength": 255}, "locale": {"type": ["string", "null"]}, "timezone": {"type": ["string", "null"], "maxLength": 64}}},
      "ContactPatch": {"type": "object", "additionalProperties": false, "minProperties": 1, "properties": {"email": {"type": "string", "format": "email", "maxLength": 254}, "name": {"type": ["string", "null"], "maxLength": 255}, "locale": {"type": ["string", "null"]}, "timezone": {"type": ["string", "null"], "maxLength": 64}, "status": {"type": "string"}}},
      "Enrollment": {
        "type": "object",
        "required": ["id", "student_id", "course_id", "status", "source", "version", "created_at", "updated_at"],
        "properties": {"id": {"$ref": "#/components/schemas/Uuid"}, "student_id": {"$ref": "#/components/schemas/Uuid"}, "course_id": {"$ref": "#/components/schemas/Uuid"}, "status": {"type": "string"}, "source": {"type": "string"}, "started_at": {"$ref": "#/components/schemas/DateTime"}, "completed_at": {"$ref": "#/components/schemas/DateTime"}, "expires_at": {"$ref": "#/components/schemas/DateTime"}, "version": {"type": "integer", "minimum": 1}, "created_at": {"type": "string", "format": "date-time"}, "updated_at": {"type": "string", "format": "date-time"}}
      },
      "EnrollmentGrantRecord": {"type": "object", "required": ["id", "source", "external_reference", "state"], "properties": {"id": {"$ref": "#/components/schemas/Uuid"}, "source": {"type": "string", "const": "api"}, "external_reference": {"type": "string"}, "state": {"type": "string"}, "starts_at": {"$ref": "#/components/schemas/DateTime"}, "ends_at": {"$ref": "#/components/schemas/DateTime"}, "revoked_at": {"$ref": "#/components/schemas/DateTime"}}},
      "EnrollmentGrantCreate": {"type": "object", "additionalProperties": false, "required": ["student_id", "course_id", "external_reference", "expires_at"], "properties": {"student_id": {"$ref": "#/components/schemas/Uuid"}, "course_id": {"$ref": "#/components/schemas/Uuid"}, "external_reference": {"type": "string", "maxLength": 180, "pattern": "^[A-Za-z0-9][A-Za-z0-9:_.\\/-]*$"}, "expires_at": {"$ref": "#/components/schemas/DateTime"}}},
      "EnrollmentGrantRevoke": {"type": "object", "additionalProperties": false, "required": ["external_reference", "reason"], "properties": {"external_reference": {"type": "string", "maxLength": 180}, "reason": {"type": "string", "minLength": 3, "maxLength": 120}}},
      "Usage": {"type": "object", "required": ["plan", "video"], "properties": {"plan": {"type": "string"}, "video": {"type": "object", "required": ["storage", "bandwidth", "stale"], "properties": {"storage": {"type": "object", "additionalProperties": true}, "bandwidth": {"type": "object", "additionalProperties": true}, "last_reconciled_at": {"$ref": "#/components/schemas/DateTime"}, "stale": {"type": "boolean"}}}}},
      "OfferItemInput": {"type": "object", "additionalProperties": false, "required": ["course_id", "access_behavior", "access_duration_days"], "properties": {"course_id": {"$ref": "#/components/schemas/Uuid"}, "access_behavior": {"type": "string", "enum": ["course_default", "lifetime", "fixed_days"]}, "access_duration_days": {"type": ["integer", "null"], "minimum": 1, "maximum": 36500}}},
      "OfferPriceInput": {"type": "object", "additionalProperties": false, "required": ["currency", "amount_minor", "type", "billing_interval", "interval_count", "trial_days", "installment_count", "is_active", "is_default"], "properties": {"currency": {"type": "string", "pattern": "^[A-Z]{3}$"}, "amount_minor": {"$ref": "#/components/schemas/MoneyMinor"}, "type": {"type": "string", "enum": ["one_time", "recurring", "installments"]}, "billing_interval": {"type": ["string", "null"], "enum": ["day", "week", "month", "year", null]}, "interval_count": {"type": ["integer", "null"], "minimum": 1, "maximum": 36}, "trial_days": {"type": ["integer", "null"], "minimum": 1, "maximum": 365}, "installment_count": {"type": ["integer", "null"], "minimum": 2, "maximum": 120}, "is_active": {"type": "boolean"}, "is_default": {"type": "boolean"}}},
      "OfferMutationFields": {"type": "object", "additionalProperties": false, "properties": {"name": {"type": "string", "maxLength": 255}, "slug": {"type": "string", "maxLength": 255, "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"}, "description": {"type": ["string", "null"], "maxLength": 16000}, "checkout_headline": {"type": ["string", "null"], "maxLength": 180}, "checkout_description": {"type": ["string", "null"], "maxLength": 16000}, "success_url": {"type": ["string", "null"], "format": "uri"}, "cancel_url": {"type": ["string", "null"], "format": "uri"}, "starts_at": {"$ref": "#/components/schemas/DateTime"}, "ends_at": {"$ref": "#/components/schemas/DateTime"}, "purchase_limit": {"type": ["integer", "null"], "minimum": 1}, "tax_enabled": {"type": "boolean"}, "tax_code": {"type": ["string", "null"], "pattern": "^txcd_[0-9]{8}$"}, "tax_behavior": {"type": "string", "enum": ["exclusive", "inclusive"]}, "items": {"type": "array", "minItems": 1, "maxItems": 100, "items": {"$ref": "#/components/schemas/OfferItemInput"}}, "prices": {"type": "array", "minItems": 1, "maxItems": 50, "items": {"$ref": "#/components/schemas/OfferPriceInput"}}}},
      "OfferCreate": {"allOf": [{"$ref": "#/components/schemas/OfferMutationFields"}], "required": ["name", "slug", "items", "prices"]},
      "OfferPatch": {"allOf": [{"$ref": "#/components/schemas/OfferMutationFields"}], "minProperties": 1},
      "Offer": {"type": "object", "required": ["id", "slug", "name", "status", "items", "prices", "version", "created_at", "updated_at"], "properties": {"id": {"$ref": "#/components/schemas/Uuid"}, "slug": {"type": "string"}, "name": {"type": "string"}, "description": {"type": ["string", "null"]}, "status": {"$ref": "#/components/schemas/OfferStatus"}, "checkout_headline": {"type": ["string", "null"]}, "checkout_description": {"type": ["string", "null"]}, "success_url": {"type": ["string", "null"]}, "cancel_url": {"type": ["string", "null"]}, "starts_at": {"$ref": "#/components/schemas/DateTime"}, "ends_at": {"$ref": "#/components/schemas/DateTime"}, "purchase_limit": {"type": ["integer", "null"]}, "tax_enabled": {"type": "boolean"}, "tax_code": {"type": ["string", "null"]}, "tax_behavior": {"type": "string"}, "items": {"type": "array", "items": {"type": "object", "additionalProperties": true}}, "prices": {"type": "array", "items": {"type": "object", "additionalProperties": true}}, "version": {"type": "integer", "minimum": 1}, "published_at": {"$ref": "#/components/schemas/DateTime"}, "archived_at": {"$ref": "#/components/schemas/DateTime"}, "created_at": {"type": "string", "format": "date-time"}, "updated_at": {"type": "string", "format": "date-time"}}},
      "Order": {"type": "object", "required": ["id", "buyer", "status", "currency", "subtotal_minor", "discount_minor", "tax_minor", "total_minor", "items", "created_at", "updated_at"], "properties": {"id": {"$ref": "#/components/schemas/Uuid"}, "student_id": {"oneOf": [{"$ref": "#/components/schemas/Uuid"}, {"type": "null"}]}, "buyer": {"type": "object", "properties": {"name": {"type": ["string", "null"]}, "email": {"type": ["string", "null"], "format": "email"}}}, "status": {"type": "string"}, "currency": {"type": "string"}, "subtotal_minor": {"$ref": "#/components/schemas/MoneyMinor"}, "discount_minor": {"$ref": "#/components/schemas/MoneyMinor"}, "tax_minor": {"$ref": "#/components/schemas/MoneyMinor"}, "total_minor": {"$ref": "#/components/schemas/MoneyMinor"}, "coupon_id": {"oneOf": [{"$ref": "#/components/schemas/Uuid"}, {"type": "null"}]}, "offer_id": {"oneOf": [{"$ref": "#/components/schemas/Uuid"}, {"type": "null"}]}, "offer_price_id": {"oneOf": [{"$ref": "#/components/schemas/Uuid"}, {"type": "null"}]}, "provider": {"type": ["string", "null"]}, "provider_reference": {"type": ["string", "null"]}, "provider_payment_intent_id": {"type": ["string", "null"]}, "paid_at": {"$ref": "#/components/schemas/DateTime"}, "items": {"type": "array", "items": {"type": "object", "additionalProperties": true}}, "created_at": {"type": "string", "format": "date-time"}, "updated_at": {"type": "string", "format": "date-time"}}},
      "Subscription": {"type": "object", "required": ["id", "status", "access_active", "cancel_at_period_end", "is_installment_plan", "paid_installments", "cycles", "created_at", "updated_at"], "properties": {"id": {"$ref": "#/components/schemas/Uuid"}, "student_id": {"$ref": "#/components/schemas/Uuid"}, "contact_id": {"oneOf": [{"$ref": "#/components/schemas/Uuid"}, {"type": "null"}]}, "offer_id": {"$ref": "#/components/schemas/Uuid"}, "offer_price_id": {"$ref": "#/components/schemas/Uuid"}, "initial_order_id": {"oneOf": [{"$ref": "#/components/schemas/Uuid"}, {"type": "null"}]}, "provider": {"type": "string"}, "provider_customer_id": {"type": ["string", "null"]}, "provider_subscription_id": {"type": ["string", "null"]}, "provider_schedule_id": {"type": ["string", "null"]}, "status": {"type": "string"}, "access_active": {"type": "boolean"}, "current_period_start": {"$ref": "#/components/schemas/DateTime"}, "current_period_end": {"$ref": "#/components/schemas/DateTime"}, "trial_ends_at": {"$ref": "#/components/schemas/DateTime"}, "cancel_at_period_end": {"type": "boolean"}, "cancellation_requested_at": {"$ref": "#/components/schemas/DateTime"}, "cancelled_at": {"$ref": "#/components/schemas/DateTime"}, "ended_at": {"$ref": "#/components/schemas/DateTime"}, "dunning_started_at": {"$ref": "#/components/schemas/DateTime"}, "grace_ends_at": {"$ref": "#/components/schemas/DateTime"}, "access_suspended_at": {"$ref": "#/components/schemas/DateTime"}, "access_suspension_reason": {"type": ["string", "null"]}, "is_installment_plan": {"type": "boolean"}, "expected_installments": {"type": ["integer", "null"]}, "paid_installments": {"type": "integer", "minimum": 0}, "cycles": {"type": "array", "items": {"type": "object", "additionalProperties": true}}, "created_at": {"type": "string", "format": "date-time"}, "updated_at": {"type": "string", "format": "date-time"}}},
      "CampaignMutationFields": {"type": "object", "additionalProperties": false, "properties": {"name": {"type": "string", "maxLength": 120}, "purpose": {"type": "string", "enum": ["transactional", "marketing", "learning_reminder", "community_digest"]}, "email_template_id": {"$ref": "#/components/schemas/Uuid"}, "segment_id": {"$ref": "#/components/schemas/Uuid"}, "sender_domain_id": {"$ref": "#/components/schemas/Uuid"}, "sender_name": {"type": "string", "maxLength": 120}, "sender_email": {"type": "string", "format": "email", "maxLength": 254}, "reply_to_email": {"type": ["string", "null"], "format": "email", "maxLength": 254}, "dynamic_audience": {"type": "boolean"}, "scheduled_at": {"$ref": "#/components/schemas/DateTime"}}},
      "CampaignCreate": {"allOf": [{"$ref": "#/components/schemas/CampaignMutationFields"}], "required": ["name", "purpose", "email_template_id", "segment_id", "sender_domain_id", "sender_name", "sender_email", "dynamic_audience"]},
      "CampaignPatch": {"allOf": [{"$ref": "#/components/schemas/CampaignMutationFields"}], "minProperties": 1},
      "Campaign": {"type": "object", "required": ["id", "name", "purpose", "email_template_id", "template_version", "sender_domain_id", "sender_name", "sender_email", "state", "dynamic_audience", "audience", "delivery", "version", "created_at", "updated_at"], "properties": {"id": {"$ref": "#/components/schemas/Uuid"}, "name": {"type": "string"}, "purpose": {"type": "string"}, "email_template_id": {"$ref": "#/components/schemas/Uuid"}, "template_version": {"type": "integer"}, "segment_id": {"oneOf": [{"$ref": "#/components/schemas/Uuid"}, {"type": "null"}]}, "sender_domain_id": {"$ref": "#/components/schemas/Uuid"}, "sender_name": {"type": "string"}, "sender_email": {"type": "string", "format": "email"}, "reply_to_email": {"type": ["string", "null"], "format": "email"}, "state": {"$ref": "#/components/schemas/CampaignState"}, "dynamic_audience": {"type": "boolean"}, "audience": {"type": "object", "required": ["selected", "eligible", "suppressed"], "properties": {"selected": {"type": "integer"}, "eligible": {"type": "integer"}, "suppressed": {"type": "integer"}}}, "delivery": {"type": "object", "additionalProperties": {"type": "integer", "minimum": 0}}, "version": {"type": "integer", "minimum": 1}, "audience_frozen_at": {"$ref": "#/components/schemas/DateTime"}, "confirmed_at": {"$ref": "#/components/schemas/DateTime"}, "scheduled_at": {"$ref": "#/components/schemas/DateTime"}, "started_at": {"$ref": "#/components/schemas/DateTime"}, "completed_at": {"$ref": "#/components/schemas/DateTime"}, "cancelled_at": {"$ref": "#/components/schemas/DateTime"}, "created_at": {"type": "string", "format": "date-time"}, "updated_at": {"type": "string", "format": "date-time"}}},
      "AutomationDefinitionInput": {"type": "object", "additionalProperties": false, "required": ["trigger", "conditions", "actions", "rate_limit_per_hour"], "properties": {"trigger": {"type": "object", "additionalProperties": true}, "conditions": {"type": ["object", "null"], "additionalProperties": true}, "actions": {"type": "array", "minItems": 1, "maxItems": 50, "items": {"type": "object", "additionalProperties": true}}, "rate_limit_per_hour": {"type": "integer", "minimum": 1, "maximum": 100000}}},
      "AutomationCreate": {"allOf": [{"$ref": "#/components/schemas/AutomationDefinitionInput"}, {"type": "object", "required": ["name"], "properties": {"name": {"type": "string", "maxLength": 120}}}]},
      "AutomationPatch": {"oneOf": [{"type": "object", "additionalProperties": false, "required": ["name"], "properties": {"name": {"type": "string", "maxLength": 120}}}, {"allOf": [{"$ref": "#/components/schemas/AutomationDefinitionInput"}, {"type": "object", "properties": {"name": {"type": "string", "maxLength": 120}}}]}]},
      "AutomationDryTestRequest": {"type": "object", "additionalProperties": false, "properties": {"contact_id": {"oneOf": [{"$ref": "#/components/schemas/Uuid"}, {"type": "null"}]}, "event_context": {"type": "object", "maxProperties": 100, "additionalProperties": true}}},
      "AutomationDryTestResult": {"type": "object", "required": ["passed", "conditions_matched", "action_count", "destructive_action_count", "action_types", "definition_hash", "contact_context_present"], "properties": {"passed": {"type": "boolean"}, "conditions_matched": {"type": "boolean"}, "action_count": {"type": "integer"}, "destructive_action_count": {"type": "integer"}, "action_types": {"type": "array", "items": {"type": "string"}}, "definition_hash": {"type": "string"}, "contact_context_present": {"type": "boolean"}}},
      "Automation": {"type": "object", "required": ["id", "name", "state", "trigger_family", "trigger_key", "latest_version", "runs", "version", "created_at", "updated_at"], "properties": {"id": {"$ref": "#/components/schemas/Uuid"}, "name": {"type": "string"}, "state": {"$ref": "#/components/schemas/AutomationState"}, "trigger_family": {"type": "string", "enum": ["event", "schedule"]}, "trigger_key": {"type": "string"}, "latest_version": {"type": "integer"}, "published_version": {"type": ["integer", "null"]}, "definition": {"type": ["object", "null"], "additionalProperties": true}, "runs": {"type": "object", "required": ["total", "active", "completed", "failed", "cancelled"], "additionalProperties": {"type": "integer", "minimum": 0}}, "version": {"type": "integer", "minimum": 1}, "published_at": {"$ref": "#/components/schemas/DateTime"}, "paused_at": {"$ref": "#/components/schemas/DateTime"}, "archived_at": {"$ref": "#/components/schemas/DateTime"}, "created_at": {"type": "string", "format": "date-time"}, "updated_at": {"type": "string", "format": "date-time"}}},
      "CommunityAttachment": {"type": "object", "required": ["id", "name", "mime_type", "size_bytes", "state", "version"], "properties": {"id": {"$ref": "#/components/schemas/Uuid"}, "name": {"type": "string"}, "mime_type": {"type": "string"}, "size_bytes": {"type": "integer", "minimum": 1}, "state": {"type": "string"}, "version": {"type": "integer"}, "alt_text": {"type": ["string", "null"]}, "scanned_at": {"$ref": "#/components/schemas/DateTime"}, "removed_at": {"$ref": "#/components/schemas/DateTime"}}},
      "CommunitySpace": {"type": "object", "required": ["id", "slug", "name", "visibility", "posting_policy", "counts", "version", "created_at", "updated_at"], "properties": {"id": {"$ref": "#/components/schemas/Uuid"}, "slug": {"type": "string"}, "name": {"type": "string"}, "description": {"type": ["string", "null"]}, "visibility": {"type": "string"}, "posting_policy": {"type": "string"}, "course_id": {"oneOf": [{"$ref": "#/components/schemas/Uuid"}, {"type": "null"}]}, "offer_id": {"oneOf": [{"$ref": "#/components/schemas/Uuid"}, {"type": "null"}]}, "member_messages_enabled": {"type": "boolean"}, "directory_enabled": {"type": "boolean"}, "points_enabled": {"type": "boolean"}, "position": {"type": "integer"}, "counts": {"type": "object", "additionalProperties": {"type": "integer", "minimum": 0}}, "version": {"type": "integer"}, "archived_at": {"$ref": "#/components/schemas/DateTime"}, "created_at": {"type": "string", "format": "date-time"}, "updated_at": {"type": "string", "format": "date-time"}}},
      "CommunityPost": {"type": "object", "required": ["id", "space_id", "type", "state", "body", "is_pinned", "is_locked", "comments_count", "reactions_count", "attachments", "version", "published_at", "updated_at"], "properties": {"id": {"$ref": "#/components/schemas/Uuid"}, "space_id": {"$ref": "#/components/schemas/Uuid"}, "author": {"$ref": "#/components/schemas/IdentitySummary"}, "type": {"type": "string"}, "state": {"$ref": "#/components/schemas/CommunityContentState"}, "title": {"type": ["string", "null"]}, "body": {"type": "string"}, "is_pinned": {"type": "boolean"}, "is_locked": {"type": "boolean"}, "comments_count": {"type": "integer"}, "reactions_count": {"type": "integer"}, "attachments": {"type": "array", "items": {"$ref": "#/components/schemas/CommunityAttachment"}}, "version": {"type": "integer"}, "published_at": {"type": "string", "format": "date-time"}, "edited_at": {"$ref": "#/components/schemas/DateTime"}, "hidden_at": {"$ref": "#/components/schemas/DateTime"}, "updated_at": {"type": "string", "format": "date-time"}}},
      "CommunityComment": {"type": "object", "required": ["id", "post_id", "state", "body", "reactions_count", "attachments", "version", "published_at", "updated_at"], "properties": {"id": {"$ref": "#/components/schemas/Uuid"}, "post_id": {"$ref": "#/components/schemas/Uuid"}, "parent_id": {"oneOf": [{"$ref": "#/components/schemas/Uuid"}, {"type": "null"}]}, "root_id": {"oneOf": [{"$ref": "#/components/schemas/Uuid"}, {"type": "null"}]}, "author": {"$ref": "#/components/schemas/IdentitySummary"}, "state": {"$ref": "#/components/schemas/CommunityContentState"}, "body": {"type": "string"}, "reactions_count": {"type": "integer"}, "attachments": {"type": "array", "items": {"$ref": "#/components/schemas/CommunityAttachment"}}, "version": {"type": "integer"}, "published_at": {"type": "string", "format": "date-time"}, "edited_at": {"$ref": "#/components/schemas/DateTime"}, "hidden_at": {"$ref": "#/components/schemas/DateTime"}, "updated_at": {"type": "string", "format": "date-time"}}},
      "CommunityEvent": {"type": "object", "required": ["id", "space_id", "title", "state", "starts_at", "ends_at", "location_type", "rsvps_count", "version", "created_at", "updated_at"], "properties": {"id": {"$ref": "#/components/schemas/Uuid"}, "space_id": {"$ref": "#/components/schemas/Uuid"}, "live_session_id": {"oneOf": [{"$ref": "#/components/schemas/Uuid"}, {"type": "null"}]}, "host": {"$ref": "#/components/schemas/IdentitySummary"}, "title": {"type": "string"}, "description": {"type": ["string", "null"]}, "state": {"type": "string"}, "starts_at": {"type": "string", "format": "date-time"}, "ends_at": {"type": "string", "format": "date-time"}, "location_type": {"type": "string"}, "location_label": {"type": ["string", "null"]}, "capacity": {"type": ["integer", "null"]}, "rsvps_count": {"type": "integer"}, "version": {"type": "integer"}, "created_at": {"type": "string", "format": "date-time"}, "updated_at": {"type": "string", "format": "date-time"}}},
      "CommunityMembership": {"type": "object", "required": ["id", "space_id", "role", "state", "version", "updated_at"], "properties": {"id": {"$ref": "#/components/schemas/Uuid"}, "space_id": {"$ref": "#/components/schemas/Uuid"}, "student": {"$ref": "#/components/schemas/IdentitySummary"}, "role": {"type": "string"}, "state": {"type": "string"}, "version": {"type": "integer"}, "joined_at": {"$ref": "#/components/schemas/DateTime"}, "muted_until": {"$ref": "#/components/schemas/DateTime"}, "suspended_until": {"$ref": "#/components/schemas/DateTime"}, "banned_at": {"$ref": "#/components/schemas/DateTime"}, "left_at": {"$ref": "#/components/schemas/DateTime"}, "updated_at": {"type": "string", "format": "date-time"}}},
      "CommunityReport": {"type": "object", "required": ["id", "space", "target", "reason", "state", "version", "created_at", "updated_at"], "properties": {"id": {"$ref": "#/components/schemas/Uuid"}, "space": {"type": "object", "required": ["id", "name"], "properties": {"id": {"$ref": "#/components/schemas/Uuid"}, "name": {"type": "string"}}}, "reporter": {"$ref": "#/components/schemas/IdentitySummary"}, "target": {"type": "object", "required": ["type", "id"], "properties": {"type": {"type": "string"}, "id": {"$ref": "#/components/schemas/Uuid"}}}, "reason": {"type": "string"}, "details": {"type": ["string", "null"]}, "state": {"type": "string"}, "version": {"type": "integer"}, "assigned_to": {"$ref": "#/components/schemas/IdentitySummary"}, "resolution_note": {"type": ["string", "null"]}, "resolved_at": {"$ref": "#/components/schemas/DateTime"}, "created_at": {"type": "string", "format": "date-time"}, "updated_at": {"type": "string", "format": "date-time"}}},
      "CommunityModerationAction": {"type": "object", "required": ["id", "space", "action", "target", "reason", "before", "after", "correlation_id", "created_at"], "properties": {"id": {"$ref": "#/components/schemas/Uuid"}, "space": {"type": "object", "additionalProperties": true}, "space_id": {"$ref": "#/components/schemas/Uuid"}, "actor": {"$ref": "#/components/schemas/IdentitySummary"}, "action": {"type": "string"}, "target": {"type": "object", "required": ["type", "id"], "properties": {"type": {"$ref": "#/components/schemas/CommunityModerationTargetType"}, "id": {"$ref": "#/components/schemas/Uuid"}}}, "reason": {"type": "string"}, "before": {"type": "object", "additionalProperties": true}, "after": {"type": "object", "additionalProperties": true}, "correlation_id": {"$ref": "#/components/schemas/Uuid"}, "created_at": {"type": "string", "format": "date-time"}}},
      "CommunityModerationCreate": {"type": "object", "additionalProperties": false, "required": ["action", "target_type", "target_id", "reason", "correlation_id"], "properties": {"action": {"type": "string", "enum": ["hide", "restore", "lock", "unlock", "pin", "unpin", "remove_attachment", "mute", "suspend", "ban", "reinstate", "resolve_report", "dismiss_report"]}, "target_type": {"$ref": "#/components/schemas/CommunityModerationTargetType"}, "target_id": {"$ref": "#/components/schemas/Uuid"}, "reason": {"type": "string", "minLength": 3, "maxLength": 1000}, "until": {"$ref": "#/components/schemas/DateTime"}, "correlation_id": {"$ref": "#/components/schemas/Uuid"}}},
      "CommunityModerationTarget": {"type": "object", "required": ["type", "id", "state", "version", "updated_at"], "properties": {"type": {"$ref": "#/components/schemas/CommunityModerationTargetType"}, "id": {"$ref": "#/components/schemas/Uuid"}, "state": {"type": ["string", "null"]}, "version": {"type": "integer"}, "is_pinned": {"type": ["boolean", "null"]}, "is_locked": {"type": ["boolean", "null"]}, "muted_until": {"$ref": "#/components/schemas/DateTime"}, "suspended_until": {"$ref": "#/components/schemas/DateTime"}, "hidden_at": {"$ref": "#/components/schemas/DateTime"}, "removed_at": {"$ref": "#/components/schemas/DateTime"}, "resolved_at": {"$ref": "#/components/schemas/DateTime"}, "updated_at": {"type": "string", "format": "date-time"}}},
      "WebhookEvent": {"type": "object", "additionalProperties": false, "required": ["name", "version"], "properties": {"name": {"type": "string"}, "version": {"type": "integer", "const": 1}}},
      "WebhookEndpoint": {"type": "object", "required": ["id", "name", "url_display", "events", "state", "secret_version", "consecutive_failures", "version", "created_at", "updated_at"], "properties": {"id": {"$ref": "#/components/schemas/Uuid"}, "name": {"type": "string"}, "url_display": {"type": "string", "format": "uri", "description": "Sanitized display URL; query strings and credentials are never returned."}, "events": {"type": "array", "items": {"type": "string"}}, "state": {"type": "string"}, "secret_version": {"type": "integer"}, "consecutive_failures": {"type": "integer"}, "last_delivery_at": {"$ref": "#/components/schemas/DateTime"}, "disabled_at": {"$ref": "#/components/schemas/DateTime"}, "disable_reason": {"type": ["string", "null"]}, "version": {"type": "integer"}, "signing_secret": {"type": "string", "writeOnly": true, "description": "Returned once on create or rotation."}, "previous_secret_valid_until": {"$ref": "#/components/schemas/DateTime"}, "created_at": {"type": "string", "format": "date-time"}, "updated_at": {"type": "string", "format": "date-time"}}},
      "WebhookEndpointCreate": {"type": "object", "additionalProperties": false, "required": ["name", "url", "events"], "properties": {"name": {"type": "string", "maxLength": 100}, "url": {"type": "string", "format": "uri", "maxLength": 2048}, "events": {"type": "array", "minItems": 1, "maxItems": 50, "uniqueItems": true, "items": {"type": "string"}}}},
      "WebhookEndpointPatch": {"type": "object", "additionalProperties": false, "minProperties": 1, "properties": {"name": {"type": "string", "maxLength": 100}, "url": {"type": "string", "format": "uri", "maxLength": 2048}, "events": {"type": "array", "minItems": 1, "maxItems": 50, "uniqueItems": true, "items": {"type": "string"}}}},
      "WebhookDelivery": {"type": "object", "required": ["id", "endpoint_id", "event", "event_version", "event_occurred_at", "state", "attempt_count", "request_fingerprint", "is_test", "created_at"], "properties": {"id": {"$ref": "#/components/schemas/Uuid"}, "endpoint_id": {"$ref": "#/components/schemas/Uuid"}, "event": {"type": "string"}, "event_version": {"type": "integer"}, "event_occurred_at": {"type": "string", "format": "date-time"}, "state": {"type": "string"}, "attempt_count": {"type": "integer"}, "next_attempt_at": {"$ref": "#/components/schemas/DateTime"}, "delivered_at": {"$ref": "#/components/schemas/DateTime"}, "response_status": {"type": ["integer", "null"]}, "response_category": {"type": ["string", "null"]}, "last_error_code": {"type": ["string", "null"]}, "request_fingerprint": {"type": "string"}, "replay_of_id": {"oneOf": [{"$ref": "#/components/schemas/Uuid"}, {"type": "null"}]}, "is_test": {"type": "boolean"}, "attempts": {"type": ["array", "null"], "items": {"type": "object", "additionalProperties": true}}, "created_at": {"type": "string", "format": "date-time"}}},
      "CourseEnvelope": {"$ref": "#/components/schemas/_CourseEnvelope"},
      "_CourseEnvelope": {"type": "object", "required": ["data"], "properties": {"data": {"$ref": "#/components/schemas/Course"}}},
      "StudentEnvelope": {"type": "object", "required": ["data"], "properties": {"data": {"$ref": "#/components/schemas/Student"}}},
      "ContactEnvelope": {"type": "object", "required": ["data"], "properties": {"data": {"$ref": "#/components/schemas/Contact"}}},
      "EnrollmentEnvelope": {"type": "object", "required": ["data"], "properties": {"data": {"$ref": "#/components/schemas/Enrollment"}}},
      "EnrollmentGrantEnvelope": {"type": "object", "required": ["data"], "properties": {"data": {"type": "object", "required": ["enrollment", "grant"], "properties": {"enrollment": {"$ref": "#/components/schemas/Enrollment"}, "grant": {"$ref": "#/components/schemas/EnrollmentGrantRecord"}}}}},
      "UsageEnvelope": {"type": "object", "required": ["data"], "properties": {"data": {"$ref": "#/components/schemas/Usage"}}},
      "OfferEnvelope": {"type": "object", "required": ["data"], "properties": {"data": {"$ref": "#/components/schemas/Offer"}}},
      "OrderEnvelope": {"type": "object", "required": ["data"], "properties": {"data": {"$ref": "#/components/schemas/Order"}}},
      "SubscriptionEnvelope": {"type": "object", "required": ["data"], "properties": {"data": {"$ref": "#/components/schemas/Subscription"}}},
      "CampaignEnvelope": {"type": "object", "required": ["data"], "properties": {"data": {"$ref": "#/components/schemas/Campaign"}}},
      "AutomationEnvelope": {"type": "object", "required": ["data"], "properties": {"data": {"$ref": "#/components/schemas/Automation"}}},
      "AutomationDryTestEnvelope": {"type": "object", "required": ["data", "dry_test"], "properties": {"data": {"$ref": "#/components/schemas/Automation"}, "dry_test": {"$ref": "#/components/schemas/AutomationDryTestResult"}}},
      "CommunitySpaceEnvelope": {"type": "object", "required": ["data"], "properties": {"data": {"$ref": "#/components/schemas/CommunitySpace"}}},
      "CommunityPostEnvelope": {"type": "object", "required": ["data"], "properties": {"data": {"$ref": "#/components/schemas/CommunityPost"}}},
      "CommunityCommentEnvelope": {"type": "object", "required": ["data"], "properties": {"data": {"$ref": "#/components/schemas/CommunityComment"}}},
      "CommunityEventEnvelope": {"type": "object", "required": ["data"], "properties": {"data": {"$ref": "#/components/schemas/CommunityEvent"}}},
      "CommunityMembershipEnvelope": {"type": "object", "required": ["data"], "properties": {"data": {"$ref": "#/components/schemas/CommunityMembership"}}},
      "CommunityReportEnvelope": {"type": "object", "required": ["data"], "properties": {"data": {"$ref": "#/components/schemas/CommunityReport"}}},
      "CommunityModerationActionEnvelope": {"type": "object", "required": ["data"], "properties": {"data": {"$ref": "#/components/schemas/CommunityModerationAction"}}},
      "CommunityModerationCreatedEnvelope": {"type": "object", "required": ["data", "target"], "properties": {"data": {"$ref": "#/components/schemas/CommunityModerationAction"}, "target": {"$ref": "#/components/schemas/CommunityModerationTarget"}}},
      "WebhookEventListEnvelope": {"type": "object", "required": ["data"], "properties": {"data": {"type": "array", "items": {"$ref": "#/components/schemas/WebhookEvent"}}}},
      "WebhookEndpointEnvelope": {"type": "object", "required": ["data"], "properties": {"data": {"$ref": "#/components/schemas/WebhookEndpoint"}}},
      "WebhookEndpointIssuedEnvelope": {"type": "object", "required": ["data"], "properties": {"data": {"allOf": [{"$ref": "#/components/schemas/WebhookEndpoint"}], "required": ["signing_secret"]}}},
      "WebhookDeliveryEnvelope": {"type": "object", "required": ["data"], "properties": {"data": {"$ref": "#/components/schemas/WebhookDelivery"}}},
      "CoursePage": {"type": "object", "required": ["data", "meta"], "properties": {"data": {"type": "array", "items": {"$ref": "#/components/schemas/Course"}}, "meta": {"$ref": "#/components/schemas/PageMeta"}}},
      "StudentPage": {"type": "object", "required": ["data", "meta"], "properties": {"data": {"type": "array", "items": {"$ref": "#/components/schemas/Student"}}, "meta": {"$ref": "#/components/schemas/PageMeta"}}},
      "ContactPage": {"type": "object", "required": ["data", "meta"], "properties": {"data": {"type": "array", "items": {"$ref": "#/components/schemas/Contact"}}, "meta": {"$ref": "#/components/schemas/PageMeta"}}},
      "EnrollmentPage": {"type": "object", "required": ["data", "meta"], "properties": {"data": {"type": "array", "items": {"$ref": "#/components/schemas/Enrollment"}}, "meta": {"$ref": "#/components/schemas/PageMeta"}}},
      "OfferPage": {"type": "object", "required": ["data", "meta"], "properties": {"data": {"type": "array", "items": {"$ref": "#/components/schemas/Offer"}}, "meta": {"$ref": "#/components/schemas/PageMeta"}}},
      "OrderPage": {"type": "object", "required": ["data", "meta"], "properties": {"data": {"type": "array", "items": {"$ref": "#/components/schemas/Order"}}, "meta": {"$ref": "#/components/schemas/PageMeta"}}},
      "SubscriptionPage": {"type": "object", "required": ["data", "meta"], "properties": {"data": {"type": "array", "items": {"$ref": "#/components/schemas/Subscription"}}, "meta": {"$ref": "#/components/schemas/PageMeta"}}},
      "CampaignPage": {"type": "object", "required": ["data", "meta"], "properties": {"data": {"type": "array", "items": {"$ref": "#/components/schemas/Campaign"}}, "meta": {"$ref": "#/components/schemas/PageMeta"}}},
      "AutomationPage": {"type": "object", "required": ["data", "meta"], "properties": {"data": {"type": "array", "items": {"$ref": "#/components/schemas/Automation"}}, "meta": {"$ref": "#/components/schemas/PageMeta"}}},
      "CommunitySpacePage": {"type": "object", "required": ["data", "meta"], "properties": {"data": {"type": "array", "items": {"$ref": "#/components/schemas/CommunitySpace"}}, "meta": {"$ref": "#/components/schemas/PageMeta"}}},
      "CommunityPostPage": {"type": "object", "required": ["data", "meta"], "properties": {"data": {"type": "array", "items": {"$ref": "#/components/schemas/CommunityPost"}}, "meta": {"$ref": "#/components/schemas/PageMeta"}}},
      "CommunityCommentPage": {"type": "object", "required": ["data", "meta"], "properties": {"data": {"type": "array", "items": {"$ref": "#/components/schemas/CommunityComment"}}, "meta": {"$ref": "#/components/schemas/PageMeta"}}},
      "CommunityEventPage": {"type": "object", "required": ["data", "meta"], "properties": {"data": {"type": "array", "items": {"$ref": "#/components/schemas/CommunityEvent"}}, "meta": {"$ref": "#/components/schemas/PageMeta"}}},
      "CommunityMembershipPage": {"type": "object", "required": ["data", "meta"], "properties": {"data": {"type": "array", "items": {"$ref": "#/components/schemas/CommunityMembership"}}, "meta": {"$ref": "#/components/schemas/PageMeta"}}},
      "CommunityReportPage": {"type": "object", "required": ["data", "meta"], "properties": {"data": {"type": "array", "items": {"$ref": "#/components/schemas/CommunityReport"}}, "meta": {"$ref": "#/components/schemas/PageMeta"}}},
      "CommunityModerationActionPage": {"type": "object", "required": ["data", "meta"], "properties": {"data": {"type": "array", "items": {"$ref": "#/components/schemas/CommunityModerationAction"}}, "meta": {"$ref": "#/components/schemas/PageMeta"}}},
      "WebhookEndpointPage": {"type": "object", "required": ["data", "meta"], "properties": {"data": {"type": "array", "items": {"$ref": "#/components/schemas/WebhookEndpoint"}}, "meta": {"$ref": "#/components/schemas/PageMeta"}}},
      "WebhookDeliveryPage": {"type": "object", "required": ["data", "meta"], "properties": {"data": {"type": "array", "items": {"$ref": "#/components/schemas/WebhookDelivery"}}, "meta": {"$ref": "#/components/schemas/PageMeta"}}}
    }
  }
}
