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

> Update an existing partner's details, referral key, or tags

## Endpoint

```
PUT https://api.partnero.com/v1/partners/{id}
```

## Parameters

You can identify the partner either by path parameter or request body:

| Parameter | Location | Type   | Description                                     |
| --------- | -------- | ------ | ----------------------------------------------- |
| `id`      | path     | string | Partner's unique ID in the URL                  |
| `email`   | body     | string | Partner's email (alternative to path ID)        |
| `key`     | body     | string | Partner's referral key (alternative to path ID) |

## Request body

| Parameter         | Type   | Required | Description                                                               |
| ----------------- | ------ | -------- | ------------------------------------------------------------------------- |
| `update.email`    | string | No       | New email address (must be unique)                                        |
| `update.name`     | string | No       | Partner's first name                                                      |
| `update.surname`  | string | No       | Partner's last name                                                       |
| `update.password` | string | No       | New password (min 8 chars, 1 lowercase, 1 uppercase, 1 number)            |
| `update.key`      | string | No       | Partner's default referral link key                                       |
| `update.tags`     | array  | No       | Tags to associate. Empty array `[]` removes all tags. `null` skips update |

## Request

<CodeGroup>
  ```bash cURL (by path ID) theme={null}
  curl --location --request PUT 'https://api.partnero.com/v1/partners/partner_123' \
    --header 'Accept: application/json' \
    --header 'Authorization: Bearer YOUR_API_KEY' \
    --header 'Content-Type: application/json' \
    --data '{
      "update": {
        "name": "James",
        "surname": "Wilson",
        "email": "james.wilson@partnero.com",
        "tags": ["premium"]
      }
    }'
  ```

  ```bash cURL (by email) theme={null}
  curl --location --request PUT 'https://api.partnero.com/v1/partners' \
    --header 'Accept: application/json' \
    --header 'Authorization: Bearer YOUR_API_KEY' \
    --header 'Content-Type: application/json' \
    --data '{
      "email": "john.doe@partnero.com",
      "update": {
        "name": "James",
        "tags": ["premium"]
      }
    }'
  ```
</CodeGroup>

## Response

<ResponseExample>
  ```json 200 OK theme={null}
  {
    "data": {
      "email": "james.wilson@partnero.com",
      "created_at": "2025-04-30T16:44:13.000000Z",
      "updated_at": "2025-04-30T18:02:45.000000Z",
      "name": "James",
      "id": "partner_123",
      "surname": "Wilson",
      "tos": false,
      "approved": true,
      "status": "active",
      "custom_fields": [],
      "referrals_count": 0,
      "tags": [
        {
          "value": "premium"
        }
      ],
      "referral_link": "https://yourcompany.com?aff=ref_123",
      "referral_links": [
        "https://yourcompany.com?aff=ref_123"
      ]
    },
    "status": 1
  }
  ```
</ResponseExample>
