Skip to content

Create a campaign draft from a published post, as the site's rule says

POST
/api/v1/workspaces/{workspace}/wordpress/drafts
curl --request POST \
--url https://reputecast.example.com/api/v1/workspaces/acme-newsletter/wordpress/drafts \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "post": { "categories": [ "example" ], "excerpt": "example", "id": "example", "imageUrl": "example", "language": "example", "publishedAt": "2026-04-15T12:00:00Z", "title": "example", "translations": [ { "excerpt": "example", "id": "example", "imageUrl": "example", "language": "es", "title": "example", "url": "example" } ], "url": "example" } }'

Permission: campaigns:edit

Keys: only a WordPress site’s key can call this operation.

campaigns:edit lets a site’s key create drafts from posts only: it can’t open, change or send any other campaign. Nothing is sent.

workspace
required

Workspace slug

string
/^[a-z0-9][a-z0-9-]{1,62}$/

Workspace slug

Media typeapplication/json
object
post
required
object
categories

Category slugs

Array<string>
<= 100 items
excerpt
string
<= 2000 characters
id
required
string
<= 64 characters
imageUrl

The featured image

string
<= 1000 characters
language
string
<= 40 characters
publishedAt
string format: date-time
title
required
string
>= 1 characters <= 300 characters
translations

The post’s translations (plugin 1.3.0, WPML or Polylang): they become the draft’s language versions

Array<object>
<= 20 items
object
excerpt
string
<= 2000 characters
id
required
string
<= 64 characters
imageUrl
string
<= 1000 characters
language
required
string
>= 2 characters <= 40 characters
title
required
string
>= 1 characters <= 300 characters
url
string
<= 1000 characters
url
string
<= 1000 characters

OK

Media typeapplication/json
object
campaignId
string
created
required
boolean
languages
Array<string>
name
string
reason
string
Allowed values: no_rule rule_off category exists ""

Example

{
"reason": "no_rule"
}

Error

Media typeapplication/problem+json
object
code

Stable error code, e.g. permission_denied

string
detail

A human-readable explanation specific to this occurrence of the problem.

string
errors

Optional list of individual error details

Array<object>
object
location

Where the error occurred, e.g. ‘body.items[3].tags’ or ‘path.thing-id’

string
message

Error message text

string
value

The value at the given location

helpers

Members who hold the missing permission

Array<string>
instance

A URI reference that identifies the specific occurrence of the problem.

string format: uri
meta
object
key
additional properties
permission

The missing permission key

string
status

HTTP status code

integer format: int64
title

A short, human-readable summary of the problem type. This value should not change between occurrences of the error.

string
type

A URI reference to human-readable documentation for the error.

string format: uri
default: about:blank

Example

{
"detail": "Property foo is required but is missing.",
"instance": "https://example.com/error-log/abc123",
"status": 400,
"title": "Bad Request",
"type": "about:blank"
}