---
title: "Add a document user"
method: POST
path: "/documents.add_user"
tags: ["Documents"]
---

# Add a document user

`POST /documents.add_user`

This method allows you to add a user membership to the specified document.

## Request body

- object
  - `id` string, required — Unique identifier for the document. Either the UUID or the urlId is acceptable.
  - `userId` string, uuid, required
  - `permission` 'read' | 'read_write'

## Response `200`

OK

- object
  - `data` object
    - `users` User[]
      - `id` string, uuid — Unique identifier for the object.
      - `name` string — The name of this user, it is migrated from Slack or Google Workspace when the SSO connection is made but can be changed if neccessary.
      - `avatarUrl` string, uri — The URL for the image associated with this user, it will be displayed in the application UI and email notifications.
      - `email` string, email — The email associated with this user, it is migrated from Slack or Google Workspace when the SSO connection is made but can be changed if neccessary.
      - `role` 'admin' | 'member' | 'viewer' | 'guest'
      - `isSuspended` boolean — Whether this user has been suspended.
      - `lastActiveAt` string, date-time — The last time this user made an API request, this value is updated at most every 5 minutes.
      - `createdAt` string, date-time — The date and time that this user first signed in or was invited as a guest.
    - `memberships` Membership[]
      - `id` string — Unique identifier for the object.
      - `userId` string, uuid — Identifier for the associated user.
      - `collectionId` string, uuid — Identifier for the associated collection.
      - `permission` 'read' | 'read_write'

## Other responses

- `400` — The request failed one or more validations.
- `401` — The API key is missing or otherwise invalid.
- `403` — The current API key is not authorized to perform this action.
- `404` — The specified resource was not found.
- `429` — The request was rate limited.

## Changes

- **2024-10-18** `fdf2ec9c9df4` — 5 info
  - added the non-success response with the status `400`
  - added the non-success response with the status `401`
  - added the non-success response with the status `403`
  - added the non-success response with the status `404`
  - …1 more
- **2024-06-02** `661618fa1d42` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/defaulr/apis/outline-api/changes/documents.add_user/post.md)

---

[API](https://skmtc.dev/defaulr/apis/outline-api.md) · [All operations](https://skmtc.dev/defaulr/apis/outline-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/defaulr/outline-api/revisions/fdf2ec9c9df4/schema)
