> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://developers.beehiiv.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://developers.beehiiv.com/_mcp/server.

# Update subscriptions <Badge intent="info" minimal outlined>OAuth Scope: subscriptions:write</Badge>

PATCH https://api.beehiiv.com/v2/publications/{publicationId}/subscriptions/bulk_actions
Content-Type: application/json

Bulk update multiple subscriptions fields, including status, custom fields, and tiers.

Reference: https://developers.beehiiv.com/api-reference/bulk-subscription-updates/put

## Authentication

- `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer <token>`, where token is your auth token.

## Request

### Path parameters

- `publicationId` (string, required) — The prefixed ID of the publication object

### Body (application/json)

This endpoint expects an object.

- `subscriptions` (list of SubscriptionsPatchRequestSubscriptionsItem, optional) — An array of objects representing the subscriptions to be updated (max 1000).

## Response

### 200

OK

- `data` (SubscriptionsPatchResponseData, required)

## Errors

### 400 Bad Request Error

Bad Request

- `status` (integer, required)
- `statusText` (string, required)
- `errors` (list of ErrorDetail, required)

### 401 Unauthorized Error

Unauthorized. The API key or OAuth access token is missing, invalid, or expired.

- `status` (integer, required)
- `statusText` (string, required)
- `errors` (list of ErrorDetail, required)

### 404 Not Found Error

Resource Not Found

- `status` (integer, required)
- `statusText` (string, required)
- `errors` (list of ErrorDetail, required)

### 429 Too Many Requests Error

Rate Limit Exceeded

- `status` (integer, required)
- `statusText` (string, required)
- `errors` (list of ErrorDetail, required)

### 500 Internal Server Error

Internal Server Error

- `status` (integer, required)
- `statusText` (string, required)
- `errors` (list of ErrorDetail, required)

## Types

### SubscriptionsPatchRequestSubscriptionsItem

- `subscription_id` (string, required) — The prefixed ID of the subscription.
- `newsletter_list_ids` (list of string, optional) — An array of newsletter list prefixed IDs to subscribe this subscription to. Adds to the subscription's existing list memberships; it does not replace them. The newsletter lists must belong to the same publication. Cannot be combined with `unsubscribe`.
- `unsubscribe_newsletter_list_ids` (list of string, optional) — An array of newsletter list prefixed IDs to unsubscribe this subscription from. Unsubscribing from a list the subscription is not on is a no-op. The newsletter lists must belong to the same publication, and the same list cannot appear in `newsletter_list_ids`.
- `tier` (enum, optional) — The Tier of the Subscription (not required)
  - Allowed values: `free`, `premium`
- `stripe_customer_id` (string, optional) — The Stripe Customer ID of the subscription (not required)
- `unsubscribe` (boolean, optional) — A boolean value specifying whether to unsubscribe this subscription from the publication (not required)
- `custom_fields` (list of SubscriptionsPatchRequestSubscriptionsItemCustomFieldsItem, optional) — An array of custom field objects to update
- `complimentary_gift_id` (string, optional) — The prefixed ID of a complimentary access object to apply to this subscription. The complimentary access must belong to the same publication.

### SubscriptionsPatchResponseData

- `subscription_update_id` (string, optional) — The ID of the Subscription Update object responsible for handling the update job

### ErrorDetail

- `message` (string, required)
- `code` (string, required)

### SubscriptionsPatchRequestSubscriptionsItemCustomFieldsItem

- `name` (string, optional) — The display value of the custom field
- `value` (CustomFieldDataType, optional) — The value of the custom field
- `delete` (boolean, optional) — A boolean value to specify whether to delete this custom field entry from the subscription

### CustomFieldDataType

- string
- double
- boolean
- list of string

## Examples

**Request**

```json
{
  "subscriptions": [
    {
      "subscription_id": "sub_1234-5678-9012-3456-7890",
      "newsletter_list_ids": [
        "nl_list_00000000-0000-0000-0000-000000000000"
      ],
      "tier": "premium",
      "stripe_customer_id": "cus_1234567890",
      "unsubscribe": false,
      "custom_fields": [
        {
          "name": "custom_field_name",
          "value": "custom_field_value"
        },
        {
          "name": "custom_field_name_2",
          "value": "custom_field_value_2"
        }
      ]
    },
    {
      "subscription_id": "sub_9876-5432-1098-7654-3210",
      "unsubscribe_newsletter_list_ids": [
        "nl_list_11111111-1111-1111-1111-111111111111"
      ],
      "tier": "free",
      "stripe_customer_id": "cus_1234567890",
      "unsubscribe": true,
      "custom_fields": [
        {
          "name": "custom_field_name_3",
          "value": "custom_field_value_3"
        },
        {
          "name": "custom_field_name_4",
          "value": "custom_field_value_4"
        }
      ]
    }
  ]
}
```

**Response**

```json
{
  "data": {
    "subscription_update_id": "subscription_update_id"
  }
}
```

**SDK Code**

```typescript
import { BeehiivClient } from "beehiiv";

const client = new BeehiivClient({ token: "YOUR_TOKEN" });
await client.subscriptions.patch("publicationId");

```

```python
import requests

url = "https://api.beehiiv.com/v2/publications/publicationId/subscriptions/bulk_actions"

payload = { "subscriptions": [
        {
            "subscription_id": "sub_1234-5678-9012-3456-7890",
            "newsletter_list_ids": ["nl_list_00000000-0000-0000-0000-000000000000"],
            "tier": "premium",
            "stripe_customer_id": "cus_1234567890",
            "unsubscribe": False,
            "custom_fields": [
                {
                    "name": "custom_field_name",
                    "value": "custom_field_value"
                },
                {
                    "name": "custom_field_name_2",
                    "value": "custom_field_value_2"
                }
            ]
        },
        {
            "subscription_id": "sub_9876-5432-1098-7654-3210",
            "unsubscribe_newsletter_list_ids": ["nl_list_11111111-1111-1111-1111-111111111111"],
            "tier": "free",
            "stripe_customer_id": "cus_1234567890",
            "unsubscribe": True,
            "custom_fields": [
                {
                    "name": "custom_field_name_3",
                    "value": "custom_field_value_3"
                },
                {
                    "name": "custom_field_name_4",
                    "value": "custom_field_value_4"
                }
            ]
        }
    ] }
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.patch(url, json=payload, headers=headers)

print(response.json())
```

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.beehiiv.com/v2/publications/publicationId/subscriptions/bulk_actions"

	payload := strings.NewReader("{\n  \"subscriptions\": [\n    {\n      \"subscription_id\": \"sub_1234-5678-9012-3456-7890\",\n      \"newsletter_list_ids\": [\n        \"nl_list_00000000-0000-0000-0000-000000000000\"\n      ],\n      \"tier\": \"premium\",\n      \"stripe_customer_id\": \"cus_1234567890\",\n      \"unsubscribe\": false,\n      \"custom_fields\": [\n        {\n          \"name\": \"custom_field_name\",\n          \"value\": \"custom_field_value\"\n        },\n        {\n          \"name\": \"custom_field_name_2\",\n          \"value\": \"custom_field_value_2\"\n        }\n      ]\n    },\n    {\n      \"subscription_id\": \"sub_9876-5432-1098-7654-3210\",\n      \"unsubscribe_newsletter_list_ids\": [\n        \"nl_list_11111111-1111-1111-1111-111111111111\"\n      ],\n      \"tier\": \"free\",\n      \"stripe_customer_id\": \"cus_1234567890\",\n      \"unsubscribe\": true,\n      \"custom_fields\": [\n        {\n          \"name\": \"custom_field_name_3\",\n          \"value\": \"custom_field_value_3\"\n        },\n        {\n          \"name\": \"custom_field_name_4\",\n          \"value\": \"custom_field_value_4\"\n        }\n      ]\n    }\n  ]\n}")

	req, _ := http.NewRequest("PATCH", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.beehiiv.com/v2/publications/publicationId/subscriptions/bulk_actions")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"subscriptions\": [\n    {\n      \"subscription_id\": \"sub_1234-5678-9012-3456-7890\",\n      \"newsletter_list_ids\": [\n        \"nl_list_00000000-0000-0000-0000-000000000000\"\n      ],\n      \"tier\": \"premium\",\n      \"stripe_customer_id\": \"cus_1234567890\",\n      \"unsubscribe\": false,\n      \"custom_fields\": [\n        {\n          \"name\": \"custom_field_name\",\n          \"value\": \"custom_field_value\"\n        },\n        {\n          \"name\": \"custom_field_name_2\",\n          \"value\": \"custom_field_value_2\"\n        }\n      ]\n    },\n    {\n      \"subscription_id\": \"sub_9876-5432-1098-7654-3210\",\n      \"unsubscribe_newsletter_list_ids\": [\n        \"nl_list_11111111-1111-1111-1111-111111111111\"\n      ],\n      \"tier\": \"free\",\n      \"stripe_customer_id\": \"cus_1234567890\",\n      \"unsubscribe\": true,\n      \"custom_fields\": [\n        {\n          \"name\": \"custom_field_name_3\",\n          \"value\": \"custom_field_value_3\"\n        },\n        {\n          \"name\": \"custom_field_name_4\",\n          \"value\": \"custom_field_value_4\"\n        }\n      ]\n    }\n  ]\n}"

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.patch("https://api.beehiiv.com/v2/publications/publicationId/subscriptions/bulk_actions")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"subscriptions\": [\n    {\n      \"subscription_id\": \"sub_1234-5678-9012-3456-7890\",\n      \"newsletter_list_ids\": [\n        \"nl_list_00000000-0000-0000-0000-000000000000\"\n      ],\n      \"tier\": \"premium\",\n      \"stripe_customer_id\": \"cus_1234567890\",\n      \"unsubscribe\": false,\n      \"custom_fields\": [\n        {\n          \"name\": \"custom_field_name\",\n          \"value\": \"custom_field_value\"\n        },\n        {\n          \"name\": \"custom_field_name_2\",\n          \"value\": \"custom_field_value_2\"\n        }\n      ]\n    },\n    {\n      \"subscription_id\": \"sub_9876-5432-1098-7654-3210\",\n      \"unsubscribe_newsletter_list_ids\": [\n        \"nl_list_11111111-1111-1111-1111-111111111111\"\n      ],\n      \"tier\": \"free\",\n      \"stripe_customer_id\": \"cus_1234567890\",\n      \"unsubscribe\": true,\n      \"custom_fields\": [\n        {\n          \"name\": \"custom_field_name_3\",\n          \"value\": \"custom_field_value_3\"\n        },\n        {\n          \"name\": \"custom_field_name_4\",\n          \"value\": \"custom_field_value_4\"\n        }\n      ]\n    }\n  ]\n}")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('PATCH', 'https://api.beehiiv.com/v2/publications/publicationId/subscriptions/bulk_actions', [
  'body' => '{
  "subscriptions": [
    {
      "subscription_id": "sub_1234-5678-9012-3456-7890",
      "newsletter_list_ids": [
        "nl_list_00000000-0000-0000-0000-000000000000"
      ],
      "tier": "premium",
      "stripe_customer_id": "cus_1234567890",
      "unsubscribe": false,
      "custom_fields": [
        {
          "name": "custom_field_name",
          "value": "custom_field_value"
        },
        {
          "name": "custom_field_name_2",
          "value": "custom_field_value_2"
        }
      ]
    },
    {
      "subscription_id": "sub_9876-5432-1098-7654-3210",
      "unsubscribe_newsletter_list_ids": [
        "nl_list_11111111-1111-1111-1111-111111111111"
      ],
      "tier": "free",
      "stripe_customer_id": "cus_1234567890",
      "unsubscribe": true,
      "custom_fields": [
        {
          "name": "custom_field_name_3",
          "value": "custom_field_value_3"
        },
        {
          "name": "custom_field_name_4",
          "value": "custom_field_value_4"
        }
      ]
    }
  ]
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.beehiiv.com/v2/publications/publicationId/subscriptions/bulk_actions");
var request = new RestRequest(Method.PATCH);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"subscriptions\": [\n    {\n      \"subscription_id\": \"sub_1234-5678-9012-3456-7890\",\n      \"newsletter_list_ids\": [\n        \"nl_list_00000000-0000-0000-0000-000000000000\"\n      ],\n      \"tier\": \"premium\",\n      \"stripe_customer_id\": \"cus_1234567890\",\n      \"unsubscribe\": false,\n      \"custom_fields\": [\n        {\n          \"name\": \"custom_field_name\",\n          \"value\": \"custom_field_value\"\n        },\n        {\n          \"name\": \"custom_field_name_2\",\n          \"value\": \"custom_field_value_2\"\n        }\n      ]\n    },\n    {\n      \"subscription_id\": \"sub_9876-5432-1098-7654-3210\",\n      \"unsubscribe_newsletter_list_ids\": [\n        \"nl_list_11111111-1111-1111-1111-111111111111\"\n      ],\n      \"tier\": \"free\",\n      \"stripe_customer_id\": \"cus_1234567890\",\n      \"unsubscribe\": true,\n      \"custom_fields\": [\n        {\n          \"name\": \"custom_field_name_3\",\n          \"value\": \"custom_field_value_3\"\n        },\n        {\n          \"name\": \"custom_field_name_4\",\n          \"value\": \"custom_field_value_4\"\n        }\n      ]\n    }\n  ]\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = ["subscriptions": [
    [
      "subscription_id": "sub_1234-5678-9012-3456-7890",
      "newsletter_list_ids": ["nl_list_00000000-0000-0000-0000-000000000000"],
      "tier": "premium",
      "stripe_customer_id": "cus_1234567890",
      "unsubscribe": false,
      "custom_fields": [
        [
          "name": "custom_field_name",
          "value": "custom_field_value"
        ],
        [
          "name": "custom_field_name_2",
          "value": "custom_field_value_2"
        ]
      ]
    ],
    [
      "subscription_id": "sub_9876-5432-1098-7654-3210",
      "unsubscribe_newsletter_list_ids": ["nl_list_11111111-1111-1111-1111-111111111111"],
      "tier": "free",
      "stripe_customer_id": "cus_1234567890",
      "unsubscribe": true,
      "custom_fields": [
        [
          "name": "custom_field_name_3",
          "value": "custom_field_value_3"
        ],
        [
          "name": "custom_field_name_4",
          "value": "custom_field_value_4"
        ]
      ]
    ]
  ]] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.beehiiv.com/v2/publications/publicationId/subscriptions/bulk_actions")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PATCH"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```