Skip to content

Outlets

An outlet is a place where Unspar sends finished articles, like your WordPress site or a GitHub repository. With these endpoints, your code sets up outlets and checks that they work.

All docs pages

Before Unspar can publish an article, it needs to know where to send it. That destination is called an outlet. You set it up once with the address and login details Unspar needs, then publish articles to it by ID using POST /articles/{article}/publish.

Outlets are shared across your whole team, so your token needs access to all projects to create or change them. You can also see them under Outlets in the web app.

Create an outlet

To create an outlet with POST /outlets, send a name, a type, and two objects:

  • connection holds non-secret settings, such as the site address.
  • credentials holds secret values, such as a password or token.

Unspar encrypts your credentials before storing them and never returns them in API responses. Here is an example that connects a WordPress site:

curl -X POST https://app.unspar.com/api/v1/outlets \
  -H "Authorization: Bearer $UNSPAR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "My blog",
    "type": "wordpress",
    "connection": { "api_url": "https://example.com/wp-json" },
    "credentials": {
      "username": "editor",
      "password": "abcd efgh ijkl mnop qrst uvwx"
    }
  }'

Each type requires different fields. The linked guides show where to find each value on your site.

type connection credentials Guide
wordpress api_url: the address of the site’s REST API, usually ending in /wp-json. username: a WordPress user. password: an application password for that user (rather than their regular login password). WordPress
ghost api_url: the address of the site. api_key: an Admin API key from a custom integration in Ghost. Outlets and publishing
github owner and repo: the repository. branch: an existing branch. directory: the folder where files go (leave it out to use the root folder). api_key: a fine-grained token with read and write access to the repository’s contents. GitHub
webhook api_url: a public HTTPS address. api_key: a signing secret that your receiver also knows. Webhooks

Email outlets are easiest to set up under Outlets in the web app, where you can see all their options. You can’t add new Medium outlets, though existing ones keep working.

Keep secrets out of your files

Avoid committing files with credentials to your repository. If you create outlets with the CLI, pass --secret-field to hide secret values in the command output. They appear as [REDACTED] in previews and error messages:

unspar api post /outlets --body-file github-outlet.json --secret-field api_key

Test an outlet

GET /outlets returns your outlets without their secrets. The ready field tells you whether an outlet has all the required settings, and readiness_reason explains what is missing. Neither confirms that the connection still works, so you need to run a test for that.

POST /outlets/{outlet}/test tests the connection and saves the result. What it checks depends on the outlet type:

Outlet What the test does
WordPress Logs in and reads posts.
GitHub Reads the repository and the branch.
Webhook Checks the address and confirms a secret is stored, without sending anything to your receiver.
Email Sends a test email.

You can check the outcome of the most recent test in the outlet’s last_connection_test field.

Change or delete an outlet

PATCH /outlets/{outlet} updates only the fields you include. If you omit credentials, your stored secrets stay as they are. To remove a stored secret, list it in clear_credentials:

{ "clear_credentials": { "api_key": true } }

DELETE /outlets/{outlet} removes the outlet. Unspar blocks the deletion if articles still point to the outlet or if a Project Auto publishes to it, and the response tells you what is in the way. Any projects that used the outlet as their default lose that setting, and the response lists them in cleared_project_defaults.

Find out what a site runs

POST /outlets/detect takes a site’s address in input, checks whether the site runs WordPress or Ghost, and suggests the API address to use. It doesn’t save anything. The web app runs this same check on the Assistant tab when you add an outlet.

For details on what each kind of outlet receives when you publish, see Outlets and publishing.

Endpoint reference

Generated from the OpenAPI document. Paths are relative to https://app.unspar.com.

GET/api/v1/outlets

List publishing outlets without credentials.

Operation listOutlets. Permission: unspar:outlets:read

ParameterInTypeDescription
pagequeryintegerMinimum 1.
per_pagequeryintegerMinimum 1. Maximum 100.
qquerystring
provider_typequery"wordpress", "medium", "ghost", "email", "github", "webhook"
readyqueryboolean
default_for_projectquerystring
sortquery"created_at", "-created_at", "name", "-name"
  • 200 Publishing outlet list.

POST/api/v1/outlets

Create a publishing outlet. Credentials are write-only.

Operation createOutlet. Permission: unspar:outlets:write

Body fieldTypeDescription
namestring
type"wordpress", "medium", "ghost", "email", "github", "webhook"
connectionobject
credentialsobject
selectionobject
defaultsobject
clear_credentialsobject
  • 201 Publishing outlet.

POST/api/v1/outlets/detect

Detect a publishing provider from a public URL without saving it.

Operation detectOutlet. Permission: unspar:outlets:write

Body fieldTypeDescription
inputrequiredstring
  • 200 Outlet provider detection result.

GET/api/v1/outlets/{outlet}

Show one publishing outlet without credentials.

Operation getOutlet. Permission: unspar:outlets:read

ParameterInTypeDescription
outletrequiredpathstring
  • 200 Publishing outlet.

PATCH/api/v1/outlets/{outlet}

Update a publishing outlet. Omitted credentials are preserved.

Operation updateOutlet. Permission: unspar:outlets:write

ParameterInTypeDescription
outletrequiredpathstring
Body fieldTypeDescription
namestring
type"wordpress", "medium", "ghost", "email", "github", "webhook"
connectionobject
credentialsobject
selectionobject
defaultsobject
clear_credentialsobject
  • 200 Publishing outlet.

DELETE/api/v1/outlets/{outlet}

Delete a publishing outlet when article and Project Auto safeguards allow it.

Operation deleteOutlet. Permission: unspar:outlets:write

ParameterInTypeDescription
outletrequiredpathstring
  • 200 Outlet deletion result.

POST/api/v1/outlets/{outlet}/test

Run and persist a sanitized connection test for an outlet.

Operation testOutlet. Permission: unspar:outlets:write

ParameterInTypeDescription
outletrequiredpathstring
  • 200 Outlet connection test result.

Last updated 25 November 2026. This page as Markdown: outlets.md

Try Unspar for free

Create a project, give it a topic and read the article before anything goes live.