Auth API reference

Auth API · End-Users

post/v1/apps/{app_id}/end-users/bulk-update-roleAuth

Bulk-assign a role across a selection.

Path parameters

app_id*string

Id of the app.

Request body

selection*object
mode*enum (2)

Selection strategy. `ids` operates on an explicit list of account ids (capped at 5,000). `filter` operates on every account matching the same status / search filter the list endpoint exposes — uncapped.

idsarray

Required when mode=ids. Account ids to operate on.

statusenum (3)

mode=filter only. Same status filter as GET /end-users.

searchstring

mode=filter only. Same search filter as GET /end-users.

signalenum (5)

mode=filter only. Same risk-signal filter as GET /end-users. Present so a bulk operation acts on exactly the rows the operator was looking at — omitting it would silently widen the selection to every account in the app.

providerstring

mode=filter only. Same provider filter as GET /end-users. Carried for the same reason as `signal`: the server re-resolves the set at send time, so omitting it widens the operation past what the operator was looking at.

role_name*string

Role name to assign to all selected users

Example: "member"

Response · 200

affected_users*number

Number of accounts (distinct ids) affected by the bulk write.

Example

Request

POST https://api.auth.productcraft.co/v1/apps/{app_id}/end-users/bulk-update-role
Authorization: Bearer YOUR_TOKEN
Content-Type: application/json

{
  "selection": {
    "mode": "ids",
    "ids": [
      "string"
    ],
    "status": "active",
    "search": "string",
    "signal": "unverified",
    "provider": "string"
  },
  "role_name": "member"
}

Response

{
  "affected_users": 0
}