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

# Create CommunityThread

> Create a new CommunityThread record.

A Discussion Board conversation is an opening message with replies that customers can follow; a community group or private guest list controls who can access it.

## Authentication

<Note>
  This endpoint requires OAuth2 authentication. Include a valid bearer token in the `Authorization` header.
  The authenticated user must be a full unrestricted administrator or have the **`CommunityThread-Create`** role.
</Note>

## Request Body

### Required Fields

<ParamField body="BusinessId" type="integer" required>
  ID of the location this Discussion Board conversation belongs to.
</ParamField>

<ParamField body="UserId" type="integer" required>
  ID of the user account that authors this conversation.
</ParamField>

<ParamField body="Subject" type="string" required>
  Required title or topic of the Discussion Board conversation.
</ParamField>

<ParamField body="Message" type="string" required>
  Required body text of the opening message in this conversation.
</ParamField>

### Optional Fields

<ParamField body="CommunityGroupId" type="integer">
  Optional ID of the community group that controls access to this conversation; its Public, Restricted, or Private access level applies in addition to this thread's Private setting.
</ParamField>

<ParamField body="CoworkerId" type="integer">
  Optional ID of the customer profile displayed as the author; when omitted on creation, Nexudus uses the author's matching customer profile at the location.
</ParamField>

<ParamField body="InstantDelivery" type="boolean">
  Whether to notify followers about this new conversation immediately instead of waiting for their scheduled digest.
</ParamField>

<ParamField body="Tags" type="string">
  Comma-separated search tags that help customers find this conversation.
</ParamField>

<ParamField body="Private" type="boolean">
  Whether this conversation is visible only to its author and the users in Guests; a private community group also restricts visibility regardless of this setting.
</ParamField>

<ParamField body="Guests" type="integer[]">
  List of user IDs allowed to read this thread when Private is true; an assigned community group's members are added automatically when the thread is created.
</ParamField>

<ParamField body="IncludeZoomInvite" type="boolean">
  Whether to create a Zoom meeting and attach its invite when this conversation is created.
</ParamField>

<ParamField body="ZoomEventData" type="string">
  Internal JSON payload containing Zoom meeting details generated and maintained by the Zoom integration.
</ParamField>

## Code Examples

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST \
    "https://spaces.nexudus.com/api/community/communitythreads" \
    -H "Authorization: Bearer YOUR_TOKEN" \
    -H "Content-Type: application/json" \
    -d '{
      "BusinessId": 0,
      "UserId": 0,
      "Subject": "",
      "Message": ""
  }'
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch(
    'https://spaces.nexudus.com/api/community/communitythreads',
    {
      method: 'POST',
      headers: {
        'Authorization': 'Bearer YOUR_TOKEN',
        'Content-Type': 'application/json'
      },
      body: JSON.stringify({
        BusinessId: 0,
        UserId: 0,
        Subject: '',
        Message: ''
      })
    }
  );

  const data = await response.json();
  ```

  ```python Python theme={null}
  import requests

  response = requests.post(
      'https://spaces.nexudus.com/api/community/communitythreads',
      headers={
          'Authorization': 'Bearer YOUR_TOKEN',
          'Content-Type': 'application/json'
      },
      json={
          'BusinessId': 0,
          'UserId': 0,
          'Subject': '',
          'Message': ''
      }
  )

  data = response.json()
  ```
</CodeGroup>

## Response

### 200

<ResponseField name="Status" type="integer">
  HTTP status code. `200` on success.
</ResponseField>

<ResponseField name="Message" type="string">
  A human-readable message confirming the creation.
</ResponseField>

<ResponseField name="Value" type="object">
  Contains the `Id` of the newly created record.
</ResponseField>

<ResponseField name="WasSuccessful" type="boolean">
  `true` if the communitythread was created successfully.
</ResponseField>

<ResponseField name="Errors" type="array">
  `null` on success.
</ResponseField>

```json Example Response theme={null}
{
  "Status": 200,
  "Message": "CommunityThread was successfully created.",
  "Value": {
    "Id": 87654321
  },
  "OpenInDialog": false,
  "OpenInWindow": false,
  "RedirectURL": null,
  "JavaScript": null,
  "UpdatedOn": "2025-01-15T10:30:00Z",
  "UpdatedBy": "admin@example.com",
  "Errors": null,
  "WasSuccessful": true
}
```

### 400

<ResponseField name="Message" type="string">
  A summary of the validation error(s), in the format `PropertyName: error message`.
</ResponseField>

<ResponseField name="Value" type="any">
  `null` on validation failure.
</ResponseField>

<ResponseField name="Errors" type="object[]">
  Array of validation errors.

  <Expandable>
    <ResponseField name="AttemptedValue" type="any">
      The value that was submitted for the field, or `null` if missing.
    </ResponseField>

    <ResponseField name="Message" type="string">
      The validation error message.
    </ResponseField>

    <ResponseField name="PropertyName" type="string">
      The name of the property that failed validation.
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="WasSuccessful" type="boolean">
  `false` when the request fails validation.
</ResponseField>

```json Example Response theme={null}
{
  "Message": "Subject: is a required field",
  "Value": null,
  "Errors": [
    {
      "AttemptedValue": null,
      "Message": "is a required field",
      "PropertyName": "Subject"
    }
  ],
  "WasSuccessful": false
}
```
