Campaign routes: update, delete
The Campaign Verbs update, delete as api.sb routes, with inputs, result, refusals and an example.
Reference for Campaign, one group of Campaign routes.
Campaign.update
Changes the given properties of a Campaign. Verb page.
PATCH /{namespace}/ campaigns/ {id}Path: id. Body, as JSON: the other inputs. Emits Campaign.updated.
Inputs
| Input | Type | Required | Description |
|---|---|---|---|
id | string | required | The id of the Campaign. |
budget | money | What it may spend. | |
startsAt | datetime | When it starts. | |
endsAt | datetime | When it ends. |
Returns
| Output | Type | Required | Description |
|---|---|---|---|
campaign | Campaign | required | The Campaign. |
Refuses when
| Check | Error | Fix | Then call |
|---|---|---|---|
| The key is valid, but its scopes do not allow this operation. | forbidden | Use a key whose scopes cover the operation, or ask an owner of the namespace to grant them. | None. |
Example
curl -X PATCH https: //api.sb/ leaseline.app/ campaigns/ campaign_NYwCp4DcII \
-H "Authorization: Bearer $STARTUP_BUILDER_API_KEY" \
-H "Content-Type: application/ json" \
-d '{"budget": {"amount": 29, "currency": "USD"}}'{
"api": "https: //api.sb/ leaseline.app",
"campaign": {
"$id": "https: //api.sb/ leaseline.app/ campaigns/ campaign_NYwCp4DcII",
"$type": "Campaign",
"budget": {
"amount": 29,
"currency": "USD"
},
"startsAt": "2026-10-22T12: 00: 00Z"
},
"action": {
"$id": "https: //api.sb/ leaseline.app/ actions/ act_br07HsG8MG",
"operation": "Campaign.update",
"status": "done"
},
"links": {
"self": "https: //api.sb/ leaseline.app/ actions/ act_br07HsG8MG"
}
}Campaign.delete
Deletes a Campaign: a soft delete that keeps its history, undone by Thing.restore. Verb page.
DELETE /{namespace}/ campaigns/ {id}Path: id. Emits Campaign.deleted.
Inputs
| Input | Type | Required | Description |
|---|---|---|---|
id | string | required | The id of the Campaign. |
Returns
| Output | Type | Required | Description |
|---|---|---|---|
campaign | Campaign | required | The Campaign. |
Refuses when
| Check | Error | Fix | Then call |
|---|---|---|---|
| The key is valid, but its scopes do not allow this operation. | forbidden | Use a key whose scopes cover the operation, or ask an owner of the namespace to grant them. | None. |
Example
curl -X DELETE https: //api.sb/ leaseline.app/ campaigns/ campaign_NYwCp4DcII \
-H "Authorization: Bearer $STARTUP_BUILDER_API_KEY"{
"api": "https: //api.sb/ leaseline.app",
"campaign": {
"$id": "https: //api.sb/ leaseline.app/ campaigns/ campaign_NYwCp4DcII",
"$type": "Campaign",
"budget": {
"amount": 29,
"currency": "USD"
},
"startsAt": "2026-10-22T12: 00: 00Z"
},
"action": {
"$id": "https: //api.sb/ leaseline.app/ actions/ act_br07HsG8MG",
"operation": "Campaign.delete",
"status": "done"
},
"links": {
"self": "https: //api.sb/ leaseline.app/ actions/ act_br07HsG8MG"
}
}