---
title: "Bulk index users"
method: POST
path: "/api/index/v1/bulkindexusers"
tags: ["Permissions"]
---

# Bulk index users

`POST /api/index/v1/bulkindexusers`

Replaces the users in a datasource using paginated batch API calls. Please refer to the [bulk indexing](https://developers.glean.com/indexing/documents/bulk-upload-model) documentation for an explanation of how to use bulk endpoints.
Note: Any users deleted from the existing set will have their associated memberships deleted as well.

## Request body

- BulkIndexUsersRequest — Describes the request body for the /bulkindexusers API call
  - `uploadId` string, required — Unique id that must be used for this instance of datasource users upload
  - `isFirstPage` boolean — true if this is the first page of the upload. Defaults to false
  - `isLastPage` boolean — true if this is the last page of the upload. Defaults to false
  - `forceRestartUpload` boolean — Flag to discard previous upload attempts and start from scratch. Must be specified with isFirstPage=true
  - `datasource` string, required — datasource of the users
  - `users` DatasourceUserDefinition[], required — batch of users for the datasource
    - `email` string, required
    - `userId` string — To be supplied if the user id in the datasource is not the email
    - `name` string, required
    - `isActive` boolean — set to false if the user is a former employee or a bot
  - `disableStaleDataDeletionCheck` boolean — True if older user data needs to be force deleted after the upload completes. Defaults to older data being deleted only if the percentage of data being deleted is less than a reasonable threshold. This must only be set when `isLastPage = true`

## Response `200`

OK

## Other responses

- `400` — Bad Request
- `401` — Not Authorized
- `409` — Conflict

---

[API](https://skmtc.dev/gleanwork/apis/glean-indexing-api.md) · [All operations](https://skmtc.dev/gleanwork/apis/glean-indexing-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/gleanwork/glean-indexing-api/revisions/b47bf641faba/schema)
