Getting started
WordPress integration
The Autoranko WordPress plugin connects a site once; from then on the API drives it from anywhere. This page explains how the pieces fit. For the setup itself, see How it works.
How the pieces fit
WordPress site
Autoranko
Your code
Your code never talks to WordPress directly. The API works on the records Autoranko keeps for each connected site, and Autoranko makes the WordPress calls. That's why one token can drive every site on your account, wherever they're hosted.
Connecting a site
Connecting happens in WordPress and the Autoranko dashboard, because it needs a WordPress administrator. There are no API endpoints for it. Each step changes what the API shows:
| Step | What happens | In the API |
|---|---|---|
| 1. Install the plugin | Activating the plugin registers the site with Autoranko. The site exists, but no account owns it yet. | Not listed: GET /sites shows only sites your account owns. |
| 2. Claim it with the 6-digit code | The plugin shows a 6-digit code in wp-admin. Enter it in your Autoranko dashboard to link the site to your account. Codes work once and expire after 24 hours. | Listed in GET /sites. Its plan follows your subscription. |
| 3. Authorize publishing | Approve Autoranko on WordPress's own Authorize Application screen. WordPress creates an application password for Autoranko, which stores it encrypted. | wp_connected turns true: jobs can be published. |
| 4. Sync | The plugin sends your posts to Autoranko, every post and not only the ones Autoranko wrote, and keeps sending changes. | GET /sites/{id}/articles lists them, each at its latest version. |
Once step 2 is done, everything else can run from the API: generating, reviewing and publishing articles, reading the synced content and researching keywords. Start with the quickstart.
Publishing to WordPress
When a job is published (by POST /jobs/{id}/publish, or by itself with auto_publish), Autoranko creates the post through the WordPress REST API, signed in with the application password from step 3. The post goes live right away:
| Job field | WordPress post |
|---|---|
article_title | Title |
article_html | Content |
meta_description | Excerpt |
| Status | Published (publish), not a draft |
The post's ID comes back on the job as wp_post_id, and job.published carries its URL in wp_link. If WordPress refuses the post, the job goes back to review with the reason in error, and job.review fires with publish_error: true.
Taking publishing access back
wp_connected to false. Revoking Autoranko's application password in WordPress (Users → Profile → Application Passwords) also stops publishing, but Autoranko only finds out at the next publish attempt, which then fails with an error on the job.Site states in the API
These fields of the site object (GET /sites, GET /sites/{id}) reflect the WordPress side. Check wp_connected and is_active before relying on publishing.
domainstringThe site's hostname. A domain can be registered only once across Autoranko.planstringThe plan this site's limits are enforced against. It mirrors the owner's subscription.One of
freestarterprois_activebooleanfalseonce the Autoranko plugin has been deleted from the WordPress site;trueagain if the plugin registers the site again.wp_connectedbooleantruewhen Autoranko is authorized to publish to the site's WordPress. Publishing (POST /jobs/{id}/publish orauto_publish) needs it.
Full site object: Sites reference.
Plugin keys and API tokens
Three credentials are involved, and only one of them is yours to use:
| Credential | Created | Used for |
|---|---|---|
API token ar_live_… | By you, in Dashboard → API | Your code calling the API, for every site on your account. Authentication |
| Plugin site key | Automatically, when the plugin registers the site | The plugin talking to Autoranko, and nothing else. It isn't an API token: the public API rejects it with 401 invalid_token. |
| WordPress application password | By WordPress, when you authorize publishing | Autoranko publishing posts to that one site. Stored encrypted; revoke it in WordPress at any time. |