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

# Add Presence

Use this API to add users to the presence list for a document within an organization.

# Endpoint

`POST https://api.velt.dev/v2/presence/add`

# Headers

<ParamField header="x-velt-api-key" type="string" required>
  Your API key.
</ParamField>

<ParamField header="x-velt-auth-token" type="string" required>
  Your [Auth Token](/security/auth-tokens).
</ParamField>

# Body

#### Params

<ParamField body="data" type="object" required>
  <Expandable title="properties">
    <ParamField body="organizationId" type="string" required>
      Organization ID
    </ParamField>

    <ParamField body="documentId" type="string" required>
      Document ID
    </ParamField>

    <ParamField body="users" type="object[]" required>
      Array of user objects to add to presence.

      <Expandable title="properties">
        <ParamField body="userId" type="string" required>
          Unique identifier for the user.
        </ParamField>

        <ParamField body="name" type="string">
          Display name of the user.
        </ParamField>

        <ParamField body="email" type="string">
          Email address of the user.
        </ParamField>

        <ParamField body="status" type="string">
          Presence status of the user (e.g., `"online"`, `"away"`, `"offline"`).
        </ParamField>
      </Expandable>
    </ParamField>
  </Expandable>
</ParamField>

## **Example Requests**

#### Add a single user to presence

```JSON theme={null}
{
  "data": {
    "organizationId": "org-123",
    "documentId": "doc-456",
    "users": [
      {
        "userId": "user-1",
        "name": "User Name",
        "email": "user@example.com",
        "status": "online"
      }
    ]
  }
}
```

#### Add multiple users to presence

```JSON theme={null}
{
  "data": {
    "organizationId": "org-123",
    "documentId": "doc-456",
    "users": [
      {
        "userId": "user-1",
        "name": "User Name",
        "email": "user@example.com"
      },
      {
        "userId": "user-2",
        "name": "Another User",
        "email": "another@example.com",
        "status": "away"
      }
    ]
  }
}
```

# Response

#### Success Response

```JSON theme={null}
{
  "result": {
    "status": "success",
    "message": "Presence added successfully.",
    "data": {
      "success": true
    }
  }
}
```

#### Failure Response

```JSON theme={null}
{
  "error": {
    "message": "ERROR_MESSAGE",
    "status": "INVALID_ARGUMENT"
  }
}
```

<ResponseExample>
  ```js theme={null}
  {
    "result": {
      "status": "success",
      "message": "Presence added successfully.",
      "data": {
        "success": true
      }
    }
  }
  ```
</ResponseExample>
