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

# Update program

> Update program name, website, settings, and portal configuration via API.

## Endpoint

```
PUT https://api.partnero.com/v1/program
```

Update program details, settings, and portal configuration. Available fields depend on the program type.

## Request body

**Common fields**

| Parameter | Type   | Required | Description                                   |
| --------- | ------ | -------- | --------------------------------------------- |
| `name`    | string | No       | Program name (max 255 characters)             |
| `website` | string | No       | Program landing page URL (max 250 characters) |

**Affiliate program settings** (`program_settings`)

| Parameter                             | Type    | Description                                    |
| ------------------------------------- | ------- | ---------------------------------------------- |
| `currency`                            | string  | 3-letter currency code (e.g., `USD`, `EUR`)    |
| `cookie_lifetime`                     | integer | Referral cookie duration in days (1–9,999,999) |
| `welcome_email_enabled`               | boolean | Send welcome email to new partners             |
| `onboarding_enabled`                  | boolean | Enable partner onboarding flow                 |
| `partner_email_notifications_enabled` | boolean | Enable email notifications for partners        |

**Affiliate portal settings** (`portal_settings`)

| Parameter                    | Type    | Description                     |
| ---------------------------- | ------- | ------------------------------- |
| `program_page_enabled`       | boolean | Enable the public program page  |
| `leads_page_enabled`         | boolean | Enable the lead submission page |
| `registration_disabled`      | boolean | Disable portal registration     |
| `google_login_enabled`       | boolean | Enable Google login/signup      |
| `passwordless_login_enabled` | boolean | Enable passwordless (OTP) login |
| `sub_accounts_enabled`       | boolean | Enable partner sub-accounts     |
| `widget_enabled`             | boolean | Enable the portal widget        |
| `signup_popup_enabled`       | boolean | Enable signup pop-up form       |
| `embeddable_form_enabled`    | boolean | Enable embeddable signup form   |

**Refer-a-friend program settings** (`program_settings`)

| Parameter                      | Type    | Description                     |
| ------------------------------ | ------- | ------------------------------- |
| `referral_portal_enabled`      | boolean | Enable the referral portal      |
| `rewards_notification_enabled` | boolean | Send reward notification emails |

**Refer-a-friend portal settings** (`portal_settings`)

| Parameter                 | Type    | Description                               |
| ------------------------- | ------- | ----------------------------------------- |
| `registration_disabled`   | boolean | Disable portal registration               |
| `program_page_enabled`    | boolean | Enable the program page                   |
| `widget_enabled`          | boolean | Enable the portal widget                  |
| `embeddable_form_enabled` | boolean | Enable the embeddable refer-a-friend form |
| `popup_form_enabled`      | boolean | Enable the pop-up refer-a-friend form     |

## Request examples

<CodeGroup>
  ```bash cURL (affiliate) theme={null}
  curl --location --request PUT 'https://api.partnero.com/v1/program' \
    --header 'Accept: application/json' \
    --header 'Authorization: Bearer YOUR_API_KEY' \
    --header 'Content-Type: application/json' \
    --data '{
      "name": "My Updated Program",
      "website": "https://yourcompany.com",
      "program_settings": {
        "currency": "USD",
        "cookie_lifetime": 30,
        "welcome_email_enabled": true
      },
      "portal_settings": {
        "program_page_enabled": true,
        "google_login_enabled": true
      }
    }'
  ```

  ```bash cURL (refer-a-friend) theme={null}
  curl --location --request PUT 'https://api.partnero.com/v1/program' \
    --header 'Accept: application/json' \
    --header 'Authorization: Bearer YOUR_API_KEY' \
    --header 'Content-Type: application/json' \
    --data '{
      "name": "My Referral Program",
      "program_settings": {
        "referral_portal_enabled": true,
        "rewards_notification_enabled": true
      },
      "portal_settings": {
        "embeddable_form_enabled": true,
        "popup_form_enabled": false
      }
    }'
  ```
</CodeGroup>

## Response

<ResponseExample>
  ```json 200 OK theme={null}
  {
    "status": 1,
    "message": "Program updated successfully"
  }
  ```

  ```json 422 Validation error theme={null}
  {
    "status": 0,
    "errors": {
      "program_settings.currency": [
        "The selected program_settings.currency is invalid."
      ]
    }
  }
  ```
</ResponseExample>

<Note>
  Only include the fields you want to update. All fields are optional—omitted fields remain unchanged.
</Note>
