Accounts
API for accessing account data.
An Account object looks like:
A TermsOfService object looks like:
A HelpLink object looks like:
A HelpLinks object looks like:
GET /api/v1/accounts
GET /api/v1/accounts
Scope: url:GET|/api/v1/accounts
A paginated list of accounts that the current user can view or manage. Typically, students and even teachers will get an empty list in response, only account admins can view the accounts that they are in.
Request Parameters:
Parameter | Type | Description |
---|---|---|
|
| Array of additional information to include.
Allowed values: |
Returns a list of Account objects.
AccountsController#manageable_accounts
GET /api/v1/manageable_accounts
GET /api/v1/manageable_accounts
Scope: url:GET|/api/v1/manageable_accounts
A paginated list of accounts where the current user has permission to create or manage courses. List will be empty for students and teachers as only admins can view which accounts they are in.
Returns a list of Account objects.
AccountsController#course_creation_accounts
GET /api/v1/course_creation_accounts
GET /api/v1/course_creation_accounts
Scope: url:GET|/api/v1/course_creation_accounts
A paginated list of accounts where the current user has permission to create courses.
Returns a list of Account objects.
AccountsController#course_accounts
GET /api/v1/course_accounts
GET /api/v1/course_accounts
Scope: url:GET|/api/v1/course_accounts
A paginated list of accounts that the current user can view through their admin course enrollments. (Teacher, TA, or designer enrollments). Only returns “id”, “name”, “workflow_state”, “root_account_id” and “parent_account_id”
Returns a list of Account objects.
GET /api/v1/accounts/:id
GET /api/v1/accounts/:id
Scope: url:GET|/api/v1/accounts/:id
Retrieve information on an individual account, given by id or sis sis_account_id.
Returns an Account object.
AccountsController#show_settings
GET /api/v1/accounts/:account_id/settings
GET /api/v1/accounts/:account_id/settings
Scope: url:GET|/api/v1/accounts/:account_id/settings
Returns a JSON object containing a subset of settings for the specified account. It’s possible an empty set will be returned if no settings are applicable. The caller must be an Account admin with the manage_account_settings permission.
Example Request:
Example Response:
AccountsController#environment
GET /api/v1/settings/environment
GET /api/v1/settings/environment
Scope: url:GET|/api/v1/settings/environment
Return a hash of global settings for the root account This is the same information supplied to the web interface as ENV.SETTINGS
.
Example Request:
Example Response:
AccountsController#permissions
GET /api/v1/accounts/:account_id/permissions
GET /api/v1/accounts/:account_id/permissions
Scope: url:GET|/api/v1/accounts/:account_id/permissions
Returns permission information for the calling user and the given account. You may use ‘self` as the account id to check permissions against the domain root account. The caller must have an account role or admin (teacher/TA/designer) enrollment in a course in the account.
See also the Course and Group counterparts.
Request Parameters:
Parameter | Type | Description |
---|---|---|
|
| List of permissions to check against the authenticated user. Permission names are documented in the Create a role endpoint. |
Example Request:
Example Response:
AccountsController#sub_accounts
GET /api/v1/accounts/:account_id/sub_accounts
GET /api/v1/accounts/:account_id/sub_accounts
Scope: url:GET|/api/v1/accounts/:account_id/sub_accounts
List accounts that are sub-accounts of the given account.
Request Parameters:
Parameter | Type | Description |
---|---|---|
|
| If true, the entire account tree underneath this account will be returned (though still paginated). If false, only direct sub-accounts of this account will be returned. Defaults to false. |
|
| Array of additional information to include.
Allowed values: |
Example Request:
Returns a list of Account objects.
AccountsController#terms_of_service
GET /api/v1/accounts/:account_id/terms_of_service
GET /api/v1/accounts/:account_id/terms_of_service
Scope: url:GET|/api/v1/accounts/:account_id/terms_of_service
Returns the terms of service for that account
Returns a TermsOfService object.
GET /api/v1/accounts/:account_id/help_links
GET /api/v1/accounts/:account_id/help_links
Scope: url:GET|/api/v1/accounts/:account_id/help_links
Returns the help links for that account
Returns a HelpLinks object.
AccountsController#manually_created_courses_account
GET /api/v1/manually_created_courses_account
GET /api/v1/manually_created_courses_account
Scope: url:GET|/api/v1/manually_created_courses_account
AccountsController#courses_api
GET /api/v1/accounts/:account_id/courses
GET /api/v1/accounts/:account_id/courses
Scope: url:GET|/api/v1/accounts/:account_id/courses
Retrieve a paginated list of courses in this account.
Request Parameters:
Parameter | Type | Description |
---|---|---|
|
| If true, include only courses with at least one enrollment. If false, include only courses with no enrollments. If not present, do not filter on course enrollment status. |
|
| If set, only return courses that have at least one user enrolled in in the course with one of the specified enrollment types. Allowed values: |
|
| If true, include only published courses. If false, exclude published courses. If not present, do not filter on published status. |
|
| If true, include only completed courses (these may be in state ‘completed’, or their enrollment term may have ended). If false, exclude completed courses. If not present, do not filter on completed status. |
|
| If true, include only blueprint courses. If false, exclude them. If not present, do not filter on this basis. |
|
| If true, include only courses that inherit content from a blueprint course. If false, exclude them. If not present, do not filter on this basis. |
|
| If true, include only public courses. If false, exclude them. If not present, do not filter on this basis. |
|
| List of User IDs of teachers; if supplied, include only courses taught by one of the referenced users. |
|
| List of Account IDs; if supplied, include only courses associated with one of the referenced subaccounts. |
|
| If present, only return courses that have at least one enrollment. Equivalent to ‘with_enrollments=true’; retained for compatibility. |
|
| If set, only return courses that are in the given state(s). By default, all states but “deleted” are returned. Allowed values: |
|
| If set, only includes courses from the specified term. |
|
| The partial course name, code, or full ID to match and return in the results list. Must be at least 3 characters. |
|
|
Allowed values: |
|
| The column to sort results by. Allowed values: |
|
| The order to sort the given column by. Allowed values: |
|
| The filter to search by. “course” searches for course names, course codes, and SIS IDs. “teacher” searches for teacher names Allowed values: |
|
| If set, only return courses that start before the value (inclusive) or their enrollment term starts before the value (inclusive) or both the course’s start_at and the enrollment term’s start_at are set to null. The value should be formatted as: yyyy-mm-dd or ISO 8601 YYYY-MM-DDTHH:MM:SSZ. |
|
| If set, only return courses that end after the value (inclusive) or their enrollment term ends after the value (inclusive) or both the course’s end_at and the enrollment term’s end_at are set to null. The value should be formatted as: yyyy-mm-dd or ISO 8601 YYYY-MM-DDTHH:MM:SSZ. |
|
| If set, only return homeroom courses. |
Returns a list of Course objects.
PUT /api/v1/accounts/:id
PUT /api/v1/accounts/:id
Scope: url:PUT|/api/v1/accounts/:id
Update an existing account.
Request Parameters:
Parameter | Type | Description |
---|---|---|
|
| Updates the account name |
|
| Updates the account sis_account_id Must have manage_sis permission and must not be a root_account. |
|
| The default time zone of the account. Allowed time zones are IANA time zones or friendlier Ruby on Rails time zones. |
|
| The default course storage quota to be used, if not otherwise specified. |
|
| The default user storage quota to be used, if not otherwise specified. |
|
| The default group storage quota to be used, if not otherwise specified. |
|
| The ID of a course to be used as a template for all newly created courses. Empty means to inherit the setting from parent account, 0 means to not use a template even if a parent account has one set. The course must be marked as a template. |
|
| Restrict students from viewing courses after end date |
|
| Lock this setting for sub-accounts and courses |
|
| Restrict students from viewing courses before start date |
|
| Determines whether this account has Microsoft Teams Sync enabled or not.
Note that if you are altering Microsoft Teams sync settings you must enable the Microsoft Group enrollment syncing feature flag. In addition, if you are enabling Microsoft Teams sync, you must also specify a tenant, login attribute, and a remote attribute. Specifying a suffix to use is optional. |
|
| The tenant this account should use when using Microsoft Teams Sync. This should be an Azure Active Directory domain name. |
|
| The attribute this account should use to lookup users when using Microsoft Teams Sync. Must be one of “sub”, “email”, “oid”, “preferred_username”, or “integration_id”. |
|
| A suffix that will be appended to the result of the login attribute when associating Canvas users with Microsoft users. Must be under 255 characters and contain no whitespace. This field is optional. |
|
| The Active Directory attribute to use when associating Canvas users with Microsoft users. Must be one of “mail”, “mailNickname”, or “userPrincipalName”. |
|
| Lock this setting for sub-accounts and courses |
|
| Disable comments on announcements |
|
| Lock this setting for sub-accounts and courses |
|
| Copyright and license information must be provided for files before they are published. |
|
| Lock this setting for sub-accounts and courses |
|
| Restrict students from viewing future enrollments in course list |
|
| Lock this setting for sub-accounts and courses |
|
| Enable or disable individual learning paths for students based on assessment |
|
| Lock this setting for sub-accounts and courses |
|
| Hash of optional password policy configuration parameters for a root account
Required feature option:
|
|
| Enable or disable Canvas for Elementary for this account |
|
| Whether or not the classic font is used on the dashboard. Only applies if enable_as_k5_account is true. |
|
| Default is true. If false, any fields containing “sticky” changes will not be updated. See SIS CSV Format documentation for information on which fields can have SIS stickiness |
|
|
|
|
|
|
|
|
|
|
|
|
|
| Give this a set of keys and boolean values to enable or disable services matching the keys |
Example Request:
Returns an Account object.
AccountsController#remove_user
DELETE /api/v1/accounts/:account_id/users/:user_id
DELETE /api/v1/accounts/:account_id/users/:user_id
Scope: url:DELETE|/api/v1/accounts/:account_id/users/:user_id
Delete a user record from a Canvas root account. If a user is associated with multiple root accounts (in a multi-tenant instance of Canvas), this action will NOT remove them from the other accounts.
WARNING: This API will allow a user to remove themselves from the account. If they do this, they won’t be able to make API calls or log into Canvas at that account.
Example Request:
Returns an User object.
AccountsController#restore_user
PUT /api/v1/accounts/:account_id/users/:user_id/restore
PUT /api/v1/accounts/:account_id/users/:user_id/restore
Scope: url:PUT|/api/v1/accounts/:account_id/users/:user_id/restore
Restore a user record along with the most recently deleted pseudonym from a Canvas root account.
Example Request:
Returns an User object.
POST /api/v1/accounts/:account_id/sub_accounts
POST /api/v1/accounts/:account_id/sub_accounts
Scope: url:POST|/api/v1/accounts/:account_id/sub_accounts
Add a new sub-account to a given account.
Request Parameters:
Parameter | Type | Description |
---|---|---|
| Required | The name of the new sub-account. |
|
| The account’s identifier in the Student Information System. |
|
| The default course storage quota to be used, if not otherwise specified. |
|
| The default user storage quota to be used, if not otherwise specified. |
|
| The default group storage quota to be used, if not otherwise specified. |
Returns an Account object.
DELETE /api/v1/accounts/:account_id/sub_accounts/:id
DELETE /api/v1/accounts/:account_id/sub_accounts/:id
Scope: url:DELETE|/api/v1/accounts/:account_id/sub_accounts/:id
Cannot delete an account with active courses or active sub_accounts. Cannot delete a root_account
Returns an Account object.
© Instructure, Inc. Generated on Wed Nov 6 14:20:04 2024 This documentation is generated directly from the Canvas LMS source code, available on Github.
Last updated