Logins API

API for creating and viewing user logins under an account

List user logins PseudonymsController#index

GET /api/v1/accounts/:account_id/logins

GET /api/v1/users/:user_id/logins

Given a user ID, return that user's logins for the given account.

Request Parameters:

  • user[id]

    The ID of the user to search on.

API response field:

  • account_id

    The ID of the login's account.

  • id

    The unique, numeric ID for the login.

  • sis_user_id

    The login's unique SIS id.

  • unique_id

    The unique ID for the login.

  • user_id

    The unique ID of the login's user.

Example Response:

[
   { "account_id": 1, "id" 2, "sis_user_id": null, "unique_id": "belieber@example.com", "user_id": 2 }
]

Create a user login PseudonymsController#create

POST /api/v1/accounts/:account_id/logins

Create a new login for an existing user in the given account.

Request Parameters:

  • user[id]

    The ID of the user to create the login for.

  • login[unique_id]

    The unique ID for the new login.

  • login[password]

    The new login's password.

  • login[sis_user_id]

    SIS ID for the login. To set this parameter, the caller must be able to manage SIS permissions on the account.

Edit a user login PseudonymsController#update

PUT /api/v1/accounts/:account_id/logins/:id

Update an existing login for a user in the given account.

Request Parameters:

  • login[unique_id]

    The new unique ID for the login.

  • login[password]

    The new password for the login. Can only be set by an admin user if admins are allowed to change passwords for the account.

  • login[sis_user_id]

    SIS ID for the login. To set this parameter, the caller must be able to manage SIS permissions on the account.

Delete a user login PseudonymsController#destroy

DELETE /api/v1/users/:user_id/logins/:id

Delete an existing login.

Example Request:

curl https://<canvas>/api/v1/users/:user_id/logins/:login_id \ 
  -H "Authorization: Bearer <ACCESS-TOKEN>" \ 
  -X DELETE

Example Response:

{
  "unique_id": "bieber@example.com",
  "sis_user_id": null,
  "account_id": 1,
  "id": 12345,
  "user_id": 2
}