# catalog_invitations_program_create API View for managing program invitations. This endpoint allows querying, creating, and deleting program invitations for users. Query/Request Parameters: For GET: program_key (str, optional): Filter by program key org (str, optional): Filter by platform organization email (str, optional): Filter by user email source (str, optional): Filter by invitation source active (bool, optional): Filter by active status sort (str, optional): Field to sort results by (default: '-id') metadata fields: Any additional parameters will be treated as metadata filters For POST: program_key (str, required): The program to create an invitation for email (str, required): The email address to invite active (bool, optional): Whether the invitation is active metadata fields: Any additional parameters will be added as metadata For DELETE: id (int, required): The ID of the invitation to delete org (str, required): The platform organization for verification Methods: GET: Retrieve a paginated list of program invitations POST: Create a new program invitation DELETE: Remove a program invitation Returns: GET: A paginated JSON response containing program invitations: { "count": 10, "next": "https://example.com/api/catalog/invitations/program/?page=2", "previous": null, "results": [ { "id": 123, "user_id": 456, "username": "username", "email": "user@example.com", "created": "2023-06-15T14:30:00Z", "started": "2023-06-15T14:30:00Z", "source": "source", "redirect_to": "https://example.com", "expired": null, "active": true, "metadata": {}, "program_key": "org+program1" }, ... ] } POST: A JSON response containing the created invitation: { "id": 123, "user_id": 456, "username": "username", "email": "user@example.com", "created": "2023-06-15T14:30:00Z", "started": "2023-06-15T14:30:00Z", "source": "source", "redirect_to": "https://example.com", "expired": null, "active": true, "metadata": {}, "program_key": "org+program1" } DELETE: A success response with status 200 Error Responses: 400 Bad Request: If required parameters are missing or invalid 401 Unauthorized: If the user is not authenticated 403 Forbidden: If the user does not have permission to access this resource 404 Not Found: If the program or invitation doesn't exist 500 Internal Server Error: If an unexpected error occurs Access Control: - Requires IsDMAdmin, IsPlatformAdminReadOnly, or IsPlatformAdminForProgram permission - Read-only access for platform admins, full access for DM admins and program-specific admins Endpoint: POST /api/catalog/invitations/program/ Version: 3.59.0-ai-plus Security: PlatformApiKeyAuthentication ## Query parameters: - `active` (boolean) Filter by active status - `email` (string) Filter by user email - `org` (string) Filter by platform organization - `page` (integer) Page number for pagination - `page_size` (integer) Number of results per page - `program_key` (string) Filter by program key - `sort` (string) Field to sort results by - `source` (string) Filter by invitation source - `username` (string) Filter by username - `verbose` (boolean) Whether to include verbose output ## Request fields (application/json): - `program_key` (string, required) The program to create an invitation for - `email` (string) The email address to invite - `username` (string) The username to invite - `active` (boolean) Whether the invitation is active - `source` (string) The source of the invitation - `redirect_to` (string) URL to redirect to after accepting the invitation - `created` (string) When the invitation was created - `expired` (string) When the invitation expires - `metadata` (object) Additional metadata for the invitation ## Response 200 fields (application/json): - `id` (integer, required) The unique identifier for the invitation - `user_id` (integer,null, required) The ID of the user associated with the invitation - `username` (string,null, required) The username of the user associated with the invitation - `email` (string,null, required) The email address associated with the invitation - `created` (string, required) When the invitation was created - `started` (string,null, required) When the invitation was started - `expired` (string,null, required) When the invitation expires - `source` (string,null, required) The source of the invitation - `redirect_to` (string,null, required) URL to redirect to after accepting the invitation - `active` (boolean, required) Whether the invitation is active - `metadata` (object, required) Additional metadata for the invitation - `program_key` (string, required) The program key associated with the invitation