openapi: 3.0.0 info: title: TalentLMS Public Batch Actions Course API description: "TalentLMS offers a range of API endpoints and resources designed to integrate TalentLMS with your internal systems seamlessly. It is organized around Representational State Transfer (REST) and is built to leverage standard HTTP features such as HTTP authentication and HTTP response codes, ensuring seamless integration. All API responses, including error messages, are consistently formatted in JSON for easy parsing and handling.\n\nIf your TalentLMS domain is called “samples”, then the API endpoint for your domain is [https://samples.talentlms.com/api/v2](https://samples.talentlms.com/api).\n\nThe current version of the API consumes data – information about users, courses, categories, groups, branches, and general details about your domain. Apart from that, via the API you can log in / sign up a user in your domain, enroll a user in a course, and much more. Please make sure, that you are accessing the URLs below, under HTTPs connections, otherwise, you will receive an error.\n\n## \U0001F680 **Getting Started Guide**\n\nTo start using the TalentLMS API, you must first [enable the API and generate a valid API](https://help.talentlms.com/hc/en-us/articles/9651527213468-Can-I-integrate-my-site-with-TalentLMS-Do-you-offer-an-API) key from the portal's settings (Account & Settings > Integrations > API).\n\n**Keep in mind:**\n\n- The pagination limit of each request is 100.\n \n- The API has rate and usage limits (e.g. 2000 requests per hour).\n \n- The API returns request responses in JSON format. When an API request returns an error, it is sent in the JSON response as an error key (All calls must have an Accept: application/json header value).\n \n- In each request you must add the desired version of the API by adding the header option with the key `X-API-Version` and value (the format of the version must be `YYYY-MM-DD`).\n \n## \U0001F510 Authentication\n\nAll of the requests require authentication. Our API uses the `API Key` authorization method, with key `X-API-Key` and value `your_api_key`. You can always fill these fields in the global variables or create an environment and insert them there.\n\n### ⛔️ Authentication error response\n\nYou will receive an HTTP 401 Unauthorized response code if the API key is missing, incorrectly formatted, or invalid.\n\n### ✅ API Responses\n\nTalentLMS API uses HTTP response codes to indicate the success or failure of requests. Specifically, codes in the 2xx range indicate success, codes in the 4xx range indicate an error that resulted from the provided arguments (e.g. instead of an integer a string is supplied), and the 500 error code indicates an internal TalentLMS error. Please be aware that you will receive an error too, in case you try to access an endpoint via non HTTPs connection.\n\nAll errors return JSON consisting of a type (invalid_request_error or api_error) and a message describing the error.\n\n| **Code** | **Description** |\n| --- | --- |\n| 200 | The request was executed properly and a JSON response is returned. |\n| 204 | No content, and the operation was executed successfully. |\n| 400 | A required parameter is missing or an invalid type (e.g. a string) was supplied instead of an integer. |\n| 401 | Invalid API key provided. |\n| 403 | API is not enabled for the specified domain or the domain is currently inactive. |\n| 404 | The requested resource (e.g. user) does not exist. |\n| 422 | Malformed response. |\n| 429 | The API request rate limit has been exceeded. |\n| 500 | Internal server error. |\n\n### \U0001F6D1 Rate Limits\n\nRate limits represent the maximum number of API requests that are permitted to be made \nper hour. These limits depend on your subscription plan and are as follows:\n\n| **Plan** | **Limit** |\n| --- | --- |\n| Core | 2.000 |\n| Grow | 10.000 |\n| Pro | 10.000 |\n| Small | 2.000 |\n| Basic | 2.000 |\n| Plus | 10.000 |\n| Premium | 10.000 |\n| Custom | Contact us so we can create a plan that fits your needs |\n\nRegardless of the total API requests per hour provisioned per customer, each customer's API requests should not exceed the rate of 200 API calls per 5 seconds. The following headers are included in API responses to help manage rate limits:\n\n- **`X-RateLimit-Limit`**: The maximum number of requests allowed in the current time window\n \n- **`X-RateLimit-Remaining`**: The number of requests left in the current window before hitting the limit\n \n### \U0001F4C4 Pagination\n\nOur API supports pagination, splitting responses into size-customizable chunks of up to 100 items per request. You can navigate to the first, last, previous, or next page. The endpoints that support pagination return a list formatted as shown below:\n\n``` json\n{\n \"self\": \"https://example.talentlms.com/api/v2/users?page[number]=1&page[size]=10\",\n \"first\": \"https://example.talentlms.com/api/v2/users?page[number]=1&page[size]=10\",\n \"last\": \"https://example.talentlms.com/api/v2/users?page[number]=4&page[size]=10\",\n \"prev\": \"https://example.talentlms.com/api/v2/users?page[number]=1&page[size]=10\",\n \"next\": \"https://example.talentlms.com/api/v2/users?page[number]=2&page[size]=10\"\n}\n\n ```" version: 1.0.0 servers: - url: https://your-domain.talentlms.com security: - apikeyAuth: [] tags: - name: Course paths: /api/v2/courses: get: tags: - Course summary: List all courses description: '### List all courses Retrieves a paginated list of all courses in your TalentLMS account. Upon a successful request, the API returns a JSON response containing course objects, including their associated metadata and configuration details. Results are delivered in a paginated format to ensure efficient handling of large datasets. You can optionally filter the response using course custom fields.' parameters: - name: X-API-Version in: header schema: type: string example: '{{apiVersion}}' responses: 200: description: Successful response content: application/json: {} post: tags: - Course summary: Create course description: '### Create course Creates a new course in your TalentLMS account. To successfully create a course, provide the required attributes (such as the course name, code, and other relevant details) in the request body. If the request is valid, the API creates the course and returns the newly created course object, including its unique ID. This endpoint allows you to define course properties such as description, category, pricing, visibility, and other configuration settings depending on your account setup.' requestBody: content: application/json: schema: type: object example: name: code: description: category_id: price: capacity: level: time_limit: start_datetime: expiration_datetime: is_active: custom_fields: : parameters: - name: X-API-Version in: header schema: type: string example: '{{apiVersion}}' responses: 200: description: Successful response content: application/json: {} /api/v2/courses/:id: get: tags: - Course summary: Get a course description: '### Get a course Retrieves the full details of a specific course. To successfully fetch a course, include the course’s unique ID as a path parameter in the request URL. If the request is valid and the course exists, the API returns detailed information about the course, including its metadata, settings, and related attributes.' parameters: - name: X-API-Version in: header schema: type: string example: '{{apiVersion}}' responses: 200: description: Successful response content: application/json: {} delete: tags: - Course summary: Delete a course description: '### Delete a course Permanently deletes a specific course from your TalentLMS account. To successfully remove a course, include the course’s unique ID as a path parameter in the request URL. If the request is valid and the course exists, the API deletes the course and returns a 204 No Content response upon success.' parameters: - name: X-API-Version in: header schema: type: string example: '{{apiVersion}}' responses: 200: description: Successful response content: application/json: {} /api/v2/enrollments: post: tags: - Course summary: Enroll user to course description: '### Enroll user to course Enrolls a user into a specific course. To create an enrollment, provide the user’s unique ID using the user_id attribute and the course’s unique **I**D using the course_id attribute in the request body. If the request is valid and both the user and course exist, the API creates the enrollment and returns the enrollment details in the response.' requestBody: content: application/json: schema: type: object example: course_id: user_id: parameters: - name: X-API-Version in: header schema: type: string example: '{{apiVersion}}' - name: Content-Type in: header schema: type: string example: application/json responses: 200: description: Successful response content: application/json: {} delete: tags: - Course summary: Delete a user from a course description: '### Delete a user from a course Removes a user’s enrollment from a specific course. To successfully unenroll a user, provide the user’s unique ID using the `user_id` attribute and the course’s unique ID using the `course_id` attribute. If the request is valid and the enrollment exists, the API deletes the enrollment and removes the user’s access to the course.' parameters: - name: X-API-Version in: header schema: type: string example: '{{apiVersion}}' - name: Content-Type in: header schema: type: string example: application/json responses: 200: description: Successful response content: application/json: {} /api/v2/courses/:course_id/users/:user_id/goto: get: tags: - Course summary: Goto Course description: '### Goto Course Provided the course & user ID a goto url is returned for accessing the course with the specified ID. Optionally, the user is able to provide the encoded redirection urls when a user logs out or completes the course.' parameters: - name: X-API-Version in: header schema: type: string example: '{{apiVersion}}' - name: logout_redirect in: query schema: type: string example: - name: course_completed_redirect in: query schema: type: string example: responses: 200: description: Successful response content: application/json: {} /api/v2/course-fields: get: tags: - Course summary: Get course custom fields description: '### Get course custom fields Retrieves a paginated list of all custom fields defined for courses. Upon a successful request, the API returns a JSON response containing the available custom course fields, including their configuration details and metadata. Results are returned in a paginated format to support efficient data retrieval.' parameters: - name: X-API-Version in: header schema: type: string example: '{{apiVersion}}' responses: 200: description: Successful response content: application/json: {} /api/v2/courses/:id/purchase: post: tags: - Course summary: Purchase a course description: '### Purchase a course Provided the course ID in the endpoint''s path and the user ID in the request''s body a course can be purchased for this specific user. Optionally, you can specify the redirection url if the purchase is cancelled or succeeded and you can also provide a coupon key.' requestBody: content: application/json: schema: type: object example: user_id: cancel_path: return_path: coupon: parameters: - name: X-API-Version in: header schema: type: string example: '{{apiVersion}}' - name: Content-Type in: header schema: type: string example: application/json responses: 200: description: Successful response content: application/json: {} components: securitySchemes: apikeyAuth: type: apiKey in: header name: X-API-Key