Assign or unassign delegates via API

Assigning a delegate enables any user in your organization to manage any other user, while unassigning a delegate removes this possibility. There are two ways to unassign delegates in the Learn365 API:

Later, you can restore the deleted assignment for a specific team member.

For more information about delegates, see this article.

 

Assign a delegate

POST /services/users/v2/Delegates

This request enables you to assign a delegate to a team member. 

Currently, it’s possible to assign one delegate to one team member via one request. To assign a delegate to multiple team members, send a separate request for each assignment.

 

Pre-conditions

To send the request, you'll need an API key.

It’s worth checking what delegate assignments are already in your organization. To get a list of current delegates and their team members, send the GET /services/users/v2/Delegates request. For more information about this request, see this article.

To assign a delegate to a team member, you’ll need user IDs for both. You can find this via API by following the steps in this article.

 

Request body parameters

The body object contains two required parameters:

  • delegateId (string). The user ID of a delegate.
  • teamMemberId (string). The user ID of the team member who will be managed by the delegate.

 

Request example


POST /services/users/v2/Delegates
{
"delegateId": "7853ce01-9a6f-4e07-a3e0-1e3a578655d7",
"teamMemberId": "8a47813f-62c7-4a6f-a721-496692347c14"
}

 

Response body parameters

The successful 201 response contains these parameters:

  • delegateId (string). The user ID of a delegate.
  • teamMemberId (string). The user ID of the team member who is now managed by the delegate.
  • isDeleted (boolean). States whether the delegate assignment was deleted (true) or not (false).

 

Response example

The successful 201 response returns the body similar to this:


{
 "delegateId": "7853ce01-9a6f-4e07-a3e0-1e3a578655d7",
 "teamMemberId": "8a47813f-62c7-4a6f-a721-496692347c14",
 "isDeleted": false
}


Unassign a delegate from all their team members

DELETE /services/users/v2/Delegates/{delegateId}

This request enables you to unassign a delegate from all their team members.

 

Pre-conditions

To send the request, you'll need an API key.

It’s worth checking what team members are currently assigned to the delegate. To get a list of delegates and their team members, send the GET /services/users/v2/Delegates request. The response also includes the delegateId parameter. You'll need this delegate ID to unassign the delegate. For more information about this request, see this article.

 

Path parameter

  • delegateId (string). The user ID of a delegate.

 

Request example


DELETE /services/users/v2/Delegates/7853ce01-9a6f-4e07-a3e0-1e3a578655d7

 

Response

A 204 response without a body means a successful request. 

The assignments removed from the delegate are still listed in the response to the GET /services/users/v2/Delegates request with the isDeleted parameter set to true.

Later, you can restore these assignments one by one

 

Unassign a specific team member from a delegate

DELETE /services/users/v2/Delegates/{delegateId}/members/{teamMemberId}

This request enables you to unassign a specific team member from a specific delegate.

 

Pre-conditions

To send the request, you'll need an API key.

To unassign a team member from a delegate, you’ll need user IDs for both. To find them: 

1. Send the GET /services/users/v2/Delegates request. For more information about this request, see this article.

2. In the response, find the delegateId and teamMemberId of the required delegate and team member, respectively.

 

Path parameters

  • delegateId (string). The user ID of a delegate.
  • teamMemberId (string). The user ID of a team member.

 

Request example


DELETE /services/users/v2/Delegates/8a47813f-62c7-4a6f-a721-496692347c14/
members/60118dd9-4cde-4848-b954-bc895c6393dd

 

Response

A 204 response without a body means a successful request. 

The assignments removed from the delegate are still listed in the response to the GET /services/users/v2/Delegates request with the isDeleted parameter set to true.

Later, you can restore this specific assignment.

 

Restore a deleted assignment for a specific team member

PATCH /services/users/v2/Delegates/{delegateId}/members/{teamMemberId}/update

This request enables you to restore a previously deleted assignment for a specific delegate and a specific team member.

 

Pre-conditions

To send the request, you'll need an API key.

To restore the assignment for a specific delegate and a specific team member, you’ll need user IDs for both. To find them: 

1. Send the GET /services/users/v2/Delegates request. For more information about this request, see this article.

2. In the response, find the delegateId and teamMemberId of the required delegate and team member, respectively.

To make sure the assignment for a specific delegate and a specific team member is currently deleted:

1. Send the GET /services/users/v2/Delegates/{delegateId}/members/{teamMemberId} request with the delegate and team member IDs as path parameters.

2. In the response, check if the isDeleted parameter is set to true.

 

Path parameters

  • delegateId (string). The user ID of a delegate.
  • teamMemberId (string). The user ID of a team member.

 

Request example


PATCH /services/users/v2/Delegates/8a47813f-62c7-4a6f-a721-496692347c14/
members/60118dd9-4cde-4848-b954-bc895c6393dd/update

 

Response

A 204 response without a body means a successful request. The assignment is active again.

 

Was this article helpful?
0 out of 0 found this helpful

Comments

Article is closed for comments.