HomeGuidesSamplesAPI
API

Associate users to folders

Add a list of one or more users to a list of one or more folders.

This endpoint allows you to add multiple users to multiple folders (sites) at once.

Examples

Add a user to multiple folders (sites)

curl -X POST "https://api.safetyculture.io/directory/v1/users/folders/membership" \
-H "Authorization: Bearer {api_token}" \
-d '{
  "assignments": {
    "090ab7e0-2781-48cd-aeb2-752e5de47d75": {
      "user_ids": [
        "6b0c862f-1649-4382-a0c6-ba063497a04c"
      ]
    },
    "3a943a96-124c-4d36-b224-17d53fda9243": {
      "user_ids": [
        "6b0c862f-1649-4382-a0c6-ba063497a04c"
      ]
    }
  }
}'

Add multiple users to a folder (site)

curl -X POST "https://api.safetyculture.io/directory/v1/users/folders/membership" \
-H "Authorization: Bearer {api_token}" \
-d '{
  "assignments": {
    "090ab7e0-2781-48cd-aeb2-752e5de47d75": {
      "user_ids": [
        "6b0c862f-1649-4382-a0c6-ba063497a04c",
        "eeb88ebc-8304-4816-b484-5543558b4aba",
        "99f79e18-c2de-4b78-9e83-218f057dc24c"
      ]
    },
  }
}'

Add multiple users to multiple folders (sites)

curl -X POST "https://api.safetyculture.io/directory/v1/users/folders/membership" \
-H "Authorization: Bearer {api_token}" \
-d '{
  "assignments": {
    "090ab7e0-2781-48cd-aeb2-752e5de47d75": {
      "user_ids": [
        "6b0c862f-1649-4382-a0c6-ba063497a04c",
        "eeb88ebc-8304-4816-b484-5543558b4aba",
        "99f79e18-c2de-4b78-9e83-218f057dc24c"
      ]
    },
    "3a943a96-124c-4d36-b224-17d53fda9243": {
      "user_ids": [
        "6b0c862f-1649-4382-a0c6-ba063497a04c",
        "eeb88ebc-8304-4816-b484-5543558b4aba"
      ]
    }
  }
}'
Language
Credentials
Bearer
Click Try It! to start a request and see the response here!