PUT
/
v1
/
users
/
groups
/
bulk
curl --request PUT \
  --url https://api.qobra.co/v1/users/groups/bulk \
  --header 'Content-Type: application/json' \
  --header 'X-API-Key: <api-key>' \
  --data '{
  "data": [
    {
      "user": "user-1@company.com",
      "group_dimension": "country",
      "group": "france",
      "start_date": "2023-01",
      "end_date": "2023-10"
    },
    {
      "user": "user-2@company.com",
      "manager": "manager-2@company.com"
    },
    "..."
  ]
}'
{
  "count": "<Upserted manager relationships count>",
  "data": [
    {
      "user": "user-1@company.com",
      "group_dimension": "country",
      "group": "france",
      "start_date": "2023-01",
      "end_date": "2023-10"
    },
    {
      "user": "user@company.com",
      "group_dimension": "country",
      "group": "belgium",
      "start_date": "2023-03",
      "end_date": null
    },
    "..."
  ]
}

Behavior

  • Transaction: If one group attribution is not parsable, we raise you an error and import nothing. You have to fix your payload and send it to us again. And if the answer is a success, it means that every group attribution you sent us have been upserted
  • Conflict Rule and upsert: Be careful, each user can only have one group by dimension for a given period. Given new attributions dates will override conflicting dates already present in Qobra. Also, if you send a payload with two groups attributions for the same user over the same period we’ll send you back an error.
  • Limit: you can’t update more than 200 group attributions at a time.
  • Error behavior: In case of any error, your group attributions wont be upserted

Authorizations

X-API-Key
string
header
required

Body

application/json

The body contains the user data necessary to create a new user in Qobra

The body is of type object.

Response

200
application/json

Success operation

The response is of type object.