D2lbrightspace

Learn how to use D2lbrightspace with Composio

Overview

SLUG: D2LBRIGHTSPACE

Description

D2L Brightspace is a learning management system that provides a comprehensive suite of tools for educators to create, manage, and deliver online courses and learning experiences.

Authentication Details

client_id
stringRequired
client_secret
stringRequired
subdomain
stringRequired
version
stringDefaults to 1.75Required
oauth_redirect_uri
stringDefaults to https://backend.composio.dev/api/v1/auth-apps/add
scopes
stringDefaults to quizzing:quizzes:delete,quizzing:quizzes:read,quizzing:quizzes:create
bearer_token
string

Connecting to D2lbrightspace

Create an auth config

Use the dashboard to create an auth config for the D2lbrightspace toolkit. This allows you to connect multiple D2lbrightspace accounts to Composio for agents to use.

1

Select App

Navigate to D2lbrightspace.

2

Configure Auth Config Settings

Select among the supported auth schemes of and configure them here.

3

Create and Get auth config ID

Click “Create D2lbrightspace Auth Config”. After creation, copy the displayed ID starting with ac_. This is your auth config ID. This is not a sensitive ID — you can save it in environment variables or a database. This ID will be used to create connections to the toolkit for a given user.

Connect Your Account

Using OAuth2

1from composio import Composio
2
3# Replace these with your actual values
4d2lbrightspace_auth_config_id = "ac_YOUR_D2LBRIGHTSPACE_CONFIG_ID" # Auth config ID created above
5user_id = "0000-0000-0000" # UUID from database/application
6
7composio = Composio()
8
9
10def authenticate_toolkit(user_id: str, auth_config_id: str):
11 connection_request = composio.connected_accounts.initiate(
12 user_id=user_id,
13 auth_config_id=auth_config_id,
14 )
15
16 print(
17 f"Visit this URL to authenticate D2lbrightspace: {connection_request.redirect_url}"
18 )
19
20 # This will wait for the auth flow to be completed
21 connection_request.wait_for_connection(timeout=15)
22 return connection_request.id
23
24
25connection_id = authenticate_toolkit(user_id, d2lbrightspace_auth_config_id)
26
27# You can also verify the connection status using:
28connected_account = composio.connected_accounts.get(connection_id)
29print(f"Connected account: {connected_account}")

Tools

Executing tools

To prototype you can execute some tools to see the responses and working on the D2lbrightspace toolkit’s playground

Python
1from composio import Composio
2from openai import OpenAI
3import json
4
5openai = OpenAI()
6composio = Composio()
7
8# User ID must be a valid UUID format
9user_id = "0000-0000-0000" # Replace with actual user UUID from your database
10
11tools = composio.tools.get(user_id=user_id, toolkits=["D2LBRIGHTSPACE"])
12
13print("[!] Tools:")
14print(json.dumps(tools))
15
16def invoke_llm(task = "What can you do?"):
17 completion = openai.chat.completions.create(
18 model="gpt-4o",
19 messages=[
20 {
21 "role": "user",
22 "content": task, # Your task here!
23 },
24 ],
25 tools=tools,
26 )
27
28 # Handle Result from tool call
29 result = composio.provider.handle_tool_calls(user_id=user_id, response=completion)
30 print(f"[!] Completion: {completion}")
31 print(f"[!] Tool call result: {result}")
32
33invoke_llm()

Tool List

Tool Name: Get Current User Information

Description

Retrieves the current user context's user information from d2l brightspace. requires one of these oauth2 scopes: - users:profile:read - users:own profile:read available in api versions 1.46+ (lms v20.24.3+)

Action Parameters

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Copy Role

Description

Creates a new role copied from an existing role in d2l brightspace. notes: - the new role will not have any capabilities upon the old role from which it was created - some capabilities will be copied for the new role (e.g., if old role users could impersonate other old role users, new role users will be able to impersonate other new role users) - additional capabilities must be manually created after copying requires oauth2 scope: - role:detail:create available in api versions unstable (lms v10.4.10+)

Action Parameters

deep_copy_role_id
integerRequired
role_data
objectRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Create Course Offering

Description

Creates a new course offering in d2l brightspace. notes: - course code limitations: max 50 chars, no special chars: \ : * ? " < > | ' # , % & - path: leave empty if path enforcement is enabled - semesterid: provide null if not using the semester element - canselfregister: required for api v1.28+, not supported before v1.28 requires oauth2 scope: - orgunits:course:create available in api versions 1.46+ (lms v20.24.3+)

Action Parameters

course_data
objectRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Create Course Template

Description

Creates a new course template in d2l brightspace. notes: - course template code limitations: max 50 chars, no special chars: \ : * ? " < > | ' # , % & - path: leave empty if path enforcement is enabled requires oauth2 scope: - orgunits:coursetemplate:create available in api versions 1.46+ (lms v20.24.3+)

Action Parameters

course_template_data
objectRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Create Grade Object

Description

Creates a new grade object for a particular org unit. the grade object can be one of four types: 1. numeric: for numeric grades with max points 2. passfail: for pass/fail assessments 3. selectbox: for predefined grade options 4. text: for text-only feedback returns a gradeobject json block containing the created grade object's data, including its assigned id. requires oauth2 scope: - grades:gradeobjects:write available in api versions 1.75+ (lms v20.24.5+)

Action Parameters

grade_object
objectRequired
org_unit_id
integerRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Create Quiz

Description

Creates a new quiz in d2l brightspace. notes: - numberofattemptsallowed must be between 1 and 10 (inclusive) or null for unlimited - password must not be empty or whitespace if provided - notificationemail must be a valid email address if provided - timelimitvalue: 0 for no limit (with isenforced false), or 1-9999 for enforced limit - deductionpercentage must be between 0 and 100 if provided - as of le api v1.71: - latelimitminutes is ignored - latesubmissionoption 1 is treated as 2 (autosubmitattempt) - submissiongraceperiod is not used - pagingtypeid added in le api v1.78 - date fields should be in utc format requires oauth2 scopes: - quizzing:quizzes:read - quizzing:quizzes:create available in api versions 1.75+ (lms v20.24.5+)

Action Parameters

org_unit_id
integerRequired
quiz_data
objectRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Create Quiz Category

Description

Creates a new quiz category in d2l brightspace. returns a quizcategoryreaddata json block containing: - categoryid: the id of the created category - name: the name of the category - sortorder: the sort order value requires oauth2 scopes: - quizzing:quizzes:read - quizzing:quizzes:create available in api versions 1.75+ (lms v20.24.5+)

Action Parameters

category_data
objectRequired
org_unit_id
integerRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Create User

Description

Creates a new user entity in d2l brightspace. requires oauth2 scope: - users:userdata:create available in api versions 1.46+ (lms v20.24.3+) notes: - firstname and lastname are used as legal names - externalemail must be null or a valid email address - orgdefinedid must be unique across the organization if provided - preferred names must be set separately after user creation

Action Parameters

user_data
objectRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Delete Course Template

Description

Deletes a course template from d2l brightspace. requires oauth2 scope: - orgunits:course:delete available in api versions 1.46+ (lms v20.24.3+)

Action Parameters

org_unit_id
integerRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Delete Course

Description

Deletes a course offering from d2l brightspace. requires oauth2 scope: - orgunits:course:delete available in api versions 1.46+ (lms v20.24.3+)

Action Parameters

org_unit_id
integerRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Delete Grade Object

Description

Deletes a specific grade object from an org unit. requires oauth2 scope: - grades:gradeobjects:delete available in api versions 1.75+ (lms v20.24.5+)

Action Parameters

grade_object_id
integerRequired
org_unit_id
integerRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Delete Quiz

Description

Deletes a quiz from d2l brightspace. requires oauth2 scope: - quizzing:quizzes:delete available in api versions 1.75+ (lms v20.24.5+)

Action Parameters

org_unit_id
integerRequired
quiz_id
integerRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Delete Quiz Category

Description

Deletes a quiz category from d2l brightspace. requires oauth2 scope: - quizzing:quizzes:delete available in api versions 1.75+ (lms v20.24.5+)

Action Parameters

category_id
integerRequired
org_unit_id
integerRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Delete User

Description

Deletes a user entity from d2l brightspace. requires oauth2 scope: - users:userdata:delete available in api versions 1.46+ (lms v20.24.3+)

Action Parameters

user_id
integerRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Delete User Demographics

Description

Deletes one or more of a particular user's associated demographics entries. notes: - if entry ids are provided, only those specific entries will be deleted - if entry ids are not provided, all demographics entries for the user will be deleted requires oauth2 scope: - demographics:user:delete available in api versions 1.46+ (lms v20.24.3+)

Action Parameters

entry_ids
array
user_id
integerRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Get Course Offering

Description

Retrieves a specific course offering from d2l brightspace. returns a courseoffering json block with the course's information. requires oauth2 scope: - orgunits:course:read available in api versions 1.46+ (lms v20.24.3+)

Action Parameters

org_unit_id
integerRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Get Course Template

Description

Retrieves a course template from d2l brightspace. returns a coursetemplate json block with the template's information. available in api versions 1.46+ (lms v20.24.3+)

Action Parameters

org_unit_id
integerRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Get Course Schema

Description

Retrieves the list of parent org unit type constraints for course offerings. returns a json array of schemaelement blocks defining the allowed parent organizational unit types for courses. available in api versions 1.46+ (lms v20.24.3+)

Action Parameters

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Get Course Template Schema

Description

Retrieves the list of parent org unit type constraints for course offerings built on this template. returns a json array of schemaelement blocks defining the allowed parent organizational unit types for course templates. available in api versions 1.46+ (lms v20.24.3+)

Action Parameters

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Get Enrolled Roles

Description

Retrieves a list of all enrolled user roles the calling user can view in an org unit. returns a json array of role data blocks containing the properties of all user roles that the calling user context has permission to view and that are currently enrolled in the provided org unit. requires oauth2 scope: - role:detail:read available in api versions 1.46+ (lms v20.24.3+)

Action Parameters

org_unit_id
integerRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Get Grade Access

Description

Retrieves a list of users with access to a specified grade. returns an objectlistpage containing useraccess blocks. can optionally filter by specific user id or role id. requires oauth2 scope: - grades:access:read available in api versions 1.75+ (lms v20.24.5+)

Action Parameters

grade_object_id
integerRequired
org_unit_id
integerRequired
role_id
integer
user_id
integer

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Get Grade Object

Description

Retrieves a specific grade object for a particular org unit. returns a gradeobject json block containing the grade object's properties. requires oauth2 scope: - grades:gradeobjects:read available in api versions 1.75+ (lms v20.24.5+)

Action Parameters

grade_object_id
integerRequired
org_unit_id
integerRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Get Grade Objects

Description

Retrieves all current grade objects for a particular org unit. returns an array of grade objects. requires oauth2 scope: - grades:gradeobjects:read available in api versions 1.75+ (lms v20.24.5+)

Action Parameters

org_unit_id
integerRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Get Grade Setup

Description

Retrieves the grades configuration for an org unit. returns a gradesetupinfo json block containing the grades setup information. requires oauth2 scope: - grades:gradesettings:read available in api versions 1.75+ (lms v20.24.5+)

Action Parameters

org_unit_id
integerRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Get Grade Statistics

Description

Retrieves statistics for a specified grade item. returns a gradestatisticsinfo json block containing statistical data about the grade item. requires oauth2 scope: - grades:gradestatistics:read available in api versions 1.75+ (lms v20.24.5+)

Action Parameters

grade_object_id
integerRequired
org_unit_id
integerRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Get Org Unit Demographics

Description

Retrieves all demographics entries for users enrolled in a particular org unit. notes: - filters are applied cumulatively (all conditions must match) - when using id lists in filters, matching any id in the list satisfies that filter - for example: with roleids=[1,2], userids=[3,4], search="value": * users must have role 1 or 2 (either role matches) * and must have id 3 or 4 (either id matches) * and must have a field matching "value" - results are paged; use bookmark parameter for subsequent pages requires oauth2 scope: - demographics:orgunit:read available in api versions 1.46+ (lms v20.24.3+)

Action Parameters

bookmark
string
field_ids
array
org_unit_id
integerRequired
role_ids
array
search
string
user_ids
array

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Get Quiz

Description

Retrieves a specific quiz from an org unit. returns a quizreaddata json block containing the quiz's properties. requires oauth2 scope: - quizzing:quizzes:read available in api versions 1.75+ (lms v20.24.5+)

Action Parameters

org_unit_id
integerRequired
quiz_id
integerRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Get Quizzes

Description

Retrieves all quizzes belonging to an org unit. returns an objectlistpage json block containing a list of quizreaddata blocks. requires oauth2 scope: - quizzing:quizzes:read available in api versions 1.75+ (lms v20.24.5+)

Action Parameters

org_unit_id
integerRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Get Quiz Access

Description

Retrieves a list of users with access to a specified quiz. returns an objectlistpage json block containing a list of useraccess blocks. can filter by specific user id or role id. requires oauth2 scope: - quizzing:access:read available in api versions 1.75+ (lms v20.24.5+)

Action Parameters

org_unit_id
integerRequired
quiz_id
integerRequired
role_id
integer
user_id
integer

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Get Quiz Attempt

Description

Retrieves a specific quiz attempt. returns a quizattemptdata json block containing the attempt's properties. requires oauth2 scope: - quizzing:attempts:read available in api versions 1.75+ (lms v20.24.5+)

Action Parameters

attempt_id
integerRequired
org_unit_id
integerRequired
quiz_id
integerRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Get Quiz Attempts

Description

Retrieves a list of attempts for a quiz. can optionally filter attempts for a specific user. returns an objectlistpage json block containing a list of quizattemptdata blocks. requires oauth2 scope: - quizzing:attempts:read available in api versions 1.75+ (lms v20.24.5+)

Action Parameters

org_unit_id
integerRequired
quiz_id
integerRequired
user_id
integer

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Get Quiz Categories

Description

Retrieves all quiz categories belonging to an org unit. returns an objectlistpage json block containing a list of quizcategoryreaddata blocks. requires oauth2 scope: - quizzing:quizzes:read available in api versions 1.75+ (lms v20.24.5+)

Action Parameters

org_unit_id
integerRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Get Quiz Category

Description

Retrieves a specific quiz category from an org unit. returns a quizcategoryreaddata json block containing the category's properties. requires oauth2 scope: - quizzing:quizzes:read available in api versions 1.75+ (lms v20.24.5+)

Action Parameters

category_id
integerRequired
org_unit_id
integerRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Get Quiz Questions

Description

Retrieves all questions in a quiz. returns an objectlistpage json block containing a list of questiondata blocks. requires oauth2 scope: - quizzing:quizzes:read available in api versions 1.75+ (lms v20.24.5+)

Action Parameters

org_unit_id
integerRequired
quiz_id
integerRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Get Roles

Description

Retrieves a list of all known user roles in d2l brightspace. returns a list of role data blocks containing the properties of all user roles that the calling user context has permission to manage. requires oauth2 scope: - role:detail:read available in api versions 1.46+ (lms v20.24.3+)

Action Parameters

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Get Role by ID

Description

Retrieves a particular user role from d2l brightspace by its id. requires oauth2 scope: - role:detail:read available in api versions 1.46+ (lms v20.24.3+)

Action Parameters

role_id
integerRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Get Users

Description

Retrieves data for one or more users from d2l brightspace. requires oauth2 scope: - users:userdata:read available in api versions 1.46+ (lms v20.24.3+) notes: - all search parameters (orgdefinedid, username, externalemail) are optional - returns paginated results when using bookmark parameter

Action Parameters

bookmark
string
externalEmail
string
orgDefinedId
string
userName
string

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Get User by ID

Description

Retrieves data for a particular user from d2l brightspace. requires oauth2 scope: - users:userdata:read available in api versions 1.46+ (lms v20.24.3+)

Action Parameters

user_id
stringRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Update Course Offering

Description

Updates an existing course offering in d2l brightspace. notes: - course code limitations: max 50 chars, no special chars: \ : * ? " < > | ' # , % & - startdate/enddate: null values won't overwrite existing dates - canselfregister: required for api v1.27+, not supported before v1.27 - description: ignored in api versions 1.25 and earlier requires oauth2 scope: - orgunits:course:update available in api versions 1.46+ (lms v20.24.3+)

Action Parameters

course_data
objectRequired
org_unit_id
integerRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Update Course Template

Description

Updates an existing course template in d2l brightspace. notes: - this action completely replaces the template's data with the provided values - course template code limitations: max 50 chars, no special chars: \ : * ? " < > | ' # , % & available in api versions 1.46+ (lms v20.24.3+)

Action Parameters

org_unit_id
integerRequired
template_data
objectRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Update Grade Object

Description

Updates a specific grade object. the grade object can be one of four types: 1. numeric: for numeric grades with max points 2. passfail: for pass/fail assessments 3. selectbox: for predefined grade options 4. text: for text-only feedback note: the provided data completely replaces the existing grade object's data. returns a gradeobject json block containing the updated grade object's data. requires oauth2 scope: - grades:gradeobjects:write available in api versions 1.75+ (lms v20.24.5+)

Action Parameters

grade_object
objectRequired
grade_object_id
integerRequired
org_unit_id
integerRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Update Grade Setup

Description

Updates the grades configuration for an org unit. expects a gradesetupinfo json block containing: - gradingsystem: the grading system type - isnullgradezero: whether null grades should be treated as zero - defaultgradeschemeid: id of the default grade scheme returns the updated gradesetupinfo json block. requires oauth2 scope: - grades:gradesettings:write available in api versions 1.75+ (lms v20.24.5+)

Action Parameters

org_unit_id
integerRequired
setup_info
objectRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Update Quiz

Description

Updates an existing quiz in d2l brightspace. notes: - this action updates only the provided quiz properties - numberofattemptsallowed must be between 1 and 10 (inclusive) or null for unlimited - password must not be empty or whitespace if provided - notificationemail must be a valid email address if provided - timelimitvalue: 0 for no limit (with isenforced false), or 1-9999 for enforced limit - deductionpercentage must be between 0 and 100 if provided - cannot restrict shared quizzes for special access - cannot set auto-submit for quizzes with mandatory questions - as of le api v1.71: - latelimitminutes is ignored - latesubmissionoption 1 is treated as 2 (autosubmitattempt) - submissiongraceperiod is not used - pagingtypeid added in le api v1.78 - date fields should be in utc format requires oauth2 scopes: - quizzing:quizzes:read - quizzing:quizzes:write available in api versions 1.75+ (lms v20.24.5+)

Action Parameters

org_unit_id
integerRequired
quiz_data
objectRequired
quiz_id
integerRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Update Quiz Category

Description

Updates an existing quiz category in d2l brightspace. returns a quizcategoryreaddata json block containing: - categoryid: the id of the category - name: the name of the category - sortorder: the sort order value requires oauth2 scopes: - quizzing:quizzes:read - quizzing:quizzes:write available in api versions 1.75+ (lms v20.24.5+)

Action Parameters

category_data
objectRequired
category_id
integerRequired
org_unit_id
integerRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Update User

Description

Updates an existing user entity in d2l brightspace. requires oauth2 scope: - users:userdata:update available in api versions 1.46+ (lms v20.24.3+) notes: - firstname and lastname update preferred names if set, otherwise update legal names - externalemail must be null or a valid email address - orgdefinedid must be unique across the organization if provided - pronouns: use empty string ("") to reset, null to keep existing value

Action Parameters

user_data
objectRequired
user_id
integerRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired