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

# Share A Document With A User

Grant another user download access to a Document. The caller must be the document's uploader (or have org-level admin permission). The added user appears in the document's `downloaders` list.


## OpenAPI

````yaml POST /api/v1/documents/{id}/add_user
openapi: 3.1.0
info:
  description: >-
    The One Codex API (v1) -- programmatic access to One Codex's suite of
    microbial genomics data storage, analysis, and query tools.
  title: One Codex API (v1)
  version: v1
servers:
  - url: https://app.onecodex.com
security:
  - apiKeyAuth: []
paths:
  /api/v1/documents/{id}/add_user:
    post:
      summary: POST documents add_user
      operationId: post_documents_add_user
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              properties:
                user:
                  properties:
                    __DOLLAR_REF__:
                      example: /api/v1/users/a1b2c3d4e5f67890
                      format: uri
                      pattern: ^/api/v1/users/[a-f0-9]{16}$
                      type: string
                  type: object
              required:
                - user
              title: DocumentAddUserSchema
              type: object
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/documents'
          description: OK
components:
  schemas:
    documents:
      properties:
        $uri:
          example: /api/v1/documents/0d77065796f8d173
          pattern: ^/api/v1/documents/[a-f0-9]{16}$
          readOnly: true
          title: $Uri
          type: string
        created_at:
          description: >-
            Timestamp for when the object was created on the One Codex platform,
            encoded as a [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt)
            timestamp.
          format: date-time
          title: Created At
          type: string
        downloaders:
          description: >-
            An (optionally empty) array of references to users that the document
            has been shared with. These users are able to download (but not
            modify) the document.
          items:
            properties:
              __DOLLAR_REF__:
                example: /api/v1/users/a1b2c3d4e5f67890
                format: uri
                pattern: ^/api/v1/users/[a-f0-9]{16}$
                type: string
            title: users
            type: object
          title: Downloaders
          type: array
        filename:
          description: The document filename (e.g., "report.pdf")
          title: Filename
          type: string
        size:
          anyOf:
            - minimum: 1
              type: integer
            - type: 'null'
          description: The size of the document in bytes.
          title: Size
        uploader:
          description: >-
            A reference to the user that uploaded and owns the document, e.g.,
            `{"$ref": "/api/v1/users/5891ee65711c4d5e"}`. Only owners can modify
            a document (with some exceptions in the case of organization
            accounts configured for multiple users - please [contact
            us](mailto:support@onecodex.com) if you'd like to discuss this use
            case).
          properties:
            __DOLLAR_REF__:
              example: /api/v1/users/a1b2c3d4e5f67890
              format: uri
              pattern: ^/api/v1/users/[a-f0-9]{16}$
              type: string
          title: users
          type: object
      required:
        - $uri
        - created_at
        - downloaders
        - filename
        - size
        - uploader
      title: documents
      type: object
  securitySchemes:
    apiKeyAuth:
      in: header
      name: X-API-Key
      type: apiKey

````