curl --request DELETE \
--url https://api.goyappr.com/lead-tags/{id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.goyappr.com/lead-tags/{id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.goyappr.com/lead-tags/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.goyappr.com/lead-tags/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.goyappr.com/lead-tags/{id}"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.delete("https://api.goyappr.com/lead-tags/{id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.goyappr.com/lead-tags/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"success": true
}{
"error": "<string>",
"code": "<string>",
"issues": [
{
"code": "<string>",
"message": "<string>",
"path": "<string>"
}
]
}{
"error": "<string>",
"code": "<string>",
"issues": [
{
"code": "<string>",
"message": "<string>",
"path": "<string>"
}
]
}{
"error": "<string>",
"code": "LEAD_TAG_IN_USE",
"issues": [
{
"code": "<string>",
"message": "<string>",
"path": "<string>"
}
],
"leads_tagged": 123
}{
"error": "<string>",
"code": "LEAD_TAG_COUNT_UNAVAILABLE",
"issues": [
{
"code": "<string>",
"message": "<string>",
"path": "<string>"
}
]
}Delete Lead Tag
Permanently deletes a lead tag, and takes it off every lead that carries it.
A tag one or more leads still carry is refused with 409 LEAD_TAG_IN_USE, whose body carries leads_tagged — the number of leads that would lose it. Repeat the call with ?force=true to delete it anyway. A tag no lead carries deletes on the first call. The count is taken before anything is deleted and has to succeed: a count that fails answers 503 LEAD_TAG_COUNT_UNAVAILABLE with the tag untouched, never a delete taken as if no lead carried it. Deletion is not reversible and the leads are not otherwise changed: they simply stop carrying the tag, so any GET /leads?tag=… filter or campaign enrolment built on it stops matching.
curl --request DELETE \
--url https://api.goyappr.com/lead-tags/{id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.goyappr.com/lead-tags/{id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.goyappr.com/lead-tags/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.goyappr.com/lead-tags/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.goyappr.com/lead-tags/{id}"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.delete("https://api.goyappr.com/lead-tags/{id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.goyappr.com/lead-tags/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"success": true
}{
"error": "<string>",
"code": "<string>",
"issues": [
{
"code": "<string>",
"message": "<string>",
"path": "<string>"
}
]
}{
"error": "<string>",
"code": "<string>",
"issues": [
{
"code": "<string>",
"message": "<string>",
"path": "<string>"
}
]
}{
"error": "<string>",
"code": "LEAD_TAG_IN_USE",
"issues": [
{
"code": "<string>",
"message": "<string>",
"path": "<string>"
}
],
"leads_tagged": 123
}{
"error": "<string>",
"code": "LEAD_TAG_COUNT_UNAVAILABLE",
"issues": [
{
"code": "<string>",
"message": "<string>",
"path": "<string>"
}
]
}lead_tags:manage — the
scope is spelled with an underscore even though the path is spelled with a
hyphen.
Deleting a tag takes it off every lead that carries it. Those leads are not
otherwise touched, but they stop matching
GET /leads?tag=… and stop being enrolled by any
campaign built on that segment. There is no
undo and no soft delete: create the tag again and you get a new id, with no
lead attached to it.
So a tag that leads still carry is refused, and the refusal says how many.
Refused while leads carry it
curl --request DELETE "$YAPPR_API_URL/lead-tags/02b0327b-affe-45d8-a70a-0c43c3c77349" \
--header "Authorization: Bearer $YAPPR_API_KEY"
{
"error": "5 leads still carry \"renewal-due\". Deleting the tag takes it off all of them, and any dashboard filter or campaign enrolment built on it stops matching. Retag those leads first, or repeat this call with ?force=true.",
"code": "LEAD_TAG_IN_USE",
"leads_tagged": 5
}
leads_tagged is the count right now, so it is also the answer to “how much
would this break” — read it, then either retag those leads with
Update lead or say you meant it.
Deleting it anyway
curl --request DELETE "$YAPPR_API_URL/lead-tags/02b0327b-affe-45d8-a70a-0c43c3c77349?force=true" \
--header "Authorization: Bearer $YAPPR_API_KEY"
{ "success": true }
| Query parameter | Meaning |
|---|---|
force | true deletes a tag leads still carry. Omitted or false, such a tag is refused with 409. Any other value — 1, yes, empty — is 400, never read as true. |
503 LEAD_TAG_COUNT_UNAVAILABLE and the tag
is still there. A count that failed is not a count of zero, and this delete
never guesses it — retry, or send ?force=true to delete without the count.
A tag no lead carries deletes on the first call, with or without force. Ask
GET /leads?tag_id=<id>&limit=1 first if you want
the count before you commit to the call; pagination.total is the same number
the refusal reports.
The dashboard’s own delete, under Settings → Lead tags, asks the same
question: it names the tag, shows how many leads carry it, and does nothing
until that is confirmed.
Errors
| HTTP | Body | When |
|---|---|---|
400 | {"error":"force must be true or false, not \"yes\". …","code":"LEAD_TAG_DELETE_INVALID","issues":[{"code":"query_param_invalid","path":"force","message":"…"}]} | force was something other than true or false, or the query carried a parameter this endpoint does not have. issues[] names each one: query_param_unknown (another parameter), query_param_repeated, query_param_blank or query_param_invalid (force itself). |
404 | {"error":"Lead tag not found","code":"NOT_FOUND"} | No tag with that id in this workspace. Deleting twice gives this the second time. |
409 | {"error":"…","code":"LEAD_TAG_IN_USE","leads_tagged":5} | Leads still carry the tag and force=true was not sent. Nothing was deleted. |
403 | {"error":"This key does not hold …","code":"INSUFFICIENT_SCOPE"} | The key does not hold lead_tags:manage. |
429 | {"error":"Rate limit exceeded. Try again in a moment.","code":"RATE_LIMIT"} | 60 requests per minute per key. |
503 | {"error":"Could not check how many leads carry \"renewal-due\". …","code":"LEAD_TAG_COUNT_UNAVAILABLE"} | The count of leads carrying the tag could not be taken, so nothing was deleted. Retry, or send ?force=true. |
Authorizations
Your Yappr API key (e.g. ypr_live_...). Generate one in the dashboard under Settings → API Keys. No key is 401 MISSING_KEY; a key that is not one of ours, or is revoked, is 401 INVALID_KEY; an expired one is 401 EXPIRED_KEY. A valid key without the scope an operation needs is 403 INSUFFICIENT_SCOPE on every operation, and the message names the scope. Every response, a 401 included, carries X-RateLimit-Limit, X-RateLimit-Remaining and X-RateLimit-Reset: the budget is 60 requests a minute per API key. Every 429, whatever its code, carries Retry-After (whole seconds, never zero): the per-key budget's RATE_LIMIT asks for what is left of the minute, a route's daily cap (RATE_LIMITED) for the time until that cap resets. All four headers are listed in Access-Control-Expose-Headers, so a browser can read them. A path the API does not serve (an unknown sub-path, an id left empty) is 404 ROUTE_NOT_FOUND, and a method a served path does not take is 405 METHOD_NOT_ALLOWED with an Allow header; both are answered before any scope check, and nothing is read or changed. A trailing slash is ignored where it cannot be an id left empty (POST /calls/ is POST /calls) and refused where it can (GET /calls/). A doubled slash inside a path is merged into one before the request reaches the API (GET //calls is GET /calls).