curl --request DELETE \
--url https://api.goyappr.com/campaigns/{id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.goyappr.com/campaigns/{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/campaigns/{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/campaigns/{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/campaigns/{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/campaigns/{id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.goyappr.com/campaigns/{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{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "archived",
"company_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}{
"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": "<string>",
"issues": [
{
"code": "<string>",
"message": "<string>",
"path": "<string>"
}
]
}Archive a campaign
Soft-deletes the campaign: the campaign and its history are retained for
reporting, but it disappears from GET /campaigns, stops being returned by
GET /campaigns/{id}, and can never be edited, resumed or re-launched. Its
name is freed for reuse.
Archiving is also a stop: every contact still pending, scheduled, dialing
or awaiting_disposition is retired to excluded, and every call this campaign
had waiting to be dialed is cancelled on a best-effort basis — a call the
dispatcher already picked up completes normally. Required scope
campaigns:manage. Not idempotent in its response: calling it again on an
already-archived campaign answers 404, the same as one that never existed.
curl --request DELETE \
--url https://api.goyappr.com/campaigns/{id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.goyappr.com/campaigns/{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/campaigns/{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/campaigns/{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/campaigns/{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/campaigns/{id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.goyappr.com/campaigns/{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{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "archived",
"company_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}{
"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": "<string>",
"issues": [
{
"code": "<string>",
"message": "<string>",
"path": "<string>"
}
]
}GET /campaigns list (it is listed with ?status=archived) and stops being returned by GET /campaigns/{id}. It cannot be edited, resumed or re-launched while archived; restore it to bring it back — a draft as a draft with its contacts, a campaign that had launched as stopped.
Archiving is also a stop. In one operation it:
- Sets the campaign’s status to
archivedand marks it deleted. - Retires every contact that was still live (
pending,scheduled,dialing,awaiting_disposition) toexcluded. - Cancels every call this campaign had waiting to be dialed.
max_in_flight calls already on their way may still connect. If you need a clean stop with the campaign left readable, use POST /campaigns/{id}/stop instead.
Required scope: campaigns:manage.
Path parameters
| Parameter | Type | Notes |
|---|---|---|
id | uuid | Campaign ID. Must belong to the API key’s workspace. |
draft and already-terminal campaigns.
Archive or stop?
POST /campaigns/{id}/stop | DELETE /campaigns/{id} | |
|---|---|---|
| Status afterwards | stopped | archived |
Still listed by GET /campaigns | yes | only with ?status=archived |
Still readable by GET /campaigns/{id} | yes | no (404) |
| Live contacts retired | pending and scheduled | every live state |
| Queued calls cancelled | no | yes |
| Can be brought back | no | yes, with POST /campaigns/{id}/restore |
Example request
curl -X DELETE "https://api.goyappr.com/campaigns/CAMPAIGN_ID" \
-H "Authorization: Bearer $YAPPR_API_KEY"
Example response
A short acknowledgement rather than the full campaign object, because the campaign is no longer readable:{
"id": "b3f1c0d2-5a44-4f0e-9c11-7a2e8d3f0001",
"status": "archived",
"company_id": "00000000-0000-4000-8000-0000000000c1"
}
Errors
| HTTP | Code | When |
|---|---|---|
| 403 | INSUFFICIENT_SCOPE | API key lacks campaigns:manage. |
| 404 | NOT_FOUND | No campaign with that ID in this workspace. |
| 404 | CAMPAIGN_ARCHIVED | It is already archived. The message names POST /campaigns/{id}/restore, which brings it back. |
| 404 | RESOURCE_ID_INVALID | The id in the path is not an id at all. |
| 405 | METHOD_NOT_ALLOWED | POST /campaigns/{id}/archive: archiving is DELETE /campaigns/{id}. Nothing was changed. No method is served at that path, so the answer carries no Allow header. |
| 500 | INTERNAL_ERROR | The archive write failed. The campaign is unchanged; safe to retry. |
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).