Update Campaign
POST/print-mail/v1/campaigns/{id}
Update an existing campaign.
Campaigns can only be updated if they are in the draft or changes_required status.
Updating a campaign will trigger reprocessing and set its status back to drafting.
Body ParametersJSON
chequeProfile: optional string
The ID of the cheque profile to use. Setting this will remove other profile types. Set to null to remove.
description: optional string
An optional description for the campaign. Set to null to remove the existing description.
letterProfile: optional string
The ID of the letter profile to use. Setting this will remove other profile types. Set to null to remove.
metadata: optional map[string]
Optional key-value data associated with the campaign. Set to null to remove existing metadata.
Update Campaign
curl https://api.postgrid.com/print-mail/v1/campaigns/$ID \
-H 'Content-Type: application/json' \
-H "X-API-Key: $POSTGRID_PRINT_MAIL_API_KEY" \
-d '{}'{
"id": "campaign_sqF12lZ1VlBb",
"createdAt": "2019-12-27T18:11:19.117Z",
"createdCount": 0,
"live": true,
"mailingList": "mailingList",
"status": "drafting",
"updatedAt": "2019-12-27T18:11:19.117Z",
"chequeProfile": "chequeProfile",
"defaultSenderContact": "defaultSenderContact",
"description": "description",
"errors": [
{
"message": "message",
"type": "processing_error"
}
],
"letterProfile": "letterProfile",
"metadata": {
"foo": "bar"
},
"orderPreviewURL": "https://example.com",
"postcardProfile": "postcardProfile",
"reportURL": "https://example.com",
"selfMailerProfile": "selfMailerProfile",
"sendDate": "2019-12-27T18:11:19.117Z"
}Returns Examples
{
"id": "campaign_sqF12lZ1VlBb",
"createdAt": "2019-12-27T18:11:19.117Z",
"createdCount": 0,
"live": true,
"mailingList": "mailingList",
"status": "drafting",
"updatedAt": "2019-12-27T18:11:19.117Z",
"chequeProfile": "chequeProfile",
"defaultSenderContact": "defaultSenderContact",
"description": "description",
"errors": [
{
"message": "message",
"type": "processing_error"
}
],
"letterProfile": "letterProfile",
"metadata": {
"foo": "bar"
},
"orderPreviewURL": "https://example.com",
"postcardProfile": "postcardProfile",
"reportURL": "https://example.com",
"selfMailerProfile": "selfMailerProfile",
"sendDate": "2019-12-27T18:11:19.117Z"
}