> ## Documentation Index
> Fetch the complete documentation index at: https://docs.nekt.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Add Group Members

> Put people in a group, and hand them everything it holds.

Adds users to a group without touching the people already in it. They gain every grant the group holds, on all three permission axes, immediately — no permission call.

## Request body

| Parameter | Type              | Required | Description                                            |
| --------- | ----------------- | -------- | ------------------------------------------------------ |
| `users`   | array of integers | Yes      | User ids to add. Ids already in the group are ignored. |

```bash theme={null}
curl --request POST \
  --url https://api.nekt.ai/api/v1/organization/permission-groups/GROUP_ID/users/ \
  --header "x-api-key: YOUR_API_KEY" \
  --header "Content-Type: application/json" \
  --data '{"users": [12, 42]}'
```

## Response

`204`, with no body. Read the membership back with [List Members](/platform-api/permission-groups/members) if you need to confirm it.

## Invited users can be added before they accept

This is the middle step of onboarding, and it is why an invitation provisions the user immediately. Invite, group, and the grants are waiting for them the moment they accept.

```python theme={null}
import os

import requests

BASE_URL = "https://api.nekt.ai"
headers = {"x-api-key": os.environ["NEKT_API_KEY"], "Content-Type": "application/json"}

invite = requests.post(
    f"{BASE_URL}/api/v1/invitations/",
    headers=headers,
    json={"email": "analyst@example.com", "role": "member"},
)
invite.raise_for_status()

# They exist now, pending, and can hold access. Find their user id as a recipient.
recipients = requests.get(
    f"{BASE_URL}/api/v1/permission-recipients/",
    headers=headers,
    params={"expand[]": "users", "search": "analyst@example.com"},
).json()
user_id = recipients["users"][0]["id"]

requests.post(
    f"{BASE_URL}/api/v1/organization/permission-groups/GROUP_ID/users/",
    headers=headers,
    json={"users": [user_id]},
).raise_for_status()
```

<Tip>
  Invite as `member`. Owners and Admins bypass data-level permissions entirely, so grouping them changes nothing.
</Tip>

## Errors

| Status | When                                                                |
| ------ | ------------------------------------------------------------------- |
| `400`  | A user id belongs to a deactivated member.                          |
| `400`  | The group is the All group, which contains everybody automatically. |
| `403`  | Your API key was created by a Member.                               |
| `404`  | No group with that id in your workspace.                            |

## Related

* [Remove Members](/platform-api/permission-groups/remove-members) — the reverse.
* [Update a Group](/platform-api/permission-groups/update) — replacing the whole membership instead.
* [Onboarding flow](/platform-api/invitations/overview) — invite, group, and grant in one script.


## OpenAPI

````yaml POST /api/v1/organization/permission-groups/{permission_group_pk}/users/
openapi: 3.0.3
info:
  title: Nekt API
  version: v1
  description: Nekt API Documentation
  contact:
    email: support@nekt.ai
servers:
  - url: https://api.nekt.ai
security: []
paths:
  /api/v1/organization/permission-groups/{permission_group_pk}/users/:
    post:
      tags:
        - v1
      summary: Add users to a permission group
      operationId: v1_organization_permission_groups_users_create
      parameters:
        - in: path
          name: permission_group_pk
          schema:
            type: string
            format: uuid
          description: The permission group's id.
          required: true
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PermissionGroupUsers'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PermissionGroupUsers'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PermissionGroupUsers'
        required: true
      responses:
        '204':
          description: The users were added to the group.
      security:
        - ApiKeyAuth: []
components:
  schemas:
    PermissionGroupUsers:
      type: object
      properties:
        users:
          type: array
          items:
            type: integer
      required:
        - users
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: 'API Key authentication. Format: ''x-api-key: api_key'''

````