Change lifetime campaign status
curl --request PATCH \
--url https://app.nudgen.net/api/v1/campaigns/{id}/lifecycle \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{}'const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({})
};
fetch('https://app.nudgen.net/api/v1/campaigns/{id}/lifecycle', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://app.nudgen.net/api/v1/campaigns/{id}/lifecycle"
payload = {}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text){
"campaign": {
"id": "<string>",
"name": "<string>",
"type": "one-time",
"status": "draft",
"subject": "<string>",
"scheduledAt": "2023-11-07T05:31:56Z",
"sentAt": "2023-11-07T05:31:56Z",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}API reference
Change lifetime campaign status
Allowed transitions: draft to active, active to paused or archived, paused to active or archived. Archived campaigns cannot resume. Pausing or archiving cancels pending and queued executions. A lifetime campaign must be created as a draft; the launch endpoint does not accept it.
PATCH
/
api
/
v1
/
campaigns
/
{id}
/
lifecycle
Change lifetime campaign status
curl --request PATCH \
--url https://app.nudgen.net/api/v1/campaigns/{id}/lifecycle \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{}'const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({})
};
fetch('https://app.nudgen.net/api/v1/campaigns/{id}/lifecycle', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://app.nudgen.net/api/v1/campaigns/{id}/lifecycle"
payload = {}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text){
"campaign": {
"id": "<string>",
"name": "<string>",
"type": "one-time",
"status": "draft",
"subject": "<string>",
"scheduledAt": "2023-11-07T05:31:56Z",
"sentAt": "2023-11-07T05:31:56Z",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}Was this page helpful?