Thinkific Enrollments API

Enrollments operations

OpenAPI Specification

thinkific-enrollments-api-openapi.yml Raw ↑
openapi: 3.0.1
info:
  title: Thinkific Admin Bundles Enrollments API
  description: Thinkific's public API can be used to integrate your application with your Thinkific site.
  termsOfService: https://www.thinkific.com/legal/
  contact:
    email: developers@thinkific.com
  version: v1
servers:
- url: https://api.thinkific.com/api/public/v1
security:
- OAuthAccessToken: []
- ApiKey: []
  ApiKeySubdomain: []
tags:
- name: Enrollments
  description: Enrollments operations
paths:
  /enrollments:
    get:
      tags:
      - Enrollments
      summary: Get Enrollments
      description: Returns a list of enrollments
      operationId: getEnrollments
      parameters:
      - name: page
        in: query
        description: The page within the collection to fetch.
        schema:
          type: number
          default: 1.0
      - name: limit
        in: query
        description: The number of items to be returned.
        schema:
          type: number
          default: 25.0
      - name: query[user_id]
        in: query
        description: Search Enrollments by User ID.
        schema:
          type: number
      - name: query[course_id]
        in: query
        description: Search Enrollments by Course ID.
        schema:
          type: number
      - name: query[email]
        in: query
        description: Search Enrollments by User email.
        schema:
          type: string
      - name: query[free_trial]
        in: query
        description: Filter for only Free Trial Enrollments when set to true.
        schema:
          type: boolean
      - name: query[full]
        in: query
        description: Filter for only full Enrollments when set to true.
        schema:
          type: boolean
      - name: query[completed]
        in: query
        description: Filter for only completed Enrollments when set to true.
        schema:
          type: boolean
      - name: query[expired]
        in: query
        description: Filter for only expired Enrollments when set to true.
        schema:
          type: boolean
      - name: query[created_on]
        in: query
        description: Filter for only Enrollments created on the date specified.
        schema:
          type: string
          format: date-time
      - name: query[created_before]
        in: query
        description: Filter for only Enrollments created before the date specified.
        schema:
          type: string
          format: date-time
      - name: query[created_on_or_before]
        in: query
        description: Filter for only Enrollments created on or before the date specified.
        schema:
          type: string
          format: date-time
      - name: query[created_after]
        in: query
        description: Filter for only Enrollments created after the date specified.
        schema:
          type: string
          format: date-time
      - name: query[created_on_or_after]
        in: query
        description: Filter for only Enrollments created on or after the date specified.
        schema:
          type: string
          format: date-time
      - name: query[updated_on]
        in: query
        description: Filter for only Enrollments updated on the date specified.
        schema:
          type: string
          format: date-time
      - name: query[updated_before]
        in: query
        description: Filter for only Enrollments updated before the date specified.
        schema:
          type: string
          format: date-time
      - name: query[updated_on_or_before]
        in: query
        description: Filter for only Enrollments updated on or before the date specified.
        schema:
          type: string
          format: date-time
      - name: query[updated_after]
        in: query
        description: Filter for only Enrollments updated after the date specified.
        schema:
          type: string
          format: date-time
      responses:
        200:
          description: Enrollments response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetEnrollmentsResponse'
        403:
          $ref: '#/components/responses/ErrorForbiddenAppsNotAvailableResponse'
    post:
      tags:
      - Enrollments
      summary: Create enrollment
      description: Creates a new Enrollment for specified student in specified course
      operationId: createEnrollment
      requestBody:
        description: New enrollment attributes
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateEnrollmentRequest'
        required: true
      responses:
        201:
          description: Enrollment response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EnrollmentResponse'
        403:
          $ref: '#/components/responses/ErrorForbiddenAppsNotAvailableResponse'
        422:
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnprocessableEntityError'
              example:
                errors:
                - Course could not be found.
                - User could not be found.
      x-codegen-request-body-name: body
  /enrollments/{id}:
    get:
      tags:
      - Enrollments
      summary: Get enrollments by ID
      description: Returns the Enrollment identified by the provided id.
      operationId: getEnrollmentsByID
      parameters:
      - name: id
        in: path
        description: ID of the Enrollment in the form of an integer.
        required: true
        schema:
          type: number
      responses:
        200:
          description: Enrollment response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EnrollmentResponse'
        403:
          $ref: '#/components/responses/ErrorForbiddenAppsNotAvailableResponse'
        404:
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorNotFound'
    put:
      tags:
      - Enrollments
      summary: Update enrollment
      description: Updates a Enrollment for specified student in specified course
      operationId: updateEnrollment
      parameters:
      - name: id
        in: path
        description: ID of the Enrollment in the form of an integer.
        required: true
        schema:
          type: number
      requestBody:
        description: New enrollment attributes
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateEnrollmentRequest'
        required: true
      responses:
        204:
          description: Enrollment Updated
        403:
          $ref: '#/components/responses/ErrorForbiddenAppsNotAvailableResponse'
        404:
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorNotFound'
        422:
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnprocessableEntityError'
              example:
                errors:
                - Course could not be found.
                - User could not be found.
      x-codegen-request-body-name: body
components:
  responses:
    ErrorForbiddenAppsNotAvailableResponse:
      description: Access Forbidden
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorForbiddenAppsNotAvailable'
  schemas:
    UpdateEnrollmentRequest:
      type: object
      properties:
        activated_at:
          type: string
          description: The date/time at which the Enrollment is activated. If not provided, the Enrollment is a free trial.
          format: date-time
          example: '2018-01-01T01:01:00Z'
        expiry_date:
          type: string
          description: The date/time at which the Enrollment expired. If not provided, the Enrollment does not expire.
          format: date-time
          example: '2019-01-01T01:01:00Z'
    ValidationError:
      type: object
      properties:
        field_name:
          type: string
          description: validation error
    Meta:
      type: object
      properties:
        pagination:
          $ref: '#/components/schemas/Pagination'
    EnrollmentResponse:
      required:
      - activated_at
      - completed
      - completed_at
      - course_id
      - course_name
      - expired
      - expiry_date
      - id
      - is_free_trial
      - percentage_completed
      - started_at
      - updated_at
      - user_email
      - user_id
      - user_name
      type: object
      properties:
        id:
          type: number
          description: The ID of the Enrollment as an integer.
          example: 1.0
        user_email:
          type: string
          description: The email of the User owning the Enrollment.
          example: bob@example.com
        user_name:
          type: string
          description: The full name of the User owning the Enrollment.
          example: Bob Smith
        user_id:
          type: number
          description: The ID of the User owning the Enrollment as an integer.
          example: 1.0
        course_name:
          type: string
          description: The name of the Course.
          example: My Course
        course_id:
          type: number
          description: The ID of the Course as an integer.
          example: 1.0
        percentage_completed:
          type: number
          description: The percentage complete of the Enrollment. A number between 0.0 and 1.0. For example, to represent a percentage complete of 75%, this value would be 0.75.
          example: 1.0
        expired:
          type: boolean
          description: A boolean indicating whether the Enrollment is expired.
          example: false
        is_free_trial:
          type: boolean
          description: A boolean indicating whether the Enrollment is a free trial.
          example: false
        completed:
          type: boolean
          description: A boolean indicating whether the Enrollment is complete.
          example: true
        started_at:
          type: string
          description: The date/time that the Enrollment started.
          format: date-time
          example: '2018-01-01T01:01:00Z'
        activated_at:
          type: string
          description: The date/time that the Enrollment was activated.
          format: date-time
          example: '2018-01-01T01:01:00Z'
        completed_at:
          type: string
          description: The date/time that the Enrollment was completed.
          format: date-time
          example: '2018-01-31T01:01:00Z'
        updated_at:
          type: string
          description: The date/time that the Enrollment was updated last.
          format: date-time
          example: '2018-01-31T01:01:00Z'
        expiry_date:
          type: string
          description: The date/time that the Enrollment expires.
          format: date-time
          example: '2019-01-01T01:01:00Z'
    CreateEnrollmentRequest:
      type: object
      properties:
        course_id:
          type: number
          description: The ID of the Course as an integer.
          example: 1.0
        user_id:
          type: number
          description: The ID of the User owning the Enrollment as an integer.
          example: 1.0
        activated_at:
          type: string
          description: The date/time at which the Enrollment is activated. If not provided, the Enrollment is a free trial.
          format: date-time
          example: '2018-01-01T01:01:00Z'
        expiry_date:
          type: string
          description: The date/time at which the Enrollment expired. If not provided, the Enrollment does not expire.
          format: date-time
          example: '2019-01-01T01:01:00Z'
    ErrorForbiddenAppsNotAvailable:
      type: object
      properties:
        error:
          type: string
          description: access forbidden
      example:
        error: Access to Apps is not available on your plan. Upgrade to gain access
    ErrorNotFound:
      type: object
      properties:
        error:
          type: string
          description: item not found error
      example:
        error: Record not found.
    GetEnrollmentsResponse:
      required:
      - items
      - meta
      type: object
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/EnrollmentResponse'
        meta:
          $ref: '#/components/schemas/Meta'
    UnprocessableEntityError:
      type: object
      properties:
        errors:
          type: array
          items:
            $ref: '#/components/schemas/ValidationError'
    Pagination:
      type: object
      properties:
        current_page:
          type: number
          description: Current page number
          example: 1.0
        next_page:
          type: number
          description: Next page number
          example: 2.0
        prev_page:
          type: number
          description: Previous page number
        total_pages:
          type: number
          description: Number of total pages
          example: 10.0
        total_items:
          type: number
          description: Number of total items
          example: 250.0
        entries_info:
          type: string
          description: Entries info
          example: 1-10 of 10
      description: Pagination metadata
  securitySchemes:
    OAuthAccessToken:
      type: http
      scheme: bearer
    ApiKey:
      type: apiKey
      in: header
      name: X-Auth-API-Key
      description: Used together with ApiKeySubdomain
    ApiKeySubdomain:
      type: apiKey
      in: header
      name: X-Auth-Subdomain
      description: Used together with ApiKey
externalDocs:
  description: Find out more about Thinkifc's API
  url: http://developers.thinkific.com/api/api-documentation/