Skip to main content Skip to complementary content

Using API to create a user

You can use the user management API to create users.

Before you begin

  • Generate access tokens:

    Once generated, a service account token expires after 30 minutes. If it expires, generate a new token using the POST method at the endpoint https://api.<env>.cloud.talend.com/security/oauth/token. For more information about generating a token, see Generating a service account token.

  • Ensure that the user or the service account to be used to issue API calls has the Users - Management permissions.

About this task

In this section, Talend API Tester is used to demonstrate how to issue API calls to create users.

Procedure

  1. Open Talend API Tester in your browser and select GET from the Method list.
  2. In the field next to the Method drop-down list, enter the user management endpoint to be used: https://api.<your_environment>.cloud.talend.com/scim/v2/Roles
    Your environment could be:
    • eu
    • us
    • us-west
    • ap
    • au
  3. In the HEADERS area, click Add header and in the name field that is displayed, enter Authorization and in the value field, enter Bearer and your token. Enter a whitespace to separate Bearer and the token.
  4. Click Send to issue your call to obtain the role IDs to be assigned to the user to be created.
    The response lists, in the id field, the roles already defined for your Talend Cloud applications. Note down the role IDs to be assigned to the user to be created.

    The entitlement field displays the permission details added to a given role.

  5. Select POST from the Method list and in the field aside, enter the user management endpoint to be used: https://api.<your_environment>.cloud.talend.com/scim/v2/Users
  6. Click Add header. In the name field that is displayed, enter Content-Type and in the value field, enter application/json.
  7. Click Add header again and in the name field that is displayed, enter Authorization and in the value field, enter Bearer and your personal access token or the service account access token. Enter a whitespace to separate Bearer and the token.
  8. In the BODY area, enter the profile of the user to be created.

    Example

    {
      "schemas": [
        "urn:ietf:params:scim:schemas:core:2.0:User"
      ],
      "userName": "user_name_of_your_choice, for example, ychen",
      "password": "initial_password_for_this_user",
      "name": {
        "familyName": "family_name",
        "givenName": "given_name"
      },
      "preferredLanguage": "en",
      "timezone": "Europe/Paris",
      "active": true,
      "emails": [
        {
          "value": "example@company.com",
          "display": "example@company.com",
          "primary": true
        }
      ],
      "roles": [
        {
          "value": "3906e686-5ddd-47de-8e9f-ecae7ec9e6b2"
        }
      ]
    }
  9. Click Send to issue your call.

Results

The creation is accomplished successfully and the status code 201 is returned. In the BODY field of the response, the details of this created user are displayed.

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 – please let us know!