> For the complete documentation index, see [llms.txt](https://docs.groundcover.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.groundcover.com/reference/remote-access-and-apis/api-examples/members-api.md).

# Member Management API

Invite workspace members and update member roles.

Invite workspace members and update member roles.

## Authentication

Admin permissions are required for all operations on this page. Set `GC_API_KEY` to an API key with the required permissions and `GC_BACKEND_ID` to the backend ID. Every example sends both headers. For self-hosted deployments, replace `https://api.groundcover.com` with your API URL.

## Invite members

**POST** `/api/rbac/member/invite`

The body contains `members`, an array of objects with `email` and either a role (`read`, `write`, `admin`) or `policyUUIDs`. Use policy UUIDs for custom/scoped access.

```bash
curl --request POST \
  --url "https://api.groundcover.com/api/rbac/member/invite" \
  --header "Authorization: Bearer $GC_API_KEY" \
  --header "X-Backend-Id: $GC_BACKEND_ID" \
  --header "Content-Type: application/json" \
  --data '{
  "members": [
    {
      "email": "reader@example.com",
      "role": "read"
    }
  ]
}'
```

Success returns HTTP `200` with no body. Requests are subject to seat limits and workspace access rules. A seat-limit failure returns `401` with `{"message":"max seats reached"}`. Invitations are processed individually; an error can occur after earlier members were invited.

## Update roles

**POST** `/api/rbac/member/update`

```bash
curl --request POST \
  --url "https://api.groundcover.com/api/rbac/member/update" \
  --header "Authorization: Bearer $GC_API_KEY" \
  --header "X-Backend-Id: $GC_BACKEND_ID" \
  --header "Content-Type: application/json" \
  --data '{
  "members": [
    {
      "email": "reader@example.com",
      "role": "write"
    }
  ]
}'
```

Every item requires `email` and `role`. Success returns HTTP `200` with member objects containing fields such as `email`, `roleType`, `owner`, `created`, `lastSeen`, and `firstLogin`. An administrator cannot change their own administrator role through this operation. A batch can partially succeed before an error is returned; re-read member state before retrying.

For custom policies, use [Apply policies to users](https://docs.groundcover.com/reference/remote-access-and-apis/api-examples/rbac-policies-api.md#apply-to-users). See also [List Seats Usage](https://docs.groundcover.com/reference/remote-access-and-apis/api-examples/list-seats-usage.md) and [Remove Member](https://docs.groundcover.com/reference/remote-access-and-apis/api-examples/remove-member.md).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.groundcover.com/reference/remote-access-and-apis/api-examples/members-api.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
