{
    "openapi": "3.1.2",
    "info": {
        "title": "Continuum Learn API",
        "version": "2.0",
        "description": "The Continuum Learn REST API: catalogue, users, groups, enrolments and learner progress. Guides (authentication and scopes, errors, pagination, rate limits, idempotency, webhooks, sign-in links, versioning) are at https://continuumlearn.com/developers. Authenticate with `Authorization: Bearer <key>`; create keys in Manage > Settings > Website & API > API keys."
    },
    "servers": [
        {
            "url": "https://{team}.continuumlearn.com/api/v2",
            "variables": {
                "team": {
                    "default": "your-team",
                    "description": "Your team's subdomain, as in https://your-team.continuumlearn.com."
                }
            }
        }
    ],
    "tags": [
        {
            "name": "Account"
        },
        {
            "name": "Catalogue"
        },
        {
            "name": "Users"
        },
        {
            "name": "Groups"
        },
        {
            "name": "Enrolments"
        },
        {
            "name": "Progress"
        },
        {
            "name": "Credentials"
        },
        {
            "name": "Sign-in links"
        },
        {
            "name": "Webhooks"
        },
        {
            "name": "Orders"
        }
    ],
    "security": [
        {
            "bearerAuth": []
        },
        {
            "apiKeyAuth": []
        }
    ],
    "paths": {
        "/me": {
            "get": {
                "operationId": "v2.me",
                "summary": "The team and API key making this request",
                "tags": [
                    "Account"
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "team": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        },
                                                        "url": {
                                                            "type": "string"
                                                        }
                                                    },
                                                    "required": [
                                                        "id",
                                                        "name",
                                                        "url"
                                                    ]
                                                },
                                                "key": {
                                                    "type": "object",
                                                    "properties": {
                                                        "name": {
                                                            "type": "string"
                                                        },
                                                        "prefix": {
                                                            "type": "string"
                                                        },
                                                        "scopes": {
                                                            "type": "array",
                                                            "items": {
                                                                "type": "string"
                                                            }
                                                        },
                                                        "created_at": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "expires_at": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        }
                                                    },
                                                    "required": [
                                                        "name",
                                                        "prefix",
                                                        "scopes",
                                                        "created_at",
                                                        "expires_at"
                                                    ]
                                                }
                                            },
                                            "required": [
                                                "team",
                                                "key"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Missing, invalid, revoked or expired API key (authentication_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "The API key lacks the required scope (permission_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Resource not found (not_found).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation failed; error.details maps fields to messages (validation_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Rate limit exceeded; see the Retry-After header (rate_limited).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Unexpected server error (server_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/courses": {
            "get": {
                "operationId": "v2.courses.index",
                "description": "Scope: `catalogue:read`. Returns every non-template course of the team, public and private\n(see `visibility`). Cursor-paginated by id (ascending).\n\nQuery parameters: `visibility` (`public`|`private`), `type` (`course`|`live`|`publication`),\n`folder` (folder id), `language` (locale code, e.g. `cy`: courses written in it, with no language,\nor translated into it, returned with translated titles and descriptions), `updated_since`\n(ISO 8601), `limit` (1-100, default 25) and `cursor` (`meta.next_cursor` from the previous page).",
                "summary": "List courses",
                "tags": [
                    "Catalogue"
                ],
                "parameters": [
                    {
                        "name": "visibility",
                        "in": "query",
                        "description": "`public` or `private`.",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "type",
                        "in": "query",
                        "description": "`course`, `live` or `publication`.",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "folder",
                        "in": "query",
                        "description": "Course folder id.",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "language",
                        "in": "query",
                        "description": "Locale code such as `cy`: courses written in it, with no language, or translated into it; titles and descriptions are returned translated.",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "updated_since",
                        "in": "query",
                        "description": "Only courses updated at or after this time. ISO 8601 timestamp.",
                        "schema": {
                            "type": "string",
                            "format": "date-time"
                        }
                    },
                    {
                        "name": "limit",
                        "in": "query",
                        "description": "Page size, 1-100.",
                        "schema": {
                            "type": "integer",
                            "default": 25
                        }
                    },
                    {
                        "name": "cursor",
                        "in": "query",
                        "description": "Opaque cursor: pass `meta.next_cursor` from the previous page.",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "id": {
                                                        "type": "integer"
                                                    },
                                                    "type": {
                                                        "type": "string"
                                                    },
                                                    "title": {
                                                        "type": "string"
                                                    },
                                                    "summary": {
                                                        "type": "string"
                                                    },
                                                    "image": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ]
                                                    },
                                                    "language": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ]
                                                    },
                                                    "folders": {
                                                        "type": "array",
                                                        "items": {
                                                            "type": "integer"
                                                        }
                                                    },
                                                    "price": {
                                                        "type": [
                                                            "object",
                                                            "null"
                                                        ],
                                                        "properties": {
                                                            "amount": {
                                                                "type": "integer"
                                                            },
                                                            "currency": {
                                                                "type": "string"
                                                            },
                                                            "amount_including_tax": {
                                                                "type": "integer"
                                                            },
                                                            "tax_rate": {
                                                                "type": "number"
                                                            },
                                                            "display": {
                                                                "type": "string"
                                                            }
                                                        },
                                                        "required": [
                                                            "amount",
                                                            "currency",
                                                            "amount_including_tax",
                                                            "tax_rate",
                                                            "display"
                                                        ]
                                                    },
                                                    "starts_at": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ]
                                                    },
                                                    "all_day": {
                                                        "type": "boolean"
                                                    },
                                                    "url": {
                                                        "type": "string"
                                                    },
                                                    "buy_url": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ]
                                                    },
                                                    "slug": {
                                                        "type": "string"
                                                    },
                                                    "visibility": {
                                                        "type": "string"
                                                    },
                                                    "in_person": {
                                                        "type": "boolean"
                                                    },
                                                    "timezone": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ]
                                                    },
                                                    "requires_approval": {
                                                        "type": "boolean"
                                                    },
                                                    "open_access": {
                                                        "type": "boolean"
                                                    },
                                                    "capacity": {
                                                        "type": "object",
                                                        "properties": {
                                                            "spaces": {
                                                                "type": [
                                                                    "integer",
                                                                    "null"
                                                                ]
                                                            },
                                                            "remaining": {
                                                                "type": [
                                                                    "integer",
                                                                    "null"
                                                                ]
                                                            }
                                                        },
                                                        "required": [
                                                            "spaces",
                                                            "remaining"
                                                        ]
                                                    },
                                                    "certificate_enabled": {
                                                        "type": "boolean"
                                                    },
                                                    "cpd_hours": {
                                                        "type": [
                                                            "number",
                                                            "null"
                                                        ]
                                                    },
                                                    "validity_months": {
                                                        "type": [
                                                            "integer",
                                                            "null"
                                                        ]
                                                    },
                                                    "prerequisite_ids": {
                                                        "type": "array",
                                                        "items": {
                                                            "type": "integer"
                                                        }
                                                    },
                                                    "presenters": {
                                                        "type": "array",
                                                        "items": {
                                                            "type": "object",
                                                            "properties": {
                                                                "id": {
                                                                    "type": "integer"
                                                                },
                                                                "name": {
                                                                    "type": "string"
                                                                }
                                                            },
                                                            "required": [
                                                                "id",
                                                                "name"
                                                            ]
                                                        }
                                                    },
                                                    "available_languages": {
                                                        "type": "array",
                                                        "items": {
                                                            "type": "string"
                                                        }
                                                    },
                                                    "created_at": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ]
                                                    },
                                                    "updated_at": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ]
                                                    }
                                                },
                                                "required": [
                                                    "id",
                                                    "type",
                                                    "title",
                                                    "summary",
                                                    "image",
                                                    "language",
                                                    "folders",
                                                    "price",
                                                    "starts_at",
                                                    "all_day",
                                                    "url",
                                                    "buy_url",
                                                    "slug",
                                                    "visibility",
                                                    "in_person",
                                                    "timezone",
                                                    "requires_approval",
                                                    "open_access",
                                                    "capacity",
                                                    "certificate_enabled",
                                                    "cpd_hours",
                                                    "validity_months",
                                                    "prerequisite_ids",
                                                    "presenters",
                                                    "available_languages",
                                                    "created_at",
                                                    "updated_at"
                                                ]
                                            }
                                        },
                                        "meta": {
                                            "type": "object",
                                            "properties": {
                                                "next_cursor": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "has_more": {
                                                    "type": "boolean"
                                                }
                                            },
                                            "required": [
                                                "next_cursor",
                                                "has_more"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "data",
                                        "meta"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Missing, invalid, revoked or expired API key (authentication_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "The API key lacks the required scope (permission_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Resource not found (not_found).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation failed; error.details maps fields to messages (validation_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Rate limit exceeded; see the Retry-After header (rate_limited).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Unexpected server error (server_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/courses/{id}": {
            "get": {
                "operationId": "v2.courses.show",
                "description": "Scope: `catalogue:read`.",
                "summary": "Get a course, with its module and lesson outline (no lesson content)",
                "tags": [
                    "Catalogue"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "id": {
                                                    "type": "integer"
                                                },
                                                "type": {
                                                    "type": "string"
                                                },
                                                "title": {
                                                    "type": "string"
                                                },
                                                "summary": {
                                                    "type": "string"
                                                },
                                                "image": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "language": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "folders": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "integer"
                                                    }
                                                },
                                                "price": {
                                                    "type": [
                                                        "object",
                                                        "null"
                                                    ],
                                                    "properties": {
                                                        "amount": {
                                                            "type": "integer"
                                                        },
                                                        "currency": {
                                                            "type": "string"
                                                        },
                                                        "amount_including_tax": {
                                                            "type": "integer"
                                                        },
                                                        "tax_rate": {
                                                            "type": "number"
                                                        },
                                                        "display": {
                                                            "type": "string"
                                                        }
                                                    },
                                                    "required": [
                                                        "amount",
                                                        "currency",
                                                        "amount_including_tax",
                                                        "tax_rate",
                                                        "display"
                                                    ]
                                                },
                                                "starts_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "all_day": {
                                                    "type": "boolean"
                                                },
                                                "url": {
                                                    "type": "string"
                                                },
                                                "buy_url": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "slug": {
                                                    "type": "string"
                                                },
                                                "visibility": {
                                                    "type": "string"
                                                },
                                                "in_person": {
                                                    "type": "boolean"
                                                },
                                                "timezone": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "requires_approval": {
                                                    "type": "boolean"
                                                },
                                                "open_access": {
                                                    "type": "boolean"
                                                },
                                                "capacity": {
                                                    "type": "object",
                                                    "properties": {
                                                        "spaces": {
                                                            "type": [
                                                                "integer",
                                                                "null"
                                                            ]
                                                        },
                                                        "remaining": {
                                                            "type": [
                                                                "integer",
                                                                "null"
                                                            ]
                                                        }
                                                    },
                                                    "required": [
                                                        "spaces",
                                                        "remaining"
                                                    ]
                                                },
                                                "certificate_enabled": {
                                                    "type": "boolean"
                                                },
                                                "cpd_hours": {
                                                    "type": [
                                                        "number",
                                                        "null"
                                                    ]
                                                },
                                                "validity_months": {
                                                    "type": [
                                                        "integer",
                                                        "null"
                                                    ]
                                                },
                                                "prerequisite_ids": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "integer"
                                                    }
                                                },
                                                "presenters": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            }
                                                        },
                                                        "required": [
                                                            "id",
                                                            "name"
                                                        ]
                                                    }
                                                },
                                                "available_languages": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "string"
                                                    }
                                                },
                                                "created_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "updated_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "description_html": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "outline": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "title": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "order": {
                                                                "type": [
                                                                    "integer",
                                                                    "null"
                                                                ]
                                                            },
                                                            "lessons": {
                                                                "type": "array",
                                                                "items": {
                                                                    "type": "object",
                                                                    "properties": {
                                                                        "id": {
                                                                            "type": "integer"
                                                                        },
                                                                        "title": {
                                                                            "type": [
                                                                                "string",
                                                                                "null"
                                                                            ]
                                                                        },
                                                                        "order": {
                                                                            "type": [
                                                                                "integer",
                                                                                "null"
                                                                            ]
                                                                        },
                                                                        "drip_release_at": {
                                                                            "type": [
                                                                                "string",
                                                                                "null"
                                                                            ]
                                                                        }
                                                                    },
                                                                    "required": [
                                                                        "id",
                                                                        "title",
                                                                        "order",
                                                                        "drip_release_at"
                                                                    ]
                                                                }
                                                            }
                                                        },
                                                        "required": [
                                                            "id",
                                                            "title",
                                                            "order",
                                                            "lessons"
                                                        ]
                                                    }
                                                }
                                            },
                                            "required": [
                                                "id",
                                                "type",
                                                "title",
                                                "summary",
                                                "image",
                                                "language",
                                                "folders",
                                                "price",
                                                "starts_at",
                                                "all_day",
                                                "url",
                                                "buy_url",
                                                "slug",
                                                "visibility",
                                                "in_person",
                                                "timezone",
                                                "requires_approval",
                                                "open_access",
                                                "capacity",
                                                "certificate_enabled",
                                                "cpd_hours",
                                                "validity_months",
                                                "prerequisite_ids",
                                                "presenters",
                                                "available_languages",
                                                "created_at",
                                                "updated_at",
                                                "description_html",
                                                "outline"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Missing, invalid, revoked or expired API key (authentication_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "The API key lacks the required scope (permission_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Resource not found (not_found).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation failed; error.details maps fields to messages (validation_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Rate limit exceeded; see the Retry-After header (rate_limited).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Unexpected server error (server_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/course-folders": {
            "get": {
                "operationId": "v2.course_folders.index",
                "description": "Scope: `catalogue:read`. `course_count` counts the team's non-template courses in the folder.",
                "summary": "List course folders",
                "tags": [
                    "Catalogue"
                ],
                "parameters": [
                    {
                        "name": "limit",
                        "in": "query",
                        "description": "Page size, 1-100.",
                        "schema": {
                            "type": "integer",
                            "default": 25
                        }
                    },
                    {
                        "name": "cursor",
                        "in": "query",
                        "description": "Opaque cursor: pass `meta.next_cursor` from the previous page.",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "id": {
                                                        "type": "integer"
                                                    },
                                                    "name": {
                                                        "type": "string"
                                                    },
                                                    "translations": {
                                                        "type": [
                                                            "object",
                                                            "null"
                                                        ],
                                                        "additionalProperties": {
                                                            "type": "object",
                                                            "additionalProperties": {
                                                                "type": "string"
                                                            }
                                                        }
                                                    },
                                                    "course_count": {
                                                        "type": "integer"
                                                    }
                                                },
                                                "required": [
                                                    "id",
                                                    "name",
                                                    "translations",
                                                    "course_count"
                                                ]
                                            }
                                        },
                                        "meta": {
                                            "type": "object",
                                            "properties": {
                                                "next_cursor": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "has_more": {
                                                    "type": "boolean"
                                                }
                                            },
                                            "required": [
                                                "next_cursor",
                                                "has_more"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "data",
                                        "meta"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Missing, invalid, revoked or expired API key (authentication_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "The API key lacks the required scope (permission_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Resource not found (not_found).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation failed; error.details maps fields to messages (validation_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Rate limit exceeded; see the Retry-After header (rate_limited).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Unexpected server error (server_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/events": {
            "get": {
                "operationId": "v2.events.index",
                "description": "Scope: `catalogue:read`. By default live, upcoming, replay and on-demand events; `status=all`\nalso returns ended and expired ones. The status filter is applied to each cursor page, so a\npage can hold fewer than `limit` items while `meta.has_more` is true.\n\nQuery parameters: `status=all`, `limit` (1-100, default 25) and `cursor`.",
                "summary": "List events",
                "tags": [
                    "Catalogue"
                ],
                "parameters": [
                    {
                        "name": "status",
                        "in": "query",
                        "description": "`all` to include ended and expired events; by default only live, upcoming, replay and on-demand events.",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "limit",
                        "in": "query",
                        "description": "Page size, 1-100.",
                        "schema": {
                            "type": "integer",
                            "default": 25
                        }
                    },
                    {
                        "name": "cursor",
                        "in": "query",
                        "description": "Opaque cursor: pass `meta.next_cursor` from the previous page.",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "id": {
                                                        "type": "integer"
                                                    },
                                                    "title": {
                                                        "type": "string"
                                                    },
                                                    "summary": {
                                                        "type": "string"
                                                    },
                                                    "image": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ]
                                                    },
                                                    "status": {
                                                        "type": "string"
                                                    },
                                                    "type": {
                                                        "type": "string"
                                                    },
                                                    "next_session_start": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ]
                                                    },
                                                    "sessions_count": {
                                                        "type": "integer"
                                                    },
                                                    "price": {
                                                        "type": [
                                                            "object",
                                                            "null"
                                                        ],
                                                        "properties": {
                                                            "display": {
                                                                "type": "string"
                                                            },
                                                            "from": {
                                                                "type": "boolean"
                                                            },
                                                            "free": {
                                                                "type": "boolean"
                                                            },
                                                            "currency": {
                                                                "type": "string"
                                                            },
                                                            "amount_including_tax": {
                                                                "type": "integer"
                                                            },
                                                            "tax_rate": {
                                                                "type": "number"
                                                            }
                                                        },
                                                        "required": [
                                                            "display",
                                                            "from",
                                                            "free",
                                                            "currency",
                                                            "amount_including_tax",
                                                            "tax_rate"
                                                        ]
                                                    },
                                                    "products": {
                                                        "type": "array",
                                                        "items": {
                                                            "type": "object",
                                                            "properties": {
                                                                "id": {
                                                                    "type": "integer"
                                                                },
                                                                "name": {
                                                                    "type": "string"
                                                                },
                                                                "price_display": {
                                                                    "type": "string"
                                                                },
                                                                "currency": {
                                                                    "type": "string"
                                                                },
                                                                "amount_including_tax": {
                                                                    "type": "integer"
                                                                },
                                                                "buy_url": {
                                                                    "type": "string"
                                                                }
                                                            },
                                                            "required": [
                                                                "id",
                                                                "name",
                                                                "price_display",
                                                                "currency",
                                                                "amount_including_tax",
                                                                "buy_url"
                                                            ]
                                                        }
                                                    },
                                                    "url": {
                                                        "type": "string"
                                                    },
                                                    "buy_url": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ]
                                                    }
                                                },
                                                "required": [
                                                    "id",
                                                    "title",
                                                    "summary",
                                                    "image",
                                                    "status",
                                                    "type",
                                                    "next_session_start",
                                                    "sessions_count",
                                                    "price",
                                                    "products",
                                                    "url",
                                                    "buy_url"
                                                ]
                                            }
                                        },
                                        "meta": {
                                            "type": "object",
                                            "properties": {
                                                "next_cursor": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "has_more": {
                                                    "type": "boolean"
                                                }
                                            },
                                            "required": [
                                                "next_cursor",
                                                "has_more"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "data",
                                        "meta"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Missing, invalid, revoked or expired API key (authentication_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "The API key lacks the required scope (permission_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Resource not found (not_found).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation failed; error.details maps fields to messages (validation_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Rate limit exceeded; see the Retry-After header (rate_limited).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Unexpected server error (server_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/events/{id}": {
            "get": {
                "operationId": "v2.events.show",
                "description": "Scope: `catalogue:read`.",
                "summary": "Get an event",
                "tags": [
                    "Catalogue"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "id": {
                                                    "type": "integer"
                                                },
                                                "title": {
                                                    "type": "string"
                                                },
                                                "summary": {
                                                    "type": "string"
                                                },
                                                "image": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "status": {
                                                    "type": "string"
                                                },
                                                "type": {
                                                    "type": "string"
                                                },
                                                "next_session_start": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "sessions_count": {
                                                    "type": "integer"
                                                },
                                                "price": {
                                                    "type": [
                                                        "object",
                                                        "null"
                                                    ],
                                                    "properties": {
                                                        "display": {
                                                            "type": "string"
                                                        },
                                                        "from": {
                                                            "type": "boolean"
                                                        },
                                                        "free": {
                                                            "type": "boolean"
                                                        },
                                                        "currency": {
                                                            "type": "string"
                                                        },
                                                        "amount_including_tax": {
                                                            "type": "integer"
                                                        },
                                                        "tax_rate": {
                                                            "type": "number"
                                                        }
                                                    },
                                                    "required": [
                                                        "display",
                                                        "from",
                                                        "free",
                                                        "currency",
                                                        "amount_including_tax",
                                                        "tax_rate"
                                                    ]
                                                },
                                                "products": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            },
                                                            "price_display": {
                                                                "type": "string"
                                                            },
                                                            "currency": {
                                                                "type": "string"
                                                            },
                                                            "amount_including_tax": {
                                                                "type": "integer"
                                                            },
                                                            "buy_url": {
                                                                "type": "string"
                                                            }
                                                        },
                                                        "required": [
                                                            "id",
                                                            "name",
                                                            "price_display",
                                                            "currency",
                                                            "amount_including_tax",
                                                            "buy_url"
                                                        ]
                                                    }
                                                },
                                                "url": {
                                                    "type": "string"
                                                },
                                                "buy_url": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                }
                                            },
                                            "required": [
                                                "id",
                                                "title",
                                                "summary",
                                                "image",
                                                "status",
                                                "type",
                                                "next_session_start",
                                                "sessions_count",
                                                "price",
                                                "products",
                                                "url",
                                                "buy_url"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Missing, invalid, revoked or expired API key (authentication_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "The API key lacks the required scope (permission_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Resource not found (not_found).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation failed; error.details maps fields to messages (validation_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Rate limit exceeded; see the Retry-After header (rate_limited).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Unexpected server error (server_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/users": {
            "get": {
                "operationId": "v2.users.index",
                "description": "Requires scope `users:read`. Cursor-paginated by user id. `updated_since` compares against the\nglobal `users.updated_at` (which also moves when the account is edited from another team).",
                "summary": "List users",
                "tags": [
                    "Users"
                ],
                "parameters": [
                    {
                        "name": "email",
                        "in": "query",
                        "description": "Exact, case-insensitive match.",
                        "schema": {
                            "type": "string",
                            "format": "email"
                        }
                    },
                    {
                        "name": "external_id",
                        "in": "query",
                        "description": "External id; used with `external_source` (defaults to the team's own namespace).",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "external_source",
                        "in": "query",
                        "description": "External source namespace for `external_id`.",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "group_id",
                        "in": "query",
                        "description": "Members of this team group.",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "role",
                        "in": "query",
                        "description": "`learner`, `author`, `admin`, `billing`, `presenter`, `owner` or `outreach_admin`.",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "status",
                        "in": "query",
                        "description": "`active` or `deactivated` (deactivated = a member with no roles).",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "updated_since",
                        "in": "query",
                        "description": "Only users updated at or after this time (global `users.updated_at`). ISO 8601 timestamp.",
                        "schema": {
                            "type": "string",
                            "format": "date-time"
                        }
                    },
                    {
                        "name": "limit",
                        "in": "query",
                        "description": "Page size, 1-100.",
                        "schema": {
                            "type": "integer",
                            "default": 25
                        }
                    },
                    {
                        "name": "cursor",
                        "in": "query",
                        "description": "Opaque cursor: pass `meta.next_cursor` from the previous page.",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "id": {
                                                        "type": "integer"
                                                    },
                                                    "email": {
                                                        "type": "string"
                                                    },
                                                    "name": {
                                                        "type": "string"
                                                    },
                                                    "locale": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ]
                                                    },
                                                    "status": {
                                                        "type": "string"
                                                    },
                                                    "external": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "source": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "membership_status": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            }
                                                        },
                                                        "required": [
                                                            "id",
                                                            "source",
                                                            "membership_status"
                                                        ]
                                                    },
                                                    "roles": {
                                                        "type": "array",
                                                        "items": {
                                                            "type": "string"
                                                        }
                                                    },
                                                    "group_ids": {
                                                        "type": "array",
                                                        "items": {
                                                            "type": "integer"
                                                        }
                                                    },
                                                    "custom_fields": {
                                                        "type": "array",
                                                        "items": {
                                                            "type": "object",
                                                            "properties": {
                                                                "field_id": {
                                                                    "type": "integer"
                                                                },
                                                                "name": {
                                                                    "type": "string"
                                                                },
                                                                "type": {
                                                                    "type": "string"
                                                                },
                                                                "value": {},
                                                                "option_id": {
                                                                    "type": [
                                                                        "integer",
                                                                        "null"
                                                                    ]
                                                                },
                                                                "text": {
                                                                    "type": [
                                                                        "string",
                                                                        "null"
                                                                    ]
                                                                }
                                                            },
                                                            "required": [
                                                                "field_id",
                                                                "name",
                                                                "type",
                                                                "value",
                                                                "option_id",
                                                                "text"
                                                            ]
                                                        }
                                                    },
                                                    "custom_fields_complete": {
                                                        "type": "boolean"
                                                    },
                                                    "email_verified": {
                                                        "type": "boolean"
                                                    },
                                                    "last_active_at": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ]
                                                    },
                                                    "created_at": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ]
                                                    },
                                                    "updated_at": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ]
                                                    }
                                                },
                                                "required": [
                                                    "id",
                                                    "email",
                                                    "name",
                                                    "locale",
                                                    "status",
                                                    "external",
                                                    "roles",
                                                    "group_ids",
                                                    "custom_fields",
                                                    "custom_fields_complete",
                                                    "email_verified",
                                                    "last_active_at",
                                                    "created_at",
                                                    "updated_at"
                                                ]
                                            }
                                        },
                                        "meta": {
                                            "type": "object",
                                            "properties": {
                                                "next_cursor": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "has_more": {
                                                    "type": "boolean"
                                                }
                                            },
                                            "required": [
                                                "next_cursor",
                                                "has_more"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "data",
                                        "meta"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation failed; error.details maps fields to messages (validation_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Missing, invalid, revoked or expired API key (authentication_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "The API key lacks the required scope (permission_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Resource not found (not_found).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Rate limit exceeded; see the Retry-After header (rate_limited).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Unexpected server error (server_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            },
            "post": {
                "operationId": "v2.users.store",
                "description": "Requires scope `users:write`. The user is created as a learner (the API never grants other roles) and the\nteam's registration-approval setting is bypassed.\n\n- A new email creates a global account with a random password. With `notify` true they receive the\n  verification email (including a temporary password); with false the address is marked verified and no\n  email is sent.\n- An email that is already a member of this team returns 409 `user_exists` (`details.user_id`).\n- An email that already has an account on the platform attaches that account to this team (name and\n  locale are left alone) and, when `notify` is true, sends the \"you were added to a team\" email. The\n  response is 202 with only `{data: {id, email, status: \"attached\"}}` (GET the user afterwards). From then\n  on the user is protected (it belongs to other teams). Super-admin accounts are refused (409\n  `user_protected`) and nothing is attached or sent.\n- `external_id` can never be written for a protected account: creating with `external_id` for an existing\n  platform account returns 409 `user_protected` and attaches nothing.\n- External identity conflicts return 409 `external_identity_locked` / `external_id_taken`.\n- Required custom fields are not enforced; `custom_fields_complete` tells the client what is missing.\n- Checkbox fields take a single `option_id`.",
                "summary": "Create a user",
                "tags": [
                    "Users"
                ],
                "responses": {
                    "201": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "id": {
                                                    "type": "integer"
                                                },
                                                "email": {
                                                    "type": "string"
                                                },
                                                "name": {
                                                    "type": "string"
                                                },
                                                "locale": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "status": {
                                                    "type": "string"
                                                },
                                                "external": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "source": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "membership_status": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        }
                                                    },
                                                    "required": [
                                                        "id",
                                                        "source",
                                                        "membership_status"
                                                    ]
                                                },
                                                "roles": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "string"
                                                    }
                                                },
                                                "group_ids": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "integer"
                                                    }
                                                },
                                                "custom_fields": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "field_id": {
                                                                "type": "integer"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            },
                                                            "type": {
                                                                "type": "string"
                                                            },
                                                            "value": {},
                                                            "option_id": {
                                                                "type": [
                                                                    "integer",
                                                                    "null"
                                                                ]
                                                            },
                                                            "text": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            }
                                                        },
                                                        "required": [
                                                            "field_id",
                                                            "name",
                                                            "type",
                                                            "value",
                                                            "option_id",
                                                            "text"
                                                        ]
                                                    }
                                                },
                                                "custom_fields_complete": {
                                                    "type": "boolean"
                                                },
                                                "email_verified": {
                                                    "type": "boolean"
                                                },
                                                "last_active_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "created_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "updated_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                }
                                            },
                                            "required": [
                                                "id",
                                                "email",
                                                "name",
                                                "locale",
                                                "status",
                                                "external",
                                                "roles",
                                                "group_ids",
                                                "custom_fields",
                                                "custom_fields_complete",
                                                "email_verified",
                                                "last_active_at",
                                                "created_at",
                                                "updated_at"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "id": {
                                                    "type": "integer"
                                                },
                                                "email": {
                                                    "type": "string"
                                                },
                                                "status": {
                                                    "type": "string"
                                                }
                                            },
                                            "required": [
                                                "id",
                                                "email",
                                                "status"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation failed; error.details maps fields to messages (validation_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Missing, invalid, revoked or expired API key (authentication_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "The API key lacks the required scope (permission_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Resource not found (not_found).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Rate limit exceeded; see the Retry-After header (rate_limited).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Unexpected server error (server_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/custom-fields": {
            "get": {
                "operationId": "v2.custom_fields.index",
                "description": "Requires scope `users:read`. The team's live user custom fields, ordered as in the admin UI, unpaginated.\nUse these ids (and option ids) in the `custom_fields` map of `POST /v2/users` and `PATCH /v2/users/{id}`:\ntext, textarea, email, tel, number and date fields take a plain value; select, radio and checkbox fields take\nan option `id` (or `{option_id, text}` when the option has `specify` true). `options` is null for free-text types.\n`translations` maps locale to the translated field name (omitted when none).",
                "summary": "List custom field definitions",
                "tags": [
                    "Users"
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "id": {
                                                        "type": "integer"
                                                    },
                                                    "name": {
                                                        "type": "string"
                                                    },
                                                    "type": {
                                                        "type": "string"
                                                    },
                                                    "required": {
                                                        "type": "boolean"
                                                    },
                                                    "options": {
                                                        "type": [
                                                            "array",
                                                            "null"
                                                        ],
                                                        "items": {
                                                            "type": "object",
                                                            "properties": {
                                                                "id": {
                                                                    "type": "integer"
                                                                },
                                                                "label": {
                                                                    "type": "string"
                                                                },
                                                                "specify": {
                                                                    "type": "boolean"
                                                                }
                                                            },
                                                            "required": [
                                                                "id",
                                                                "label",
                                                                "specify"
                                                            ]
                                                        }
                                                    },
                                                    "translations": {
                                                        "type": "object",
                                                        "additionalProperties": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "required": [
                                                    "id",
                                                    "name",
                                                    "type",
                                                    "required",
                                                    "options"
                                                ]
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Missing, invalid, revoked or expired API key (authentication_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "The API key lacks the required scope (permission_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Resource not found (not_found).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation failed; error.details maps fields to messages (validation_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Rate limit exceeded; see the Retry-After header (rate_limited).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Unexpected server error (server_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/users/{id}": {
            "get": {
                "operationId": "v2.users.show",
                "description": "Requires scope `users:read`. 404 if the user is not a member of this team.",
                "summary": "Get one user",
                "tags": [
                    "Users"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "id": {
                                                    "type": "integer"
                                                },
                                                "email": {
                                                    "type": "string"
                                                },
                                                "name": {
                                                    "type": "string"
                                                },
                                                "locale": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "status": {
                                                    "type": "string"
                                                },
                                                "external": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "source": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "membership_status": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        }
                                                    },
                                                    "required": [
                                                        "id",
                                                        "source",
                                                        "membership_status"
                                                    ]
                                                },
                                                "roles": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "string"
                                                    }
                                                },
                                                "group_ids": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "integer"
                                                    }
                                                },
                                                "custom_fields": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "field_id": {
                                                                "type": "integer"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            },
                                                            "type": {
                                                                "type": "string"
                                                            },
                                                            "value": {},
                                                            "option_id": {
                                                                "type": [
                                                                    "integer",
                                                                    "null"
                                                                ]
                                                            },
                                                            "text": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            }
                                                        },
                                                        "required": [
                                                            "field_id",
                                                            "name",
                                                            "type",
                                                            "value",
                                                            "option_id",
                                                            "text"
                                                        ]
                                                    }
                                                },
                                                "custom_fields_complete": {
                                                    "type": "boolean"
                                                },
                                                "email_verified": {
                                                    "type": "boolean"
                                                },
                                                "last_active_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "created_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "updated_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                }
                                            },
                                            "required": [
                                                "id",
                                                "email",
                                                "name",
                                                "locale",
                                                "status",
                                                "external",
                                                "roles",
                                                "group_ids",
                                                "custom_fields",
                                                "custom_fields_complete",
                                                "email_verified",
                                                "last_active_at",
                                                "created_at",
                                                "updated_at"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Missing, invalid, revoked or expired API key (authentication_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "The API key lacks the required scope (permission_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Resource not found (not_found).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation failed; error.details maps fields to messages (validation_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Rate limit exceeded; see the Retry-After header (rate_limited).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Unexpected server error (server_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            },
            "patch": {
                "operationId": "v2.users.update",
                "description": "Requires scope `users:write`. Email and password cannot be changed. `name` and `locale` can only be\nchanged for non-protected users (a protected user gets 409 `user_protected` when the value would change).\n`group_ids` replaces the user's membership of this team's manual groups (rules-managed groups are untouched).\n`external_id: null` clears the team-namespace identity. External id writes are refused (409 `user_protected`) for protected users.",
                "summary": "Update a user",
                "tags": [
                    "Users"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "id": {
                                                    "type": "integer"
                                                },
                                                "email": {
                                                    "type": "string"
                                                },
                                                "name": {
                                                    "type": "string"
                                                },
                                                "locale": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "status": {
                                                    "type": "string"
                                                },
                                                "external": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "source": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "membership_status": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        }
                                                    },
                                                    "required": [
                                                        "id",
                                                        "source",
                                                        "membership_status"
                                                    ]
                                                },
                                                "roles": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "string"
                                                    }
                                                },
                                                "group_ids": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "integer"
                                                    }
                                                },
                                                "custom_fields": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "field_id": {
                                                                "type": "integer"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            },
                                                            "type": {
                                                                "type": "string"
                                                            },
                                                            "value": {},
                                                            "option_id": {
                                                                "type": [
                                                                    "integer",
                                                                    "null"
                                                                ]
                                                            },
                                                            "text": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            }
                                                        },
                                                        "required": [
                                                            "field_id",
                                                            "name",
                                                            "type",
                                                            "value",
                                                            "option_id",
                                                            "text"
                                                        ]
                                                    }
                                                },
                                                "custom_fields_complete": {
                                                    "type": "boolean"
                                                },
                                                "email_verified": {
                                                    "type": "boolean"
                                                },
                                                "last_active_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "created_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "updated_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                }
                                            },
                                            "required": [
                                                "id",
                                                "email",
                                                "name",
                                                "locale",
                                                "status",
                                                "external",
                                                "roles",
                                                "group_ids",
                                                "custom_fields",
                                                "custom_fields_complete",
                                                "email_verified",
                                                "last_active_at",
                                                "created_at",
                                                "updated_at"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation failed; error.details maps fields to messages (validation_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Missing, invalid, revoked or expired API key (authentication_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "The API key lacks the required scope (permission_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Resource not found (not_found).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Rate limit exceeded; see the Retry-After header (rate_limited).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Unexpected server error (server_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            },
            "delete": {
                "operationId": "v2.users.destroy",
                "description": "Requires scope `users:write`. Detaches the user from the team, its groups and roles (the global account,\nother teams, and the user's enrolment and progress rows are kept). 409 `user_protected` for protected\nusers. Returns 204.",
                "summary": "Remove a user from this team",
                "tags": [
                    "Users"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "204": {
                        "description": "No content"
                    },
                    "401": {
                        "description": "Missing, invalid, revoked or expired API key (authentication_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "The API key lacks the required scope (permission_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Resource not found (not_found).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation failed; error.details maps fields to messages (validation_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Rate limit exceeded; see the Retry-After header (rate_limited).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Unexpected server error (server_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/users/{id}/deactivate": {
            "post": {
                "operationId": "v2.users.deactivate",
                "description": "Requires scope `users:write`. 409 `user_protected` also for users linked to a presenter profile (unlink it in Manage first). Removes the user's roles in this team (they can no longer sign in to it);\nmembership, enrolments and history stay. 409 `user_protected` for protected users. Idempotent.",
                "summary": "Deactivate a user in this team",
                "tags": [
                    "Users"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "id": {
                                                    "type": "integer"
                                                },
                                                "email": {
                                                    "type": "string"
                                                },
                                                "name": {
                                                    "type": "string"
                                                },
                                                "locale": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "status": {
                                                    "type": "string"
                                                },
                                                "external": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "source": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "membership_status": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        }
                                                    },
                                                    "required": [
                                                        "id",
                                                        "source",
                                                        "membership_status"
                                                    ]
                                                },
                                                "roles": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "string"
                                                    }
                                                },
                                                "group_ids": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "integer"
                                                    }
                                                },
                                                "custom_fields": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "field_id": {
                                                                "type": "integer"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            },
                                                            "type": {
                                                                "type": "string"
                                                            },
                                                            "value": {},
                                                            "option_id": {
                                                                "type": [
                                                                    "integer",
                                                                    "null"
                                                                ]
                                                            },
                                                            "text": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            }
                                                        },
                                                        "required": [
                                                            "field_id",
                                                            "name",
                                                            "type",
                                                            "value",
                                                            "option_id",
                                                            "text"
                                                        ]
                                                    }
                                                },
                                                "custom_fields_complete": {
                                                    "type": "boolean"
                                                },
                                                "email_verified": {
                                                    "type": "boolean"
                                                },
                                                "last_active_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "created_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "updated_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                }
                                            },
                                            "required": [
                                                "id",
                                                "email",
                                                "name",
                                                "locale",
                                                "status",
                                                "external",
                                                "roles",
                                                "group_ids",
                                                "custom_fields",
                                                "custom_fields_complete",
                                                "email_verified",
                                                "last_active_at",
                                                "created_at",
                                                "updated_at"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Missing, invalid, revoked or expired API key (authentication_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "The API key lacks the required scope (permission_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Resource not found (not_found).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation failed; error.details maps fields to messages (validation_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Rate limit exceeded; see the Retry-After header (rate_limited).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Unexpected server error (server_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/users/{id}/reactivate": {
            "post": {
                "operationId": "v2.users.reactivate",
                "description": "Requires scope `users:write`. Grants the learner role again (plus presenter when the user is linked to a\npresenter profile). Roles other than learner that were removed by an earlier deactivation are not restored.\nIdempotent.",
                "summary": "Reactivate a user in this team",
                "tags": [
                    "Users"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "id": {
                                                    "type": "integer"
                                                },
                                                "email": {
                                                    "type": "string"
                                                },
                                                "name": {
                                                    "type": "string"
                                                },
                                                "locale": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "status": {
                                                    "type": "string"
                                                },
                                                "external": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "source": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "membership_status": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        }
                                                    },
                                                    "required": [
                                                        "id",
                                                        "source",
                                                        "membership_status"
                                                    ]
                                                },
                                                "roles": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "string"
                                                    }
                                                },
                                                "group_ids": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "integer"
                                                    }
                                                },
                                                "custom_fields": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "field_id": {
                                                                "type": "integer"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            },
                                                            "type": {
                                                                "type": "string"
                                                            },
                                                            "value": {},
                                                            "option_id": {
                                                                "type": [
                                                                    "integer",
                                                                    "null"
                                                                ]
                                                            },
                                                            "text": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            }
                                                        },
                                                        "required": [
                                                            "field_id",
                                                            "name",
                                                            "type",
                                                            "value",
                                                            "option_id",
                                                            "text"
                                                        ]
                                                    }
                                                },
                                                "custom_fields_complete": {
                                                    "type": "boolean"
                                                },
                                                "email_verified": {
                                                    "type": "boolean"
                                                },
                                                "last_active_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "created_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "updated_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                }
                                            },
                                            "required": [
                                                "id",
                                                "email",
                                                "name",
                                                "locale",
                                                "status",
                                                "external",
                                                "roles",
                                                "group_ids",
                                                "custom_fields",
                                                "custom_fields_complete",
                                                "email_verified",
                                                "last_active_at",
                                                "created_at",
                                                "updated_at"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Missing, invalid, revoked or expired API key (authentication_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "The API key lacks the required scope (permission_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Resource not found (not_found).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation failed; error.details maps fields to messages (validation_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Rate limit exceeded; see the Retry-After header (rate_limited).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Unexpected server error (server_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/groups": {
            "get": {
                "operationId": "v2.groups.index",
                "description": "Requires scope `users:read`. Cursor-paginated by id.",
                "summary": "List groups",
                "tags": [
                    "Groups"
                ],
                "parameters": [
                    {
                        "name": "reference",
                        "in": "query",
                        "description": "Exact match on the group reference.",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "limit",
                        "in": "query",
                        "description": "Page size, 1-100.",
                        "schema": {
                            "type": "integer",
                            "default": 25
                        }
                    },
                    {
                        "name": "cursor",
                        "in": "query",
                        "description": "Opaque cursor: pass `meta.next_cursor` from the previous page.",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "id": {
                                                        "type": "integer"
                                                    },
                                                    "name": {
                                                        "type": "string"
                                                    },
                                                    "reference": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ]
                                                    },
                                                    "locked": {
                                                        "type": "boolean"
                                                    },
                                                    "auto_assign": {
                                                        "type": "object",
                                                        "properties": {
                                                            "enabled": {
                                                                "type": "boolean"
                                                            },
                                                            "has_rules": {
                                                                "type": "boolean"
                                                            }
                                                        },
                                                        "required": [
                                                            "enabled",
                                                            "has_rules"
                                                        ]
                                                    },
                                                    "explore_assigned_only": {
                                                        "type": "boolean"
                                                    },
                                                    "hide_enrollment": {
                                                        "type": "boolean"
                                                    },
                                                    "member_count": {
                                                        "type": "integer"
                                                    },
                                                    "created_at": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ]
                                                    },
                                                    "updated_at": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ]
                                                    }
                                                },
                                                "required": [
                                                    "id",
                                                    "name",
                                                    "reference",
                                                    "locked",
                                                    "auto_assign",
                                                    "explore_assigned_only",
                                                    "hide_enrollment",
                                                    "member_count",
                                                    "created_at",
                                                    "updated_at"
                                                ]
                                            }
                                        },
                                        "meta": {
                                            "type": "object",
                                            "properties": {
                                                "next_cursor": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "has_more": {
                                                    "type": "boolean"
                                                }
                                            },
                                            "required": [
                                                "next_cursor",
                                                "has_more"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "data",
                                        "meta"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation failed; error.details maps fields to messages (validation_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Missing, invalid, revoked or expired API key (authentication_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "The API key lacks the required scope (permission_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Resource not found (not_found).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Rate limit exceeded; see the Retry-After header (rate_limited).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Unexpected server error (server_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            },
            "post": {
                "operationId": "v2.groups.store",
                "description": "Requires scope `groups:write`. `name` is unique among the team's live groups and `reference`\n(optional) is unique per team. The group name column is latin1, so characters outside\nWindows-1252 are rejected with 422 `unsupported_characters`.",
                "summary": "Create a group",
                "tags": [
                    "Groups"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "name": {
                                        "type": "string",
                                        "maxLength": 255
                                    },
                                    "reference": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 191
                                    },
                                    "explore_assigned_only": {
                                        "type": "boolean"
                                    },
                                    "hide_enrollment": {
                                        "type": "boolean"
                                    }
                                },
                                "required": [
                                    "name"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "id": {
                                                    "type": "integer"
                                                },
                                                "name": {
                                                    "type": "string"
                                                },
                                                "reference": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "locked": {
                                                    "type": "boolean"
                                                },
                                                "auto_assign": {
                                                    "type": "object",
                                                    "properties": {
                                                        "enabled": {
                                                            "type": "boolean"
                                                        },
                                                        "has_rules": {
                                                            "type": "boolean"
                                                        }
                                                    },
                                                    "required": [
                                                        "enabled",
                                                        "has_rules"
                                                    ]
                                                },
                                                "explore_assigned_only": {
                                                    "type": "boolean"
                                                },
                                                "hide_enrollment": {
                                                    "type": "boolean"
                                                },
                                                "member_count": {
                                                    "type": "integer"
                                                },
                                                "created_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "updated_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                }
                                            },
                                            "required": [
                                                "id",
                                                "name",
                                                "reference",
                                                "locked",
                                                "auto_assign",
                                                "explore_assigned_only",
                                                "hide_enrollment",
                                                "member_count",
                                                "created_at",
                                                "updated_at"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation failed; error.details maps fields to messages (validation_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Missing, invalid, revoked or expired API key (authentication_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "The API key lacks the required scope (permission_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Resource not found (not_found).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Rate limit exceeded; see the Retry-After header (rate_limited).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Unexpected server error (server_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/groups/{id}": {
            "get": {
                "operationId": "v2.groups.show",
                "description": "Requires scope `users:read`. 404 if the group is not in this team.",
                "summary": "Get one group",
                "tags": [
                    "Groups"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "id": {
                                                    "type": "integer"
                                                },
                                                "name": {
                                                    "type": "string"
                                                },
                                                "reference": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "locked": {
                                                    "type": "boolean"
                                                },
                                                "auto_assign": {
                                                    "type": "object",
                                                    "properties": {
                                                        "enabled": {
                                                            "type": "boolean"
                                                        },
                                                        "has_rules": {
                                                            "type": "boolean"
                                                        }
                                                    },
                                                    "required": [
                                                        "enabled",
                                                        "has_rules"
                                                    ]
                                                },
                                                "explore_assigned_only": {
                                                    "type": "boolean"
                                                },
                                                "hide_enrollment": {
                                                    "type": "boolean"
                                                },
                                                "member_count": {
                                                    "type": "integer"
                                                },
                                                "created_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "updated_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                }
                                            },
                                            "required": [
                                                "id",
                                                "name",
                                                "reference",
                                                "locked",
                                                "auto_assign",
                                                "explore_assigned_only",
                                                "hide_enrollment",
                                                "member_count",
                                                "created_at",
                                                "updated_at"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Missing, invalid, revoked or expired API key (authentication_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "The API key lacks the required scope (permission_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Resource not found (not_found).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation failed; error.details maps fields to messages (validation_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Rate limit exceeded; see the Retry-After header (rate_limited).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Unexpected server error (server_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            },
            "patch": {
                "operationId": "v2.groups.update",
                "description": "Requires scope `groups:write`. A locked group cannot be renamed or re-referenced (409 `group_locked`).",
                "summary": "Update a group",
                "tags": [
                    "Groups"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "name": {
                                        "type": "string",
                                        "maxLength": 255
                                    },
                                    "reference": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 191
                                    },
                                    "explore_assigned_only": {
                                        "type": "boolean"
                                    },
                                    "hide_enrollment": {
                                        "type": "boolean"
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "id": {
                                                    "type": "integer"
                                                },
                                                "name": {
                                                    "type": "string"
                                                },
                                                "reference": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "locked": {
                                                    "type": "boolean"
                                                },
                                                "auto_assign": {
                                                    "type": "object",
                                                    "properties": {
                                                        "enabled": {
                                                            "type": "boolean"
                                                        },
                                                        "has_rules": {
                                                            "type": "boolean"
                                                        }
                                                    },
                                                    "required": [
                                                        "enabled",
                                                        "has_rules"
                                                    ]
                                                },
                                                "explore_assigned_only": {
                                                    "type": "boolean"
                                                },
                                                "hide_enrollment": {
                                                    "type": "boolean"
                                                },
                                                "member_count": {
                                                    "type": "integer"
                                                },
                                                "created_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "updated_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                }
                                            },
                                            "required": [
                                                "id",
                                                "name",
                                                "reference",
                                                "locked",
                                                "auto_assign",
                                                "explore_assigned_only",
                                                "hide_enrollment",
                                                "member_count",
                                                "created_at",
                                                "updated_at"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation failed; error.details maps fields to messages (validation_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Missing, invalid, revoked or expired API key (authentication_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "The API key lacks the required scope (permission_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Resource not found (not_found).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Rate limit exceeded; see the Retry-After header (rate_limited).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Unexpected server error (server_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            },
            "delete": {
                "operationId": "v2.groups.destroy",
                "description": "Requires scope `groups:write`. Members are detached and the group soft-deleted. A locked group\nreturns 409 `group_locked`. Returns 204.",
                "summary": "Delete a group",
                "tags": [
                    "Groups"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "204": {
                        "description": "No content"
                    },
                    "401": {
                        "description": "Missing, invalid, revoked or expired API key (authentication_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "The API key lacks the required scope (permission_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Resource not found (not_found).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation failed; error.details maps fields to messages (validation_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Rate limit exceeded; see the Retry-After header (rate_limited).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Unexpected server error (server_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/groups/{id}/members": {
            "get": {
                "operationId": "v2.groups.members.index",
                "description": "Requires scope `users:read`. Compact user shape; cursor-paginated by user id. Use `GET /v2/users?group_id=` for the full user shape.",
                "summary": "List group members",
                "tags": [
                    "Groups"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "limit",
                        "in": "query",
                        "description": "Page size, 1-100.",
                        "schema": {
                            "type": "integer",
                            "default": 25
                        }
                    },
                    {
                        "name": "cursor",
                        "in": "query",
                        "description": "Opaque cursor: pass `meta.next_cursor` from the previous page.",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "id": {
                                                        "type": "integer"
                                                    },
                                                    "email": {
                                                        "type": "string"
                                                    },
                                                    "name": {
                                                        "type": "string"
                                                    },
                                                    "status": {
                                                        "type": "string"
                                                    },
                                                    "external": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "source": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            }
                                                        },
                                                        "required": [
                                                            "id",
                                                            "source"
                                                        ]
                                                    }
                                                },
                                                "required": [
                                                    "id",
                                                    "email",
                                                    "name",
                                                    "status",
                                                    "external"
                                                ]
                                            }
                                        },
                                        "meta": {
                                            "type": "object",
                                            "properties": {
                                                "next_cursor": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "has_more": {
                                                    "type": "boolean"
                                                }
                                            },
                                            "required": [
                                                "next_cursor",
                                                "has_more"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "data",
                                        "meta"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Missing, invalid, revoked or expired API key (authentication_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "The API key lacks the required scope (permission_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Resource not found (not_found).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation failed; error.details maps fields to messages (validation_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Rate limit exceeded; see the Retry-After header (rate_limited).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Unexpected server error (server_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            },
            "post": {
                "operationId": "v2.groups.members.bulk",
                "description": "Requires scope `groups:write`. At most 100 ids in each list. Ids that are not members of this team\nare reported in `not_found`; `added` and `removed` list only users whose membership actually changed.",
                "summary": "Add and remove members in bulk",
                "tags": [
                    "Groups"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "add": {
                                        "type": "array",
                                        "items": {
                                            "type": "integer",
                                            "minimum": 1
                                        },
                                        "maxItems": 100
                                    },
                                    "remove": {
                                        "type": "array",
                                        "items": {
                                            "type": "integer",
                                            "minimum": 1
                                        },
                                        "maxItems": 100
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "added": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "integer"
                                                    }
                                                },
                                                "removed": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "integer"
                                                    }
                                                },
                                                "not_found": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "integer"
                                                    }
                                                }
                                            },
                                            "required": [
                                                "added",
                                                "removed",
                                                "not_found"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation failed; error.details maps fields to messages (validation_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Missing, invalid, revoked or expired API key (authentication_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "The API key lacks the required scope (permission_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Resource not found (not_found).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Rate limit exceeded; see the Retry-After header (rate_limited).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Unexpected server error (server_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/groups/{id}/members/{userId}": {
            "put": {
                "operationId": "v2.groups.members.add",
                "description": "Requires scope `groups:write`. 404 if the user is not a member of this team; 409 `group_rules_managed`\nif the group's membership is managed by active auto-assign rules. Idempotent.",
                "summary": "Add a member",
                "tags": [
                    "Groups"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "userId",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "group_id": {
                                                    "type": "integer"
                                                },
                                                "user_id": {
                                                    "type": "integer"
                                                },
                                                "member": {
                                                    "type": "boolean"
                                                }
                                            },
                                            "required": [
                                                "group_id",
                                                "user_id",
                                                "member"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Missing, invalid, revoked or expired API key (authentication_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "The API key lacks the required scope (permission_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Resource not found (not_found).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation failed; error.details maps fields to messages (validation_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Rate limit exceeded; see the Retry-After header (rate_limited).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Unexpected server error (server_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            },
            "delete": {
                "operationId": "v2.groups.members.remove",
                "description": "Requires scope `groups:write`. Same errors as adding a member. Returns 204.",
                "summary": "Remove a member",
                "tags": [
                    "Groups"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "userId",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "204": {
                        "description": "No content"
                    },
                    "401": {
                        "description": "Missing, invalid, revoked or expired API key (authentication_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "The API key lacks the required scope (permission_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Resource not found (not_found).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation failed; error.details maps fields to messages (validation_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Rate limit exceeded; see the Retry-After header (rate_limited).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Unexpected server error (server_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/groups/{id}/courses/{courseId}": {
            "put": {
                "operationId": "v2.groups.courses.assign",
                "description": "Requires scopes `groups:write` and `enrolments:write`. Sends no emails. `assignment` `auto` enrols the\ngroup's members; `optional` only offers the course to them in Explore. Idempotent (updates the assignment).",
                "summary": "Assign a group to a course",
                "tags": [
                    "Groups"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "courseId",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "assignment": {
                                        "type": "string",
                                        "enum": [
                                            "auto",
                                            "optional"
                                        ]
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "group_id": {
                                                    "type": "integer"
                                                },
                                                "course_id": {
                                                    "type": "integer"
                                                },
                                                "assignment": {
                                                    "type": "string"
                                                }
                                            },
                                            "required": [
                                                "group_id",
                                                "course_id",
                                                "assignment"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation failed; error.details maps fields to messages (validation_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Missing, invalid, revoked or expired API key (authentication_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "The API key lacks the required scope (permission_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Resource not found (not_found).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Rate limit exceeded; see the Retry-After header (rate_limited).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Unexpected server error (server_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            },
            "delete": {
                "operationId": "v2.groups.courses.unassign",
                "description": "Requires scopes `groups:write` and `enrolments:write`. Idempotent; returns 204.",
                "summary": "Unassign a group from a course",
                "tags": [
                    "Groups"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "courseId",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "204": {
                        "description": "No content"
                    },
                    "401": {
                        "description": "Missing, invalid, revoked or expired API key (authentication_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "The API key lacks the required scope (permission_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Resource not found (not_found).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation failed; error.details maps fields to messages (validation_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Rate limit exceeded; see the Retry-After header (rate_limited).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Unexpected server error (server_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/users/{user}/enrolments": {
            "get": {
                "operationId": "v2.users.enrolments.index",
                "description": "Query: `status` (enrolled|pending_approval|waitlisted|unenrolled; default enrolled), `include_unenrolled`\n(also return previously unenrolled courses), `limit`, `cursor`. Scope `enrolments:read`.",
                "summary": "List a user's enrolments (cursor paginated, by course id)",
                "tags": [
                    "Enrolments"
                ],
                "parameters": [
                    {
                        "name": "user",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "status",
                        "in": "query",
                        "description": "`enrolled` (default), `pending_approval`, `waitlisted` or `unenrolled`.",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "include_unenrolled",
                        "in": "query",
                        "description": "Also return previously unenrolled courses.",
                        "schema": {
                            "type": "boolean"
                        }
                    },
                    {
                        "name": "limit",
                        "in": "query",
                        "description": "Page size, 1-100.",
                        "schema": {
                            "type": "integer",
                            "default": 25
                        }
                    },
                    {
                        "name": "cursor",
                        "in": "query",
                        "description": "Opaque cursor: pass `meta.next_cursor` from the previous page.",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "user_id": {
                                                        "type": "integer"
                                                    },
                                                    "course_id": {
                                                        "type": "integer"
                                                    },
                                                    "status": {
                                                        "type": "string"
                                                    },
                                                    "enrolled_at": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ]
                                                    },
                                                    "unenrolled_at": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ]
                                                    },
                                                    "sources": {
                                                        "type": "array",
                                                        "items": {
                                                            "type": "object",
                                                            "properties": {
                                                                "type": {
                                                                    "type": "string"
                                                                },
                                                                "enrolled_at": {
                                                                    "type": [
                                                                        "string",
                                                                        "null"
                                                                    ]
                                                                },
                                                                "group_id": {
                                                                    "type": "integer"
                                                                },
                                                                "assignment": {
                                                                    "type": [
                                                                        "string",
                                                                        "null"
                                                                    ]
                                                                }
                                                            },
                                                            "required": [
                                                                "type"
                                                            ]
                                                        }
                                                    },
                                                    "offered_via_group_ids": {
                                                        "type": "array",
                                                        "items": {
                                                            "type": "integer"
                                                        }
                                                    },
                                                    "request": {
                                                        "type": [
                                                            "object",
                                                            "null"
                                                        ],
                                                        "properties": {
                                                            "status": {
                                                                "type": "string"
                                                            },
                                                            "created_at": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            }
                                                        },
                                                        "required": [
                                                            "status",
                                                            "created_at"
                                                        ]
                                                    }
                                                },
                                                "required": [
                                                    "user_id",
                                                    "course_id",
                                                    "status",
                                                    "enrolled_at",
                                                    "unenrolled_at",
                                                    "sources",
                                                    "offered_via_group_ids",
                                                    "request"
                                                ]
                                            }
                                        },
                                        "meta": {
                                            "type": "object",
                                            "properties": {
                                                "next_cursor": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "has_more": {
                                                    "type": "boolean"
                                                }
                                            },
                                            "required": [
                                                "next_cursor",
                                                "has_more"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "data",
                                        "meta"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Missing, invalid, revoked or expired API key (authentication_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "The API key lacks the required scope (permission_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Resource not found (not_found).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation failed; error.details maps fields to messages (validation_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Rate limit exceeded; see the Retry-After header (rate_limited).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Unexpected server error (server_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/users/{user}/enrolments/{course}": {
            "get": {
                "operationId": "v2.users.enrolments.show",
                "description": "Returns 200 with `status: not_enrolled` when there is none. Scope `enrolments:read`.",
                "summary": "Get a user's enrolment on a course",
                "tags": [
                    "Enrolments"
                ],
                "parameters": [
                    {
                        "name": "user",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "course",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "user_id": {
                                                    "type": "integer"
                                                },
                                                "course_id": {
                                                    "type": "integer"
                                                },
                                                "status": {
                                                    "type": "string"
                                                },
                                                "enrolled_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "unenrolled_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "sources": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "type": {
                                                                "type": "string"
                                                            },
                                                            "enrolled_at": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "group_id": {
                                                                "type": "integer"
                                                            },
                                                            "assignment": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            }
                                                        },
                                                        "required": [
                                                            "type"
                                                        ]
                                                    }
                                                },
                                                "offered_via_group_ids": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "integer"
                                                    }
                                                },
                                                "request": {
                                                    "type": [
                                                        "object",
                                                        "null"
                                                    ],
                                                    "properties": {
                                                        "status": {
                                                            "type": "string"
                                                        },
                                                        "created_at": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        }
                                                    },
                                                    "required": [
                                                        "status",
                                                        "created_at"
                                                    ]
                                                }
                                            },
                                            "required": [
                                                "user_id",
                                                "course_id",
                                                "status",
                                                "enrolled_at",
                                                "unenrolled_at",
                                                "sources",
                                                "offered_via_group_ids",
                                                "request"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Missing, invalid, revoked or expired API key (authentication_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "The API key lacks the required scope (permission_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Resource not found (not_found).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation failed; error.details maps fields to messages (validation_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Rate limit exceeded; see the Retry-After header (rate_limited).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Unexpected server error (server_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            },
            "put": {
                "operationId": "v2.users.enrolments.upsert",
                "description": "Idempotent. Returns 201 when a new enrolment was created, 200 when the user was already enrolled, 202\nwhen the user was placed on the waiting list. Scope `enrolments:write`.\n\nErrors: 404 (user not in this team / course not found), 409 `course_full`, 422 `prerequisites_unmet`\n(only when `check_prerequisites=true`).",
                "summary": "Enrol a user on a course",
                "tags": [
                    "Enrolments"
                ],
                "parameters": [
                    {
                        "name": "user",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "course",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "user_id": {
                                                    "type": "integer"
                                                },
                                                "course_id": {
                                                    "type": "integer"
                                                },
                                                "status": {
                                                    "type": "string"
                                                },
                                                "enrolled_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "unenrolled_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "sources": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "type": {
                                                                "type": "string"
                                                            },
                                                            "enrolled_at": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "group_id": {
                                                                "type": "integer"
                                                            },
                                                            "assignment": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            }
                                                        },
                                                        "required": [
                                                            "type"
                                                        ]
                                                    }
                                                },
                                                "offered_via_group_ids": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "integer"
                                                    }
                                                },
                                                "request": {
                                                    "type": [
                                                        "object",
                                                        "null"
                                                    ],
                                                    "properties": {
                                                        "status": {
                                                            "type": "string"
                                                        },
                                                        "created_at": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        }
                                                    },
                                                    "required": [
                                                        "status",
                                                        "created_at"
                                                    ]
                                                }
                                            },
                                            "required": [
                                                "user_id",
                                                "course_id",
                                                "status",
                                                "enrolled_at",
                                                "unenrolled_at",
                                                "sources",
                                                "offered_via_group_ids",
                                                "request"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "201": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "user_id": {
                                                    "type": "integer"
                                                },
                                                "course_id": {
                                                    "type": "integer"
                                                },
                                                "status": {
                                                    "type": "string"
                                                },
                                                "enrolled_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "unenrolled_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "sources": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "type": {
                                                                "type": "string"
                                                            },
                                                            "enrolled_at": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "group_id": {
                                                                "type": "integer"
                                                            },
                                                            "assignment": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            }
                                                        },
                                                        "required": [
                                                            "type"
                                                        ]
                                                    }
                                                },
                                                "offered_via_group_ids": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "integer"
                                                    }
                                                },
                                                "request": {
                                                    "type": [
                                                        "object",
                                                        "null"
                                                    ],
                                                    "properties": {
                                                        "status": {
                                                            "type": "string"
                                                        },
                                                        "created_at": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        }
                                                    },
                                                    "required": [
                                                        "status",
                                                        "created_at"
                                                    ]
                                                }
                                            },
                                            "required": [
                                                "user_id",
                                                "course_id",
                                                "status",
                                                "enrolled_at",
                                                "unenrolled_at",
                                                "sources",
                                                "offered_via_group_ids",
                                                "request"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "user_id": {
                                                    "type": "integer"
                                                },
                                                "course_id": {
                                                    "type": "integer"
                                                },
                                                "status": {
                                                    "type": "string"
                                                },
                                                "enrolled_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "unenrolled_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "sources": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "type": {
                                                                "type": "string"
                                                            },
                                                            "enrolled_at": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "group_id": {
                                                                "type": "integer"
                                                            },
                                                            "assignment": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            }
                                                        },
                                                        "required": [
                                                            "type"
                                                        ]
                                                    }
                                                },
                                                "offered_via_group_ids": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "integer"
                                                    }
                                                },
                                                "request": {
                                                    "type": [
                                                        "object",
                                                        "null"
                                                    ],
                                                    "properties": {
                                                        "status": {
                                                            "type": "string"
                                                        },
                                                        "created_at": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        }
                                                    },
                                                    "required": [
                                                        "status",
                                                        "created_at"
                                                    ]
                                                }
                                            },
                                            "required": [
                                                "user_id",
                                                "course_id",
                                                "status",
                                                "enrolled_at",
                                                "unenrolled_at",
                                                "sources",
                                                "offered_via_group_ids",
                                                "request"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Missing, invalid, revoked or expired API key (authentication_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "The API key lacks the required scope (permission_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Resource not found (not_found).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation failed; error.details maps fields to messages (validation_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Rate limit exceeded; see the Retry-After header (rate_limited).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Unexpected server error (server_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            },
            "delete": {
                "operationId": "v2.users.enrolments.destroy",
                "description": "Soft-deletes the enrolment and clears any pending/waiting request. Idempotent (200 even if there was\nnothing to remove). If the user is still enrolled through an `auto` group the response has\n`status: enrolled` with that group in `sources`. Scope `enrolments:write`.\n\nErrors: 409 `required_training` when an active training requirement covers the user on this course\n(exempt the learner or remove them from the requirement's audience first).",
                "summary": "Remove a user's direct enrolment",
                "tags": [
                    "Enrolments"
                ],
                "parameters": [
                    {
                        "name": "user",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "course",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "user_id": {
                                                    "type": "integer"
                                                },
                                                "course_id": {
                                                    "type": "integer"
                                                },
                                                "status": {
                                                    "type": "string"
                                                },
                                                "enrolled_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "unenrolled_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "sources": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "type": {
                                                                "type": "string"
                                                            },
                                                            "enrolled_at": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "group_id": {
                                                                "type": "integer"
                                                            },
                                                            "assignment": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            }
                                                        },
                                                        "required": [
                                                            "type"
                                                        ]
                                                    }
                                                },
                                                "offered_via_group_ids": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "integer"
                                                    }
                                                },
                                                "request": {
                                                    "type": [
                                                        "object",
                                                        "null"
                                                    ],
                                                    "properties": {
                                                        "status": {
                                                            "type": "string"
                                                        },
                                                        "created_at": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        }
                                                    },
                                                    "required": [
                                                        "status",
                                                        "created_at"
                                                    ]
                                                }
                                            },
                                            "required": [
                                                "user_id",
                                                "course_id",
                                                "status",
                                                "enrolled_at",
                                                "unenrolled_at",
                                                "sources",
                                                "offered_via_group_ids",
                                                "request"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Missing, invalid, revoked or expired API key (authentication_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "The API key lacks the required scope (permission_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Resource not found (not_found).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation failed; error.details maps fields to messages (validation_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Rate limit exceeded; see the Retry-After header (rate_limited).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Unexpected server error (server_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/courses/{course}/enrolments": {
            "get": {
                "operationId": "v2.courses.enrolments.index",
                "description": "Query: `status` (enrolled|pending_approval|waitlisted|unenrolled; default enrolled), `include_unenrolled`,\n`enrolled_since` (ISO 8601; matches direct enrolments created since, group-only learners have no date),\n`limit`, `cursor`. Each row carries a compact `user`. Scope `enrolments:read`.",
                "summary": "List a course's enrolments (cursor paginated, by user id)",
                "tags": [
                    "Enrolments"
                ],
                "parameters": [
                    {
                        "name": "course",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "status",
                        "in": "query",
                        "description": "`enrolled` (default), `pending_approval`, `waitlisted` or `unenrolled`.",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "include_unenrolled",
                        "in": "query",
                        "description": "Also return previously unenrolled users.",
                        "schema": {
                            "type": "boolean"
                        }
                    },
                    {
                        "name": "enrolled_since",
                        "in": "query",
                        "description": "Direct enrolments created at or after this time; group-only learners have no date. ISO 8601 timestamp.",
                        "schema": {
                            "type": "string",
                            "format": "date-time"
                        }
                    },
                    {
                        "name": "limit",
                        "in": "query",
                        "description": "Page size, 1-100.",
                        "schema": {
                            "type": "integer",
                            "default": 25
                        }
                    },
                    {
                        "name": "cursor",
                        "in": "query",
                        "description": "Opaque cursor: pass `meta.next_cursor` from the previous page.",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "user_id": {
                                                        "type": "integer"
                                                    },
                                                    "course_id": {
                                                        "type": "integer"
                                                    },
                                                    "user": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "email": {
                                                                "type": "string"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            },
                                                            "external": {
                                                                "type": "object",
                                                                "properties": {
                                                                    "id": {
                                                                        "type": [
                                                                            "string",
                                                                            "null"
                                                                        ]
                                                                    },
                                                                    "source": {
                                                                        "type": [
                                                                            "string",
                                                                            "null"
                                                                        ]
                                                                    }
                                                                },
                                                                "required": [
                                                                    "id",
                                                                    "source"
                                                                ]
                                                            }
                                                        },
                                                        "required": [
                                                            "id",
                                                            "email",
                                                            "name",
                                                            "external"
                                                        ]
                                                    },
                                                    "status": {
                                                        "type": "string"
                                                    },
                                                    "enrolled_at": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ]
                                                    },
                                                    "unenrolled_at": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ]
                                                    },
                                                    "sources": {
                                                        "type": "array",
                                                        "items": {
                                                            "type": "object",
                                                            "properties": {
                                                                "type": {
                                                                    "type": "string"
                                                                },
                                                                "enrolled_at": {
                                                                    "type": [
                                                                        "string",
                                                                        "null"
                                                                    ]
                                                                },
                                                                "group_id": {
                                                                    "type": "integer"
                                                                },
                                                                "assignment": {
                                                                    "type": [
                                                                        "string",
                                                                        "null"
                                                                    ]
                                                                }
                                                            },
                                                            "required": [
                                                                "type"
                                                            ]
                                                        }
                                                    },
                                                    "offered_via_group_ids": {
                                                        "type": "array",
                                                        "items": {
                                                            "type": "integer"
                                                        }
                                                    },
                                                    "request": {
                                                        "type": [
                                                            "object",
                                                            "null"
                                                        ],
                                                        "properties": {
                                                            "status": {
                                                                "type": "string"
                                                            },
                                                            "created_at": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            }
                                                        },
                                                        "required": [
                                                            "status",
                                                            "created_at"
                                                        ]
                                                    }
                                                },
                                                "required": [
                                                    "user_id",
                                                    "course_id",
                                                    "user",
                                                    "status",
                                                    "enrolled_at",
                                                    "unenrolled_at",
                                                    "sources",
                                                    "offered_via_group_ids",
                                                    "request"
                                                ]
                                            }
                                        },
                                        "meta": {
                                            "type": "object",
                                            "properties": {
                                                "next_cursor": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "has_more": {
                                                    "type": "boolean"
                                                }
                                            },
                                            "required": [
                                                "next_cursor",
                                                "has_more"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "data",
                                        "meta"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Missing, invalid, revoked or expired API key (authentication_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "The API key lacks the required scope (permission_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Resource not found (not_found).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation failed; error.details maps fields to messages (validation_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Rate limit exceeded; see the Retry-After header (rate_limited).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Unexpected server error (server_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/enrolments": {
            "post": {
                "operationId": "v2.enrolments.store",
                "description": "Same behaviour and responses as `PUT /users/{user}/enrolments/{course}`. Identify the user with exactly\none of `user_id`, `email`, or `external_id` (+ optional `external_source`, default the team's own\nnamespace). Only members of this team are matched. Scope `enrolments:write`.",
                "summary": "Enrol a user on a course, identifying the user in the body",
                "tags": [
                    "Enrolments"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "course_id": {
                                        "type": "integer"
                                    },
                                    "user_id": {
                                        "type": [
                                            "integer",
                                            "null"
                                        ]
                                    },
                                    "email": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 191
                                    },
                                    "external_id": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 191
                                    },
                                    "external_source": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 191
                                    }
                                },
                                "required": [
                                    "course_id"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "user_id": {
                                                    "type": "integer"
                                                },
                                                "course_id": {
                                                    "type": "integer"
                                                },
                                                "status": {
                                                    "type": "string"
                                                },
                                                "enrolled_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "unenrolled_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "sources": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "type": {
                                                                "type": "string"
                                                            },
                                                            "enrolled_at": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "group_id": {
                                                                "type": "integer"
                                                            },
                                                            "assignment": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            }
                                                        },
                                                        "required": [
                                                            "type"
                                                        ]
                                                    }
                                                },
                                                "offered_via_group_ids": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "integer"
                                                    }
                                                },
                                                "request": {
                                                    "type": [
                                                        "object",
                                                        "null"
                                                    ],
                                                    "properties": {
                                                        "status": {
                                                            "type": "string"
                                                        },
                                                        "created_at": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        }
                                                    },
                                                    "required": [
                                                        "status",
                                                        "created_at"
                                                    ]
                                                }
                                            },
                                            "required": [
                                                "user_id",
                                                "course_id",
                                                "status",
                                                "enrolled_at",
                                                "unenrolled_at",
                                                "sources",
                                                "offered_via_group_ids",
                                                "request"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation failed; error.details maps fields to messages (validation_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "201": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "user_id": {
                                                    "type": "integer"
                                                },
                                                "course_id": {
                                                    "type": "integer"
                                                },
                                                "status": {
                                                    "type": "string"
                                                },
                                                "enrolled_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "unenrolled_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "sources": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "type": {
                                                                "type": "string"
                                                            },
                                                            "enrolled_at": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "group_id": {
                                                                "type": "integer"
                                                            },
                                                            "assignment": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            }
                                                        },
                                                        "required": [
                                                            "type"
                                                        ]
                                                    }
                                                },
                                                "offered_via_group_ids": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "integer"
                                                    }
                                                },
                                                "request": {
                                                    "type": [
                                                        "object",
                                                        "null"
                                                    ],
                                                    "properties": {
                                                        "status": {
                                                            "type": "string"
                                                        },
                                                        "created_at": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        }
                                                    },
                                                    "required": [
                                                        "status",
                                                        "created_at"
                                                    ]
                                                }
                                            },
                                            "required": [
                                                "user_id",
                                                "course_id",
                                                "status",
                                                "enrolled_at",
                                                "unenrolled_at",
                                                "sources",
                                                "offered_via_group_ids",
                                                "request"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "user_id": {
                                                    "type": "integer"
                                                },
                                                "course_id": {
                                                    "type": "integer"
                                                },
                                                "status": {
                                                    "type": "string"
                                                },
                                                "enrolled_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "unenrolled_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "sources": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "type": {
                                                                "type": "string"
                                                            },
                                                            "enrolled_at": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "group_id": {
                                                                "type": "integer"
                                                            },
                                                            "assignment": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            }
                                                        },
                                                        "required": [
                                                            "type"
                                                        ]
                                                    }
                                                },
                                                "offered_via_group_ids": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "integer"
                                                    }
                                                },
                                                "request": {
                                                    "type": [
                                                        "object",
                                                        "null"
                                                    ],
                                                    "properties": {
                                                        "status": {
                                                            "type": "string"
                                                        },
                                                        "created_at": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        }
                                                    },
                                                    "required": [
                                                        "status",
                                                        "created_at"
                                                    ]
                                                }
                                            },
                                            "required": [
                                                "user_id",
                                                "course_id",
                                                "status",
                                                "enrolled_at",
                                                "unenrolled_at",
                                                "sources",
                                                "offered_via_group_ids",
                                                "request"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Missing, invalid, revoked or expired API key (authentication_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "The API key lacks the required scope (permission_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Resource not found (not_found).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Rate limit exceeded; see the Retry-After header (rate_limited).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Unexpected server error (server_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/users/{user}/progress": {
            "get": {
                "operationId": "v2.users.progress.index",
                "description": "Query: `include_unenrolled` (also include previously unenrolled courses), `limit`, `cursor`. Scope\n`progress:read`.",
                "summary": "List a user's progress across courses (cursor paginated by course id; default 50, max 100)",
                "tags": [
                    "Progress"
                ],
                "parameters": [
                    {
                        "name": "user",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "include_unenrolled",
                        "in": "query",
                        "description": "Also include previously unenrolled courses.",
                        "schema": {
                            "type": "boolean"
                        }
                    },
                    {
                        "name": "limit",
                        "in": "query",
                        "description": "Page size, 1-100.",
                        "schema": {
                            "type": "integer",
                            "default": 50
                        }
                    },
                    {
                        "name": "cursor",
                        "in": "query",
                        "description": "Opaque cursor: pass `meta.next_cursor` from the previous page.",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "user_id": {
                                                        "type": "integer"
                                                    },
                                                    "course_id": {
                                                        "type": "integer"
                                                    },
                                                    "enrolment_status": {
                                                        "type": "string"
                                                    },
                                                    "status": {
                                                        "type": "string"
                                                    },
                                                    "percentage": {
                                                        "type": "number"
                                                    },
                                                    "percentage_updated_at": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ]
                                                    },
                                                    "started_at": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ]
                                                    },
                                                    "last_activity_at": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ]
                                                    },
                                                    "completed_at": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ]
                                                    },
                                                    "quizzes": {
                                                        "type": "array",
                                                        "items": {
                                                            "type": "object",
                                                            "properties": {
                                                                "column_id": {
                                                                    "type": "string"
                                                                },
                                                                "title": {
                                                                    "type": [
                                                                        "string",
                                                                        "null"
                                                                    ]
                                                                },
                                                                "attempts": {
                                                                    "type": "integer"
                                                                },
                                                                "best_score": {
                                                                    "type": [
                                                                        "number",
                                                                        "null"
                                                                    ]
                                                                },
                                                                "last_score": {
                                                                    "type": [
                                                                        "number",
                                                                        "null"
                                                                    ]
                                                                },
                                                                "pass_score": {
                                                                    "type": [
                                                                        "number",
                                                                        "null"
                                                                    ]
                                                                },
                                                                "passed": {
                                                                    "type": "boolean"
                                                                },
                                                                "last_submitted_at": {
                                                                    "type": [
                                                                        "string",
                                                                        "null"
                                                                    ]
                                                                }
                                                            },
                                                            "required": [
                                                                "column_id",
                                                                "title",
                                                                "attempts",
                                                                "best_score",
                                                                "last_score",
                                                                "pass_score",
                                                                "passed",
                                                                "last_submitted_at"
                                                            ]
                                                        }
                                                    },
                                                    "attendance": {
                                                        "type": "object",
                                                        "properties": {
                                                            "applicable": {
                                                                "type": "boolean"
                                                            },
                                                            "attended": {
                                                                "type": "boolean"
                                                            },
                                                            "attended_at": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "live_minutes": {
                                                                "type": [
                                                                    "integer",
                                                                    "null"
                                                                ]
                                                            }
                                                        },
                                                        "required": [
                                                            "applicable",
                                                            "attended",
                                                            "attended_at",
                                                            "live_minutes"
                                                        ]
                                                    },
                                                    "signoff": {
                                                        "type": [
                                                            "object",
                                                            "null"
                                                        ],
                                                        "properties": {
                                                            "required": {
                                                                "type": "boolean"
                                                            },
                                                            "signed_at": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            }
                                                        },
                                                        "required": [
                                                            "required",
                                                            "signed_at"
                                                        ]
                                                    },
                                                    "certificate": {
                                                        "type": [
                                                            "object",
                                                            "null"
                                                        ],
                                                        "properties": {
                                                            "number": {
                                                                "type": "string"
                                                            },
                                                            "state": {
                                                                "type": "string"
                                                            },
                                                            "awarded_at": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "expires_at": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "verify_url": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            }
                                                        },
                                                        "required": [
                                                            "number",
                                                            "state",
                                                            "awarded_at",
                                                            "expires_at",
                                                            "verify_url"
                                                        ]
                                                    }
                                                },
                                                "required": [
                                                    "user_id",
                                                    "course_id",
                                                    "enrolment_status",
                                                    "status",
                                                    "percentage",
                                                    "percentage_updated_at",
                                                    "started_at",
                                                    "last_activity_at",
                                                    "completed_at",
                                                    "quizzes",
                                                    "attendance",
                                                    "signoff",
                                                    "certificate"
                                                ]
                                            }
                                        },
                                        "meta": {
                                            "type": "object",
                                            "properties": {
                                                "next_cursor": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "has_more": {
                                                    "type": "boolean"
                                                }
                                            },
                                            "required": [
                                                "next_cursor",
                                                "has_more"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "data",
                                        "meta"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation failed; error.details maps fields to messages (validation_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Missing, invalid, revoked or expired API key (authentication_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "The API key lacks the required scope (permission_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Resource not found (not_found).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Rate limit exceeded; see the Retry-After header (rate_limited).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Unexpected server error (server_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/users/{user}/progress/{course}": {
            "get": {
                "operationId": "v2.users.progress.show",
                "description": "200 even when the user is not enrolled (`enrolment_status: not_enrolled`, `status: not_started`). Scope\n`progress:read`.",
                "summary": "Get one user's progress on one course",
                "tags": [
                    "Progress"
                ],
                "parameters": [
                    {
                        "name": "user",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "course",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "user_id": {
                                                    "type": "integer"
                                                },
                                                "course_id": {
                                                    "type": "integer"
                                                },
                                                "enrolment_status": {
                                                    "type": "string"
                                                },
                                                "status": {
                                                    "type": "string"
                                                },
                                                "percentage": {
                                                    "type": "number"
                                                },
                                                "percentage_updated_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "started_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "last_activity_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "completed_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "quizzes": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "column_id": {
                                                                "type": "string"
                                                            },
                                                            "title": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "attempts": {
                                                                "type": "integer"
                                                            },
                                                            "best_score": {
                                                                "type": [
                                                                    "number",
                                                                    "null"
                                                                ]
                                                            },
                                                            "last_score": {
                                                                "type": [
                                                                    "number",
                                                                    "null"
                                                                ]
                                                            },
                                                            "pass_score": {
                                                                "type": [
                                                                    "number",
                                                                    "null"
                                                                ]
                                                            },
                                                            "passed": {
                                                                "type": "boolean"
                                                            },
                                                            "last_submitted_at": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            }
                                                        },
                                                        "required": [
                                                            "column_id",
                                                            "title",
                                                            "attempts",
                                                            "best_score",
                                                            "last_score",
                                                            "pass_score",
                                                            "passed",
                                                            "last_submitted_at"
                                                        ]
                                                    }
                                                },
                                                "attendance": {
                                                    "type": "object",
                                                    "properties": {
                                                        "applicable": {
                                                            "type": "boolean"
                                                        },
                                                        "attended": {
                                                            "type": "boolean"
                                                        },
                                                        "attended_at": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "live_minutes": {
                                                            "type": [
                                                                "integer",
                                                                "null"
                                                            ]
                                                        }
                                                    },
                                                    "required": [
                                                        "applicable",
                                                        "attended",
                                                        "attended_at",
                                                        "live_minutes"
                                                    ]
                                                },
                                                "signoff": {
                                                    "type": [
                                                        "object",
                                                        "null"
                                                    ],
                                                    "properties": {
                                                        "required": {
                                                            "type": "boolean"
                                                        },
                                                        "signed_at": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        }
                                                    },
                                                    "required": [
                                                        "required",
                                                        "signed_at"
                                                    ]
                                                },
                                                "certificate": {
                                                    "type": [
                                                        "object",
                                                        "null"
                                                    ],
                                                    "properties": {
                                                        "number": {
                                                            "type": "string"
                                                        },
                                                        "state": {
                                                            "type": "string"
                                                        },
                                                        "awarded_at": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "expires_at": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "verify_url": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        }
                                                    },
                                                    "required": [
                                                        "number",
                                                        "state",
                                                        "awarded_at",
                                                        "expires_at",
                                                        "verify_url"
                                                    ]
                                                }
                                            },
                                            "required": [
                                                "user_id",
                                                "course_id",
                                                "enrolment_status",
                                                "status",
                                                "percentage",
                                                "percentage_updated_at",
                                                "started_at",
                                                "last_activity_at",
                                                "completed_at",
                                                "quizzes",
                                                "attendance",
                                                "signoff",
                                                "certificate"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Missing, invalid, revoked or expired API key (authentication_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "The API key lacks the required scope (permission_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Resource not found (not_found).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation failed; error.details maps fields to messages (validation_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Rate limit exceeded; see the Retry-After header (rate_limited).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Unexpected server error (server_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/courses/{course}/progress": {
            "get": {
                "operationId": "v2.courses.progress.index",
                "description": "Same population as the course enrolments list (enrolled, directly or via an `auto` group).\nQuery: `status` (not_started|in_progress|completed), `completed_since` (ISO 8601), `include_unenrolled`,\n`limit`, `cursor`. Each row carries a compact `user`. Scope `progress:read`.",
                "summary": "List progress for everyone on a course (cursor paginated by user id; default 50, max 100)",
                "tags": [
                    "Progress"
                ],
                "parameters": [
                    {
                        "name": "course",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "status",
                        "in": "query",
                        "description": "`not_started`, `in_progress` or `completed`.",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "completed_since",
                        "in": "query",
                        "description": "Only learners completed at or after this time. ISO 8601 timestamp.",
                        "schema": {
                            "type": "string",
                            "format": "date-time"
                        }
                    },
                    {
                        "name": "include_unenrolled",
                        "in": "query",
                        "description": "Also include previously unenrolled users.",
                        "schema": {
                            "type": "boolean"
                        }
                    },
                    {
                        "name": "limit",
                        "in": "query",
                        "description": "Page size, 1-100.",
                        "schema": {
                            "type": "integer",
                            "default": 50
                        }
                    },
                    {
                        "name": "cursor",
                        "in": "query",
                        "description": "Opaque cursor: pass `meta.next_cursor` from the previous page.",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "user_id": {
                                                        "type": "integer"
                                                    },
                                                    "course_id": {
                                                        "type": "integer"
                                                    },
                                                    "user": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "email": {
                                                                "type": "string"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            },
                                                            "external": {
                                                                "type": "object",
                                                                "properties": {
                                                                    "id": {
                                                                        "type": [
                                                                            "string",
                                                                            "null"
                                                                        ]
                                                                    },
                                                                    "source": {
                                                                        "type": [
                                                                            "string",
                                                                            "null"
                                                                        ]
                                                                    }
                                                                },
                                                                "required": [
                                                                    "id",
                                                                    "source"
                                                                ]
                                                            }
                                                        },
                                                        "required": [
                                                            "id",
                                                            "email",
                                                            "name",
                                                            "external"
                                                        ]
                                                    },
                                                    "enrolment_status": {
                                                        "type": "string"
                                                    },
                                                    "status": {
                                                        "type": "string"
                                                    },
                                                    "percentage": {
                                                        "type": "number"
                                                    },
                                                    "percentage_updated_at": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ]
                                                    },
                                                    "started_at": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ]
                                                    },
                                                    "last_activity_at": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ]
                                                    },
                                                    "completed_at": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ]
                                                    },
                                                    "quizzes": {
                                                        "type": "array",
                                                        "items": {
                                                            "type": "object",
                                                            "properties": {
                                                                "column_id": {
                                                                    "type": "string"
                                                                },
                                                                "title": {
                                                                    "type": [
                                                                        "string",
                                                                        "null"
                                                                    ]
                                                                },
                                                                "attempts": {
                                                                    "type": "integer"
                                                                },
                                                                "best_score": {
                                                                    "type": [
                                                                        "number",
                                                                        "null"
                                                                    ]
                                                                },
                                                                "last_score": {
                                                                    "type": [
                                                                        "number",
                                                                        "null"
                                                                    ]
                                                                },
                                                                "pass_score": {
                                                                    "type": [
                                                                        "number",
                                                                        "null"
                                                                    ]
                                                                },
                                                                "passed": {
                                                                    "type": "boolean"
                                                                },
                                                                "last_submitted_at": {
                                                                    "type": [
                                                                        "string",
                                                                        "null"
                                                                    ]
                                                                }
                                                            },
                                                            "required": [
                                                                "column_id",
                                                                "title",
                                                                "attempts",
                                                                "best_score",
                                                                "last_score",
                                                                "pass_score",
                                                                "passed",
                                                                "last_submitted_at"
                                                            ]
                                                        }
                                                    },
                                                    "attendance": {
                                                        "type": "object",
                                                        "properties": {
                                                            "applicable": {
                                                                "type": "boolean"
                                                            },
                                                            "attended": {
                                                                "type": "boolean"
                                                            },
                                                            "attended_at": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "live_minutes": {
                                                                "type": [
                                                                    "integer",
                                                                    "null"
                                                                ]
                                                            }
                                                        },
                                                        "required": [
                                                            "applicable",
                                                            "attended",
                                                            "attended_at",
                                                            "live_minutes"
                                                        ]
                                                    },
                                                    "signoff": {
                                                        "type": [
                                                            "object",
                                                            "null"
                                                        ],
                                                        "properties": {
                                                            "required": {
                                                                "type": "boolean"
                                                            },
                                                            "signed_at": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            }
                                                        },
                                                        "required": [
                                                            "required",
                                                            "signed_at"
                                                        ]
                                                    },
                                                    "certificate": {
                                                        "type": [
                                                            "object",
                                                            "null"
                                                        ],
                                                        "properties": {
                                                            "number": {
                                                                "type": "string"
                                                            },
                                                            "state": {
                                                                "type": "string"
                                                            },
                                                            "awarded_at": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "expires_at": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "verify_url": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            }
                                                        },
                                                        "required": [
                                                            "number",
                                                            "state",
                                                            "awarded_at",
                                                            "expires_at",
                                                            "verify_url"
                                                        ]
                                                    }
                                                },
                                                "required": [
                                                    "user_id",
                                                    "course_id",
                                                    "user",
                                                    "enrolment_status",
                                                    "status",
                                                    "percentage",
                                                    "percentage_updated_at",
                                                    "started_at",
                                                    "last_activity_at",
                                                    "completed_at",
                                                    "quizzes",
                                                    "attendance",
                                                    "signoff",
                                                    "certificate"
                                                ]
                                            }
                                        },
                                        "meta": {
                                            "type": "object",
                                            "properties": {
                                                "next_cursor": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "has_more": {
                                                    "type": "boolean"
                                                }
                                            },
                                            "required": [
                                                "next_cursor",
                                                "has_more"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "data",
                                        "meta"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation failed; error.details maps fields to messages (validation_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Missing, invalid, revoked or expired API key (authentication_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "The API key lacks the required scope (permission_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Resource not found (not_found).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Rate limit exceeded; see the Retry-After header (rate_limited).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Unexpected server error (server_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/credentials": {
            "get": {
                "operationId": "v2.credentials.index",
                "description": "Scope: `credentials:read`. Cursor-paginated by id (ascending). Query parameters: `user_id`,\n`course_id`, `programme_id`, `issued_since` (ISO 8601, matches the award date), `state`\n(`valid`|`revoked`|`expired`|`unsigned`), `limit` (1-100, default 25), `cursor`.\nEach item is the credential summary plus a compact `user`. `verify_url` is null unless\npublic verification is enabled for the credential.",
                "summary": "List issued credentials",
                "tags": [
                    "Credentials"
                ],
                "parameters": [
                    {
                        "name": "user_id",
                        "in": "query",
                        "description": "Only credentials awarded to this user.",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "course_id",
                        "in": "query",
                        "description": "Only credentials for this course.",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "programme_id",
                        "in": "query",
                        "description": "Only credentials for this programme.",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "issued_since",
                        "in": "query",
                        "description": "Only credentials awarded at or after this time. ISO 8601 timestamp.",
                        "schema": {
                            "type": "string",
                            "format": "date-time"
                        }
                    },
                    {
                        "name": "state",
                        "in": "query",
                        "description": "`valid`, `revoked`, `expired` or `unsigned`.",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "limit",
                        "in": "query",
                        "description": "Page size, 1-100.",
                        "schema": {
                            "type": "integer",
                            "default": 25
                        }
                    },
                    {
                        "name": "cursor",
                        "in": "query",
                        "description": "Opaque cursor: pass `meta.next_cursor` from the previous page.",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "additionalProperties": {}
                                            }
                                        },
                                        "meta": {
                                            "type": "object",
                                            "properties": {
                                                "next_cursor": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "has_more": {
                                                    "type": "boolean"
                                                }
                                            },
                                            "required": [
                                                "next_cursor",
                                                "has_more"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "data",
                                        "meta"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Missing, invalid, revoked or expired API key (authentication_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "The API key lacks the required scope (permission_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Resource not found (not_found).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation failed; error.details maps fields to messages (validation_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Rate limit exceeded; see the Retry-After header (rate_limited).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Unexpected server error (server_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/credentials/{certificateNumber}": {
            "get": {
                "operationId": "v2.credentials.show",
                "description": "Scope: `credentials:read`. Adds `credential_jwt` (the signed Open Badges credential).",
                "summary": "Get an issued credential by certificate number",
                "tags": [
                    "Credentials"
                ],
                "parameters": [
                    {
                        "name": "certificateNumber",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "additionalProperties": {}
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Missing, invalid, revoked or expired API key (authentication_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "The API key lacks the required scope (permission_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Resource not found (not_found).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation failed; error.details maps fields to messages (validation_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Rate limit exceeded; see the Retry-After header (rate_limited).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Unexpected server error (server_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/users/{id}/sign-in-links": {
            "post": {
                "operationId": "v2.users.sign_in_links.store",
                "description": "Requires scope `auth:sign_in_links`. Returns a single-use URL on the team's own host that signs the user\nin and redirects them to `redirect_path` (or the team's normal landing page). The link expires after\n`ttl_seconds` (30-300, default 120) and stops working once used. Treat the URL as a secret; it is shown\nonly in this response.\n\nRefused with 409 `user_protected` for administrators (admin, owner, billing, author, outreach_admin, super\nand content admins), accounts that belong to other teams, linked presenters, accounts with confirmed\ntwo-factor authentication, and teams that require single sign-on. A deactivated user gets 409\n`user_deactivated`. Limited to 60 links per minute per API key.",
                "summary": "Create a one-time sign-in link for a user",
                "tags": [
                    "Sign-in links"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "redirect_path": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 2000
                                    },
                                    "ttl_seconds": {
                                        "type": "integer",
                                        "minimum": 30,
                                        "maximum": 300
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "url": {
                                                    "type": "string"
                                                },
                                                "expires_at": {
                                                    "type": "string"
                                                }
                                            },
                                            "required": [
                                                "url",
                                                "expires_at"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation failed; error.details maps fields to messages (validation_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Missing, invalid, revoked or expired API key (authentication_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "The API key lacks the required scope (permission_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Resource not found (not_found).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Rate limit exceeded; see the Retry-After header (rate_limited).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Unexpected server error (server_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/webhook-event-types": {
            "get": {
                "operationId": "v2.webhook_event_types",
                "description": "Requires scope `webhooks:manage`.",
                "summary": "List the webhook event types",
                "tags": [
                    "Webhooks"
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "type": {
                                                        "type": "string"
                                                    },
                                                    "description": {
                                                        "type": "string"
                                                    }
                                                },
                                                "required": [
                                                    "type",
                                                    "description"
                                                ]
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Missing, invalid, revoked or expired API key (authentication_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "The API key lacks the required scope (permission_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Resource not found (not_found).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation failed; error.details maps fields to messages (validation_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Rate limit exceeded; see the Retry-After header (rate_limited).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Unexpected server error (server_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/webhook-endpoints": {
            "get": {
                "operationId": "v2.webhook_endpoints.index",
                "description": "Requires scope `webhooks:manage`. Cursor-paginated by id.",
                "summary": "List webhook endpoints",
                "tags": [
                    "Webhooks"
                ],
                "parameters": [
                    {
                        "name": "limit",
                        "in": "query",
                        "description": "Page size, 1-100.",
                        "schema": {
                            "type": "integer",
                            "default": 25
                        }
                    },
                    {
                        "name": "cursor",
                        "in": "query",
                        "description": "Opaque cursor: pass `meta.next_cursor` from the previous page.",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "id": {
                                                        "type": "integer"
                                                    },
                                                    "url": {
                                                        "type": "string"
                                                    },
                                                    "description": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ]
                                                    },
                                                    "events": {
                                                        "type": "array",
                                                        "items": {
                                                            "type": "string"
                                                        }
                                                    },
                                                    "enabled": {
                                                        "type": "boolean"
                                                    },
                                                    "disabled_reason": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ]
                                                    },
                                                    "consecutive_failures": {
                                                        "type": "integer"
                                                    },
                                                    "last_success_at": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ]
                                                    },
                                                    "last_failure_at": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ]
                                                    },
                                                    "previous_secret_expires_at": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ]
                                                    },
                                                    "created_at": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ]
                                                    },
                                                    "updated_at": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ]
                                                    }
                                                },
                                                "required": [
                                                    "id",
                                                    "url",
                                                    "description",
                                                    "events",
                                                    "enabled",
                                                    "disabled_reason",
                                                    "consecutive_failures",
                                                    "last_success_at",
                                                    "last_failure_at",
                                                    "previous_secret_expires_at",
                                                    "created_at",
                                                    "updated_at"
                                                ]
                                            }
                                        },
                                        "meta": {
                                            "type": "object",
                                            "properties": {
                                                "next_cursor": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "has_more": {
                                                    "type": "boolean"
                                                }
                                            },
                                            "required": [
                                                "next_cursor",
                                                "has_more"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "data",
                                        "meta"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Missing, invalid, revoked or expired API key (authentication_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "The API key lacks the required scope (permission_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Resource not found (not_found).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation failed; error.details maps fields to messages (validation_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Rate limit exceeded; see the Retry-After header (rate_limited).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Unexpected server error (server_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            },
            "post": {
                "operationId": "v2.webhook_endpoints.store",
                "description": "Requires scope `webhooks:manage`. `events` is a list of event types or `[\"*\"]` for all (see\n`GET /webhook-event-types`). Returns 201 with the signing `secret`, shown only this once.",
                "summary": "Create a webhook endpoint",
                "tags": [
                    "Webhooks"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "url": {
                                        "type": "string",
                                        "maxLength": 2048
                                    },
                                    "events": {
                                        "type": "array",
                                        "items": {
                                            "type": "string"
                                        },
                                        "minItems": 1
                                    },
                                    "description": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 255
                                    }
                                },
                                "required": [
                                    "url",
                                    "events"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "id": {
                                                    "type": "integer"
                                                },
                                                "url": {
                                                    "type": "string"
                                                },
                                                "description": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "events": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "string"
                                                    }
                                                },
                                                "enabled": {
                                                    "type": "boolean"
                                                },
                                                "disabled_reason": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "consecutive_failures": {
                                                    "type": "integer"
                                                },
                                                "last_success_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "last_failure_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "previous_secret_expires_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "created_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "updated_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "secret": {
                                                    "type": "string"
                                                }
                                            },
                                            "required": [
                                                "id",
                                                "url",
                                                "description",
                                                "events",
                                                "enabled",
                                                "disabled_reason",
                                                "consecutive_failures",
                                                "last_success_at",
                                                "last_failure_at",
                                                "previous_secret_expires_at",
                                                "created_at",
                                                "updated_at",
                                                "secret"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation failed; error.details maps fields to messages (validation_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Missing, invalid, revoked or expired API key (authentication_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "The API key lacks the required scope (permission_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Resource not found (not_found).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Rate limit exceeded; see the Retry-After header (rate_limited).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Unexpected server error (server_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/webhook-endpoints/{id}": {
            "get": {
                "operationId": "v2.webhook_endpoints.show",
                "description": "Requires scope `webhooks:manage`. 404 if the endpoint is not in this team.",
                "summary": "Get a webhook endpoint",
                "tags": [
                    "Webhooks"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "id": {
                                                    "type": "integer"
                                                },
                                                "url": {
                                                    "type": "string"
                                                },
                                                "description": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "events": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "string"
                                                    }
                                                },
                                                "enabled": {
                                                    "type": "boolean"
                                                },
                                                "disabled_reason": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "consecutive_failures": {
                                                    "type": "integer"
                                                },
                                                "last_success_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "last_failure_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "previous_secret_expires_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "created_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "updated_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                }
                                            },
                                            "required": [
                                                "id",
                                                "url",
                                                "description",
                                                "events",
                                                "enabled",
                                                "disabled_reason",
                                                "consecutive_failures",
                                                "last_success_at",
                                                "last_failure_at",
                                                "previous_secret_expires_at",
                                                "created_at",
                                                "updated_at"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Missing, invalid, revoked or expired API key (authentication_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "The API key lacks the required scope (permission_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Resource not found (not_found).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation failed; error.details maps fields to messages (validation_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Rate limit exceeded; see the Retry-After header (rate_limited).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Unexpected server error (server_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            },
            "patch": {
                "operationId": "v2.webhook_endpoints.update",
                "description": "Requires scope `webhooks:manage`. `enabled=true` re-enables an endpoint (also after an automatic disable)\nand resets its failure count.",
                "summary": "Update a webhook endpoint",
                "tags": [
                    "Webhooks"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "url": {
                                        "type": "string",
                                        "maxLength": 2048
                                    },
                                    "events": {
                                        "type": "array",
                                        "items": {
                                            "type": "string"
                                        },
                                        "minItems": 1
                                    },
                                    "description": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 255
                                    },
                                    "enabled": {
                                        "type": "boolean"
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "id": {
                                                    "type": "integer"
                                                },
                                                "url": {
                                                    "type": "string"
                                                },
                                                "description": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "events": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "string"
                                                    }
                                                },
                                                "enabled": {
                                                    "type": "boolean"
                                                },
                                                "disabled_reason": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "consecutive_failures": {
                                                    "type": "integer"
                                                },
                                                "last_success_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "last_failure_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "previous_secret_expires_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "created_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "updated_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                }
                                            },
                                            "required": [
                                                "id",
                                                "url",
                                                "description",
                                                "events",
                                                "enabled",
                                                "disabled_reason",
                                                "consecutive_failures",
                                                "last_success_at",
                                                "last_failure_at",
                                                "previous_secret_expires_at",
                                                "created_at",
                                                "updated_at"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation failed; error.details maps fields to messages (validation_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Missing, invalid, revoked or expired API key (authentication_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "The API key lacks the required scope (permission_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Resource not found (not_found).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Rate limit exceeded; see the Retry-After header (rate_limited).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Unexpected server error (server_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            },
            "delete": {
                "operationId": "v2.webhook_endpoints.destroy",
                "description": "Requires scope `webhooks:manage`. Returns 204; undelivered retries for it are abandoned.",
                "summary": "Delete a webhook endpoint",
                "tags": [
                    "Webhooks"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "204": {
                        "description": "No content"
                    },
                    "401": {
                        "description": "Missing, invalid, revoked or expired API key (authentication_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "The API key lacks the required scope (permission_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Resource not found (not_found).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation failed; error.details maps fields to messages (validation_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Rate limit exceeded; see the Retry-After header (rate_limited).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Unexpected server error (server_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/webhook-endpoints/{id}/rotate-secret": {
            "post": {
                "operationId": "v2.webhook_endpoints.rotate_secret",
                "description": "Requires scope `webhooks:manage`. Returns the new `secret` once. For 24 hours both the old and the new\nsecret sign every delivery (two signatures in the `webhook-signature` header), so receivers can switch\nwithout dropping events.",
                "summary": "Rotate the signing secret",
                "tags": [
                    "Webhooks"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "id": {
                                                    "type": "integer"
                                                },
                                                "url": {
                                                    "type": "string"
                                                },
                                                "description": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "events": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "string"
                                                    }
                                                },
                                                "enabled": {
                                                    "type": "boolean"
                                                },
                                                "disabled_reason": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "consecutive_failures": {
                                                    "type": "integer"
                                                },
                                                "last_success_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "last_failure_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "previous_secret_expires_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "created_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "updated_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "secret": {
                                                    "type": "string"
                                                }
                                            },
                                            "required": [
                                                "id",
                                                "url",
                                                "description",
                                                "events",
                                                "enabled",
                                                "disabled_reason",
                                                "consecutive_failures",
                                                "last_success_at",
                                                "last_failure_at",
                                                "previous_secret_expires_at",
                                                "created_at",
                                                "updated_at",
                                                "secret"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Missing, invalid, revoked or expired API key (authentication_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "The API key lacks the required scope (permission_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Resource not found (not_found).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation failed; error.details maps fields to messages (validation_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Rate limit exceeded; see the Retry-After header (rate_limited).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Unexpected server error (server_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/webhook-endpoints/{id}/test": {
            "post": {
                "operationId": "v2.webhook_endpoints.test",
                "description": "Requires scope `webhooks:manage`. Queues a `ping` event to this endpoint (even when it is disabled) and\nreturns the delivery (status `pending`; poll the deliveries list for the outcome). 202.",
                "summary": "Send a test event",
                "tags": [
                    "Webhooks"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "202": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "id": {
                                                    "type": "integer"
                                                },
                                                "endpoint_id": {
                                                    "type": "integer"
                                                },
                                                "event_id": {
                                                    "type": "string"
                                                },
                                                "event_type": {
                                                    "type": "string"
                                                },
                                                "status": {
                                                    "type": "string"
                                                },
                                                "attempts": {
                                                    "type": "integer"
                                                },
                                                "next_attempt_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "last_status_code": {
                                                    "type": [
                                                        "integer",
                                                        "null"
                                                    ]
                                                },
                                                "last_error": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "last_response_snippet": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "delivered_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "created_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                }
                                            },
                                            "required": [
                                                "id",
                                                "endpoint_id",
                                                "event_id",
                                                "event_type",
                                                "status",
                                                "attempts",
                                                "next_attempt_at",
                                                "last_status_code",
                                                "last_error",
                                                "last_response_snippet",
                                                "delivered_at",
                                                "created_at"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Missing, invalid, revoked or expired API key (authentication_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "The API key lacks the required scope (permission_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Resource not found (not_found).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation failed; error.details maps fields to messages (validation_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Rate limit exceeded; see the Retry-After header (rate_limited).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Unexpected server error (server_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/webhook-endpoints/{id}/deliveries": {
            "get": {
                "operationId": "v2.webhook_endpoints.deliveries.index",
                "description": "Requires scope `webhooks:manage`. Newest first, cursor-paginated by id. Deliveries are kept for 30 days.\nThe payload is not included in the list; fetch one delivery to read it.",
                "summary": "List deliveries of an endpoint",
                "tags": [
                    "Webhooks"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "status",
                        "in": "query",
                        "description": "`pending`, `retrying`, `succeeded` or `failed`.",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "event_type",
                        "in": "query",
                        "description": "Only deliveries of this event type.",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "limit",
                        "in": "query",
                        "description": "Page size, 1-100.",
                        "schema": {
                            "type": "integer",
                            "default": 25
                        }
                    },
                    {
                        "name": "cursor",
                        "in": "query",
                        "description": "Opaque cursor: pass `meta.next_cursor` from the previous page.",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "id": {
                                                        "type": "integer"
                                                    },
                                                    "endpoint_id": {
                                                        "type": "integer"
                                                    },
                                                    "event_id": {
                                                        "type": "string"
                                                    },
                                                    "event_type": {
                                                        "type": "string"
                                                    },
                                                    "status": {
                                                        "type": "string"
                                                    },
                                                    "attempts": {
                                                        "type": "integer"
                                                    },
                                                    "next_attempt_at": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ]
                                                    },
                                                    "last_status_code": {
                                                        "type": [
                                                            "integer",
                                                            "null"
                                                        ]
                                                    },
                                                    "last_error": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ]
                                                    },
                                                    "last_response_snippet": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ]
                                                    },
                                                    "delivered_at": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ]
                                                    },
                                                    "created_at": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ]
                                                    }
                                                },
                                                "required": [
                                                    "id",
                                                    "endpoint_id",
                                                    "event_id",
                                                    "event_type",
                                                    "status",
                                                    "attempts",
                                                    "next_attempt_at",
                                                    "last_status_code",
                                                    "last_error",
                                                    "last_response_snippet",
                                                    "delivered_at",
                                                    "created_at"
                                                ]
                                            }
                                        },
                                        "meta": {
                                            "type": "object",
                                            "properties": {
                                                "next_cursor": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "has_more": {
                                                    "type": "boolean"
                                                }
                                            },
                                            "required": [
                                                "next_cursor",
                                                "has_more"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "data",
                                        "meta"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation failed; error.details maps fields to messages (validation_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Missing, invalid, revoked or expired API key (authentication_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "The API key lacks the required scope (permission_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Resource not found (not_found).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Rate limit exceeded; see the Retry-After header (rate_limited).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Unexpected server error (server_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/webhook-endpoints/{id}/deliveries/{deliveryId}": {
            "get": {
                "operationId": "v2.webhook_endpoints.deliveries.show",
                "description": "Requires scope `webhooks:manage`.",
                "summary": "Get one delivery, with its payload",
                "tags": [
                    "Webhooks"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "deliveryId",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "id": {
                                                    "type": "integer"
                                                },
                                                "endpoint_id": {
                                                    "type": "integer"
                                                },
                                                "event_id": {
                                                    "type": "string"
                                                },
                                                "event_type": {
                                                    "type": "string"
                                                },
                                                "status": {
                                                    "type": "string"
                                                },
                                                "attempts": {
                                                    "type": "integer"
                                                },
                                                "next_attempt_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "last_status_code": {
                                                    "type": [
                                                        "integer",
                                                        "null"
                                                    ]
                                                },
                                                "last_error": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "last_response_snippet": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "delivered_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "created_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "payload": {
                                                    "type": "object",
                                                    "additionalProperties": {}
                                                }
                                            },
                                            "required": [
                                                "id",
                                                "endpoint_id",
                                                "event_id",
                                                "event_type",
                                                "status",
                                                "attempts",
                                                "next_attempt_at",
                                                "last_status_code",
                                                "last_error",
                                                "last_response_snippet",
                                                "delivered_at",
                                                "created_at",
                                                "payload"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Missing, invalid, revoked or expired API key (authentication_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "The API key lacks the required scope (permission_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Resource not found (not_found).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation failed; error.details maps fields to messages (validation_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Rate limit exceeded; see the Retry-After header (rate_limited).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Unexpected server error (server_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/webhook-endpoints/{id}/deliveries/{deliveryId}/redeliver": {
            "post": {
                "operationId": "v2.webhook_endpoints.deliveries.redeliver",
                "description": "Requires scope `webhooks:manage`. Only for a delivery that has succeeded or failed; a pending or retrying one\nreturns 409 `delivery_in_progress`. Starts a new delivery with the same `event_id` (the `webhook-id`\nheader) and payload, so receivers that dedupe on it can ignore a repeat. 202.",
                "summary": "Redeliver an event",
                "tags": [
                    "Webhooks"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "deliveryId",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "202": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "id": {
                                                    "type": "integer"
                                                },
                                                "endpoint_id": {
                                                    "type": "integer"
                                                },
                                                "event_id": {
                                                    "type": "string"
                                                },
                                                "event_type": {
                                                    "type": "string"
                                                },
                                                "status": {
                                                    "type": "string"
                                                },
                                                "attempts": {
                                                    "type": "integer"
                                                },
                                                "next_attempt_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "last_status_code": {
                                                    "type": [
                                                        "integer",
                                                        "null"
                                                    ]
                                                },
                                                "last_error": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "last_response_snippet": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "delivered_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "created_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                }
                                            },
                                            "required": [
                                                "id",
                                                "endpoint_id",
                                                "event_id",
                                                "event_type",
                                                "status",
                                                "attempts",
                                                "next_attempt_at",
                                                "last_status_code",
                                                "last_error",
                                                "last_response_snippet",
                                                "delivered_at",
                                                "created_at"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Missing, invalid, revoked or expired API key (authentication_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "The API key lacks the required scope (permission_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Resource not found (not_found).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation failed; error.details maps fields to messages (validation_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Rate limit exceeded; see the Retry-After header (rate_limited).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Unexpected server error (server_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/orders": {
            "get": {
                "operationId": "v2.orders.index",
                "description": "Scope: `orders:read`. Only paid, completed orders are listed (including ones since fully or partly\nrefunded); baskets and failed payments never appear. Cursor-paginated by id (ascending). Money is\ndecimal strings in the order's `currency`. Query parameters: `status` (`completed`|`partially_refunded`|`refunded`),\n`updated_since` (ISO 8601, catches refunds too), `user_id`, `limit` (1-100, default 25), `cursor`.",
                "summary": "List orders",
                "tags": [
                    "Orders"
                ],
                "parameters": [
                    {
                        "name": "status",
                        "in": "query",
                        "description": "`completed`, `partially_refunded` or `refunded`.",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "updated_since",
                        "in": "query",
                        "description": "Only orders created or changed (for example refunded) at or after this time. ISO 8601 timestamp.",
                        "schema": {
                            "type": "string",
                            "format": "date-time"
                        }
                    },
                    {
                        "name": "user_id",
                        "in": "query",
                        "description": "Only this buyer's orders.",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "limit",
                        "in": "query",
                        "description": "Page size, 1-100.",
                        "schema": {
                            "type": "integer",
                            "default": 25
                        }
                    },
                    {
                        "name": "cursor",
                        "in": "query",
                        "description": "Opaque cursor: pass `meta.next_cursor` from the previous page.",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {}
                                        },
                                        "meta": {
                                            "type": "object",
                                            "properties": {
                                                "next_cursor": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "has_more": {
                                                    "type": "boolean"
                                                }
                                            },
                                            "required": [
                                                "next_cursor",
                                                "has_more"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "data",
                                        "meta"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Missing, invalid, revoked or expired API key (authentication_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "The API key lacks the required scope (permission_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Resource not found (not_found).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation failed; error.details maps fields to messages (validation_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Rate limit exceeded; see the Retry-After header (rate_limited).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Unexpected server error (server_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/orders/{id}": {
            "get": {
                "operationId": "v2.orders.show",
                "description": "Scope: `orders:read`. An order of another team, or one that was never completed, returns 404.",
                "summary": "Get an order",
                "tags": [
                    "Orders"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "id": {
                                                    "type": "integer"
                                                },
                                                "status": {
                                                    "type": "string"
                                                },
                                                "total": {
                                                    "type": "string"
                                                },
                                                "subtotal": {
                                                    "type": "string"
                                                },
                                                "discount": {
                                                    "type": "string"
                                                },
                                                "tax": {
                                                    "type": "string"
                                                },
                                                "amount_refunded": {
                                                    "type": "string"
                                                },
                                                "coupon": {
                                                    "type": [
                                                        "object",
                                                        "null"
                                                    ],
                                                    "properties": {
                                                        "code": {
                                                            "type": "string"
                                                        }
                                                    },
                                                    "required": [
                                                        "code"
                                                    ]
                                                },
                                                "currency": {
                                                    "type": "string"
                                                },
                                                "invoice_number": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "items": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "type": {
                                                                "type": "string"
                                                            },
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "title": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "quantity": {
                                                                "type": "integer"
                                                            },
                                                            "unit_price": {
                                                                "type": "string"
                                                            },
                                                            "tax_rate": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            }
                                                        },
                                                        "required": [
                                                            "type",
                                                            "id",
                                                            "title",
                                                            "quantity",
                                                            "unit_price",
                                                            "tax_rate"
                                                        ]
                                                    }
                                                },
                                                "completed_at": {
                                                    "type": "string"
                                                },
                                                "created_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "updated_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "user": {
                                                    "type": [
                                                        "object",
                                                        "null"
                                                    ],
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "email": {
                                                            "type": "string"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        },
                                                        "external": {
                                                            "type": "object",
                                                            "properties": {
                                                                "id": {
                                                                    "type": [
                                                                        "string",
                                                                        "null"
                                                                    ]
                                                                },
                                                                "source": {
                                                                    "type": [
                                                                        "string",
                                                                        "null"
                                                                    ]
                                                                }
                                                            },
                                                            "required": [
                                                                "id",
                                                                "source"
                                                            ]
                                                        }
                                                    },
                                                    "required": [
                                                        "id",
                                                        "email",
                                                        "name",
                                                        "external"
                                                    ]
                                                }
                                            },
                                            "required": [
                                                "id",
                                                "status",
                                                "total",
                                                "subtotal",
                                                "discount",
                                                "tax",
                                                "amount_refunded",
                                                "coupon",
                                                "currency",
                                                "invoice_number",
                                                "items",
                                                "completed_at",
                                                "created_at",
                                                "updated_at",
                                                "user"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Missing, invalid, revoked or expired API key (authentication_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "The API key lacks the required scope (permission_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Resource not found (not_found).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation failed; error.details maps fields to messages (validation_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Rate limit exceeded; see the Retry-After header (rate_limited).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Unexpected server error (server_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/invoices/{number}": {
            "get": {
                "operationId": "v2.invoices.show",
                "description": "Scope: `orders:read`. Looks up an invoice, receipt or credit note by its number (for example\n`INV-00042`); `type` says which. A number from another team returns 404.",
                "summary": "Get an invoice",
                "tags": [
                    "Orders"
                ],
                "parameters": [
                    {
                        "name": "number",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "type": {
                                                    "type": "string"
                                                },
                                                "number": {
                                                    "type": "string"
                                                },
                                                "issued_at": {
                                                    "type": "string"
                                                },
                                                "currency": {
                                                    "type": "string"
                                                },
                                                "subtotal": {
                                                    "type": "string"
                                                },
                                                "discount": {
                                                    "type": "string"
                                                },
                                                "tax": {
                                                    "type": "string"
                                                },
                                                "total": {
                                                    "type": "string"
                                                },
                                                "reverse_charge": {
                                                    "type": "boolean"
                                                },
                                                "order_id": {
                                                    "type": "integer"
                                                },
                                                "credits_invoice_number": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "lines": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "description": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "quantity": {
                                                                "type": "integer"
                                                            },
                                                            "unit": {
                                                                "type": "string"
                                                            },
                                                            "discount": {
                                                                "type": "string"
                                                            },
                                                            "net": {
                                                                "type": "string"
                                                            },
                                                            "rate": {
                                                                "type": "string"
                                                            },
                                                            "tax": {
                                                                "type": "string"
                                                            }
                                                        },
                                                        "required": [
                                                            "description",
                                                            "quantity",
                                                            "unit",
                                                            "discount",
                                                            "net",
                                                            "rate",
                                                            "tax"
                                                        ]
                                                    }
                                                },
                                                "user": {
                                                    "type": [
                                                        "object",
                                                        "null"
                                                    ],
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "email": {
                                                            "type": "string"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        },
                                                        "external": {
                                                            "type": "object",
                                                            "properties": {
                                                                "id": {
                                                                    "type": [
                                                                        "string",
                                                                        "null"
                                                                    ]
                                                                },
                                                                "source": {
                                                                    "type": [
                                                                        "string",
                                                                        "null"
                                                                    ]
                                                                }
                                                            },
                                                            "required": [
                                                                "id",
                                                                "source"
                                                            ]
                                                        }
                                                    },
                                                    "required": [
                                                        "id",
                                                        "email",
                                                        "name",
                                                        "external"
                                                    ]
                                                }
                                            },
                                            "required": [
                                                "type",
                                                "number",
                                                "issued_at",
                                                "currency",
                                                "subtotal",
                                                "discount",
                                                "tax",
                                                "total",
                                                "reverse_charge",
                                                "order_id",
                                                "credits_invoice_number",
                                                "lines",
                                                "user"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Missing, invalid, revoked or expired API key (authentication_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "The API key lacks the required scope (permission_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Resource not found (not_found).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation failed; error.details maps fields to messages (validation_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Rate limit exceeded; see the Retry-After header (rate_limited).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Unexpected server error (server_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/invoices/{number}/pdf": {
            "get": {
                "operationId": "v2.invoices.pdf",
                "description": "Scope: `orders:read`. Returns the document as `application/pdf`, rendered in the buyer's language.",
                "summary": "Download an invoice as PDF",
                "tags": [
                    "Orders"
                ],
                "parameters": [
                    {
                        "name": "number",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/pdf": {
                                "schema": {
                                    "type": "string"
                                }
                            }
                        },
                        "headers": {
                            "Content-Disposition": {
                                "schema": {
                                    "type": "string"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Missing, invalid, revoked or expired API key (authentication_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "The API key lacks the required scope (permission_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Resource not found (not_found).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation failed; error.details maps fields to messages (validation_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Rate limit exceeded; see the Retry-After header (rate_limited).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Unexpected server error (server_error).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        }
    },
    "components": {
        "securitySchemes": {
            "bearerAuth": {
                "type": "http",
                "scheme": "bearer"
            },
            "apiKeyAuth": {
                "type": "apiKey",
                "in": "header",
                "name": "X-API-Key"
            }
        },
        "schemas": {
            "Error": {
                "type": "object",
                "properties": {
                    "error": {
                        "type": "object",
                        "properties": {
                            "type": {
                                "type": "string",
                                "enum": [
                                    "authentication_error",
                                    "permission_error",
                                    "not_found",
                                    "validation_error",
                                    "rate_limited",
                                    "invalid_request",
                                    "conflict",
                                    "server_error"
                                ]
                            },
                            "code": {
                                "type": "string"
                            },
                            "message": {
                                "type": "string"
                            },
                            "details": {
                                "type": "object",
                                "additionalProperties": {
                                    "type": "array",
                                    "items": {
                                        "type": "string"
                                    }
                                }
                            }
                        },
                        "required": [
                            "type",
                            "message"
                        ]
                    },
                    "request_id": {
                        "type": "string"
                    }
                },
                "required": [
                    "error",
                    "request_id"
                ],
                "title": "Error"
            }
        },
        "responses": {
            "ValidationException": {
                "description": "Validation error",
                "content": {
                    "application/json": {
                        "schema": {
                            "type": "object",
                            "properties": {
                                "message": {
                                    "type": "string",
                                    "description": "Errors overview."
                                },
                                "errors": {
                                    "type": "object",
                                    "description": "A detailed description of each field that failed validation.",
                                    "additionalProperties": {
                                        "type": "array",
                                        "items": {
                                            "type": "string"
                                        }
                                    }
                                }
                            },
                            "required": [
                                "message",
                                "errors"
                            ]
                        }
                    }
                }
            }
        }
    }
}