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
| Access | Routes |
|---|---|
| Public | POST /play-count/{post_id}, GET /interstitial-for-post/{post_id} |
edit_posts | ElevenLabs voices/TTS, GET /tts-text/{post_id}, spoken-article-for helpers |
manage_options | POST /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
Response headers
Key: value
BodyJSON
{
"play_count": 42
}ElevenLabs proxy
| Method | Path | Permission | Purpose |
|---|---|---|---|
GET | /elevenlabs/voices | edit_posts | Voice list (cached 1 day; ?refresh=1 requires manage_options) |
GET | /elevenlabs/voices/{voice_id} | edit_posts | Single voice (cached 1 day) |
POST | /elevenlabs/tts | edit_posts | TTS; response body is raw audio/mpeg |
Reference
4 fields
POST /elevenlabs/tts body
Typed options, defaults, and constraints in one scannable reference.
-
textstring required -
Text to synthesize.
-
voice_idstring -
ElevenLabs voice ID override.
-
model_idstring -
Model ID (draft or production tier).
-
voice_settingsobject -
Optional voice settings object.
No fields match this filter.
TTS text
GET /tts-text/{post_id} — returns TTS-ready text for a post.
Reference
1 field
Query parameters
Typed options, defaults, and constraints in one scannable reference.
-
target_minutesnumber -
Target spoken length in minutes (1–8) for summarization.
No fields match this filter.
Interstitial ads and settings
| Method | Path | Permission | Purpose |
|---|---|---|---|
GET / POST | /interstitial-ads | manage_options | Global ads + ElevenLabs admin settings payload |
GET | /interstitial-for-post/{post_id} | Public | Resolve 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.