Auth API reference

Auth API · End-Users

post/v1/apps/{app_id}/end-users/bulk-deleteAuth

Bulk-delete accounts across a selection.

Deletes every matched account in one transaction. Each deleted account gets an `auth.account.deleted` audit row (`via: platform_bulk`) whose metadata carries the `selection` (`{ mode: "ids" }`, or `{ mode: "filter", filter }`), so a filter sweep reads as one. The workspace audit log gets one `auth.end_users.deleted` row with the count. `user.deleted` (`via: "platform_bulk"`) fires per account only when 100 or fewer were deleted.

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.

confirm_all_in_appboolean

Defence-in-depth confirmation for the destructive case where selection is `mode: 'filter'` with no `status` and no `search` (i.e. matches every account in the app). The server rejects that combination with 400 unless this flag is `true`. Set explicitly when you really mean "delete every end-user in this app".

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-delete
Authorization: Bearer YOUR_TOKEN
Content-Type: application/json

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

Response

{
  "affected_users": 0
}