Feature Flags
Manage optional features in Canvas.
Deprecated[2016-01-15] FeatureFlags previously had a locking_account_id field; it was never used, and has been removed. It is still included in API responses for backwards compatibility reasons. Its value is always null.
A Feature object looks like:
A FeatureFlag object looks like:
GET /api/v1/courses/:course_id/features
GET /api/v1/courses/:course_id/features
Scope: url:GET|/api/v1/courses/:course_id/features
GET /api/v1/accounts/:account_id/features
GET /api/v1/accounts/:account_id/features
Scope: url:GET|/api/v1/accounts/:account_id/features
GET /api/v1/users/:user_id/features
GET /api/v1/users/:user_id/features
Scope: url:GET|/api/v1/users/:user_id/features
A paginated list of all features that apply to a given Account, Course, or User.
Example Request:
Returns a list of Feature objects.
FeatureFlagsController#enabled_features
GET /api/v1/courses/:course_id/features/enabled
GET /api/v1/courses/:course_id/features/enabled
Scope: url:GET|/api/v1/courses/:course_id/features/enabled
GET /api/v1/accounts/:account_id/features/enabled
GET /api/v1/accounts/:account_id/features/enabled
Scope: url:GET|/api/v1/accounts/:account_id/features/enabled
GET /api/v1/users/:user_id/features/enabled
GET /api/v1/users/:user_id/features/enabled
Scope: url:GET|/api/v1/users/:user_id/features/enabled
A paginated list of all features that are enabled on a given Account, Course, or User. Only the feature names are returned.
Example Request:
Example Response:
FeatureFlagsController#environment
GET /api/v1/features/environment
GET /api/v1/features/environment
Scope: url:GET|/api/v1/features/environment
Return a hash of global feature options that pertain to the Canvas user interface. This is the same information supplied to the web interface as ENV.FEATURES
.
Example Request:
Example Response:
GET /api/v1/courses/:course_id/features/flags/:feature
GET /api/v1/courses/:course_id/features/flags/:feature
Scope: url:GET|/api/v1/courses/:course_id/features/flags/:feature
GET /api/v1/accounts/:account_id/features/flags/:feature
GET /api/v1/accounts/:account_id/features/flags/:feature
Scope: url:GET|/api/v1/accounts/:account_id/features/flags/:feature
GET /api/v1/users/:user_id/features/flags/:feature
GET /api/v1/users/:user_id/features/flags/:feature
Scope: url:GET|/api/v1/users/:user_id/features/flags/:feature
Get the feature flag that applies to a given Account, Course, or User. The flag may be defined on the object, or it may be inherited from a parent account. You can look at the context_id and context_type of the returned object to determine which is the case. If these fields are missing, then the object is the global Canvas default.
Example Request:
Returns a FeatureFlag object.
PUT /api/v1/courses/:course_id/features/flags/:feature
PUT /api/v1/courses/:course_id/features/flags/:feature
Scope: url:PUT|/api/v1/courses/:course_id/features/flags/:feature
PUT /api/v1/accounts/:account_id/features/flags/:feature
PUT /api/v1/accounts/:account_id/features/flags/:feature
Scope: url:PUT|/api/v1/accounts/:account_id/features/flags/:feature
PUT /api/v1/users/:user_id/features/flags/:feature
PUT /api/v1/users/:user_id/features/flags/:feature
Scope: url:PUT|/api/v1/users/:user_id/features/flags/:feature
Set a feature flag for a given Account, Course, or User. This call will fail if a parent account sets a feature flag for the same feature in any state other than “allowed”.
Request Parameters:
Parameter | Type | Description |
---|---|---|
|
|
Allowed values: |
Example Request:
Returns a FeatureFlag object.
DELETE /api/v1/courses/:course_id/features/flags/:feature
DELETE /api/v1/courses/:course_id/features/flags/:feature
Scope: url:DELETE|/api/v1/courses/:course_id/features/flags/:feature
DELETE /api/v1/accounts/:account_id/features/flags/:feature
DELETE /api/v1/accounts/:account_id/features/flags/:feature
Scope: url:DELETE|/api/v1/accounts/:account_id/features/flags/:feature
DELETE /api/v1/users/:user_id/features/flags/:feature
DELETE /api/v1/users/:user_id/features/flags/:feature
Scope: url:DELETE|/api/v1/users/:user_id/features/flags/:feature
Remove feature flag for a given Account, Course, or User. (Note that the flag must be defined on the Account, Course, or User directly.) The object will then inherit the feature flags from a higher account, if any exist. If this flag was ‘on’ or ‘off’, then lower-level account flags that were masked by this one will apply again.
Example Request:
Returns a FeatureFlag object.
© Instructure, Inc. Generated on Wed Nov 6 14:20:07 2024 This documentation is generated directly from the Canvas LMS source code, available on Github.
Last updated