Last updated Apr 1, 2024

Update managed SCIM email addresses

In the following example scripts, replace the bearer token with the organization API token, the orgId with the orgId provided, and the aaIdList with values of AAID that you want to replace (a single AAID can be used). This will call the Delete User in DB Admin API for multiple accountIds.

See more about how to use this in the guide.


Node JS (Click to expand)
1
2
  const fetch = require('node-fetch');
  var bearer = "BearerToken";
  var orgId = "orgId";
  var aaIdList = [
      "aaId1",
      "aaId2"
  ]
  var requestOptions = {
  method: 'DELETE',
  headers: {
      "Authorization": `Bearer ${bearer}`
  },
  redirect: 'follow'
  };
  for (const aaId of aaIdList) {
      fetch(`https://api.atlassian.com/admin/user-provisioning/v1/org/${orgId}/user/${aaId}/onlyDeleteUserInDB`, requestOptions)
      .then(response => console.log(`Deleted User in SCIM DB with response: ${response.status}`))
      .catch(error => console.log('error', error));
  }

Python (Click to expand)
1
2
  import requests
  org_id = "org_id"
  bearer = "bearer_token"
  aaid_list = [
      "aaId1",
      "aaId2"
  ]
  for aaid in aaid_list:
      url = "https://api.atlassian.com/admin/user-provisioning/v1/org/{0}/user/{1}/onlyDeleteUserInDB".format(org_id, aaid)
      headers = {
          'Authorization': 'Bearer {}'.format(bearer)
      }
      response = requests.request("DELETE", url, headers=headers)
      print("Deleted User in SCIM DB with response {}".format(response))

Bash (Click to expand)
1
2
  #! /bin/bash
  ORG_ID="orgId"
  BEARER_TOKEN="bearerToken"
  AAIDLIST=(
  "aaId1"
  "aaId2"
  )
  function deleteInScimDB ()
  {
      local aaId=$1
      curl --request DELETE \
      "https://api.atlassian.com/admin/user-provisioning/v1/org/$ORG_ID/user/$aaId/onlyDeleteUserInDB" \
      --header "Authorization: Bearer $BEARER_TOKEN"
  }
  for user in "${AAIDLIST[@]}"; do
      deleteInScimDB $user
      echo "Finsihed deleting scim user in db $user"
  done

Rate this page: