{
  "opencollection": "1.0.0",
  "info": {
    "name": "LearnWorlds Courses Enrollments API",
    "version": "2.0"
  },
  "request": {
    "auth": {
      "type": "oauth2",
      "flow": "client_credentials",
      "accessTokenUrl": "https://yourschool.learnworlds.com/admin/api/oauth2/access_token",
      "credentials": {
        "clientId": "{{clientId}}",
        "clientSecret": "{{clientSecret}}"
      }
    }
  },
  "items": [
    {
      "info": {
        "name": "Enrollments",
        "type": "folder"
      },
      "items": [
        {
          "info": {
            "name": "Enroll a user",
            "type": "http"
          },
          "http": {
            "method": "POST",
            "url": "https://{school}.learnworlds.com/admin/api/v2/users/:id/enrollment",
            "params": [
              {
                "name": "id",
                "value": "",
                "type": "path",
                "description": "The user identifier (LearnWorlds user id or email)."
              }
            ],
            "body": {
              "type": "json",
              "data": "{}"
            }
          },
          "docs": "Enrolls a user on a product - a course, bundle, or subscription. The product type and id are supplied in the request body."
        },
        {
          "info": {
            "name": "Unenroll a user",
            "type": "http"
          },
          "http": {
            "method": "DELETE",
            "url": "https://{school}.learnworlds.com/admin/api/v2/users/:id/enrollment",
            "params": [
              {
                "name": "id",
                "value": "",
                "type": "path",
                "description": "The user identifier (LearnWorlds user id or email)."
              }
            ],
            "body": {
              "type": "json",
              "data": "{}"
            }
          },
          "docs": "Removes a user's enrollment from a product."
        },
        {
          "info": {
            "name": "List a user's enrollments",
            "type": "http"
          },
          "http": {
            "method": "GET",
            "url": "https://{school}.learnworlds.com/admin/api/v2/users/:id/enrollments",
            "params": [
              {
                "name": "id",
                "value": "",
                "type": "path",
                "description": "The user identifier (LearnWorlds user id or email)."
              }
            ]
          },
          "docs": "Lists all products (courses, bundles, subscriptions) a user is enrolled in."
        }
      ]
    }
  ],
  "bundled": true
}