Skip to main content Skip to complementary content
Close announcements banner

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.

The API to be used is https://api.<env>.cloud.talend.com/security/workspaces/{workspaceId}/service-accounts/{serviceAccountId}/permissions.

Information noteNote: Only one service account is used in this example. If you need to add permissions to a batch of service accounts, use https://api.<env>.cloud.talend.com/security/service-accounts/permissions/batch

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

  1. 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

    Example

    The POST method is selected and the endpoint is specified.
    In this endpoint, serviceAccountId identifies the service account to which you want to assign workspace permissions.
    Information noteNote: This ID was randomly generated upon the creation of this service account. If you did not keep a copy of this ID, call GET /account/service-accounts to get list of all service accounts and find the one to be used by names.
    The workspaceId field indicates the workspace to which the task to be run belongs. You can obtain it through a API request or find it in Talend Management Console.
    • APIs:
      • use GET at the https://api.<env>.cloud.talend.com/orchestration/workspaces for workspaces
    • In Talend Management Console, open the artifact list from the workspace and then open an artifact. The ID of the workspace appears in the URL of the Edit workspace page.
      The ID of the workspace in the URL of the "Edit workspace" page.
  2. Click Add header twice to add tow rows and enter the following key:value pairs.
    • Content-Type : application/json.
    • Authorization : Bearer <your_personal_access_token>
  3. In the BODY area, enter workspace permission to be assigned to this service account. In this example, the Execute permission is assigned.

    Example

    ["EXECUTE"]
  4. Send and save the request.

Results

The permission is granted and the status code 201 is returned.

Did this page help you?

If you find any issues with this page or its content – a typo, a missing step, or a technical error – let us know how we can improve!