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

# Profile sharing

> Give someone access to a profile, change their role, or revoke an invitation.

Only the owner can list members, invite someone, change roles, or revoke access. An `editor` can read and modify settings, and a `viewer` can read them. The owner also controls the profile name. Editors and viewers can [leave the profile](https://docs.nextdns.io/api-reference/profiles/delete.md).

## Invite someone

Send the recipient's email address and the role to grant (`editor` or `viewer`). NextDNS emails an invitation and returns the pending entry in `data`.

```bash theme={null}
curl -X POST "https://api.nextdns.io/profiles/$PROFILE_ID/access" \
  -H "X-Api-Key: $NEXTDNS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"email":"alex@example.com","role":"viewer"}'
```

```json theme={null}
{
  "data": {
    "email": "alex@example.com",
    "role": "viewer",
    "pending": true
  }
}
```

You can share a profile with up to 50 people, counting accepted members and pending invitations and excluding the owner. At the limit, inviting a new address returns HTTP `400` with `{"code":"listLimitExceeded","list":"access","limit":50}` in the `errors` array. Inviting an address that already belongs to the profile or has a pending invitation returns HTTP `200` with error code `duplicate`, even when the profile is full.

## Manage access

| Request | Result |
| - | - |
| `GET /profiles/{profile}/access` | Lists editors and viewers, followed by pending invitations. Each entry in `data` contains `email`, `role`, and `pending`. |
| `PATCH /profiles/{profile}/access/{email}` | Changes a member's or invitee's role. Send `{"role":"editor"}` or `{"role":"viewer"}`. An address with no matching membership or invitation returns HTTP `404`. |
| `DELETE /profiles/{profile}/access/{email}` | Removes a member or cancels a pending invitation. If the address has already been removed, the request still succeeds. |

URL-encode the email address in the path. Both `PATCH` and `DELETE` return **204 No Content** on success.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.