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

# Newsletter subscribers

> Manage subscribers in Newsletter Referral programs

## Create Subscriber

```
POST https://api.partnero.com/v1/subscribers
```

<Note>
  Subscribers are automatically created when signing up via the Partnero portal or through ESP sync.
</Note>

### Request Body

| Parameter           | Type    | Required | Description                                    |
| ------------------- | ------- | -------- | ---------------------------------------------- |
| `id`                | string  | No       | Unique ID (auto-generated, or synced from ESP) |
| `email`             | string  | Yes      | Unique email address                           |
| `name`              | string  | No       | Subscriber's name                              |
| `tos`               | boolean | No       | Terms of service accepted                      |
| `marketing_consent` | boolean | No       | Marketing consent given                        |
| `status`            | string  | No       | `active`, `rejected`, `suspended`              |
| `approved`          | boolean | No       | Whether subscriber is approved                 |
| `referral`          | object  | No       | The subscriber who referred this person        |
| `referral.id`       | string  | Yes\*    | Referring subscriber's ID                      |
| `referral.email`    | string  | Yes\*    | Referring subscriber's email                   |

## Request

```bash cURL theme={null}
curl --location 'https://api.partnero.com/v1/subscribers' \
  --header 'Authorization: Bearer YOUR_API_KEY' \
  --header 'Content-Type: application/json' \
  --data '{
    "email": "subscriber@partnero.com",
    "name": "John Doe",
    "tos": true,
    "marketing_consent": true,
    "status": "active",
    "approved": true
  }'
```

## Response

<ResponseExample>
  ```json 201 Created theme={null}
  {
    "data": {
      "id": "subscriber@partnero.com",
      "name": "John Doe",
      "email": "subscriber@partnero.com",
      "is_referred": false,
      "tos": true,
      "marketing_consent": true,
      "status": "Active",
      "approved": true,
      "portal_link": "https://partnero.referral.site/portal/xxx",
      "share_link": "https://partnero.referral.site/share/xxx",
      "referrals_count": 0,
      "reward": [],
      "created_at": "2025-05-12T22:03:20.000000Z"
    },
    "status": 1
  }
  ```
</ResponseExample>

### Response Fields

| Field             | Type    | Description                          |
| ----------------- | ------- | ------------------------------------ |
| `portal_link`     | string  | Link to subscriber's portal          |
| `share_link`      | string  | Subscriber's referral link to share  |
| `referrals_count` | integer | Number of referred subscribers       |
| `is_referred`     | boolean | Whether this subscriber was referred |
| `reward`          | array   | Earned rewards                       |

## List Subscribers

```bash theme={null}
GET https://api.partnero.com/v1/subscribers
```

| Parameter      | Type    | Description                            |
| -------------- | ------- | -------------------------------------- |
| `limit`        | integer | Results per page (10-250, default: 10) |
| `page`         | integer | Page number                            |
| `refer_status` | string  | Filter: `referred` or `non_referred`   |

## Get Subscriber

```bash theme={null}
GET https://api.partnero.com/v1/subscribers/{id|email}
```

## Search Subscribers

```bash theme={null}
GET https://api.partnero.com/v1/subscribers:search?email=subscriber@partnero.com
```

## Update Subscriber

```bash theme={null}
PUT https://api.partnero.com/v1/subscribers/{id|email}
```

```json theme={null}
{
  "update": {
    "name": "Updated Name",
    "status": "active",
    "approved": true
  }
}
```

## Delete Subscriber

```bash theme={null}
DELETE https://api.partnero.com/v1/subscribers/{id|email}
```
