Development documentation Help

Users

This resource provides access to users.

Description

Resource

/api/v2/users/

Returned entry

User

Supported methods

Supported sub-resources

  • /users/{id}/: Actions with a specific user.

  • /users/external_id/{external_id}/: Actions with a specific user by external ID.

User object

Represents a user entity in the LMS.

User fields

The table describes fields of the User object.

Field

Type

Description

id

integer

The unique identifier of the user in the LMS.

address

string

Part of the user's address: address line 1.

address2

string

Part of the user's address: address line 2.

city

string

Part of the user's address: city.

country

string

Part of the user's address: country. ISO 3166-1 alpha-2 (see link).

createdDate

datetime

User creation date.

email

string

User's email.

externalId

string

A unique identifier in the external system. Can be used by the caller to simplify integration with the LMS.

firstName

string

User's first name.

lastName

string

User's last name.

loginName

string

User's login name.

state

string

Part of the user's address: state. 2-letter US state or territory abbreviation code from the ANSI standard INCITS 38:2009 (see link).

updatedDate

string

User update date.

zip

string

User's address postal code.

Read user list

Get a list of users.

Request

GET {LMS_URL}/api/v2/users/

Request parameters

Parameter

Type

Description

offset

integer

The number of records to skip before starting to collect the result set.

limit

integer

The number of records to return.

groupId

integer

Selects only users belonging to this group or its subgroups.

createdAfter

string ($ISO 8601 UTC)

Select only records created after the specified date.

updatedAfter

string ($ISO 8601 UTC)

Select only records updated after the specified date.

Response

The method returns an array of User objects.

Examples

Request URL

https://lms.example.com/api/v2/users/?offset=0&limit=100

Curl

curl -X 'GET' \ 'https://lms.example.com/api/v2/users/?offset=0&limit=100' \ -H 'accept: application/json'

Get user

Read a specific user information.

Request

GET /api/v2/users/{id}/

Request parameters

Parameter

Type

Description

id

integer

User ID.

Example

This is an example of reading information about a specific user account.

Request URL

https://lms.example.com/api/v2/users/1523/

Response body

{ "id": "1523", "email": "jsmith@example.com", "firstName": "John", "lastName": "Smith", "address": "1 Main street", "address2": "", "city": "Columbus", "state": "OH", "zip": "43215", "country": "US", "expirationDate": "", "externalId": "", "createdDate": "2024-01-15T14:58:41Z", "updatedDate": "2024-02-01T10:25:01Z" }

Curl

curl -X 'GET' \ 'https://lms.example.com/api/v2/users/1523/' \ -H 'accept: application/json'

Create user

Add a new user account.

Required fields: email, firstName, lastName, loginName.

Request

POST {LMS_URL}/api/v2/users/

Request body

The body of the request is a User object. You must include all required fields. Optional fields can be omitted from the request.

Response

The method returns a User object containing all fields.

Example

This is an example of creating a user John Smith with login jsmith and email address jsmith@example.com.

Request URL

https://lms.example.com/api/v2/users/

Request body

{ "email": "jsmith@example.com", "firstName": "John", "lastName": "Smith", "loginName": "jsmith" }

Response body

{ "id": 1523, "email": "jsmith@example.com", "firstName": "John", "lastName": "Smith", "address": "1 Main street", "address2": "", "city": "Columbus", "state": "OH", "zip": "43215", "country": "US", "expirationDate": "", "externalId": "", "createdDate": "2024-01-15T14:58:41Z", "updatedDate": "2024-02-01T10:25:01Z" }

Curl

curl -X 'POST' \ 'https://lms.example.com/api/v2/users/' \ -H 'accept: application/json' \ -H 'Content-Type: application/json' \ -d '{ "email": "jsmith@example.com", "firstName": "John", "lastName": "Smith", "loginName": "jsmith" }'

Update user

Update an existing user account.

Required fields: email, firstName, lastName, loginName.

Request

POST {LMS_URL}/api/v2/users/{id}/

Request parameters

Parameter

Type

Description

id

integer

User ID.

Request body

The body of the request is a User object. You must include all required fields. Optional fields can be omitted from the request.

Response

The method returns a user object containing all fields.

Example

This is an example of updating a user's city field.

Request URL

https://lms.example.com/api/v2/users/1523/

Request body

{ "city": "Dublin" }

Response body

{ "id": 1523, "email": "jsmith@example.com", "firstName": "John", "lastName": "Smith", "address": "1 Main street", "address2": "", "city": "Columbus", "state": "OH", "zip": "43215", "country": "US", "expirationDate": "", "externalId": "", "createdDate": "2024-01-15T14:58:41Z", "updatedDate": "2024-02-01T10:25:01Z" }

Curl

curl -X 'POST' \ 'https://lms.example.com/api/v2/users/1523/' \ -H 'accept: application/json' \ -H 'Content-Type: application/json' \ -d '{ "city": "Dublin" }'

Delete user

This method marks the user account as deleted.

Request

DELETE {LMS_URL}/api/v2/users/{id}/

Request parameters

Parameter

Type

Description

id

integer

User ID.

Response

The method returns HTTP code 204 if the user account was successfully deleted.

Example

This is an example of deleting a user account.

Request URL

https://lms.example.com/api/v2/users/1523/

Curl

curl -X 'DELETE' \ 'https://lms.example.com/api/v2/users/1523/' \ -H 'accept: application/json'
Last modified: 06 January 2025