---
title: "Index membership"
method: POST
path: "/api/index/v1/indexmembership"
tags: ["Permissions"]
---

# Index membership

`POST /api/index/v1/indexmembership`

Add the memberships of a group in the datasource.

## Request body

- IndexMembershipRequest — Describes the request body of the /indexmembership API call
  - `version` integer — Version number for document for optimistic concurrency control. If absent or 0 then no version checks are done.
  - `datasource` string, required — The datasource for which the membership is added
  - `membership` DatasourceMembershipDefinition, required — describes the membership row of a group. Only one of memberUserId and memberGroupName can be specified.
    - `groupName` string, required — The group for which the membership is specified
    - `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.dev/gleanwork/apis/glean-api-2.md) · [All operations](https://skmtc.dev/gleanwork/apis/glean-api-2/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/gleanwork/glean-api-2/revisions/8516a7bdcc02/schema)
