> ## 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.

# Update Course

> Update an existing Course record.

Updates an existing Course record. You must include the `Id` of the record to update along with all required fields.

## 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 **`Course-Edit`** role.
</Note>

## Enums

<Accordion title="eCourseVisibility — Visibility values">
  | Value | Name    |
  | ----- | ------- |
  | 1     | Public  |
  | 2     | Hidden  |
  | 3     | Private |
  | 4     | Paid    |
</Accordion>

## Request Body

### Required Fields

<ParamField body="Id" type="integer" required>
  The Id of the Course record to update.
</ParamField>

<ParamField body="BusinessId" type="integer" required>
  ID of the Location this course belongs to.
</ParamField>

<ParamField body="HostId" type="integer" required>
  ID of the coworker or administrator who hosts this course.
</ParamField>

<ParamField body="Title" type="string" required>
  Course title displayed on the Members Portal.
</ParamField>

<ParamField body="DisplayOrder" type="integer" required>
  Position of the course in listing pages; lower numbers appear first.
</ParamField>

<ParamField body="Visibility" type="integer" required>
  Access control for the course: Public (1), Hidden from listing but accessible via link (2), Private/invite-only (3), or Paid via TariffId (4).
</ParamField>

### Optional Fields

<ParamField body="SummaryText" type="string">
  Short summary displayed under the course title on the Members Portal (up to \~400 characters).
</ParamField>

<ParamField body="FullDescription" type="string">
  Full course description shown in the 'What's this course about?' section when customers open the course.
</ParamField>

<ParamField body="ShowOverview" type="boolean">
  Whether to display the overview section on the course page.
</ParamField>

<ParamField body="HasCommunityGroup" type="boolean">
  Whether the course has an associated community discussion group on the Members Portal.
</ParamField>

<ParamField body="OverviewText" type="string">
  Overview text displayed below the full description on the course page.
</ParamField>

<ParamField body="NewImageUrl" type="string">
  URL of a new thumbnail image to upload (JPG/JPEG, PNG, or GIF, max 10 MB).
</ParamField>

<ParamField body="ClearImageFile" type="boolean">
  Set to true to remove the existing thumbnail image.
</ParamField>

<ParamField body="NewLargeImageUrl" type="string">
  URL of a new banner/large image to upload (JPG/JPEG, PNG, or GIF, max 10 MB).
</ParamField>

<ParamField body="ClearLargeImageFile" type="boolean">
  Set to true to remove the existing banner/large image.
</ParamField>

<ParamField body="Active" type="boolean">
  Whether the course is active and available to customers.
</ParamField>

<ParamField body="GroupName" type="string">
  Optional group label used to cluster related courses together on the Members Portal.
</ParamField>

<ParamField body="ShowInHomePage" type="boolean">
  Whether the course is featured on the Members Portal home page.
</ParamField>

<ParamField body="TariffId" type="integer">
  ID of the pricing plan (tariff) required to access this course when Visibility is Paid.
</ParamField>

## Code Examples

<CodeGroup>
  ```bash cURL theme={null}
  curl -X PUT \
    "https://spaces.nexudus.com/api/content/courses" \
    -H "Authorization: Bearer YOUR_TOKEN" \
    -H "Content-Type: application/json" \
    -d '{
      "BusinessId": 0,
      "HostId": 0,
      "Title": "",
      "DisplayOrder": 0,
      "Visibility": 0,
      "Id": 87654321
  }'
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch(
    'https://spaces.nexudus.com/api/content/courses',
    {
      method: 'PUT',
      headers: {
        'Authorization': 'Bearer YOUR_TOKEN',
        'Content-Type': 'application/json'
      },
      body: JSON.stringify({
        BusinessId: 0,
        HostId: 0,
        Title: '',
        DisplayOrder: 0,
        Visibility: 0,
        Id: 87654321
      })
    }
  );

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

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

  response = requests.put(
      'https://spaces.nexudus.com/api/content/courses',
      headers={
          'Authorization': 'Bearer YOUR_TOKEN',
          'Content-Type': 'application/json'
      },
      json={
          'BusinessId': 0,
          'HostId': 0,
          'Title': '',
          'DisplayOrder': 0,
          'Visibility': 0,
          'Id': 87654321
      }
  )

  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 update.
</ResponseField>

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

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

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

```json Example Response theme={null}
{
  "Status": 200,
  "Message": "Course was successfully updated.",
  "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": "Title: is a required field",
  "Value": null,
  "Errors": [
    {
      "AttemptedValue": null,
      "Message": "is a required field",
      "PropertyName": "Title"
    }
  ],
  "WasSuccessful": false
}
```
