Guide

Spoken Article REST API

Custom REST routes for play counts, ElevenLabs proxying, TTS text, interstitial ads, and spoken-article CPT helpers.

Namespace: prc-spoken-article/v1 Base path: /wp-json/prc-spoken-article/v1/

Auth summary

AccessRoutes
PublicPOST /play-count/{post_id}, GET /interstitial-for-post/{post_id}
edit_postsElevenLabs voices/TTS, GET /tts-text/{post_id}, spoken-article-for helpers
manage_optionsPOST /voice, GET/POST /interstitial-ads (includes ElevenLabs site settings)

Play count

Request POST /wp-json/prc-spoken-article/v1/play-count/123
HeadersKey: value
Accept application/json
Response 200 OK
BodyJSON
{
  "play_count": 42
}

ElevenLabs proxy

MethodPathPermissionPurpose
GET/elevenlabs/voicesedit_postsVoice list (cached 1 day; ?refresh=1 requires manage_options)
GET/elevenlabs/voices/{voice_id}edit_postsSingle voice (cached 1 day)
POST/elevenlabs/ttsedit_postsTTS; response body is raw audio/mpeg
Reference

POST /elevenlabs/tts body

Typed options, defaults, and constraints in one scannable reference.
4 fields
text string required
Text to synthesize.
voice_id string
ElevenLabs voice ID override.
model_id string
Model ID (draft or production tier).
voice_settings object
Optional voice settings object.

TTS text

GET /tts-text/{post_id} — returns TTS-ready text for a post.

Reference

Query parameters

Typed options, defaults, and constraints in one scannable reference.
1 field
target_minutes number
Target spoken length in minutes (1–8) for summarization.

Interstitial ads and settings

MethodPathPermissionPurpose
GET / POST/interstitial-adsmanage_optionsGlobal ads + ElevenLabs admin settings payload
GET/interstitial-for-post/{post_id}PublicResolve interstitial audio for the player

Voice default

POST /voice — save the site default ElevenLabs voice ID (manage_options). Body: { "voice_id": "..." }.

Spoken-article CPT helpers

GET / POST /spoken-article-for/{post_id} — look up or create the private spoken-article post linked to a parent (edit_posts). Optional target_minutes on create.

Was this helpful?