---
title: "Bulk index memberships for a group"
method: POST
path: "/api/index/v1/bulkindexmemberships"
tags: ["Permissions"]
---

# Bulk index memberships for a group

`POST /api/index/v1/bulkindexmemberships`

Replaces the memberships for a group 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.

## Request body

- BulkIndexMembershipsRequest — Describes the request body for the /bulkindexmemberships API call
  - `uploadId` string, required — Unique id that must be used for this instance of datasource group memberships 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 memberships
  - `group` string — group who's memberships are specified
  - `memberships` DatasourceBulkMembershipDefinition[], required — batch of memberships for the group
    - `memberUserId` string — If the member is a user, then the email or datasource id for the user
    - `memberGroupName` string — If the member is a group, then the name of the member group

## Response `200`

OK

## Other responses

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

---

[API](https://skmtc.net/gleanwork/apis/glean-api-2.md) · [All operations](https://skmtc.net/gleanwork/apis/glean-api-2/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/gleanwork/glean-api-2/versions/c4ae998a3802/schema)
