openapi: 3.0.3 info: title: Teachable Admin Courses Users API description: 'REST API for managing Teachable school data including courses, users, enrollments, quiz responses, pricing plans, transactions, and webhooks. Authenticated via API key header and available on Growth plan and above. ' version: '1' contact: name: Teachable Support url: https://support.teachable.com email: support@teachable.com termsOfService: https://teachable.com/terms-of-use servers: - url: https://developers.teachable.com/v1 description: Teachable Admin API security: - ApiKeyAuth: [] tags: - name: Users description: User management endpoints paths: /users: get: operationId: listUsers summary: List users description: Get a list of users. tags: - Users parameters: - name: page in: query description: Used in pagination when number of users exceed the maximum amount of results per page. schema: type: integer format: int32 - name: per in: query description: Used in pagination to define amount of users per page, when not defined the maximum is 20. schema: type: integer format: int32 - name: email in: query description: Filter users by user email. schema: type: string - name: search_after in: query description: Used when number of users exceeds 10,000 records. Use the search_after value to search the next set of records. schema: type: integer format: int32 responses: '200': description: Successful response content: application/json: schema: $ref: '#/components/schemas/UsersListResponse' post: operationId: createUser summary: Create a user description: Create a new user on the school. tags: - Users requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/CreateUserRequest' responses: '201': description: User created successfully content: application/json: schema: $ref: '#/components/schemas/UserDetailResponse' '400': description: Bad request content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' /users/{user_id}: get: operationId: getUser summary: Get a user description: Return a user by their unique ID. tags: - Users parameters: - name: user_id in: path required: true description: The unique ID of the user. schema: type: integer format: int32 minimum: 1 responses: '200': description: Successful response content: application/json: schema: $ref: '#/components/schemas/UserDetailResponse' '404': description: Not found content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' patch: operationId: updateUser summary: Update a user description: Update the name or src of a user. tags: - Users parameters: - name: user_id in: path required: true description: The unique ID of the user. schema: type: integer format: int32 minimum: 1 requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/UpdateUserRequest' responses: '200': description: User updated successfully content: application/json: schema: $ref: '#/components/schemas/UserDetailResponse' '404': description: Not found content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' components: schemas: UserDetail: allOf: - $ref: '#/components/schemas/UserSummary' - type: object properties: role: type: string description: The role of the user (student, owner, affiliate, author, custom, etc.). last_sign_in_ip: type: string nullable: true description: Last sign-in IP address, or null if user hasn't signed in. courses: type: array items: $ref: '#/components/schemas/UserCourse' description: A list of courses the user is or has been enrolled in. tags: type: array items: $ref: '#/components/schemas/UserTag' description: Tags related to the user. ErrorResponse: type: object properties: message: oneOf: - type: string - type: array items: type: string description: Error message or array of error messages. PaginationMeta: type: object properties: total: type: integer description: Total number of items. page: type: integer description: Current page number. from: type: integer description: First item position on current page. to: type: integer description: Last item position on current page. per_page: type: integer description: Number of items per page. number_of_pages: type: integer description: Total number of pages. UserCourse: type: object properties: course_id: type: integer course_name: type: string enrolled_at: type: string format: date-time is_active_enrollment: type: boolean completed_at: type: string format: date-time nullable: true percent_complete: type: number UpdateUserRequest: type: object properties: name: type: string description: The name of the user. src: type: string description: The signup source of the user, which is displayed on the Information tab of the user profile. UsersListResponse: type: object properties: users: type: array items: $ref: '#/components/schemas/UserSummary' meta: $ref: '#/components/schemas/PaginationMeta' UserDetailResponse: type: object properties: user: $ref: '#/components/schemas/UserDetail' CreateUserRequest: type: object required: - email properties: email: type: string description: The email address of the new user. name: type: string description: The name of the new user. password: type: string minLength: 6 description: Password for the account. Minimum 6 characters. src: type: string description: The signup source of the user. Can store custom values or external system IDs. UserSummary: type: object properties: id: type: integer format: int32 description: The unique ID of the user. name: type: string nullable: true description: The name of the user. email: type: string description: The email address of the user. UserTag: type: object properties: name: type: string description: Tag name. securitySchemes: ApiKeyAuth: type: apiKey in: header name: apiKey description: API key for Admin API authentication. Available on Growth plan and above.