Assigning workspace permissions to a service account
Assign workspace permissions to a service account so that it could run tasks that belong to the related workspace.
Before you begin
- Ensure that the user that issues API calls has the Users - Manage permission. The ID of this permission is
TMC_USER_MANAGEMENT
.
About this task
In this section, the following API call is issued:
method: POST
endpoint: https://api.<env>.cloud.talend.com/security/workspaces/{workspaceId}/service-accounts/{serviceAccountId}/permissions
headers: {
"Content-Type": "application/json",
"Authorization": "Bearer <your_personal_access_token>"
}
payload: ["EXECUTE"]
It is implemented in Talend API Tester for demonstration purposes.
Procedure
-
Select POST from the Method list and in the field aside, enter the endpoint to be used:
https://api.<env>.cloud.talend.com/security/workspaces/{workspaceId}/service-accounts/{serviceAccountId}/permissions
and replace the placeholders with the correct values:Parameter Value workspaceId
Workspace for which you want to assign permissions. You can find the workspace ID with a GET
request onhttps://api.<env>.cloud.talend.com/orchestration/workspaces
. It also appears in Talend Cloud Management Console, in the URL of the Edit workspace page, after/worspaces/edit
.serviceAccountId
Service account to which you want to assign workspace permissions. The ID is randomly generated upon the creation of this service account. If you did not keep a copy of this ID, call GET /service-accounts
to get list of all service accounts and find the one to be used. -
Click Add header twice to add two rows and enter the following
key:value
pairs.Content-Type
:application/json
Authorization
:Bearer <your_personal_access_token>
-
In the BODY area, enter workspace permission to be assigned to this service account. In this example, the Execute permission is assigned.
["EXECUTE"]
-
Send the request.
Results
The permission is granted and the status code 201 is returned.