> 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. # Remove subscription tag OAuth Scope: subscriptions:write DELETE https://api.beehiiv.com/v2/publications/{publicationId}/subscriptions/{subscriptionId}/tags Content-Type: application/json Removes tags from a subscription. Does not delete the tag from the publication. Reference: https://developers.beehiiv.com/api-reference/subscription-tags/destroy ## Authentication - `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer `, where token is your auth token. ## Request ### Path parameters - `publicationId` (string, required) — The prefixed ID of the publication. - `subscriptionId` (string, required) — The prefixed ID of the subscription. ### Body (application/json) This endpoint expects an object. - `tags` (list of string, optional) — Tags to remove from the subscriber ## Response ### 204 No Content ## 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 ### ErrorDetail - `message` (string, required) - `code` (string, required) ## Examples **Request** ```json { "tags": [ "Premium" ] } ``` **Response** ```json {} ``` **SDK Code** ```python import requests url = "https://api.beehiiv.com/v2/publications/publicationId/subscriptions/subscriptionId/tags" payload = { "tags": ["Premium"] } headers = { "Authorization": "Bearer ", "Content-Type": "application/json" } response = requests.delete(url, json=payload, headers=headers) print(response.json()) ``` ```javascript const url = 'https://api.beehiiv.com/v2/publications/publicationId/subscriptions/subscriptionId/tags'; const options = { method: 'DELETE', headers: {Authorization: 'Bearer ', 'Content-Type': 'application/json'}, body: '{"tags":["Premium"]}' }; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` ```go package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://api.beehiiv.com/v2/publications/publicationId/subscriptions/subscriptionId/tags" payload := strings.NewReader("{\n \"tags\": [\n \"Premium\"\n ]\n}") req, _ := http.NewRequest("DELETE", url, payload) req.Header.Add("Authorization", "Bearer ") 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/subscriptionId/tags") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Delete.new(url) request["Authorization"] = 'Bearer ' request["Content-Type"] = 'application/json' request.body = "{\n \"tags\": [\n \"Premium\"\n ]\n}" response = http.request(request) puts response.read_body ``` ```java import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.delete("https://api.beehiiv.com/v2/publications/publicationId/subscriptions/subscriptionId/tags") .header("Authorization", "Bearer ") .header("Content-Type", "application/json") .body("{\n \"tags\": [\n \"Premium\"\n ]\n}") .asString(); ``` ```php request('DELETE', 'https://api.beehiiv.com/v2/publications/publicationId/subscriptions/subscriptionId/tags', [ 'body' => '{ "tags": [ "Premium" ] }', 'headers' => [ 'Authorization' => 'Bearer ', 'Content-Type' => 'application/json', ], ]); echo $response->getBody(); ``` ```csharp using RestSharp; var client = new RestClient("https://api.beehiiv.com/v2/publications/publicationId/subscriptions/subscriptionId/tags"); var request = new RestRequest(Method.DELETE); request.AddHeader("Authorization", "Bearer "); request.AddHeader("Content-Type", "application/json"); request.AddParameter("application/json", "{\n \"tags\": [\n \"Premium\"\n ]\n}", ParameterType.RequestBody); IRestResponse response = client.Execute(request); ``` ```swift import Foundation let headers = [ "Authorization": "Bearer ", "Content-Type": "application/json" ] let parameters = ["tags": ["Premium"]] as [String : Any] let postData = JSONSerialization.data(withJSONObject: parameters, options: []) let request = NSMutableURLRequest(url: NSURL(string: "https://api.beehiiv.com/v2/publications/publicationId/subscriptions/subscriptionId/tags")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "DELETE" 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() ``` > Build your audience with beehiiv's API and SDKs. Create new subscribers and posts, get real-time notifications of subscription activity, and more.