Everything you write in Unspar belongs to a project. A project stores who your site is for along with the defaults for new articles, such as language and template. Any article you start through the article endpoints inherits these settings unless you override them for that specific article.
These same projects appear under Projects in the web app. To see how each setting affects the final article, read Projects and site context.
Create a project
POST /projects requires a name and the website’s url. If you leave out language and timezone, they default to en-US and UTC, so send both if your site targets another language or region. Only an API token with access to all projects can create a new one.
curl -X POST https://app.unspar.com/api/v1/projects \
-H "Authorization: Bearer $UNSPAR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "My blog",
"url": "https://example.com",
"language": "en-GB",
"timezone": "Europe/London",
"context": {
"background": "Guides for people who repair their own bikes. Readers are in the UK, so prices are in pounds. We do not recommend specific shops."
}
}'
The response returns the new project inside data, including its id.
Change the settings
PATCH /projects/{project} updates only the fields you include in the request. This also works for individual keys inside context. For example, this request updates the form of address and leaves everything else untouched:
curl -X PATCH https://app.unspar.com/api/v1/projects/<project-id> \
-H "Authorization: Bearer $UNSPAR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"context": {"address_form": "formal"}}'
Here are the fields that shape new articles:
| Field |
What it sets |
language |
The language of new articles, as a tag like en-US or de-DE. |
timezone |
The time zone for publishing times, like Europe/Berlin. |
status |
active, paused or archived. New articles only start in an active project. |
context.background |
The site context: two to four plain sentences on who reads the site and what it covers. Up to 5,000 characters. |
context.address_form |
formal, informal or auto. This matters in languages like German or French. |
context.target_word_count |
The default length. One of 1000, 2000, 3000, 5000, 7500 or 10000. null lets the topic decide. |
defaults.content_template |
The template for new articles. |
defaults.voice |
The voice for new articles. |
defaults.outlet |
The outlet new articles go to. |
Send null to clear any of the defaults. Leave writing style instructions out of context.background, since the template and voice handle that.
Target length affects the price. Starting at 3,000 words, an article is at least In-depth (4 credits). Starting at 7,500 words, it becomes a Report (15 credits).
Delete a project
DELETE /projects/{project} removes the project permanently, and the API has no way to restore it. If you want to stop new articles without losing the project, set status to paused or archived instead.
Turn on Project Auto
Project Auto writes articles for a project every day without you having to start each one manually. It pulls from your project’s best ideas first, and when those run out, it starts a new idea run on its own. Keep in mind that it spends credits automatically for every article and idea run without asking first.
Use PUT /projects/{project}/auto to turn it on or update its settings:
curl -X PUT https://app.unspar.com/api/v1/projects/<project-id>/auto \
-H "Authorization: Bearer $UNSPAR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"enabled": true, "daily_article_goal": 2, "template_reference": "template:builtin:general_guide"}'
| Field |
What it does |
enabled |
true turns Auto on. Required. |
daily_article_goal |
How many articles Auto starts per day. |
template_reference |
The template Auto writes with. Required when you turn Auto on. |
stop_condition |
until_turned_off (the default), until_date with stop_at, or after_article_count with stop_article_goal. |
confirm_media_spend |
Send true if the template makes images. Each image costs 1 credit. |
Auto doesn’t start immediately; it picks up during one of its next regular checks. It also needs to know what to do with finished articles, which you configure on the project’s Edit page under Publishing automation.
Call GET /projects/{project}/auto to view the current settings and see if Auto is paused. Call DELETE /projects/{project}/auto to turn it off. Any articles already in progress will still finish. Read Project Auto and ideas to see why Auto might pause and how to handle it.
Find ideas
An idea is a suggested article that includes a title and a reason to write it. Unspar generates these in an idea run, which you start with POST /projects/{project}/idea-runs. Each run costs 1 credit, even if it finds nothing new.
curl -X POST https://app.unspar.com/api/v1/projects/<project-id>/idea-runs \
-H "Authorization: Bearer $UNSPAR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"workflow_type": "research_topic", "topic": "Bike repair at home"}'
The workflow_type field sets the kind of run. While the web app only offers the first and third options, the API supports all five:
workflow_type |
What Unspar does |
Fields |
analyze_site |
Reads the website and suggests topics it doesn’t have yet. |
project_url, which defaults to the project’s website |
competitor_gaps |
Suggests topics a competitor covers and you don’t. |
competitor_url (required) |
research_topic |
Researches a topic on the web. |
topic (required), audience |
refresh_content |
Suggests which finished articles in the project need an update. |
focus_area |
plan_series |
Plans a series of articles on one subject. |
series_brief (required), series_length, audience |
Send only the fields that belong to your chosen workflow_type. Any extra field triggers a 422 response naming the invalid field.
Read the ideas
An idea run takes about a minute. You can track it in three steps:
- Call
GET /idea-runs/{run} every 10 to 30 seconds while should_poll is true.
- Check
status. With completed, the ideas are ready. With completed_empty, the run found nothing new, and diagnostics says why.
- Call
GET /idea-runs/{run}/appearances to list the ideas. Each one has a title and a rationale. Many also have a template_suggestion.
Unspar skips topics your project already covers, whether in Unspar or on your live site, as well as ideas that are still open or were previously dismissed. Check counts.left_out to see how many were filtered out.
In the API, an idea inside a run is called an appearance. For the endpoints below, pass the item’s id as {appearance}, rather than its idea_id (the two are easy to mix up).
Queue or hide an idea
Use these endpoints to act on a single idea or on the run as a whole:
| Request |
What happens |
POST /idea-appearances/{appearance}/queue |
Unspar starts the article with the project’s settings. It costs the article’s normal price. Send "confirm_media_spend": true if the template makes images. |
POST /idea-appearances/{appearance}/decision |
Sets decision to shortlisted, dismissed or new. Dismissed ideas don’t come back in later runs. Free. |
POST /idea-runs/{run}/find-more |
Adds more ideas to the run. 1 credit. |
POST /idea-runs/{run}/refresh |
Repeats the run with the same input. 1 credit. |
You can call POST /articles/{article}/unqueue to move an article queued from an idea back to draft. Note that runs Unspar started on its own can’t be extended or repeated.
You also can’t queue ideas from a refresh_content run; the API returns 409 idea_queue_mode_unsupported. Start those refreshes in the web app instead, as shown in Refresh.
Set the look of the images
A project can use a visual identity, which gives all of its generated images a consistent look. You pick one from three generated options, just as you do in the web app.
- Call
POST /projects/{project}/visual-identity/rounds. Unspar makes three options. You can send an image style from GET /image-presets as preset, plus notes or a palette.
- Call
GET /projects/{project}/visual-identity until latest_round.status is ready. latest_round.candidates holds the three options, each with an index and a preview url.
- Call
PUT /projects/{project}/visual-identity with latest_round.id as round and your chosen index as candidate.
Rounds are free, with a daily limit of 5 per project and 15 per team (resetting at midnight UTC). Once a look is active, you can send a PUT request with only palette or notes to update them without starting a new round.
Call DELETE /projects/{project}/visual-identity to turn the visual identity off for new images. Existing images stay as they are. Using a visual identity adds no extra cost, so each image still costs 1 credit. See Images for examples of what it changes.
Endpoint reference
Generated from the OpenAPI document. Paths are relative to https://app.unspar.com.
GET/api/v1/projects
List visible projects.
Operation listProjects. Permission: unspar:projects:read
| Parameter | In | Type | Description |
|---|
page | query | integer | Minimum 1. |
per_page | query | integer | Minimum 1. Maximum 100. |
status | query | string | |
q | query | string | |
sort | query | "created_at", "-created_at", "updated_at", "-updated_at", "name", "-name", "status", "-status" | |
200 Visible project list.
POST/api/v1/projects
Create a project.
Creates a project in the caller's team. Omitted settings take the same defaults as the app. Requires an API key that covers all projects; project-scoped keys cannot create projects.
Operation createProject. Permission: unspar:projects:create
| Parameter | In | Type | Description |
|---|
Idempotency-Key | header | string | Optional client key that makes a repeated POST replay the first response instead of running twice. Up to 255 characters. |
| Body field | Type | Description |
|---|
namerequired | string | Up to 255 characters. |
urlrequired | string (uri) | The website the project writes for. |
language | string | Locale tag such as en-US or de-DE. |
status | "active", "paused", "archived" | |
timezone | string | IANA timezone name, for example Europe/Berlin. |
limit | integer | Monthly article limit; 0 means unlimited. Minimum 0. |
automate | boolean | Legacy app automation flag. It does not enable Project Auto; use /api/v1/projects/{project}/auto. |
defaults | object | |
context | object | Site context for the project. Only the keys you send change. |
201 Visible project.422 The request body failed validation; error.details lists the fields.
GET/api/v1/projects/{project}/visual-identity
Show the current look and latest options.
Images: set each project's look once with its visual identity (show three options, pick one). New illustrations, or new photos if the look is a photo style, then follow it. Do not describe image styles or colors in briefs. Candidate rounds are free, limited to 5 per project and 15 per team per UTC day. Responses include remaining rounds and the next UTC midnight reset time. Approve with both round (its public id) and candidate (1 to 3). Omit both to update only palette or notes. Reference files remain available for in-flight images.
Operation getProjectVisualIdentity. Permission: unspar:projects:read
| Parameter | In | Type | Description |
|---|
projectrequired | path | string | |
200 The current look, latest round and remaining daily allowance.409 Round in progress, daily limit reached, look inactive or round no longer available. The error details include reason and allowance with remaining rounds and resets_at.422 The request body failed validation; error.details lists the fields.
PUT/api/v1/projects/{project}/visual-identity
Use an option from an exact round, or change colors and notes.
Images: set each project's look once with its visual identity (show three options, pick one). New illustrations, or new photos if the look is a photo style, then follow it. Do not describe image styles or colors in briefs. Candidate rounds are free, limited to 5 per project and 15 per team per UTC day. Responses include remaining rounds and the next UTC midnight reset time. Approve with both round (its public id) and candidate (1 to 3). Omit both to update only palette or notes. Reference files remain available for in-flight images.
Operation approveProjectVisualIdentity. Permission: unspar:projects:update
| Parameter | In | Type | Description |
|---|
projectrequired | path | string | |
Idempotency-Key | header | string | Optional client key that makes a repeated POST replay the first response instead of running twice. Up to 255 characters. |
| Body field | Type | Description |
|---|
round | string | Exact round public id returned by generate or show. |
candidate | integer | Minimum 1. Maximum 3. |
palette | array of string | |
notes | string | Up to 300 characters. |
200 The current look, latest round and remaining daily allowance.409 Round in progress, daily limit reached, look inactive or round no longer available. The error details include reason and allowance with remaining rounds and resets_at.422 The request body failed validation; error.details lists the fields.
DELETE/api/v1/projects/{project}/visual-identity
Turn off the look for future images.
Images: set each project's look once with its visual identity (show three options, pick one). New illustrations, or new photos if the look is a photo style, then follow it. Do not describe image styles or colors in briefs. Candidate rounds are free, limited to 5 per project and 15 per team per UTC day. Responses include remaining rounds and the next UTC midnight reset time. Approve with both round (its public id) and candidate (1 to 3). Omit both to update only palette or notes. Reference files remain available for in-flight images.
Operation clearProjectVisualIdentity. Permission: unspar:projects:update
| Parameter | In | Type | Description |
|---|
projectrequired | path | string | |
Idempotency-Key | header | string | Optional client key that makes a repeated POST replay the first response instead of running twice. Up to 255 characters. |
200 The current look, latest round and remaining daily allowance.409 Round in progress, daily limit reached, look inactive or round no longer available. The error details include reason and allowance with remaining rounds and resets_at.422 The request body failed validation; error.details lists the fields.
POST/api/v1/projects/{project}/visual-identity/rounds
Show three free look options. Daily limits apply.
Images: set each project's look once with its visual identity (show three options, pick one). New illustrations, or new photos if the look is a photo style, then follow it. Do not describe image styles or colors in briefs. Candidate rounds are free, limited to 5 per project and 15 per team per UTC day. Responses include remaining rounds and the next UTC midnight reset time. Approve with both round (its public id) and candidate (1 to 3). Omit both to update only palette or notes. Reference files remain available for in-flight images.
Operation generateProjectVisualIdentity. Permission: unspar:projects:update
| Parameter | In | Type | Description |
|---|
projectrequired | path | string | |
Idempotency-Key | header | string | Optional client key that makes a repeated POST replay the first response instead of running twice. Up to 255 characters. |
| Body field | Type | Description |
|---|
preset | string | Public image preset id from GET /api/v1/image-presets. Choose a photo or illustration style. Defaults to the project's image style, then clean editorial illustration. |
palette | array of string | |
notes | string | Up to 300 characters. |
202 The current look, latest round and remaining daily allowance.409 Round in progress, daily limit reached, look inactive or round no longer available. The error details include reason and allowance with remaining rounds and resets_at.422 The request body failed validation; error.details lists the fields.
GET/api/v1/projects/{project}/auto
Show Project Auto configuration for one project.
Operation getProjectAuto. Permission: unspar:projects:automate
| Parameter | In | Type | Description |
|---|
projectrequired | path | string | |
200 Project Auto configuration.
PUT/api/v1/projects/{project}/auto
Enable or update Project Auto configuration.
Enabling Project Auto requires daily_article_goal and template_reference. Set confirm_media_spend to true when the selected template requires media spend acknowledgement.
Operation setProjectAuto. Permission: unspar:projects:automate
| Parameter | In | Type | Description |
|---|
projectrequired | path | string | |
Idempotency-Key | header | string | Optional client key that makes a repeated POST replay the first response instead of running twice. Up to 255 characters. |
| Body field | Type | Description |
|---|
enabledrequired | boolean | |
daily_article_goal | integer | Minimum 1. Maximum 65535. |
template_reference | string | template:builtin:<key> or a team template id from reads. Required when enabling. |
stop_condition | "until_turned_off", "until_date", "after_article_count", null | |
stop_at | string (date) | |
stop_article_goal | integer | Minimum 1. Maximum 65535. |
confirm_media_spend | boolean | Default false. |
200 Project Auto configuration.409 The request conflicts with current resource state or required confirmation.422 The request body failed validation; error.details lists the fields.
DELETE/api/v1/projects/{project}/auto
Disable Project Auto for one project.
Operation disableProjectAuto. Permission: unspar:projects:automate
| Parameter | In | Type | Description |
|---|
projectrequired | path | string | |
Idempotency-Key | header | string | Optional client key that makes a repeated POST replay the first response instead of running twice. Up to 255 characters. |
200 Project Auto configuration.
GET/api/v1/projects/{project}
Show one visible project.
Operation getProject. Permission: unspar:projects:read
| Parameter | In | Type | Description |
|---|
projectrequired | path | string | |
PATCH/api/v1/projects/{project}
Update a project.
Partial update. Only the fields present in the JSON body change, and inside context only the keys you send change.
Operation updateProject. Permission: unspar:projects:update
| Parameter | In | Type | Description |
|---|
projectrequired | path | string | |
Idempotency-Key | header | string | Optional client key that makes a repeated POST replay the first response instead of running twice. Up to 255 characters. |
| Body field | Type | Description |
|---|
namerequired | string | Up to 255 characters. |
urlrequired | string (uri) | The website the project writes for. |
language | string | Locale tag such as en-US or de-DE. |
status | "active", "paused", "archived" | |
timezone | string | IANA timezone name, for example Europe/Berlin. |
limit | integer | Monthly article limit; 0 means unlimited. Minimum 0. |
automate | boolean | Legacy app automation flag. It does not enable Project Auto; use /api/v1/projects/{project}/auto. |
defaults | object | |
context | object | Site context for the project. Only the keys you send change. |
200 Visible project.422 The request body failed validation; error.details lists the fields.
DELETE/api/v1/projects/{project}
Delete a project.
Operation deleteProject. Permission: unspar:projects:delete
| Parameter | In | Type | Description |
|---|
projectrequired | path | string | |
Idempotency-Key | header | string | Optional client key that makes a repeated POST replay the first response instead of running twice. Up to 255 characters. |
GET/api/v1/projects/{project}/idea-runs
List idea discovery runs for one visible project.
Operation listIdeaRuns. Permission: unspar:ideas:read
| Parameter | In | Type | Description |
|---|
projectrequired | path | string | |
page | query | integer | Minimum 1. |
per_page | query | integer | Minimum 1. Maximum 100. |
POST/api/v1/projects/{project}/idea-runs
Start an idea discovery run for one project.
Operation startIdeaRun. Permission: unspar:ideas:write
| Parameter | In | Type | Description |
|---|
projectrequired | path | string | |
Idempotency-Key | header | string | Optional client key that makes a repeated POST replay the first response instead of running twice. Up to 255 characters. |
| Body field | Type | Description |
|---|
workflow_typerequired | "analyze_site", "competitor_gaps", "research_topic", "refresh_content", "plan_series" | |
project_url | string | analyze_site only. Defaults to the project website. Up to 2000 characters. |
competitor_url | string | competitor_gaps only, required there. Up to 2000 characters. |
topic | string | research_topic only, required there. Up to 2000 characters. |
focus_area | string | refresh_content only. For research_topic, put the focus into topic or audience. Up to 2000 characters. |
series_brief | string | plan_series only, required there. Up to 2000 characters. |
series_length | integer | plan_series only. Minimum 1. |
audience | string | research_topic and plan_series only. Up to 500 characters. |
202 Idea run mutation response.402 The team does not have enough credits for this operation.409 The request conflicts with current resource state or required confirmation.422 The request body failed validation; error.details lists the fields.
GET/api/v1/idea-runs/{run}
Show one idea discovery run.
Operation getIdeaRun. Permission: unspar:ideas:read
| Parameter | In | Type | Description |
|---|
runrequired | path | string | |
GET/api/v1/idea-runs/{run}/appearances
List public idea appearances produced by one run.
Operation listIdeaAppearances. Permission: unspar:ideas:read
| Parameter | In | Type | Description |
|---|
runrequired | path | string | |
page | query | integer | Minimum 1. |
per_page | query | integer | Minimum 1. Maximum 100. |
200 Idea appearance list.
POST/api/v1/idea-runs/{run}/find-more
Start an expansion pass for an ordinary idea run.
Operation findMoreIdeas. Permission: unspar:ideas:write
| Parameter | In | Type | Description |
|---|
runrequired | path | string | |
Idempotency-Key | header | string | Optional client key that makes a repeated POST replay the first response instead of running twice. Up to 255 characters. |
202 Idea run mutation response.409 The request conflicts with current resource state or required confirmation.
POST/api/v1/idea-runs/{run}/refresh
Refresh an idea run from its stored input.
Operation refreshIdeaRun. Permission: unspar:ideas:write
| Parameter | In | Type | Description |
|---|
runrequired | path | string | |
Idempotency-Key | header | string | Optional client key that makes a repeated POST replay the first response instead of running twice. Up to 255 characters. |
202 Idea run mutation response.409 The request conflicts with current resource state or required confirmation.422 The request body failed validation; error.details lists the fields.
POST/api/v1/idea-appearances/{appearance}/decision
Set an idea appearance decision state.
Operation decideIdeaAppearance. Permission: unspar:ideas:write
| Parameter | In | Type | Description |
|---|
appearancerequired | path | string | |
| Body field | Type | Description |
|---|
decisionrequired | "new", "shortlisted", "dismissed" | |
200 Idea appearance.422 The request body failed validation; error.details lists the fields.
POST/api/v1/idea-appearances/{appearance}/queue
Queue one idea appearance as an article.
Operation queueIdeaAppearance. Permission: unspar:generation:write
| Parameter | In | Type | Description |
|---|
appearancerequired | path | string | |
Idempotency-Key | header | string | Optional client key that makes a repeated POST replay the first response instead of running twice. Up to 255 characters. |
| Body field | Type | Description |
|---|
confirm_media_spend | boolean | Default false. |
202 Queued idea article.402 The team does not have enough credits for this operation.409 The request conflicts with current resource state or required confirmation.