# Generated from the implemented API on 2026-11-28. Keep in step with workers/api/src/routes.
openapi: 3.1.0
info:
  title: Everyspoke API
  version: 1.0.0-beta
  summary: Publish to every social network and read real analytics.
  description: 'Every request is authenticated with an API key: `Authorization: Bearer es_live_...`.


    Keys starting with `es_test_` work against simulated platforms: nothing is ever published, so you can build your whole
    integration first. Test keys only see test workspaces, live keys only live ones.


    Errors always have a stable `error.code` and a plain `error.message` you can show to people. Rate limits answer `429`
    with `Retry-After`.


    Each API key may make 600 requests a minute. Above that the API answers `429` with `Retry-After`.


    Features that depend on an outside review can be switched off for your organization. A network that is off shows as `coming_soon`
    in `GET /platforms` and is left out of connect links.


    Changes 2026-12-01: the clip tools (combine, talking head) caption with `bold` in the `middle` and the spoken word
    in `brand.accent` when `captions` is left out (it was `highlight` at the `bottom`; a captions object keeps those
    defaults). Talking head `layout` defaults to `pip` (it was `full`). The video chat can answer with `drafts`
    messages: designs and post drafts it planned, nothing made or charged.'
  contact:
    email: developers@everyspoke.com
servers:
- url: https://api.everyspoke.com/v1
  description: Production
- url: https://everyspoke-api.dahllof-richard.workers.dev/v1
  description: Until api.everyspoke.com is live
security:
- apiKey: []
tags:
- name: Workspaces
- name: Accounts
- name: Media
- name: Posts
- name: Metrics
- name: Webhook endpoints
- name: Platforms
- name: Organization
- name: Billing
  description: Plans, subscription, invoices, credit packs and platform fees. Payments are handled by Stripe; card details never reach Everyspoke.
- name: Operations
  description: Whether publishing works, per platform.
- name: API keys
- name: Members
- name: Approvals
  description: Let people check posts before they go out. Reviewers use a simple page of their own, see "Approvals" in the
    guide.
- name: Inbox
  description: Comments on your posts from every connected account, in one place per workspace.
- name: Automations
  description: Answer comments that contain a keyword with a private message and a public reply on Facebook and Instagram, and
    collect the contacts people leave. Needs the automations feature.
- name: Boosts
  description: Promote a published post from the client's own ad account (Meta, LinkedIn, TikTok), with ad statistics next to the
    post. Each ad system has its own feature.
- name: Listening
  description: A paid add-on. Watch keywords, names and hashtags on X, Bluesky, Mastodon, YouTube, Instagram hashtags and news.
- name: Content
  description: 'Write, design and voice posts. Brand profile, text drafts per platform, images and templates, video, voice,
    captions, sources (web pages, YouTube, PDF, audio) and RSS feeds. Everything made is a draft or a file in the media library:
    nothing is published until you create a post.'
- name: Credits
  description: Image and video generation uses credits. Text, voice and captions are free.
- name: Short links
  description: Short links, UTM parameters and click counts. Short links open at `/l/{code}` on the API host, or at the root
    of your short domain.
- name: Scheduling
  description: Posting times per account, queue, recurring posts, threads, bulk upload from CSV and best time to post.
- name: Campaign video
  description: 'Short promo videos from a description. You get several different proposals for one brief, each labelled with
    its method and its price in credits: `campaign` (designed from your brand profile and rendered from a layout, the cheapest,
    with a free preview), `mixed` (the same with generated images or clips in some scenes) and `ai_video` (fully generated
    by a video model). Pick one, edit it, save it as a template, and render it to an MP4 in the media library. Nothing is
    charged until a render, and a render is charged only when it is done. Needs the campaign_video feature.'
- name: Video chat
  description: 'Make a campaign video by talking it through. The assistant asks only for what is missing, offers quick
    replies, makes proposals with the campaign video proposals and changes the chosen one on request. It never renders,
    publishes or schedules: use the render and post endpoints for that, each with its price shown first. Chatting is charged
    by use: each plan includes some chat a month, and use beyond it costs credits, debited a whole credit at a time as the
    fractions add up (see `meter`). Needs the video_chat and campaign_video features. In test mode the assistant is simulated
    and costs nothing.'
- name: Designs
  description: 'Design templates: quote carousels on paper or with highlighted words, text post cards, tips carousels in two
    styles, a "when this, then that" slideshow, centred quotes, generated infographics in 20 visual themes, generated
    carousels from one prompt per slide, and product photos placed in a new scene. Drawn templates are laid out by Everyspoke
    in your brand colours and fonts and can be previewed for free; generated templates are priced cost-plus per image, shown
    before anything is charged and returned if the job fails. Give `inputs` that match the template fields, a `prompt` (a
    short brief that is written into the fields for you), or both. The infographic has a detail choice
    (`inputs.density`): `short` (a title and 3 to 6 facts) or `detailed` (a title, 4 to 6 sections, a small chart or
    timeline and a short how-to list); its quality `auto` makes short on Standard and detailed on Pro at 2K, and
    `price.density` in the catalog gives both prices. The words in a finished infographic are read back and compared
    with the text (`text.check`); a picture that differs is made again once at no extra charge, and if the words still
    differ a quiet notice says so (`notices`, code `text_may_differ`). Every image is saved to the media library, ready for a
    post. A design is a generation of kind `image`, so the `generation.completed` and `generation.failed` webhooks fire for it
    too. Needs the design_templates feature.'
- name: AI video formats
  description: 'Saved characters and four video formats made of generated scenes: a talking character, a narrated story,
    a hook story and voiced scenes. A character keeps the same face, hair and clothes in every scene: its reference picture
    goes with every picture request and its traits are repeated word for word. Plan for free, see the price, make the scenes
    (each charged when made, refunded if it fails), make one again, and render with the campaign video render. Needs the
    ai_video_formats and campaign_video features.'
- name: Clip tools
  description: 'Videos made from your own clips. Combine 1 to 20 clips from the media library into one video (order, trimmed
    silence, a title, captions from what is said, transitions, music under the speech, a length cap, any of the four shapes),
    or turn one clip of a person speaking into a video that cuts to 3 to 6 generated pictures or clips at the moments that
    suit what is said, while their own voice carries on. The words said in each clip are recognized from the sound the media
    analysis keeps, charged once (only windows not recognized before) and kept with the file. Every request that charges
    takes an Idempotency-Key, and `dry_run: true` gives the whole price first. The result is a campaign video, rendered with
    the normal render endpoint: each cutaway is charged when it is made and refunded if it fails, the render only when it is
    done. Clips must be analysed first (POST /workspaces/{workspace_id}/media-analyses). Needs the clip_tools and
    campaign_video features. These videos need renderer feature level 3.'
- name: Reports
  description: Monthly reports as a web page, a shareable link and a PDF, automatic email to the client, and CSV export of
    statistics.
- name: Imports
  description: Bring media in from Google Drive, Dropbox and Canva.
- name: MCP
  description: Remote MCP server for AI assistants.
- name: Video coach
  description: 'A review of a short video (a reel, a short, a TikTok) with concrete advice. It uses the media analysis of the
    video (frames, cuts, words said, quality) and measures facts itself (length, when the first words come, text on screen),
    then scores six areas from 0 to 100 with a short reason each: the hook in the first 3 seconds, pacing and cuts, on-screen
    text and captions, audio and voice, length for the network and call to action. It gives 3 to 7 fixes in order, a new
    first line and a caption. Fixes that one of our tools can carry out name it (`apply`). The price (the analysis the video
    still needs plus the review) is shown first, charged once and the review part refunded if it cannot be made; a failed
    analysis refunds itself. Needs the video_coach feature and a renderer for the analysis.'
- name: Inspiration
  description: 'Public posts that did well on a topic, from the official public APIs of Bluesky (post search) and Mastodon
    (hashtag timelines and trending posts of the configured servers), plus the workspace''s own best posts of the last 90
    days from our statistics. X can be added with an app token. Filter by network, media, likes, comments, shares,
    followers, words to leave out and creator, and sort. Results are cached for a short time for everyone, hold only the
    fields shown and are replaced whole on refresh, so a post deleted on its network drops out. Fetches that reach a network
    are limited per organization. Remix turns the idea of a post into original drafts in the brand voice through the normal
    text generation (free, counted against the daily text allowance). In test mode the posts are made up and no network
    is asked. Needs the inspiration feature.'
- name: Prompts
  description: 'A library of writing frameworks for posts and short video scripts (three tips, list post, lessons learned, myth
    versus fact, problem agitate solve, before after bridge, story with a hook, question post, offer post, summary, thread,
    YouTube description with chapters, short video script, how-to script). Built in prompts are read only and can be
    duplicated; a workspace creates, edits and deletes its own. Pass a prompt id as `options.prompt_id` in a text
    generation (or `prompt_id` in a remix) and the drafts follow it, with the brand profile still setting tone and words. The
    prompt''s text is copied into the generation when it is made. Needs the prompt_library feature.'
- name: Marketing strategist
  description: 'A marketing plan for a small business, made in a short interview. Give the website addresses, a description
    in your own words and product photos or PDFs; the strategist reads them (public https pages only, size and time
    capped), looks at what the workspace already shows (connected networks, posts scheduled and published, how the last 30
    days did, followers, brand profile, plan and age) and asks one question at a time, each with 2 to 4 suggested answers,
    skipping what it already knows. The plan has the audience and their problems, positioning and key messages, 3 to 5
    content pillars, channels with a cadence, offers, KPIs and a 30 day calendar where each post names the tool to make it.
    Every claim of fact in it cites its source (a page by URL, your text, a document, a photo, an answer or your own
    data); claims without one are dropped. Every version is kept. Make week turns a week of the calendar into drafts
    awaiting approval: written posts get their text, pictures and videos become proposals that open their tool, where the
    price is shown before anything is made. A weekly check-in reads the last week''s results and adds what worked and what
    to change, as a new version; it is skipped, free, when nothing was published or nothing changed. Charged by use on its
    own monthly allowance, then credits (`meter`). The strategist answers in the language you write in. Needs the
    marketing_strategist feature.'
- name: Content packs
  description: 'A whole set of posts from the photos and the text about one thing: a home for sale, a new product, a dish
    or menu, an event, an offer. Give 1 to 40 photos or clips and the text (pasted, or read from a public link). One call
    reads the facts as structured data, only what the text says (a figure, a name or a date the text does not give is
    left out and listed in notes), finds the kind of pack and the language, and orders the photos with the media analysis
    (the outside first for a home, the hero shot first for a product; blurry photos and near duplicates are left out).
    The recipe of the kind of pack makes the items, all in the language of the text with its number formats: a designed
    9:16 video over the photos, a 15 second reel with a voice and captions, a 4:5 carousel of photo slides, two or three
    single images of the strongest points, post texts per network and a suggested day for each. Real estate packs only
    use the real photos; other kinds can add the product in a generated scene. Planning is free (it counts against the
    daily text allowance) and shows one price for the whole pack. Making it checks the whole price against the balance
    first, analyses photos that were never analysed (charged and refunded like any analysis), then makes each item with
    its own tool: videos are charged when the render succeeds and never when it fails, slides and images are charged when
    started and refunded when they fail. Every item becomes a draft in the calendar; nothing is published until a draft
    is approved. Needs the content and content_packs features (videos also need campaign_video).'
- name: Video editor
  description: 'Make any picture move. "Make it a video" turns a finished picture into a campaign video where the camera
    reads it part by part (an infographic heading by heading, top to bottom, a photo''s subject from its media analysis),
    holding on each, then shows it whole; a carousel becomes one scene per slide, pushed on like a swipe. "Animate this
    image" makes the picture the first frame of a short generated clip. "Make another version" makes the picture again on a
    chosen quality from an edited prompt (a design from the same design), and every version is kept. Making the video is
    free until it is rendered; a version and an animation are generations, priced before, charged when they start and
    refunded if they fail. The editor''s timeline saves text, shapes, pictures and clips placed freely in time as
    `overlays` of the spec, and can give a video as a slideshow (one still per scene, drawn in the browser and saved as
    pictures, for a carousel post). These videos need renderer feature level 4. Needs the free_editor and campaign_video
    features.'
paths:
  /workspaces:
    get:
      tags:
      - Workspaces
      summary: List workspaces
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/Workspace'
                  next_cursor:
                    type:
                    - string
                    - 'null'
                required:
                - data
        default:
          $ref: '#/components/responses/Error'
      description: Requires the `read` scope.
      parameters:
      - $ref: '#/components/parameters/Cursor'
      - $ref: '#/components/parameters/Limit'
    post:
      tags:
      - Workspaces
      summary: Create a workspace
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Workspace'
        default:
          $ref: '#/components/responses/Error'
      description: 'One workspace per end client. Data in one workspace is never visible from another. A test key creates
        a test workspace, a live key a live one.


        Requires the `admin` scope.'
      parameters:
      - $ref: '#/components/parameters/IdempotencyKey'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  maxLength: 200
                external_id:
                  type: string
                  maxLength: 200
                  description: Your own id for this client.
              required:
              - name
  /workspaces/{workspace_id}:
    parameters:
    - $ref: '#/components/parameters/WorkspaceId'
    get:
      tags:
      - Workspaces
      summary: Get a workspace
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Workspace'
        default:
          $ref: '#/components/responses/Error'
      description: Requires the `read` scope.
    delete:
      tags:
      - Workspaces
      summary: Delete a workspace and all its data
      responses:
        '202':
          description: Deletion started. Accounts, posts, media, metrics and logs are removed.
        default:
          $ref: '#/components/responses/Error'
      description: Requires the `admin` scope.
  /workspaces/{workspace_id}/connect-links:
    parameters:
    - $ref: '#/components/parameters/WorkspaceId'
    post:
      tags:
      - Accounts
      summary: Create a connect link
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ConnectLink'
        default:
          $ref: '#/components/responses/Error'
      description: 'A link your client opens to connect their own accounts, shown under your brand. In test mode the link
        connects simulated accounts.


        Requires the `connect` scope.'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                platforms:
                  type: array
                  items:
                    $ref: '#/components/schemas/PlatformId'
                  description: Platforms to offer. Empty means all available.
                redirect_url:
                  type: string
                  format: uri
                  description: Where your client is sent afterwards. Its origin must be in allowed_redirect_origins.
                expires_in:
                  type: integer
                  minimum: 300
                  maximum: 2592000
                  default: 604800
                  description: Seconds.
  /workspaces/{workspace_id}/accounts:
    parameters:
    - $ref: '#/components/parameters/WorkspaceId'
    get:
      tags:
      - Accounts
      summary: List connected accounts
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/Account'
                  next_cursor:
                    type:
                    - string
                    - 'null'
                required:
                - data
        default:
          $ref: '#/components/responses/Error'
      description: Requires the `read` scope. Lists the accounts you can publish to. Ad accounts (kind `ad_account`) are only
        listed with `kind=ad_account`.
      parameters:
      - name: platform
        in: query
        schema:
          $ref: '#/components/schemas/PlatformId'
      - name: kind
        in: query
        schema:
          type: string
          enum:
          - ad_account
  /accounts/{account_id}:
    parameters:
    - $ref: '#/components/parameters/AccountId'
    get:
      tags:
      - Accounts
      summary: Get an account
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Account'
        default:
          $ref: '#/components/responses/Error'
      description: Requires the `read` scope.
    delete:
      tags:
      - Accounts
      summary: Disconnect an account
      responses:
        '204':
          description: Disconnected. Its tokens are deleted at once.
        default:
          $ref: '#/components/responses/Error'
      description: Requires the `connect` scope.
  /accounts/{account_id}/metrics:
    parameters:
    - $ref: '#/components/parameters/AccountId'
    get:
      tags:
      - Metrics
      summary: Account metrics as a time series
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MetricSeriesList'
        default:
          $ref: '#/components/responses/Error'
      description: 'Collected once a day for every connected account.


        Requires the `metrics` scope.'
      parameters:
      - name: from
        in: query
        required: true
        schema:
          type: string
          format: date
      - name: to
        in: query
        required: true
        schema:
          type: string
          format: date
  /media:
    post:
      tags:
      - Media
      summary: Create a media upload
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MediaUpload'
        default:
          $ref: '#/components/responses/Error'
      description: 'Give `content_type` and `bytes` to get an upload. Files up to 95 MB get one `upload_url`: PUT the bytes
        there. Larger files (up to 4 GB) get `part_urls`: PUT each part of `part_size` bytes (the last one smaller), then
        call complete. Or give `source_url` and the file is fetched for you (up to 100 MB). Upload URLs are signed and need
        no API key; they expire after 6 hours.


        Requires the `publish` scope.'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                workspace_id:
                  type: string
                content_type:
                  type: string
                  enum:
                  - image/jpeg
                  - image/png
                  - image/gif
                  - image/webp
                  - image/heic
                  - image/heif
                  - video/mp4
                  - video/quicktime
                  - audio/mpeg
                  - audio/wav
                  - audio/mp4
                  - audio/aac
                  - application/pdf
                bytes:
                  type: integer
                  minimum: 1
                  maximum: 4294967296
                filename:
                  type: string
                  maxLength: 255
                source_url:
                  type: string
                  format: uri
              required:
              - workspace_id
  /workspaces/{workspace_id}/media:
    parameters:
    - $ref: '#/components/parameters/WorkspaceId'
    get:
      tags:
      - Media
      summary: List the media library, newest first
      description: The files of the workspace, with the same fields as `GET /media/{media_id}`. That is uploads and
        imports, and also the files Everyspoke made, such as rendered campaign videos, generated images, voiceovers and
        music. An upload that is not finished yet is left out; it shows up on a later call once its last byte is in. Files
        are ordered by when the upload was created, so a large upload that finishes late lands where it started, not at
        the top. Without `links` the list has no links, and `GET /media/{media_id}/link` signs one. With `links=1` each
        file gets `links` (signed links to the file and to each copy listed under `variants`, such as the still
        `poster` of a video or the small `proxy` preview) and `links_expire_in`. Requires the `read` scope.
      parameters:
      - $ref: '#/components/parameters/Cursor'
      - $ref: '#/components/parameters/Limit'
      - name: kind
        in: query
        description: Only these kinds, one or several separated by commas (`image,video`).
        schema:
          type: string
          pattern: ^(image|video|audio)(,(image|video|audio))*$
        example: image,video
      - name: links
        in: query
        description: '`1` adds signed links that work for one hour.'
        schema:
          type: string
          enum:
          - '0'
          - '1'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  object:
                    type: string
                    const: list
                  data:
                    type: array
                    items:
                      allOf:
                      - $ref: '#/components/schemas/Media'
                      - type: object
                        properties:
                          links:
                            type: object
                            description: Only with `links=1`.
                            properties:
                              file:
                                type: string
                              poster:
                                type: string
                              proxy:
                                type: string
                              normalized:
                                type: string
                            required:
                            - file
                          links_expire_in:
                            type: integer
                            description: Seconds the links work, only with `links=1`.
                  next_cursor:
                    type:
                    - string
                    - 'null'
                required:
                - data
                - next_cursor
        default:
          $ref: '#/components/responses/Error'
  /media/{media_id}:
    parameters:
    - $ref: '#/components/parameters/MediaId'
    get:
      tags:
      - Media
      summary: Get media
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Media'
        default:
          $ref: '#/components/responses/Error'
      description: Requires the `read` scope.
    patch:
      tags:
      - Media
      summary: Keep media in the library
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - keep
              properties:
                keep:
                  type: boolean
      responses:
        '200':
          description: Updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Media'
        default:
          $ref: '#/components/responses/Error'
      description: Requires the `publish` scope.
    delete:
      tags:
      - Media
      summary: Delete media
      description: Removes the file and the copies made from it (converted and preview copies), which frees its storage.
        A file that a post still waiting to be published uses, or that is being analysed, is refused (`media_in_use`).
        Requires the `publish` scope.
      responses:
        '204':
          description: Deleted
        '409':
          description: The file is still needed (`media_in_use`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        default:
          $ref: '#/components/responses/Error'
  /storage:
    get:
      tags:
      - Media
      summary: Storage used
      description: How much of the organization's media storage is used, and the limit of its plan (`quota_bytes` is null
        when the plan has no limit). Every file counts with the copies made from it. An upload that would go over the limit
        is refused with 413 `storage_full`. Requires the `read` scope.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  object:
                    type: string
                    const: storage
                  used_bytes:
                    type: integer
                  quota_bytes:
                    type:
                    - integer
                    - 'null'
                  plan:
                    type: string
                required:
                - used_bytes
                - quota_bytes
        default:
          $ref: '#/components/responses/Error'
  /media/{media_id}/link:
    parameters:
    - $ref: '#/components/parameters/MediaId'
    get:
      tags:
      - Media
      summary: A short lived link to show or play a file
      description: The link works for one hour and needs no API key, so it can go in an image tag. With `variant` it points
        at a copy made when the file was analysed instead of the file itself; 404 `variant_not_found` when there is no such
        copy. Requires the `read` scope.
      parameters:
      - name: variant
        in: query
        schema:
          type: string
          enum:
          - poster
          - proxy
          - normalized
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  url:
                    type: string
                  content_type:
                    type: string
                  expires_in:
                    type: integer
                required:
                - url
                - content_type
                - expires_in
        default:
          $ref: '#/components/responses/Error'
  /media/{media_id}/complete:
    parameters:
    - $ref: '#/components/parameters/MediaId'
    post:
      tags:
      - Media
      summary: Complete a multipart upload
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Media'
        default:
          $ref: '#/components/responses/Error'
      description: 'Fails with `parts_missing` until every part is uploaded.


        Requires the `publish` scope.'
  /posts:
    get:
      tags:
      - Posts
      summary: List posts
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/PostListItem'
                  next_cursor:
                    type:
                    - string
                    - 'null'
                required:
                - data
        default:
          $ref: '#/components/responses/Error'
      description: 'Newest first.


        Requires the `read` scope.'
      parameters:
      - name: workspace_id
        in: query
        required: true
        schema:
          type: string
      - name: status
        in: query
        schema:
          $ref: '#/components/schemas/TargetStatus'
        description: Only posts with at least one target in this status.
      - $ref: '#/components/parameters/Cursor'
      - $ref: '#/components/parameters/Limit'
      - name: from
        in: query
        schema:
          type: string
          format: date-time
        description: Only posts placed at or after this time (the `at` of each item), for a calendar.
      - name: to
        in: query
        schema:
          type: string
          format: date-time
        description: Only posts placed before this time.
      - name: account_id
        in: query
        schema:
          type: string
        description: Only posts with a target on this account.
    post:
      tags:
      - Posts
      summary: Create a post
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Post'
        '200':
          description: The post created earlier with this Idempotency-Key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Post'
        '422':
          description: Validation failed for one or more targets. `error.details` lists each problem with the target it concerns.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        default:
          $ref: '#/components/responses/Error'
      description: 'Validated against every target platform, and its daily limit, before it is accepted. The same `Idempotency-Key`
        always returns the same post and never publishes twice. A different body with the same key gives 409.


        Requires the `publish` scope.'
      parameters:
      - $ref: '#/components/parameters/IdempotencyKeyRequired'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PostCreate'
  /posts/{post_id}:
    parameters:
    - $ref: '#/components/parameters/PostId'
    get:
      tags:
      - Posts
      summary: Get a post with status per target
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Post'
        default:
          $ref: '#/components/responses/Error'
      description: Requires the `read` scope.
    patch:
      tags:
      - Posts
      summary: Change a scheduled post
      responses:
        '200':
          description: Updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Post'
        '409':
          description: Already sending, sent or canceled
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        default:
          $ref: '#/components/responses/Error'
      description: 'Allowed until any target starts sending.


        Requires the `publish` scope.


        Changing the content or the time of a post that goes through approval starts the approval over, so what is sent is
        always what was approved.'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                content:
                  $ref: '#/components/schemas/Content'
                scheduled_at:
                  type:
                  - string
                  - 'null'
                  format: date-time
                links:
                  $ref: '#/components/schemas/LinkOptions'
    delete:
      tags:
      - Posts
      summary: Cancel a post, or delete it where it is published
      responses:
        '202':
          description: Accepted
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Post'
        default:
          $ref: '#/components/responses/Error'
      description: 'Targets not yet sent become `canceled`. Published targets become `deleting`, then `deleted` once the platform
        confirms, or back to `published` with error `delete_failed`.


        Requires the `publish` scope.'
  /posts/{post_id}/metrics:
    parameters:
    - $ref: '#/components/parameters/PostId'
    get:
      tags:
      - Metrics
      summary: Metrics for a post, per target, as a time series
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MetricSeriesList'
        default:
          $ref: '#/components/responses/Error'
      description: 'Read one hour after publishing, then daily for 30 days, then weekly until day 90.


        Requires the `metrics` scope.


        Posts with short links also have a `clicks` series with `source: everyspoke_links`, counted by Everyspoke per target.'
  /workspaces/{workspace_id}/webhooks:
    parameters:
    - $ref: '#/components/parameters/WorkspaceId'
    get:
      tags:
      - Webhook endpoints
      summary: List webhook endpoints
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/WebhookEndpoint'
        default:
          $ref: '#/components/responses/Error'
      description: Requires the `read` scope.
    post:
      tags:
      - Webhook endpoints
      summary: Create a webhook endpoint
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                allOf:
                - $ref: '#/components/schemas/WebhookEndpoint'
                - type: object
                  properties:
                    secret:
                      type: string
                      description: Signing secret, shown once.
        default:
          $ref: '#/components/responses/Error'
      description: 'At most 10 per workspace.


        Requires the `admin` scope.'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                url:
                  type: string
                  format: uri
                  description: https only
                events:
                  type: array
                  items:
                    $ref: '#/components/schemas/WebhookEvent'
              required:
              - url
              - events
  /webhooks/{webhook_id}:
    parameters:
    - $ref: '#/components/parameters/WebhookId'
    delete:
      tags:
      - Webhook endpoints
      summary: Delete a webhook endpoint
      responses:
        '204':
          description: Deleted
        default:
          $ref: '#/components/responses/Error'
      description: Requires the `admin` scope.
  /webhooks/{webhook_id}/deliveries:
    parameters:
    - $ref: '#/components/parameters/WebhookId'
    get:
      tags:
      - Webhook endpoints
      summary: Delivery log
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/WebhookDelivery'
        default:
          $ref: '#/components/responses/Error'
      description: Requires the `read` scope.
      parameters:
      - $ref: '#/components/parameters/Limit'
  /webhooks/{webhook_id}/deliveries/{delivery_id}/retry:
    parameters:
    - $ref: '#/components/parameters/WebhookId'
    - name: delivery_id
      in: path
      required: true
      schema:
        type: string
    post:
      tags:
      - Webhook endpoints
      summary: Send a delivery again
      responses:
        '202':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  queued:
                    type: boolean
        default:
          $ref: '#/components/responses/Error'
      description: Requires the `admin` scope.
  /platforms:
    get:
      tags:
      - Platforms
      summary: What each platform supports
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/Platform'
        default:
          $ref: '#/components/responses/Error'
      description: 'Post types, text limits, media rules, daily limits and available metrics. The same rules are used to validate
        posts.


        Requires the `read` scope.'
  /billing:
    get:
      tags:
      - Billing
      summary: Plan, usage and billing state
      description: 'Your plan, what it includes, what you have used this month, the state of your subscription, and what can be
        bought. `publishing_paused` is true when a payment has failed for more than `grace_days` (14) days. Needs the `admin`
        scope and a key with full access.'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Billing'
        default:
          $ref: '#/components/responses/Error'
  /billing/checkout:
    post:
      tags:
      - Billing
      summary: Subscribe to a paid plan
      description: 'Returns the address of a Stripe Checkout page. Card details are typed there, never sent to Everyspoke. Tax
        is calculated by Stripe Tax, and companies in the EU can enter a VAT number for reverse charge. Answers `409` if you
        already have a subscription: use the customer portal to change it.'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - plan
              properties:
                plan:
                  type: string
                  enum:
                  - creator
                  - agency
                  - agency_pro
                  - scale
                interval:
                  type: string
                  enum:
                  - month
                  - year
                  default: month
                currency:
                  type: string
                  enum:
                  - usd
                  - eur
                  default: usd
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BillingUrl'
        default:
          $ref: '#/components/responses/Error'
  /billing/credit-checkout:
    post:
      tags:
      - Billing
      summary: Buy a credit pack
      description: A one time payment. The credits are added when Stripe confirms the payment, once per purchase.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - pack
              properties:
                pack:
                  type: string
                currency:
                  type: string
                  enum:
                  - usd
                  - eur
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BillingUrl'
        default:
          $ref: '#/components/responses/Error'
  /billing/portal:
    post:
      tags:
      - Billing
      summary: Open the customer portal
      description: Returns the address of the Stripe customer portal, where payment method, plan, invoices and cancellation are
        managed. Answers `409` before the first purchase.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BillingUrl'
        default:
          $ref: '#/components/responses/Error'
  /billing/invoices:
    get:
      tags:
      - Billing
      summary: List invoices
      description: The latest 24 invoices from Stripe, with links to the hosted invoice and the PDF.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/Invoice'
        default:
          $ref: '#/components/responses/Error'
  /billing/sync-usage:
    post:
      tags:
      - Billing
      summary: Report connected accounts to billing now
      description: Sends the number of connected live accounts above your plan to Stripe. This also happens by itself when an
        account is connected or removed, and once a day.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  reported:
                    type: boolean
        default:
          $ref: '#/components/responses/Error'
  /workspaces/{id}/spending-cap:
    parameters:
    - name: id
      in: path
      required: true
      schema:
        type: string
    get:
      tags:
      - Billing
      summary: Monthly spending cap for platform fees
      description: What this workspace may spend on platform fees (X charges per post, passed on at cost) in a month. A post
        that would go over the cap is refused with `fee_cap_reached`.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SpendingCap'
        default:
          $ref: '#/components/responses/Error'
    put:
      tags:
      - Billing
      summary: Set the monthly spending cap
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - monthly_cap_cents
              properties:
                monthly_cap_cents:
                  type: integer
                  minimum: 0
                  maximum: 1000000
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SpendingCap'
        default:
          $ref: '#/components/responses/Error'
  /health:
    servers:
    - url: https://api.everyspoke.com
    get:
      tags:
      - Operations
      summary: Health of the service and what it depends on
      description: Answers `200` when the database, storage, rate limiter and queue binding work, otherwise `503`. Each part says
        `ok` or `fail`. Nothing secret or customer related is in the answer.
      security: []
      responses:
        '200':
          description: Healthy
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                  checks:
                    type: object
                    additionalProperties:
                      type: string
                      enum:
                      - ok
                      - fail
                  config:
                    type: object
                    additionalProperties:
                      type: boolean
        '503':
          description: A dependency fails
  /status:
    get:
      tags:
      - Operations
      summary: Is publishing working?
      description: Per platform, from the success and failure counts of the last hours. Open to anyone, no key needed, and it
        holds no customer data. The status page on everyspoke.com shows it.
      security: []
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Status'
  /auth/login/2fa:
    post:
      tags:
      - Members
      summary: Finish logging in with a second step
      description: Send the `mfa_token` from `POST /auth/login` and either the six digit code from the authenticator app or
        a recovery code. Five wrong codes end the sign in. A code works once.
      security: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - mfa_token
              - code
              properties:
                mfa_token:
                  type: string
                code:
                  type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SessionResult'
        default:
          $ref: '#/components/responses/Error'
  /auth/mfa:
    get:
      tags:
      - Members
      summary: State of two factor sign in
      security:
      - session: []
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  enabled:
                    type: boolean
                  pending:
                    type: boolean
                  recovery_codes_left:
                    type: integer
                  required_by_organization:
                    type: boolean
        default:
          $ref: '#/components/responses/Error'
  /auth/mfa/setup:
    post:
      tags:
      - Members
      summary: Start setting up two factor sign in
      description: Returns a new secret, the `otpauth://` address and the QR code as an SVG image, made by Everyspoke with no
        outside service. Turn it on with `POST /auth/mfa/enable`.
      security:
      - session: []
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  secret:
                    type: string
                  otpauth_uri:
                    type: string
                  qr_svg:
                    type: string
        default:
          $ref: '#/components/responses/Error'
  /auth/mfa/enable:
    post:
      tags:
      - Members
      summary: Turn on two factor sign in
      description: Send a code from the app. Returns ten recovery codes, shown this once. Only their hashes are kept.
      security:
      - session: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - code
              properties:
                code:
                  type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  enabled:
                    type: boolean
                  recovery_codes:
                    type: array
                    items:
                      type: string
        default:
          $ref: '#/components/responses/Error'
  /auth/mfa/recovery-codes:
    post:
      tags:
      - Members
      summary: Make new recovery codes
      description: Needs a code from the app. The old recovery codes stop working.
      security:
      - session: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - code
              properties:
                code:
                  type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  recovery_codes:
                    type: array
                    items:
                      type: string
        default:
          $ref: '#/components/responses/Error'
  /auth/mfa/disable:
    post:
      tags:
      - Members
      summary: Turn off two factor sign in
      description: Needs the password and a code. Not possible while the organization requires two factor sign in.
      security:
      - session: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - password
              - code
              properties:
                password:
                  type: string
                code:
                  type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  enabled:
                    type: boolean
        default:
          $ref: '#/components/responses/Error'
  /auth/google/config:
    get:
      tags:
      - Members
      summary: Is sign in with Google on?
      security: []
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  enabled:
                    type: boolean
                  client_id:
                    type:
                    - string
                    - 'null'
  /auth/google:
    post:
      tags:
      - Members
      summary: Sign in or sign up with Google
      description: 'Send the ID token (`credential`) that Google gives the browser. It is checked against Google''s public keys,
        issuer, audience and expiry. An existing account is found by its Google id, or linked by email when that email was
        already confirmed. Without an account, send `organization_name` to sign up. A member with two factor sign in gets
        an `mfa_token` like with a password.'
      security: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - credential
              properties:
                credential:
                  type: string
                nonce:
                  type: string
                organization_name:
                  type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                oneOf:
                - $ref: '#/components/schemas/SessionResult'
                - $ref: '#/components/schemas/MfaRequired'
        default:
          $ref: '#/components/responses/Error'
  /organization:
    get:
      tags:
      - Organization
      summary: Get your organization
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Organization'
        default:
          $ref: '#/components/responses/Error'
      description: Requires the `read` scope.
    patch:
      tags:
      - Organization
      summary: Change name, brand and allowed redirect origins
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Organization'
        default:
          $ref: '#/components/responses/Error'
      description: Requires the `admin` scope.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  maxLength: 200
                brand:
                  type: object
                  properties:
                    name:
                      type:
                      - string
                      - 'null'
                    logo_url:
                      type:
                      - string
                      - 'null'
                      format: uri
                    color:
                      type:
                      - string
                      - 'null'
                      pattern: ^#[0-9a-fA-F]{6}$
                    hide_everyspoke_brand:
                      type: boolean
                allowed_redirect_origins:
                  type: array
                  maxItems: 20
                  items:
                    type: string
                    format: uri
                require_two_factor:
                  type: boolean
  /api-keys:
    get:
      tags:
      - API keys
      summary: List API keys
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/ApiKey'
        default:
          $ref: '#/components/responses/Error'
      description: 'The keys themselves are never shown again after creation.


        Requires the `admin` scope.'
    post:
      tags:
      - API keys
      summary: Create an API key
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                allOf:
                - $ref: '#/components/schemas/ApiKey'
                - type: object
                  properties:
                    key:
                      type: string
                      description: Shown once.
        default:
          $ref: '#/components/responses/Error'
      description: Requires the `admin` scope.
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                scopes:
                  type: array
                  items:
                    $ref: '#/components/schemas/Scope'
                  description: 'Default: read, publish, connect, metrics.'
                workspace_id:
                  type: string
                  description: Limit the key to one workspace.
                mode:
                  type: string
                  enum:
                  - test
                  - live
  /api-keys/{key_id}:
    parameters:
    - name: key_id
      in: path
      required: true
      schema:
        type: string
    delete:
      tags:
      - API keys
      summary: Revoke an API key
      responses:
        '204':
          description: Revoked
        default:
          $ref: '#/components/responses/Error'
      description: Requires the `admin` scope.
  /api-keys/{key_id}/rotate:
    parameters:
    - name: key_id
      in: path
      required: true
      schema:
        type: string
    post:
      tags:
      - API keys
      summary: Rotate an API key
      responses:
        '201':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                  key:
                    type: string
                  previous_key_expires_at:
                    type: string
                    format: date-time
        default:
          $ref: '#/components/responses/Error'
      description: 'Creates a new key with the same permissions. The old key keeps working for `overlap_seconds` (default
        one day).


        Requires the `admin` scope.'
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                overlap_seconds:
                  type: integer
                  minimum: 0
                  maximum: 2592000
  /auth/signup:
    post:
      tags:
      - Members
      summary: Sign up
      description: Creates an organization and its owner, sends a confirmation email and returns a session token (`es_sess_...`).
        Until the email is confirmed the member cannot publish. Passwords need at least 10 characters.
      security: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - email
              - password
              - name
              - organization_name
              properties:
                email:
                  type: string
                password:
                  type: string
                  minLength: 10
                name:
                  type: string
                organization_name:
                  type: string
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SessionResult'
        default:
          $ref: '#/components/responses/Error'
  /auth/login:
    post:
      tags:
      - Members
      summary: Log in
      description: Returns a new session token valid for 30 days. A session sent in the Authorization header ends. Limited
        to 10 attempts per email in 15 minutes. If the member has two factor sign in on, no session is returned. The answer
        has `mfa_required` set to true and an `mfa_token` to send with a code to `POST /auth/login/2fa`.
      security: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - email
              - password
              properties:
                email:
                  type: string
                password:
                  type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                oneOf:
                - $ref: '#/components/schemas/SessionResult'
                - $ref: '#/components/schemas/MfaRequired'
        default:
          $ref: '#/components/responses/Error'
  /auth/logout:
    post:
      tags:
      - Members
      summary: Log out
      description: Ends the session used for the call.
      security:
      - session: []
      responses:
        '204':
          description: Logged out
        default:
          $ref: '#/components/responses/Error'
  /auth/me:
    get:
      tags:
      - Members
      summary: Who am I
      description: 'The signed in member, the organization, the permissions and whether the session works against test or
        live workspaces. Send `Everyspoke-Mode: test` or `live` on any call to choose. Without it the mode is live, unless
        the organization has only test keys.'
      security:
      - session: []
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  member:
                    $ref: '#/components/schemas/Member'
                  organization:
                    type: object
                    properties:
                      id:
                        type: string
                      name:
                        type: string
                      plan:
                        type: string
                  scopes:
                    type: array
                    items:
                      type: string
                  mode:
                    type: string
                    enum:
                    - test
                    - live
        default:
          $ref: '#/components/responses/Error'
  /auth/verify-email:
    post:
      tags:
      - Members
      summary: Confirm an email address
      description: Uses the token from the link in the confirmation email.
      security: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - token
              properties:
                token:
                  type: string
      responses:
        '200':
          description: OK
        default:
          $ref: '#/components/responses/Error'
  /auth/resend-verification:
    post:
      tags:
      - Members
      summary: Send the confirmation email again
      description: For the signed in member.
      security:
      - session: []
      responses:
        '200':
          description: OK
        default:
          $ref: '#/components/responses/Error'
  /auth/accept-invite:
    post:
      tags:
      - Members
      summary: Accept an invite
      description: Creates the member with the role from the invite and returns a session token. The email counts as confirmed.
      security: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - token
              - password
              - name
              properties:
                token:
                  type: string
                password:
                  type: string
                  minLength: 10
                name:
                  type: string
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SessionResult'
        default:
          $ref: '#/components/responses/Error'
  /members:
    get:
      tags:
      - Members
      summary: List members
      description: Requires the `admin` scope (owner or admin).
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/Member'
        default:
          $ref: '#/components/responses/Error'
  /members/{member_id}:
    parameters:
    - name: member_id
      in: path
      required: true
      schema:
        type: string
    patch:
      tags:
      - Members
      summary: Change a member
      description: Change the role (admin, editor or viewer), the name or the workspaces the member is limited to (empty list
        means all). The owner cannot be changed. Only the owner can make or change admins.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                role:
                  type: string
                  enum:
                  - admin
                  - editor
                  - viewer
                name:
                  type: string
                workspace_ids:
                  type: array
                  items:
                    type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Member'
        default:
          $ref: '#/components/responses/Error'
    delete:
      tags:
      - Members
      summary: Remove a member
      description: Ends the member sessions. The owner and yourself cannot be removed.
      responses:
        '204':
          description: Removed
        default:
          $ref: '#/components/responses/Error'
  /members/invites:
    get:
      tags:
      - Members
      summary: List open invites
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/Invite'
        default:
          $ref: '#/components/responses/Error'
    post:
      tags:
      - Members
      summary: Invite a member
      description: 'Sends an email with a link valid for 7 days. Roles: admin (owner only), editor, viewer. Editor has read,
        publish, connect and metrics; viewer has read and metrics.'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - email
              properties:
                email:
                  type: string
                role:
                  type: string
                  enum:
                  - admin
                  - editor
                  - viewer
                  default: editor
                workspace_ids:
                  type: array
                  items:
                    type: string
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Invite'
        default:
          $ref: '#/components/responses/Error'
  /members/invites/{invite_id}:
    parameters:
    - name: invite_id
      in: path
      required: true
      schema:
        type: string
    delete:
      tags:
      - Members
      summary: Cancel an invite
      responses:
        '204':
          description: Cancelled
        default:
          $ref: '#/components/responses/Error'
  /workspaces/{workspace_id}/approval-settings:
    parameters:
    - $ref: '#/components/parameters/WorkspaceId'
    get:
      tags:
      - Approvals
      summary: Get the approval settings
      description: Requires the `read` scope.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApprovalSettings'
        default:
          $ref: '#/components/responses/Error'
    put:
      tags:
      - Approvals
      summary: Turn approval on or off and set the steps
      description: Requires the `admin` scope. Turning approval on needs the approvals feature for your organization (`403
        feature_unavailable` otherwise). Posts already created keep the steps they were made with.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApprovalSettings'
        default:
          $ref: '#/components/responses/Error'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ApprovalSettings'
  /workspaces/{workspace_id}/reviewers:
    parameters:
    - $ref: '#/components/parameters/WorkspaceId'
    get:
      tags:
      - Approvals
      summary: List reviewers
      description: Requires the `read` scope.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/Reviewer'
                required:
                - data
        default:
          $ref: '#/components/responses/Error'
    post:
      tags:
      - Approvals
      summary: Invite a reviewer by email
      description: Creates the reviewer (or brings back a removed one) and emails them a login link that works once and lasts
        15 minutes. They log in without a password and see only the posts of this workspace that wait for them, in your brand.
        In test workspaces no email is sent and `login_url` is returned. At most 20 reviewers per workspace. Requires the
        `admin` scope.
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Reviewer'
        default:
          $ref: '#/components/responses/Error'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - email
              properties:
                email:
                  type: string
                  format: email
                name:
                  type: string
                  maxLength: 100
  /workspaces/{workspace_id}/reviewers/{reviewer_id}:
    parameters:
    - $ref: '#/components/parameters/WorkspaceId'
    - $ref: '#/components/parameters/ReviewerId'
    delete:
      tags:
      - Approvals
      summary: Remove a reviewer
      description: Their login links and sessions stop working at once. Requires the `admin` scope.
      responses:
        '204':
          description: Removed
        default:
          $ref: '#/components/responses/Error'
  /workspaces/{workspace_id}/reviewers/{reviewer_id}/invite:
    parameters:
    - $ref: '#/components/parameters/WorkspaceId'
    - $ref: '#/components/parameters/ReviewerId'
    post:
      tags:
      - Approvals
      summary: Send a new login link
      description: At most one link a minute per reviewer; a request inside that minute does nothing. Requires the `admin`
        scope.
      responses:
        '202':
          description: Accepted
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Reviewer'
        default:
          $ref: '#/components/responses/Error'
  /posts/{post_id}/approve:
    parameters:
    - $ref: '#/components/parameters/PostId'
    post:
      tags:
      - Approvals
      summary: Approve the step now waiting
      description: Agency steps need the `publish` scope. A client step can be decided here only with an `admin` key, otherwise
        by the reviewer on the review page. After the last step the targets are queued. `409 approval_expired` when the scheduled
        time has passed.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Post'
        default:
          $ref: '#/components/responses/Error'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ApprovalDecision'
  /posts/{post_id}/reject:
    parameters:
    - $ref: '#/components/parameters/PostId'
    post:
      tags:
      - Approvals
      summary: Send the post back with a comment
      description: The post is held until it is changed. Requires the `publish` scope and a `comment`.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Post'
        default:
          $ref: '#/components/responses/Error'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ApprovalDecision'
  /posts/{post_id}/approvals:
    parameters:
    - $ref: '#/components/parameters/PostId'
    get:
      tags:
      - Approvals
      summary: History of requests and decisions
      description: Requires the `read` scope.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/ApprovalEvent'
                required:
                - data
        default:
          $ref: '#/components/responses/Error'
  /workspaces/{workspace_id}/inbox:
    parameters:
    - $ref: '#/components/parameters/WorkspaceId'
    get:
      tags:
      - Inbox
      summary: List conversations, newest activity first
      description: One conversation per top level comment, with the replies under it. Comments are read every 15 minutes at
        most, for posts of the last 14 days, on the networks that allow it (see `inbox` on `GET /platforms`). Requires the
        `read` scope and the inbox feature.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/InboxConversation'
                  next_cursor:
                    type:
                    - string
                    - 'null'
                required:
                - data
        default:
          $ref: '#/components/responses/Error'
      parameters:
      - $ref: '#/components/parameters/Cursor'
      - $ref: '#/components/parameters/Limit'
      - name: status
        in: query
        schema:
          type: string
          enum:
          - open
          - done
      - name: assigned_to
        in: query
        schema:
          type: string
  /workspaces/{workspace_id}/inbox/{conversation_id}:
    parameters:
    - $ref: '#/components/parameters/WorkspaceId'
    - $ref: '#/components/parameters/ConversationId'
    get:
      tags:
      - Inbox
      summary: Get a conversation with its messages
      description: Requires the `read` scope.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InboxConversationDetail'
        default:
          $ref: '#/components/responses/Error'
    patch:
      tags:
      - Inbox
      summary: Assign or mark done
      description: A new comment from someone else opens a done conversation again. Requires the `publish` scope.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InboxConversation'
        default:
          $ref: '#/components/responses/Error'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                status:
                  type: string
                  enum:
                  - open
                  - done
                assigned_to:
                  type:
                  - string
                  - 'null'
                  description: A member id, or null to clear.
  /workspaces/{workspace_id}/inbox/{conversation_id}/reply:
    parameters:
    - $ref: '#/components/parameters/WorkspaceId'
    - $ref: '#/components/parameters/ConversationId'
    post:
      tags:
      - Inbox
      summary: Reply to a comment
      description: 'Answers the newest comment from someone else, or the one in `message_id`. Needs an `Idempotency-Key`:
        a repeat with the same key shows what happened and sends nothing. A failed reply is marked `failed`; send it again
        with a new key. Requires the `publish` scope.'
      responses:
        '201':
          description: Sent
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InboxMessage'
        default:
          $ref: '#/components/responses/Error'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - text
              properties:
                text:
                  type: string
                  maxLength: 5000
                message_id:
                  type: string
      parameters:
      - $ref: '#/components/parameters/IdempotencyKeyRequired'
  /workspaces/{workspace_id}/inbox/{conversation_id}/messages/{message_id}/hide:
    parameters:
    - $ref: '#/components/parameters/WorkspaceId'
    - $ref: '#/components/parameters/ConversationId'
    - $ref: '#/components/parameters/MessageId'
    post:
      tags:
      - Inbox
      summary: Hide a comment
      description: Where the network allows it (Facebook, Bluesky). `422 not_supported` otherwise. Requires the `publish`
        scope.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InboxMessage'
        default:
          $ref: '#/components/responses/Error'
  /workspaces/{workspace_id}/inbox/{conversation_id}/messages/{message_id}/unhide:
    parameters:
    - $ref: '#/components/parameters/WorkspaceId'
    - $ref: '#/components/parameters/ConversationId'
    - $ref: '#/components/parameters/MessageId'
    post:
      tags:
      - Inbox
      summary: Show a hidden comment again
      description: Requires the `publish` scope.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InboxMessage'
        default:
          $ref: '#/components/responses/Error'
  /workspaces/{workspace_id}/inbox/{conversation_id}/messages/{message_id}:
    parameters:
    - $ref: '#/components/parameters/WorkspaceId'
    - $ref: '#/components/parameters/ConversationId'
    - $ref: '#/components/parameters/MessageId'
    delete:
      tags:
      - Inbox
      summary: Delete a comment
      description: Where the network allows it (Facebook). Mastodon and Bluesky only let you delete your own replies. The
        text is removed from Everyspoke too. Requires the `publish` scope.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InboxMessage'
        default:
          $ref: '#/components/responses/Error'
  /workspaces/{workspace_id}/link-settings:
    parameters:
    - $ref: '#/components/parameters/WorkspaceId'
    get:
      tags:
      - Short links
      summary: Get the default link settings
      description: Requires the `read` scope.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LinkSettings'
        default:
          $ref: '#/components/responses/Error'
    put:
      tags:
      - Short links
      summary: Set the default link settings
      description: Applies to posts that do not say otherwise. Requires the `admin` scope and the short links feature.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LinkSettings'
        default:
          $ref: '#/components/responses/Error'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LinkSettings'
  /posts/{post_id}/links:
    parameters:
    - $ref: '#/components/parameters/PostId'
    get:
      tags:
      - Short links
      summary: Short links of a post with clicks
      description: Clicks per link by platform (utm_source), country, device and day. Requires the `metrics` scope.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/PostLink'
                required:
                - data
        default:
          $ref: '#/components/responses/Error'
  /workspaces/{workspace_id}/brand:
    parameters:
    - $ref: '#/components/parameters/WorkspaceId'
    get:
      tags:
      - Content
      summary: Get the brand profile
      description: Colours, fonts, logo, tone of voice and words to use or avoid. Used by every generation. Requires the `read`
        scope. A workspace with no profile gets the defaults.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BrandProfile'
        default:
          $ref: '#/components/responses/Error'
    put:
      tags:
      - Content
      summary: Set the brand profile
      description: Replaces the whole profile. Fields you leave out go back to the default. `logo_media_id` must be a PNG
        or JPEG in this workspace. Requires the `publish` scope.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BrandProfileInput'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BrandProfile'
        default:
          $ref: '#/components/responses/Error'
  /workspaces/{workspace_id}/generations/quote:
    parameters:
    - $ref: '#/components/parameters/WorkspaceId'
    post:
      tags:
      - Content
      summary: The price of a generation, before it is made
      description: Takes the same body as starting a generation and returns what it would cost, with a quote token. Send
        the token back in the `Everyspoke-Quote` header with the same request within 30 minutes and you are never charged
        more than this. Nothing is charged here. Requires the `read` scope.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GenerationInput'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  object:
                    const: generation_quote
                  kind:
                    type: string
                  credits:
                    type: integer
                  quote_token:
                    type: string
                  expires_at:
                    type: string
                    format: date-time
                  balance:
                    type: integer
        default:
          $ref: '#/components/responses/Error'
  /workspaces/{workspace_id}/generations:
    parameters:
    - $ref: '#/components/parameters/WorkspaceId'
    post:
      tags:
      - Content
      summary: Generate text, an image, a video, a voice or captions
      description: 'Starts a generation and returns it at once with status `queued`. Poll `GET /workspaces/{id}/generations/{generation_id}`
        or subscribe to the `generation.completed` and `generation.failed` webhooks. Credits are taken before the job starts
        and returned if it fails. Requires the `publish` scope.


        `kind: text` writes one draft per platform in `platforms`, each within that platform''s limit (see `GET /platforms`),
        from a `prompt`, a `source`, or both. `kind: image` makes an AI image from a `prompt`, or a template image with `options.template`
        (`quote_card`, `carousel`, `slideshow`) in your brand colours. `kind: video` makes a short clip from a prompt (and
        an optional start image), or with `options.mode: avatar` a talking portrait from an image and an audio file. `kind:
        voice` turns the `prompt` into speech. `kind: captions` transcribes an audio or video file given as `source` and returns
        SRT and VTT. `kind: music` makes an instrumental track from the `prompt` (at most 600 characters) for a video of
        `options.seconds` (5 to 60, default 30), priced cost-plus from the music model''s price per track; the result is
        an audio file in the media library.


        Test keys use simulated providers and a separate test balance.'
      parameters:
      - $ref: '#/components/parameters/IdempotencyKey'
      - $ref: '#/components/parameters/Quote'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GenerationInput'
      responses:
        '202':
          description: Accepted
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Generation'
        '200':
          description: The same Idempotency-Key was used before. The earlier generation, nothing new charged.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Generation'
        '402':
          description: Not enough credits (`insufficient_credits`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '503':
          description: This kind of generation is not set up on this server (`provider_not_configured`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        default:
          $ref: '#/components/responses/Error'
    get:
      tags:
      - Content
      summary: List generations, newest first
      description: Includes drafts made from RSS feeds (origin rss). Requires the `read` scope.
      parameters:
      - $ref: '#/components/parameters/Cursor'
      - $ref: '#/components/parameters/Limit'
      - name: kind
        in: query
        schema:
          $ref: '#/components/schemas/GenerationKind'
      - name: status
        in: query
        schema:
          type: string
          enum:
          - queued
          - running
          - completed
          - failed
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/Generation'
                  next_cursor:
                    type:
                    - string
                    - 'null'
                required:
                - data
        default:
          $ref: '#/components/responses/Error'
  /workspaces/{workspace_id}/generations/{generation_id}:
    parameters:
    - $ref: '#/components/parameters/WorkspaceId'
    - name: generation_id
      in: path
      required: true
      schema:
        type: string
    get:
      tags:
      - Content
      summary: Get a generation
      description: Poll this until `status` is `completed` or `failed`. Images and video usually take under two minutes. Requires
        the `read` scope.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Generation'
        default:
          $ref: '#/components/responses/Error'
  /workspaces/{workspace_id}/feeds:
    parameters:
    - $ref: '#/components/parameters/WorkspaceId'
    get:
      tags:
      - Content
      summary: List RSS feeds
      description: Requires the `read` scope.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/Feed'
                required:
                - data
        default:
          $ref: '#/components/responses/Error'
    post:
      tags:
      - Content
      summary: Add an RSS feed
      description: New items in the feed become drafts (text generations with origin rss), never posts. The first check only
        notes what is already in the feed, so old posts are not turned into drafts. At most 5 drafts per check and 50 a day.
        Requires the `publish` scope.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                url:
                  type: string
                  description: A public https address of an RSS or Atom feed.
                platforms:
                  type: array
                  items:
                    type: string
                language:
                  type: string
                check_every_minutes:
                  type: integer
                  minimum: 15
                  maximum: 1440
                  default: 60
              required:
              - url
              - platforms
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Feed'
        default:
          $ref: '#/components/responses/Error'
  /workspaces/{workspace_id}/feeds/{feed_id}:
    parameters:
    - $ref: '#/components/parameters/WorkspaceId'
    - name: feed_id
      in: path
      required: true
      schema:
        type: string
    patch:
      tags:
      - Content
      summary: Pause, resume, change platforms or check now
      description: Requires the `publish` scope.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                active:
                  type: boolean
                platforms:
                  type: array
                  items:
                    type: string
                check_now:
                  type: boolean
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Feed'
        default:
          $ref: '#/components/responses/Error'
    delete:
      tags:
      - Content
      summary: Remove an RSS feed
      description: Drafts already made are kept. Requires the `publish` scope.
      responses:
        '204':
          description: Removed
        default:
          $ref: '#/components/responses/Error'
  /credits:
    get:
      tags:
      - Credits
      summary: Credit balance and history
      description: One balance per organization and mode (test keys have their own). Each month the plan's credits are added
        and unused credits carry over. Text, voice, captions and template images cost nothing. Requires the `read` scope.
      parameters:
      - $ref: '#/components/parameters/Cursor'
      - $ref: '#/components/parameters/Limit'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Credits'
        default:
          $ref: '#/components/responses/Error'
  /posts/{post_id}/targets/{target_id}/retry-thread:
    post:
      tags:
      - Posts
      summary: Send the parts of a thread that did not go out
      description: Parts that are already published are never sent again. Refused with 409 `thread_outcome_unknown` when a
        part may be live (a timeout), and `thread_complete` when nothing is left. Requires the `publish` scope.
      parameters:
      - name: post_id
        in: path
        required: true
        schema:
          type: string
      - name: target_id
        in: path
        required: true
        schema:
          type: string
      responses:
        '202':
          description: The rest of the thread is queued.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Post'
        default:
          $ref: '#/components/responses/Error'
  /accounts/{account_id}/queue:
    parameters:
    - name: account_id
      in: path
      required: true
      schema:
        type: string
    get:
      tags:
      - Scheduling
      summary: Get the weekly posting times of an account
      description: Requires the `read` scope.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Queue'
        default:
          $ref: '#/components/responses/Error'
    put:
      tags:
      - Scheduling
      summary: Set the weekly posting times of an account
      description: 'Replaces all times. Times are local to `timezone`. Posts made with `queue: true` take the next free time.
        Requires the `publish` scope.'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/QueueSettings'
      responses:
        '200':
          description: Saved
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Queue'
        default:
          $ref: '#/components/responses/Error'
  /accounts/{account_id}/best-times:
    parameters:
    - name: account_id
      in: path
      required: true
      schema:
        type: string
    get:
      tags:
      - Scheduling
      summary: Best times to post, from the account's own numbers
      description: An estimate from the last 90 days of the account's published posts. `confidence` is `estimate` with fewer
        than 20 posts (and with none, general defaults are shown). `method` explains the calculation. Requires the `metrics`
        scope.
      parameters:
      - name: timezone
        in: query
        schema:
          type: string
        description: IANA time zone for weekday and hour. Defaults to the account's queue time zone, else UTC.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BestTimes'
        default:
          $ref: '#/components/responses/Error'
  /recurring-posts:
    get:
      tags:
      - Scheduling
      summary: List recurring posts
      description: Requires the `read` scope.
      parameters:
      - name: workspace_id
        in: query
        required: true
        schema:
          type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/RecurringPost'
                  next_cursor:
                    type:
                    - string
                    - 'null'
                required:
                - data
        default:
          $ref: '#/components/responses/Error'
    post:
      tags:
      - Scheduling
      summary: Create a recurring post
      description: Posts again every N days or weeks until a date. Each occurrence becomes a normal post up to 7 days before
        its time, so it can be changed or canceled like any post, and goes through approval if the workspace needs it. Media
        is kept in the library. Requires the `publish` scope.
      parameters:
      - $ref: '#/components/parameters/IdempotencyKeyRequired'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RecurringPostCreate'
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RecurringPost'
        '200':
          description: The recurring post created earlier with this Idempotency-Key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RecurringPost'
        '422':
          description: Validation failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        default:
          $ref: '#/components/responses/Error'
  /recurring-posts/{recurring_post_id}:
    parameters:
    - name: recurring_post_id
      in: path
      required: true
      schema:
        type: string
    get:
      tags:
      - Scheduling
      summary: Get a recurring post
      description: Requires the `read` scope.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RecurringPost'
        default:
          $ref: '#/components/responses/Error'
    delete:
      tags:
      - Scheduling
      summary: Stop a recurring post
      description: Stops further occurrences and cancels the ones already made that have not started sending. Requires the
        `publish` scope.
      responses:
        '202':
          description: Stopped
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RecurringPost'
        default:
          $ref: '#/components/responses/Error'
  /workspaces/{workspace_id}/bulk-posts:
    parameters:
    - $ref: '#/components/parameters/WorkspaceId'
    post:
      tags:
      - Scheduling
      summary: Create many posts from a CSV file
      description: 'Columns: `accounts` (ids, names or handles separated by `;` or `|`), `time` (`2027-03-15 09:30` in `timezone`,
        full ISO 8601, or `queue`), `text`, `media_urls` (https, separated by spaces), `first_comment`. At most 500 rows and
        1 MB. By default (`dry_run` true) nothing is created and every row is returned with its problems, for a preview. With
        `dry_run` false the posts are made in the background, in batches: the answer is 202 with a `job_id`, and you read
        progress from `GET /workspaces/{workspace_id}/bulk-posts/{job_id}` until `status` is `done`. Creating is idempotent
        per row: a row with the same accounts, time, text, media and first comment in the same workspace creates its post
        once, in whichever file it arrives. Media is fetched when posts are created. Requires the `publish` scope.'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                csv:
                  type: string
                timezone:
                  type: string
                  default: UTC
                dry_run:
                  type: boolean
                  default: true
                skip_invalid:
                  type: boolean
                  default: false
                  description: Create the valid rows even if others have problems.
              required:
              - csv
      responses:
        '200':
          description: Preview (`dry_run` true)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BulkResult'
        '202':
          description: Creating has started. Poll the job.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BulkResult'
        '422':
          description: The file is not usable, or rows have problems and `skip_invalid` is not set.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        default:
          $ref: '#/components/responses/Error'
  /workspaces/{workspace_id}/bulk-posts/{job_id}:
    parameters:
    - $ref: '#/components/parameters/WorkspaceId'
    - name: job_id
      in: path
      required: true
      schema:
        type: string
    get:
      tags:
      - Scheduling
      summary: Read a bulk upload
      description: Progress and per row results of a bulk upload. `status` is `running` until every row is settled, then `done`.
        Requires the `publish` scope.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BulkResult'
        default:
          $ref: '#/components/responses/Error'
  /workspaces/{workspace_id}/reports/monthly:
    parameters:
    - $ref: '#/components/parameters/WorkspaceId'
    get:
      tags:
      - Reports
      summary: Monthly report
      description: Top posts by views, likes, comments and reach, totals, follower growth and audience data where the network
        gives it. A number a network did not give is `null` and left out of rankings, never counted as zero. Requires the
        `metrics` scope.
      parameters:
      - name: month
        in: query
        schema:
          type: string
          example: 2026-11
        description: Defaults to the last full month.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Report'
        default:
          $ref: '#/components/responses/Error'
  /workspaces/{workspace_id}/reports/monthly.pdf:
    parameters:
    - $ref: '#/components/parameters/WorkspaceId'
    get:
      tags:
      - Reports
      summary: Monthly report as a PDF
      description: With the agency's logo and colour from the organization brand. Requires the `metrics` scope.
      parameters:
      - name: month
        in: query
        schema:
          type: string
          example: 2026-11
      responses:
        '200':
          description: The PDF
          content:
            application/pdf:
              schema:
                type: string
                format: binary
        default:
          $ref: '#/components/responses/Error'
  /workspaces/{workspace_id}/reports/links:
    parameters:
    - $ref: '#/components/parameters/WorkspaceId'
    get:
      tags:
      - Reports
      summary: List report links
      description: Requires the `metrics` scope.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                        month:
                          type: string
                        created_at:
                          type: string
                          format: date-time
                        expires_at:
                          type: string
                          format: date-time
                        revoked_at:
                          type:
                          - string
                          - 'null'
                          format: date-time
                  next_cursor:
                    type:
                    - string
                    - 'null'
                required:
                - data
        default:
          $ref: '#/components/responses/Error'
    post:
      tags:
      - Reports
      summary: Create a shareable report link
      description: The link (https://.../rp/{token}) shows the month's report as a web page with a PDF download and needs
        no login. Only a hash of the token is stored, so the link is shown once. Requires the `publish` scope.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                month:
                  type: string
                  example: 2026-11
                expires_in:
                  type: integer
                  minimum: 3600
                  maximum: 7776000
                  default: 2592000
                  description: Seconds.
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                  url:
                    type: string
                    format: uri
                  month:
                    type: string
                  expires_at:
                    type: string
                    format: date-time
                required:
                - id
                - url
                - month
                - expires_at
        default:
          $ref: '#/components/responses/Error'
  /workspaces/{workspace_id}/reports/links/{link_id}:
    parameters:
    - $ref: '#/components/parameters/WorkspaceId'
    - name: link_id
      in: path
      required: true
      schema:
        type: string
    delete:
      tags:
      - Reports
      summary: Revoke a report link
      description: Requires the `publish` scope.
      responses:
        '204':
          description: Revoked
        default:
          $ref: '#/components/responses/Error'
  /workspaces/{workspace_id}/report-settings:
    parameters:
    - $ref: '#/components/parameters/WorkspaceId'
    get:
      tags:
      - Reports
      summary: Get automatic report email settings
      description: Requires the `metrics` scope.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ReportSettings'
        default:
          $ref: '#/components/responses/Error'
    put:
      tags:
      - Reports
      summary: Set automatic report email settings
      description: When on, the report of the last month is emailed to the recipients (at most 5) on the first days of each
        month, as a link. Test mode workspaces never send email. Turning it on does not send last month's report at once.
        Requires the `publish` scope.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ReportSettings'
      responses:
        '200':
          description: Saved
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ReportSettings'
        default:
          $ref: '#/components/responses/Error'
  /workspaces/{workspace_id}/exports/posts.csv:
    parameters:
    - $ref: '#/components/parameters/WorkspaceId'
    get:
      tags:
      - Reports
      summary: Export post statistics as CSV
      description: One row per published post and account in the period (default last 30 days). Numbers the network did not
        give are empty. Requires the `metrics` scope.
      parameters:
      - name: from
        in: query
        schema:
          type: string
          format: date-time
      - name: to
        in: query
        schema:
          type: string
          format: date-time
      responses:
        '200':
          description: CSV
          content:
            text/csv:
              schema:
                type: string
        default:
          $ref: '#/components/responses/Error'
  /workspaces/{workspace_id}/exports/accounts.csv:
    parameters:
    - $ref: '#/components/parameters/WorkspaceId'
    get:
      tags:
      - Reports
      summary: Export account statistics as CSV
      description: Followers at the start and end of the period and posts published. Requires the `metrics` scope.
      parameters:
      - name: from
        in: query
        schema:
          type: string
          format: date-time
      - name: to
        in: query
        schema:
          type: string
          format: date-time
      responses:
        '200':
          description: CSV
          content:
            text/csv:
              schema:
                type: string
        default:
          $ref: '#/components/responses/Error'
  /workspaces/{workspace_id}/campaign-videos/proposals:
    parameters:
    - $ref: '#/components/parameters/WorkspaceId'
    post:
      tags:
      - Campaign video
      summary: Get video proposals from a description
      description: 'Writes several different proposals for the same brief: by default 3 of kind `campaign`, 1 `mixed` and 1
        `ai_video`. Each is checked; one that cannot be repaired into a valid spec is left out (`dropped`). Each comes with
        `method` (what kind of production it is) and `price` (credits when rendered). Free, counted against the daily text
        limit. Requires the `publish` scope.'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CampaignProposalInput'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  object:
                    type: string
                    const: list
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/CampaignProposal'
                  dropped:
                    type: integer
                required:
                - data
                - dropped
        '429':
          description: The daily text limit is reached (`daily_limit_reached`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        default:
          $ref: '#/components/responses/Error'
  /workspaces/{workspace_id}/media-analyses/quote:
    parameters:
    - $ref: '#/components/parameters/WorkspaceId'
    post:
      tags:
      - Campaign video
      summary: Price of analysing files
      description: 'What it costs to analyse photos and videos so proposals can use them well, for example "Analyse 12
        images and 2 videos: 9 credits". Files analysed before cost nothing (`analysed`), and so do files being analysed now
        (`in_progress`). A video whose length cannot be read before it is opened is priced at the longest allowed (10
        minutes) and settled on its real length. Charges nothing. Requires the `read` scope.'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MediaAnalysisInput'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MediaAnalysisQuote'
        '422':
          description: A file is not a finished photo or video in this workspace (`media_not_found`, `media_type_unsupported`),
            or a video is longer than 10 minutes (`media_too_long`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        default:
          $ref: '#/components/responses/Error'
  /workspaces/{workspace_id}/media-analyses:
    parameters:
    - $ref: '#/components/parameters/WorkspaceId'
    post:
      tags:
      - Campaign video
      summary: Analyse files
      description: 'Looks at each photo and video once: what it shows, where faces and the product are, where text can go
        without covering them, colours, quality and what it suits; for a video also its best ranges and what is said in
        it. Videos are converted to an upright H.264 MP4 of at most 1080p with a small preview copy, and HEIC photos to
        JPEG. The result is stored on the file (`analysis` on the media object) and used by every proposal and render
        after that; a file is never analysed or charged twice. The quoted price is charged once for the whole request;
        files that fail, and videos that turn out shorter than priced, are refunded in one refund when the analysis
        finishes. Send an `Idempotency-Key` to make a retry safe. Requires the `publish` scope.'
      parameters:
      - name: Idempotency-Key
        in: header
        required: false
        schema:
          type: string
          maxLength: 255
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MediaAnalysisInput'
      responses:
        '202':
          description: Started (or done at once when there was nothing new to analyse)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MediaAnalysis'
        '200':
          description: The same Idempotency-Key was sent before; this is that analysis
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MediaAnalysis'
        '402':
          description: The balance does not cover the price (`insufficient_credits`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        default:
          $ref: '#/components/responses/Error'
  /workspaces/{workspace_id}/media-analyses/{analysis_id}:
    parameters:
    - $ref: '#/components/parameters/WorkspaceId'
    - name: analysis_id
      in: path
      required: true
      schema:
        type: string
    get:
      tags:
      - Campaign video
      summary: Get an analysis
      description: Requires the `read` scope.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MediaAnalysis'
        default:
          $ref: '#/components/responses/Error'
  /workspaces/{workspace_id}/campaign-videos:
    parameters:
    - $ref: '#/components/parameters/WorkspaceId'
    post:
      tags:
      - Campaign video
      summary: Create a campaign video
      description: 'From a picked proposal (`spec` or `ai_video`) or a template (`template_id` with `values`). Library files
        in the spec must be finished images or videos in this workspace. A spec that is not valid answers 422 `invalid_spec`
        with every problem in `error.details.problems`. Requires the `publish` scope.'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CampaignVideoInput'
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CampaignVideo'
        default:
          $ref: '#/components/responses/Error'
    get:
      tags:
      - Campaign video
      summary: List campaign videos, newest first
      parameters:
      - $ref: '#/components/parameters/Cursor'
      - $ref: '#/components/parameters/Limit'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/CampaignVideo'
                  next_cursor:
                    type:
                    - string
                    - 'null'
                required:
                - data
        default:
          $ref: '#/components/responses/Error'
  /workspaces/{workspace_id}/campaign-videos/{video_id}:
    parameters:
    - $ref: '#/components/parameters/WorkspaceId'
    - $ref: '#/components/parameters/CampaignVideoId'
    get:
      tags:
      - Campaign video
      summary: Get a campaign video with its price and latest render
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CampaignVideo'
        default:
          $ref: '#/components/responses/Error'
    patch:
      tags:
      - Campaign video
      summary: Edit a campaign video
      description: Change `title`, `spec` (texts, timing, media) or, for a fully generated video, `ai_video`. Requires the `publish`
        scope.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                title:
                  type: string
                  maxLength: 100
                spec:
                  $ref: '#/components/schemas/CampaignVideoSpec'
                ai_video:
                  $ref: '#/components/schemas/AiVideoSettings'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CampaignVideo'
        default:
          $ref: '#/components/responses/Error'
    delete:
      tags:
      - Campaign video
      summary: Delete a campaign video
      description: Finished renders stay in the media library. A video that is being rendered cannot be deleted (409).
      responses:
        '204':
          description: Deleted
        default:
          $ref: '#/components/responses/Error'
  /workspaces/{workspace_id}/campaign-videos/{video_id}/render:
    parameters:
    - $ref: '#/components/parameters/WorkspaceId'
    - $ref: '#/components/parameters/CampaignVideoId'
    post:
      tags:
      - Campaign video
      summary: Render a campaign video to MP4
      description: 'Starts a render and returns it with status `rendering`. Media to generate and the voiceover are made first,
        each charged like a generation and returned if it fails. The render itself is charged when it is done, once; a failed
        render is never charged. The MP4 (H.264, AAC with a voiceover) becomes media in the workspace and can be used in
        posts. Send an Idempotency-Key so a retry never starts a second render. Requires the `publish` scope.'
      parameters:
      - $ref: '#/components/parameters/IdempotencyKey'
      responses:
        '202':
          description: Accepted
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CampaignRender'
        '200':
          description: The same Idempotency-Key was used before. The earlier render.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CampaignRender'
        '402':
          description: Not enough credits for the quoted price (`insufficient_credits`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '409':
          description: The video is already being rendered (`render_in_progress`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          description: 'The daily allowance of free voice generations is used up (`daily_limit_reached`, retryable;
            `details.resets_at` says when it comes back, 00:00 UTC). A render that makes voice lines counts once, however
            many lines it has; one whose voice lines were made for an earlier render of the video needs none. Nothing was
            charged.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '503':
          description: 'The video uses something no running renderer can draw yet (a character speaking in its clip, captions
            in the middle or at the top, the spoken word in colour): `renderer_unavailable`, retryable. Nothing was charged.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        default:
          $ref: '#/components/responses/Error'
  /workspaces/{workspace_id}/campaign-videos/{video_id}/renders:
    parameters:
    - $ref: '#/components/parameters/WorkspaceId'
    - $ref: '#/components/parameters/CampaignVideoId'
    get:
      tags:
      - Campaign video
      summary: List the renders of a campaign video, newest first
      parameters:
      - $ref: '#/components/parameters/Limit'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/CampaignRender'
                required:
                - data
        default:
          $ref: '#/components/responses/Error'
  /workspaces/{workspace_id}/campaign-videos/{video_id}/renders/{render_id}:
    parameters:
    - $ref: '#/components/parameters/WorkspaceId'
    - $ref: '#/components/parameters/CampaignVideoId'
    - name: render_id
      in: path
      required: true
      schema:
        type: string
    get:
      tags:
      - Campaign video
      summary: Get a render
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CampaignRender'
        default:
          $ref: '#/components/responses/Error'
  /workspaces/{workspace_id}/video-chats:
    parameters:
    - $ref: '#/components/parameters/WorkspaceId'
    post:
      tags:
      - Video chat
      summary: Start a video chat
      description: 'Creates a chat, optionally tied to an existing campaign video (`video_id`). With `message`, the first
        message is sent and answered in the same request, and the answer is in `messages`. A first message that is not
        valid is refused before anything is created. Requires the `publish` scope.'
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                title:
                  type: string
                  maxLength: 100
                aspect_ratio:
                  type: string
                  enum: ['9:16', '1:1', '4:5', '16:9']
                  default: '9:16'
                video_id:
                  type: string
                message:
                  $ref: '#/components/schemas/VideoChatMessageInput'
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VideoChat'
        default:
          $ref: '#/components/responses/Error'
    get:
      tags:
      - Video chat
      summary: List video chats, latest activity first
      parameters:
      - $ref: '#/components/parameters/Cursor'
      - $ref: '#/components/parameters/Limit'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      type: object
                      properties:
                        object:
                          const: video_chat
                        id:
                          type: string
                        title:
                          type: string
                        status:
                          type: string
                          enum: [open, closed]
                        video_id:
                          type: [string, 'null']
                        continued_in:
                          type: [string, 'null']
                        user_messages:
                          type: integer
                        updated_at:
                          type: string
                          format: date-time
                  next_cursor:
                    type: [string, 'null']
                required:
                - data
        default:
          $ref: '#/components/responses/Error'
  /workspaces/{workspace_id}/video-chats/{chat_id}:
    parameters:
    - $ref: '#/components/parameters/WorkspaceId'
    - $ref: '#/components/parameters/VideoChatId'
    get:
      tags:
      - Video chat
      summary: Get a video chat with its messages and meter
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VideoChat'
        default:
          $ref: '#/components/responses/Error'
    patch:
      tags:
      - Video chat
      summary: Rename a chat or change the shape of the next proposals
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                title:
                  type: string
                  maxLength: 100
                aspect_ratio:
                  type: string
                  enum: ['9:16', '1:1', '4:5', '16:9']
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VideoChat'
        default:
          $ref: '#/components/responses/Error'
    delete:
      tags:
      - Video chat
      summary: Delete a chat
      description: Only the conversation goes. A campaign video made in it stays.
      responses:
        '204':
          description: Deleted
        default:
          $ref: '#/components/responses/Error'
  /workspaces/{workspace_id}/video-chats/{chat_id}/messages:
    parameters:
    - $ref: '#/components/parameters/WorkspaceId'
    - $ref: '#/components/parameters/VideoChatId'
    post:
      tags:
      - Video chat
      summary: Send a message and get the answer
      description: 'Text with at most 5 attachments (library files in `media_ids`, uploaded first with POST /media, and
        `links`). Photos are shrunk before the assistant sees them; links are read as plain text from public https
        addresses only; a clip that is not analysed yet is not sent, and the answer offers the analysis with its price
        (`actions`). PDFs are refused for now (422). Send an `Idempotency-Key`: a retry with the same key returns the stored
        answer (200) instead of asking again. After `max_user_messages` messages the chat continues in a new one, which
        the answer returns (its `id` differs and the old chat is `closed`). When the included chat is used up and credits
        have run out, the answer is a notice with a `buy_credits` action and nothing is charged. 409 `chat_busy` while the
        previous message is still being answered. 409 `chat_turn_lost` (retryable) when an answer took so long that it
        was stopped before it was saved: you do not pay for it, send the message again with the same key. 409
        `chat_closed` for a closed chat. A retry with the same key sent to a closed chat gets the answer
        from the chat it continued in. 429 at the daily message limit of the organization. Requires the `publish` scope.'
      parameters:
      - name: Idempotency-Key
        in: header
        schema:
          type: string
          maxLength: 255
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/VideoChatMessageInput'
      responses:
        '201':
          description: Answered. `messages` holds the message sent and the answer.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VideoChat'
        '200':
          description: A retry with the same Idempotency-Key. The stored answer.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VideoChat'
        default:
          $ref: '#/components/responses/Error'
  /workspaces/{workspace_id}/video-chats/{chat_id}/choose:
    parameters:
    - $ref: '#/components/parameters/WorkspaceId'
    - $ref: '#/components/parameters/VideoChatId'
    post:
      tags:
      - Video chat
      summary: Pick a proposal of the chat
      description: Saves the proposal as a campaign video (free) and ties the chat to it, so the next messages change that
        video. Picking the same one again changes nothing. For a fully generated proposal, `model` picks one of its quality
        options (default the cheapest). Requires the `publish` scope.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                index:
                  type: integer
                  minimum: 0
                model:
                  type: string
              required:
              - index
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VideoChat'
        default:
          $ref: '#/components/responses/Error'
  /workspaces/{workspace_id}/campaign-templates:
    parameters:
    - $ref: '#/components/parameters/WorkspaceId'
    post:
      tags:
      - Campaign video
      summary: Save a campaign template
      description: 'From a campaign video (`from_video_id`) or a `spec`. Each text becomes a field such as `headline_1` and each
        library file a field such as `media_1`, with the current value as its default, unless the spec already has its own
        `{{placeholders}}`. Requires the `publish` scope.'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  maxLength: 100
                description:
                  type: string
                  maxLength: 500
                from_video_id:
                  type: string
                spec:
                  $ref: '#/components/schemas/CampaignVideoSpec'
                auto_fields:
                  type: boolean
                  description: Set false to keep the spec as it is, without turning texts into fields.
              required:
              - name
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CampaignTemplate'
        default:
          $ref: '#/components/responses/Error'
    get:
      tags:
      - Campaign video
      summary: List campaign templates
      parameters:
      - $ref: '#/components/parameters/Cursor'
      - $ref: '#/components/parameters/Limit'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/CampaignTemplate'
                  next_cursor:
                    type:
                    - string
                    - 'null'
                required:
                - data
        default:
          $ref: '#/components/responses/Error'
  /workspaces/{workspace_id}/campaign-templates/{template_id}:
    parameters:
    - $ref: '#/components/parameters/WorkspaceId'
    - name: template_id
      in: path
      required: true
      schema:
        type: string
    get:
      tags:
      - Campaign video
      summary: Get a campaign template
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CampaignTemplate'
        default:
          $ref: '#/components/responses/Error'
    patch:
      tags:
      - Campaign video
      summary: Edit a campaign template
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                description:
                  type:
                  - string
                  - 'null'
                spec:
                  $ref: '#/components/schemas/CampaignVideoSpec'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CampaignTemplate'
        default:
          $ref: '#/components/responses/Error'
    delete:
      tags:
      - Campaign video
      summary: Delete a campaign template
      responses:
        '204':
          description: Deleted
        default:
          $ref: '#/components/responses/Error'
  /workspaces/{workspace_id}/designs/templates:
    parameters:
    - $ref: '#/components/parameters/WorkspaceId'
    get:
      tags:
      - Designs
      summary: List the design templates and their input schemas
      description: Every template with its fields (the input schema), the shapes it can be made in, sample inputs, a cover
        image and the price per image. For generated templates the price is given per picture quality tier (`quick`,
        `balanced`, `standard`, `pro`, as the template offers them; the infographic and a product scene are `standard` or
        `pro`); a tier that this server cannot offer is left out. The quality is picked with `inputs.tier`.
        `when_then` also gives `hook_image`, the credits of its generated hook picture per tier. Requires the `read` scope.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/DesignTemplate'
                required:
                - data
        default:
          $ref: '#/components/responses/Error'
  /workspaces/{workspace_id}/designs/templates/{template_id}/thumbnail:
    parameters:
    - $ref: '#/components/parameters/WorkspaceId'
    - name: template_id
      in: path
      required: true
      schema:
        type: string
    get:
      tags:
      - Designs
      summary: The cover image of a template
      description: A PNG, 432 pixels wide. Drawn templates show their first slide with the sample text in the workspace's
        brand; generated templates show a drawn cover of what they make. Requires the `read` scope.
      responses:
        '200':
          description: OK
          content:
            image/png:
              schema:
                type: string
                format: binary
        default:
          $ref: '#/components/responses/Error'
  /workspaces/{workspace_id}/designs/quote:
    parameters:
    - $ref: '#/components/parameters/WorkspaceId'
    post:
      tags:
      - Designs
      summary: The price of a design, before it is made
      description: Takes the same body as making a design and returns what it would cost. Nothing is charged. Requires the
        `read` scope.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DesignInput'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                allOf:
                - $ref: '#/components/schemas/DesignPrice'
                - type: object
                  properties:
                    object:
                      const: design_quote
                    template:
                      type: string
                    quote_token:
                      type: string
                      description: Send back in the `Everyspoke-Quote` header within 30 minutes to be charged at most this price.
                    quote_expires_at:
                      type: string
                      format: date-time
                    balance:
                      type: integer
        default:
          $ref: '#/components/responses/Error'
  /workspaces/{workspace_id}/designs/preview:
    parameters:
    - $ref: '#/components/parameters/WorkspaceId'
    post:
      tags:
      - Designs
      summary: Preview a drawn design
      description: Draws every slide of a drawn template as a small PNG (data URL) so it can be checked before it is made.
        Free and nothing is stored. Needs full `inputs` (use `POST /designs/fill` to write them from a prompt first).
        Generated templates cannot be previewed (422 `preview_unavailable`). Requires the `publish` scope.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              allOf:
              - $ref: '#/components/schemas/DesignInput'
              - type: object
                properties:
                  width:
                    type: integer
                    minimum: 160
                    maximum: 720
                    default: 432
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                allOf:
                - $ref: '#/components/schemas/DesignPrice'
                - type: object
                  properties:
                    object:
                      const: design_preview
                    template:
                      type: string
                    aspect_ratio:
                      type: string
                    slides:
                      type: array
                      items:
                        type: object
                        properties:
                          index:
                            type: integer
                          data_url:
                            type: string
        default:
          $ref: '#/components/responses/Error'
  /workspaces/{workspace_id}/designs/fill:
    parameters:
    - $ref: '#/components/parameters/WorkspaceId'
    post:
      tags:
      - Designs
      summary: Write a template's fields from a brief
      description: The writer fills the content fields of a template from `prompt`, in the brand voice, for you to check and
        change before making the design. Fields given in `inputs` are kept as they are. `slide_count` sets how many slides or
        items it writes. Free, like other text, and counted against the daily allowance for free generations. If the answer
        cannot be used, the brief is split into the fields instead and `written` is false. Requires the `publish` scope.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DesignInput'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                allOf:
                - $ref: '#/components/schemas/DesignPrice'
                - type: object
                  properties:
                    object:
                      const: design_fill
                    template:
                      type: string
                    aspect_ratio:
                      type: string
                    inputs:
                      type: object
                      additionalProperties: true
                    written:
                      type: boolean
        default:
          $ref: '#/components/responses/Error'
  /workspaces/{workspace_id}/designs:
    parameters:
    - $ref: '#/components/parameters/WorkspaceId'
    post:
      tags:
      - Designs
      summary: Make a design
      description: 'Starts making a design and returns it at once with status `queued`. Poll `GET /designs/{design_id}`
        or subscribe to the generation webhooks. Credits are taken before the job starts and returned if it fails. With
        an `Idempotency-Key` the same request returns the first design and is charged once. With a `prompt`, the fields not
        given in `inputs` are written first (and `slide_count` sets how many slides, default 5 for most templates, so the
        price is known before anything is written). Media ids in `inputs` must be finished images in the workspace.
        Requires the `publish` scope.'
      parameters:
      - $ref: '#/components/parameters/IdempotencyKey'
      - $ref: '#/components/parameters/Quote'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DesignInput'
            examples:
              brief:
                summary: From a brief
                value:
                  template: tips_bold
                  prompt: Five tips for first-time home buyers, friendly and practical
                  slide_count: 5
                  aspect_ratio: '4:5'
              inputs:
                summary: From explicit inputs
                value:
                  template: highlight_quotes
                  aspect_ratio: '1:1'
                  inputs:
                    title: What we *learned* this year
                    quotes:
                    - text: Your audience remembers *how you made them feel*.
                    highlight_color: yellow
      responses:
        '202':
          description: Queued
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Design'
        '200':
          description: The design an earlier request with the same Idempotency-Key started
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Design'
        default:
          $ref: '#/components/responses/Error'
    get:
      tags:
      - Designs
      summary: List designs, newest first
      parameters:
      - $ref: '#/components/parameters/Cursor'
      - $ref: '#/components/parameters/Limit'
      - name: status
        in: query
        schema:
          type: string
          enum: [queued, running, completed, failed]
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/Design'
                  next_cursor:
                    type: [string, 'null']
                required:
                - data
        default:
          $ref: '#/components/responses/Error'
  /workspaces/{workspace_id}/designs/{design_id}:
    parameters:
    - $ref: '#/components/parameters/WorkspaceId'
    - name: design_id
      in: path
      required: true
      schema:
        type: string
    get:
      tags:
      - Designs
      summary: Get a design
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Design'
        default:
          $ref: '#/components/responses/Error'
  /workspaces/{workspace_id}/characters:
    parameters:
    - $ref: '#/components/parameters/WorkspaceId'
    get:
      tags:
      - AI video formats
      summary: List saved characters
      parameters:
      - $ref: '#/components/parameters/Limit'
      - name: cursor
        in: query
        schema:
          type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/Character'
                  next_cursor:
                    type:
                    - string
                    - 'null'
                required:
                - data
        default:
          $ref: '#/components/responses/Error'
    post:
      tags:
      - AI video formats
      summary: Save a character
      description: 'A name, a detailed description and fixed traits. The traits are repeated word for word in every scene
        prompt, so keep each short and visual. A reference picture can be given now (a finished PNG, JPEG or WebP in the media
        library) or picked later from candidates. Free. Requires the `publish` scope. At most 50 per workspace.'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CharacterInput'
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Character'
        default:
          $ref: '#/components/responses/Error'
  /workspaces/{workspace_id}/characters/{character_id}:
    parameters:
    - $ref: '#/components/parameters/WorkspaceId'
    - name: character_id
      in: path
      required: true
      schema:
        type: string
        pattern: ^chr_[0-9a-z]{26}$
    get:
      tags:
      - AI video formats
      summary: Get a character, with its candidate pictures
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Character'
        default:
          $ref: '#/components/responses/Error'
    patch:
      tags:
      - AI video formats
      summary: Change a character
      description: Send only the fields to change. `traits` replaces all traits. `reference_media_id` null removes the reference.
        Videos already rendered do not change; scenes made after the change use the new look.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CharacterInput'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Character'
        default:
          $ref: '#/components/responses/Error'
    delete:
      tags:
      - AI video formats
      summary: Delete a character
      responses:
        '204':
          description: Deleted
        default:
          $ref: '#/components/responses/Error'
  /workspaces/{workspace_id}/characters/{character_id}/candidates:
    parameters:
    - $ref: '#/components/parameters/WorkspaceId'
    - name: character_id
      in: path
      required: true
      schema:
        type: string
    post:
      tags:
      - AI video formats
      summary: Make 2 to 4 candidate reference pictures from the description
      description: 'With `dry_run: true` only the price is returned. Otherwise each picture is charged when it is asked for
        (the price of one generated image) and refunded if it fails. The pictures appear in `candidates` as they finish; pick
        one with POST .../reference. Send an Idempotency-Key so a retry makes nothing twice. Requires the `publish` scope.'
      parameters:
      - $ref: '#/components/parameters/IdempotencyKey'
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                count:
                  type: integer
                  minimum: 2
                  maximum: 4
                  default: 3
                style:
                  $ref: '#/components/schemas/VisualStyle'
                dry_run:
                  type: boolean
      responses:
        '200':
          description: The price (dry run).
          content:
            application/json:
              schema:
                type: object
                properties:
                  object:
                    const: character_candidates_quote
                  count:
                    type: integer
                  credits_per_image:
                    type: integer
                  credits:
                    type: integer
        '202':
          description: The pictures are being made.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Character'
        '402':
          description: Not enough credits (`insufficient_credits`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        default:
          $ref: '#/components/responses/Error'
  /workspaces/{workspace_id}/characters/{character_id}/reference:
    parameters:
    - $ref: '#/components/parameters/WorkspaceId'
    - name: character_id
      in: path
      required: true
      schema:
        type: string
    post:
      tags:
      - AI video formats
      summary: Pick the reference picture
      description: A candidate's picture or any finished PNG, JPEG or WebP picture in the media library.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                media_id:
                  type: string
              required:
              - media_id
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Character'
        default:
          $ref: '#/components/responses/Error'
  /workspaces/{workspace_id}/story-options:
    parameters:
    - $ref: '#/components/parameters/WorkspaceId'
    get:
      tags:
      - AI video formats
      summary: What the formats offer here
      description: 'The formats, picture styles, video models for moving scenes (cheapest first) and for talking characters,
        caption positions, and how captions are timed: `recognized` (to the words as they are heard in the voice) or
        `estimated` (from the script, sentence by sentence, the time split evenly over the words).'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  formats:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          $ref: '#/components/schemas/StoryFormat'
                        label:
                          type: string
                        about:
                          type: string
                  styles:
                    type: array
                    items:
                      type: object
                  animation_models:
                    type: array
                    items:
                      type: object
                      properties:
                        model:
                          type: string
                        label:
                          type: string
                        talks:
                          type: boolean
                  image_tiers:
                    type: array
                    description: Picture quality of scene pictures, cheapest first, with credits per picture.
                    items:
                      $ref: '#/components/schemas/ImageTierChoice'
                  reference_tiers:
                    type: array
                    description: The tiers a scene with the character can be made on.
                    items:
                      $ref: '#/components/schemas/ImageTierChoice'
                  talking_models:
                    type: array
                    items:
                      type: object
                  caption_positions:
                    type: array
                    items:
                      type: string
                  caption_timing:
                    enum:
                    - recognized
                    - estimated
        default:
          $ref: '#/components/responses/Error'
  /workspaces/{workspace_id}/campaign-videos/stories:
    parameters:
    - $ref: '#/components/parameters/WorkspaceId'
    post:
      tags:
      - AI video formats
      summary: Plan a video in one of the AI video formats
      description: 'Plans the scenes and returns a campaign video spec with free scenes (one generated picture or clip per
        scene, or your own file), narration, captions, on screen text and music, with the price of the scene pictures and
        clips and of the whole video. Nothing is charged. Send exactly one of `brief` (the scenes are written for you),
        `script` (split into scenes; every word is kept) or `scenes` (given; no text model is used). Planning from a brief or a
        script counts against the daily text cap. With `save: true` the video is saved too. Formats: `talking_character` (the
        character talks to the camera in first person; with a video model that makes speech the clip says the line, otherwise
        the character is animated and a voiceover says it), `narrated`, `hook_story` (a big hook on the first scene, short text
        on the others) and `voiced_scenes`. Requires the `publish` scope and the ai_video_formats feature.'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/StoryRequest'
      responses:
        '200':
          description: The plan.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StoryProposal'
        '201':
          description: The plan, saved as a campaign video (`video`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StoryProposal'
        default:
          $ref: '#/components/responses/Error'
  /workspaces/{workspace_id}/campaign-videos/{video_id}/scenes/generate:
    parameters:
    - $ref: '#/components/parameters/WorkspaceId'
    - $ref: '#/components/parameters/CampaignVideoId'
    post:
      tags:
      - AI video formats
      summary: Make every scene picture and clip that is not made yet
      description: 'With `dry_run: true` only the price is returned. Otherwise a run starts (a campaign render with
        `assets_only: true` and no video file): each picture and clip is charged when it is asked for and refunded if it fails,
        and what was made is written into the video. A clip made from a still (moving scenes, talking characters) is two
        items: the still, made with the character''s reference picture, and the clip. Nothing is rendered. Every character the
        video uses needs a reference picture (`character_needs_reference`). Requires the `publish` scope.'
      parameters:
      - $ref: '#/components/parameters/IdempotencyKey'
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                dry_run:
                  type: boolean
      responses:
        '200':
          description: The price (dry run), or the earlier run for a repeated Idempotency-Key.
          content:
            application/json:
              schema:
                type: object
        '202':
          description: The run.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CampaignRender'
        '402':
          description: Not enough credits (`insufficient_credits`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        default:
          $ref: '#/components/responses/Error'
  /workspaces/{workspace_id}/campaign-videos/{video_id}/scenes/{scene_id}/regenerate:
    parameters:
    - $ref: '#/components/parameters/WorkspaceId'
    - $ref: '#/components/parameters/CampaignVideoId'
    - name: scene_id
      in: path
      required: true
      schema:
        type: string
    post:
      tags:
      - AI video formats
      summary: Make one scene again
      description: 'A new take of the scene''s picture or clip, with the same recipe or a changed `description`. With
        `dry_run: true` only its price is returned and nothing changes. Otherwise only this scene is made, at once, and
        charged on its own: the price shown is the price charged. While other scenes are still to be made the request is
        refused (`scenes_unmade`, 409); make them with POST .../scenes/generate first. With an Idempotency-Key a repeat
        gives back the first take (200) and changes nothing. A scene that uses your own file cannot be made again
        (`not_generated`).'
      parameters:
      - $ref: '#/components/parameters/IdempotencyKey'
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                description:
                  type: string
                  maxLength: 800
                dry_run:
                  type: boolean
      responses:
        '200':
          description: The price (dry run).
          content:
            application/json:
              schema:
                type: object
                properties:
                  credits:
                    type: integer
        '202':
          description: The new take is being made.
          content:
            application/json:
              schema:
                type: object
                properties:
                  run:
                    $ref: '#/components/schemas/CampaignRender'
                  price:
                    type: object
        default:
          $ref: '#/components/responses/Error'
  /workspaces/{workspace_id}/clip-options:
    parameters:
    - $ref: '#/components/parameters/WorkspaceId'
    get:
      tags:
      - Clip tools
      summary: What the clip tools offer here
      description: Shapes, framing, transitions, caption styles and positions, title positions, cutaway layouts and picture
        styles, the music library, the video models for moving cutaways (with the clip length each makes), limits, the price
        of a picture cutaway, and how the words are found (`recognized` from the sound, or `analysis` from the clip's
        transcript by sentence when no speech recognition is set up).
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClipOptions'
        default:
          $ref: '#/components/responses/Error'
  /workspaces/{workspace_id}/campaign-videos/combine:
    parameters:
    - $ref: '#/components/parameters/WorkspaceId'
    post:
      tags:
      - Clip tools
      summary: Combine clips into one video
      description: 'With `dry_run: true` the price is returned: preparing clips that are not analysed yet (`prepare`), recognizing
        the speech (when captions or trimming are on), music made for the video and the render. Otherwise the clips must be
        analysed (`clip_not_prepared`, 409, lists them). Only the part of each clip that fits under the length cap is recognized
        (the cap is applied before trimming silence). Each window of sound is charged at most once, ever, as it comes back, and
        kept; a window that fails or in which nothing was said is not charged. Checks that need no words (music, files, what is
        left after the cap) come first; if the video cannot be made after the words were recognized, their charge is refunded.
        The video is saved as a campaign
        video. A long clip becomes contiguous scenes that play as one. Requires the `publish` scope, an Idempotency-Key (the
        same key and request give back the first answer; another request under it is `idempotency_conflict`, 409; one still
        running is `request_in_progress`, 409) and the clip_tools feature.'
      parameters:
      - $ref: '#/components/parameters/IdempotencyKey'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                clips:
                  type: array
                  minItems: 1
                  maxItems: 20
                  description: Videos from the media library, in order. A media id, or `{"media_id","start","end"}` to use a part
                    (seconds in the file).
                  items:
                    oneOf:
                    - type: string
                    - type: object
                      properties:
                        media_id:
                          type: string
                        start:
                          type: number
                        end:
                          type: number
                      required: [media_id]
                transition:
                  description: 'Between clips: `none` (a cut, the sound ramps over 0.1 s so it never clicks), `fade` (through
                    black), `crossfade`, `slide` or `zoom`. The clips'' sound cross fades with the picture. At most 1 second and
                    half of either clip. A string is the type with 0.4 s.'
                  oneOf:
                  - type: string
                  - type: object
                    properties:
                      type:
                        enum: [none, fade, crossfade, slide, zoom]
                        default: crossfade
                      duration:
                        type: number
                        minimum: 0.1
                        maximum: 1
                        default: 0.4
                aspect_ratio:
                  enum: ['9:16', '1:1', '4:5', '16:9']
                  default: '9:16'
                fit:
                  enum: [fit, fill]
                  default: fill
                  description: '`fill` crops each clip to the frame around its subject (from the analysis); `fit` shows the
                    whole picture with blurred, enlarged edges behind it.'
                trim_silence:
                  type: boolean
                  description: Cut each clip from 0.25 s before its first recognized word to 0.35 s after its last one. A clip
                    with no recognized speech is kept as it is.
                captions:
                  description: 'Captions from what is said, timed word by word. `null` (or `{"on": false}`) for none.
                    Styles: `minimal` (white with a shadow), `bold` (heavy capitals with an outline), `highlight` (a dark pill,
                    the spoken word in the highlight colour, the brand accent unless `highlight` says otherwise) and
                    `word_by_word` (one word at a time, large). Positions keep inside the platform safe area and never
                    under the title. Left out (or `true`), the captions are `bold` in the `middle` with the spoken word
                    in `brand.accent`, and move above a picture in picture card. An object keeps its own defaults
                    (`highlight` at the `bottom`) for what it leaves out. Changed 2026-12-01: before, leaving captions
                    out gave `highlight` at the `bottom`.'
                  oneOf:
                  - type: 'null'
                  - type: object
                    properties:
                      on:
                        type: boolean
                      style:
                        enum: [minimal, bold, highlight, word_by_word]
                        default: highlight
                      position:
                        enum: [bottom, middle, top]
                        default: bottom
                      highlight:
                        type: string
                        description: A brand colour reference such as `brand.accent`.
                title:
                  oneOf:
                  - type: 'null'
                  - type: object
                    properties:
                      text:
                        type: string
                        maxLength: 80
                      position:
                        enum: [top, center, bottom]
                        default: top
                      duration:
                        type: number
                        minimum: 1
                        maximum: 10
                        default: 3
                    required: [text]
                music:
                  description: 'Background music, or null for none. It sits well under the clips'' sound and about 10 dB
                    lower again while someone speaks (from the recognized words). `library` picks a bundled track by mood or
                    `track_id`; `generate` makes one with the music model when the video is rendered (its own price item);
                    `media` is an audio file in the workspace.'
                  oneOf:
                  - type: 'null'
                  - type: object
                    properties:
                      source:
                        enum: [library, generate, media]
                        default: library
                      mood:
                        enum: [energetic, upbeat, playful, calm, uplifting, cinematic]
                      track_id:
                        type: string
                      media_id:
                        type: string
                      prompt:
                        type: string
                        maxLength: 200
                      volume:
                        type: number
                        minimum: 0
                        maximum: 1
                        default: 0.8
                max_duration_seconds:
                  type: number
                  minimum: 3
                  maximum: 90
                  description: The video is cut at this length (at most 90 seconds).
                language:
                  type: string
                  description: The language spoken, when the analysis got it wrong. Captions keep what is said.
                name:
                  type: string
                  description: The video's title in the list.
                video_id:
                  type: string
                  description: Make it again into this clip video instead of a new one.
                dry_run:
                  type: boolean
                  description: Only the price; nothing is recognized, made or charged.
              required: [clips]
      responses:
        '200':
          description: The price (dry run), or the first answer for a repeated Idempotency-Key.
          content:
            application/json:
              schema:
                oneOf:
                - $ref: '#/components/schemas/ClipQuote'
                - $ref: '#/components/schemas/ClipVideo'
        '201':
          description: The video, saved.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClipVideo'
        default:
          $ref: '#/components/responses/Error'
  /workspaces/{workspace_id}/campaign-videos/talking-head:
    parameters:
    - $ref: '#/components/parameters/WorkspaceId'
    post:
      tags:
      - Clip tools
      summary: A talking head clip with cutaways
      description: 'One clip of a person speaking. With `dry_run: true` the whole price is returned: preparing the clip, recognizing
        the speech, the cutaways (placeholders spread over the clip, priced as the real ones) and the render. Otherwise the
        speech is recognized and charged, a text model picks the moments (one sentence each, never the first, at least a second
        of the speaker between two) and writes what each cutaway shows (free, counted against the daily text cap; without a
        text model the moments are spread evenly), and the video is saved: the speaker''s clip runs from start to end with its
        own sound, cut into scenes at each cutaway, which shows full frame or as a card on the side away from the face. Give
        `moments` to place them yourself. The cutaways are made, and charged one by one, when the video is rendered; one that
        fails is refunded and the render is not charged. Requires the `publish` scope, an Idempotency-Key and the clip_tools
        feature.'
      parameters:
      - $ref: '#/components/parameters/IdempotencyKey'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                clip:
                  description: The clip, a media id or `{"media_id","start","end"}`.
                  oneOf:
                  - type: string
                  - type: object
                    properties:
                      media_id:
                        type: string
                      start:
                        type: number
                      end:
                        type: number
                    required: [media_id]
                cutaways:
                  type: integer
                  minimum: 3
                  maximum: 6
                  default: 4
                cutaway_kind:
                  enum: [image, video]
                  default: image
                  description: '`video` animates a generated still with a video model (`video_model`, from clip-options); each
                    clip cutaway lasts exactly the clip length the model makes.'
                layout:
                  enum: [full, pip]
                  default: pip
                  description: '`pip` shows each cutaway as a card on the side away from the speaker''s face (the lower
                    half when the face is in the upper half); `full` cuts to it full frame. Changed 2026-12-01: the
                    default was `full`.'
                style:
                  enum: [realistic, cartoon, anime, watercolor, oil_painting, sketch, cyberpunk, fantasy, minimalist]
                  default: realistic
                video_model:
                  type: string
                image_tier:
                  type: string
                  enum: [quick, balanced, standard]
                  default: standard
                  description: Picture quality of the cutaway pictures and of the stills cutaway clips start from
                    (clip-options image_tiers gives credits per picture).
                moments:
                  type: array
                  maxItems: 6
                  description: Your own moments instead of the chosen ones, in seconds of the clip. Ones that start in the first
                    1.5 s, run into the last second or come within a second of the one before are left out (see `notes`).
                  items:
                    type: object
                    properties:
                      start:
                        type: number
                      duration:
                        type: number
                        minimum: 1
                        maximum: 8
                        default: 3
                      prompt:
                        type: string
                      kind:
                        enum: [image, video]
                    required: [start, prompt]
                aspect_ratio:
                  enum: ['9:16', '1:1', '4:5', '16:9']
                  default: '9:16'
                fit:
                  enum: [fit, fill]
                  default: fill
                  description: '`fill` crops each clip to the frame around its subject (from the analysis); `fit` shows the
                    whole picture with blurred, enlarged edges behind it.'
                trim_silence:
                  type: boolean
                  description: Cut each clip from 0.25 s before its first recognized word to 0.35 s after its last one. A clip
                    with no recognized speech is kept as it is.
                captions:
                  description: 'Captions from what is said, timed word by word. `null` (or `{"on": false}`) for none.
                    Styles: `minimal` (white with a shadow), `bold` (heavy capitals with an outline), `highlight` (a dark pill,
                    the spoken word in the highlight colour, the brand accent unless `highlight` says otherwise) and
                    `word_by_word` (one word at a time, large). Positions keep inside the platform safe area and never
                    under the title. Left out (or `true`), the captions are `bold` in the `middle` with the spoken word
                    in `brand.accent`, and move above a picture in picture card. An object keeps its own defaults
                    (`highlight` at the `bottom`) for what it leaves out. Changed 2026-12-01: before, leaving captions
                    out gave `highlight` at the `bottom`.'
                  oneOf:
                  - type: 'null'
                  - type: object
                    properties:
                      on:
                        type: boolean
                      style:
                        enum: [minimal, bold, highlight, word_by_word]
                        default: highlight
                      position:
                        enum: [bottom, middle, top]
                        default: bottom
                      highlight:
                        type: string
                        description: A brand colour reference such as `brand.accent`.
                title:
                  oneOf:
                  - type: 'null'
                  - type: object
                    properties:
                      text:
                        type: string
                        maxLength: 80
                      position:
                        enum: [top, center, bottom]
                        default: top
                      duration:
                        type: number
                        minimum: 1
                        maximum: 10
                        default: 3
                    required: [text]
                music:
                  description: 'Background music, or null for none. It sits well under the clips'' sound and about 10 dB
                    lower again while someone speaks (from the recognized words). `library` picks a bundled track by mood or
                    `track_id`; `generate` makes one with the music model when the video is rendered (its own price item);
                    `media` is an audio file in the workspace.'
                  oneOf:
                  - type: 'null'
                  - type: object
                    properties:
                      source:
                        enum: [library, generate, media]
                        default: library
                      mood:
                        enum: [energetic, upbeat, playful, calm, uplifting, cinematic]
                      track_id:
                        type: string
                      media_id:
                        type: string
                      prompt:
                        type: string
                        maxLength: 200
                      volume:
                        type: number
                        minimum: 0
                        maximum: 1
                        default: 0.8
                max_duration_seconds:
                  type: number
                  minimum: 3
                  maximum: 90
                  description: The video is cut at this length (at most 90 seconds).
                language:
                  type: string
                  description: The language spoken, when the analysis got it wrong. Captions keep what is said.
                name:
                  type: string
                  description: The video's title in the list.
                video_id:
                  type: string
                  description: Make it again into this clip video instead of a new one.
                dry_run:
                  type: boolean
                  description: Only the price; nothing is recognized, made or charged.
              required: [clip]
      responses:
        '200':
          description: The price (dry run), or the first answer for a repeated Idempotency-Key.
          content:
            application/json:
              schema:
                oneOf:
                - $ref: '#/components/schemas/ClipQuote'
                - $ref: '#/components/schemas/ClipVideo'
        '201':
          description: The video, saved, with its moments.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClipVideo'
        default:
          $ref: '#/components/responses/Error'
  /workspaces/{workspace_id}/video-reviews/quote:
    parameters:
    - $ref: '#/components/parameters/WorkspaceId'
    post:
      tags:
      - Video coach
      summary: Price of a video review
      description: 'What reviewing a video costs: the media analysis it still needs (0 when it was analysed before) plus the
        review step. Charges nothing. Requires the `read` scope.'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/VideoReviewInput'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VideoReviewQuote'
        '422':
          description: The file is not a finished video in this workspace (`media_not_found`, `media_type_unsupported`), or
            it is longer than the analysis allows (`media_too_long`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        default:
          $ref: '#/components/responses/Error'
  /workspaces/{workspace_id}/video-reviews:
    parameters:
    - $ref: '#/components/parameters/WorkspaceId'
    post:
      tags:
      - Video coach
      summary: Review a video
      description: 'Starts a review. The analysis the video still needs is requested and charged as a media analysis; the
        review step is charged under the review id. The review waits for the analysis, then the text model writes it. If
        the review cannot be made its credits are refunded once; a failed analysis refunds itself. In test mode the analysis
        and the review are simulated and done at once. Send an `Idempotency-Key` to make a retry safe; the same key with
        another video, network or goal is refused (409). Requires the `publish` scope.'
      parameters:
      - name: Idempotency-Key
        in: header
        required: false
        schema:
          type: string
          maxLength: 200
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/VideoReviewInput'
      responses:
        '202':
          description: Started (done at once in test mode)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VideoReview'
        '200':
          description: The same Idempotency-Key was sent before; this is that review
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VideoReview'
        '402':
          description: The balance does not cover the price (`insufficient_credits`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '409':
          description: The Idempotency-Key was used for a different request (`idempotency_conflict`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        default:
          $ref: '#/components/responses/Error'
    get:
      tags:
      - Video coach
      summary: List video reviews
      description: Newest first. Requires the `read` scope.
      parameters:
      - name: media_id
        in: query
        required: false
        schema:
          type: string
        description: Only the reviews of this video.
      - name: limit
        in: query
        schema:
          type: integer
          minimum: 1
          maximum: 100
          default: 25
      - name: cursor
        in: query
        schema:
          type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/VideoReview'
                  next_cursor:
                    type:
                    - string
                    - 'null'
        default:
          $ref: '#/components/responses/Error'
  /workspaces/{workspace_id}/video-reviews/{review_id}:
    parameters:
    - $ref: '#/components/parameters/WorkspaceId'
    - name: review_id
      in: path
      required: true
      schema:
        type: string
    get:
      tags:
      - Video coach
      summary: Get a video review
      description: Requires the `read` scope.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VideoReview'
        default:
          $ref: '#/components/responses/Error'
  /workspaces/{workspace_id}/inspiration:
    parameters:
    - $ref: '#/components/parameters/WorkspaceId'
    get:
      tags:
      - Inspiration
      summary: Posts that did well
      description: 'Public posts on a topic and your own best posts, filtered and sorted. A filter on a number the network does
        not give (for example followers when a profile could not be read) leaves the post out. `sources` says for each network
        whether the result is fresh, cached, or why it is empty (`unavailable`, `rate_limited`, `not_configured`, `failed`).
        Requires the `read` scope.'
      parameters:
      - name: topic
        in: query
        schema:
          type: string
          maxLength: 100
        description: What to look for. On Mastodon it is read as a hashtag; without it, the servers' trending posts. Bluesky
          needs a topic.
      - name: networks
        in: query
        schema:
          type: string
          default: bluesky,mastodon
        description: Comma separated, from bluesky, mastodon, x and own.
      - name: media
        in: query
        schema:
          enum: [any, image, video, text]
          default: any
      - name: min_likes
        in: query
        schema:
          type: integer
          minimum: 0
      - name: max_likes
        in: query
        schema:
          type: integer
          minimum: 0
      - name: min_comments
        in: query
        schema:
          type: integer
          minimum: 0
      - name: max_comments
        in: query
        schema:
          type: integer
          minimum: 0
      - name: min_shares
        in: query
        schema:
          type: integer
          minimum: 0
      - name: max_shares
        in: query
        schema:
          type: integer
          minimum: 0
      - name: min_followers
        in: query
        schema:
          type: integer
          minimum: 0
      - name: max_followers
        in: query
        schema:
          type: integer
          minimum: 0
      - name: exclude
        in: query
        schema:
          type: string
        description: Comma separated words. Posts that contain any of them are left out.
      - name: creator
        in: query
        schema:
          type: string
        description: Only posts whose author handle or name contains this.
      - name: sort
        in: query
        schema:
          enum: [engagement, likes, comments, shares, newest]
          default: engagement
        description: Engagement counts likes once, comments twice and shares three times.
      - name: limit
        in: query
        schema:
          type: integer
          minimum: 1
          maximum: 100
          default: 30
      - name: refresh
        in: query
        schema:
          type: boolean
        description: Ask the networks again instead of using the cached result (a result under two minutes old is reused).
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  topic:
                    type: string
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/InspirationPost'
                  sources:
                    type: array
                    items:
                      type: object
                      properties:
                        network:
                          type: string
                        status:
                          enum: [fresh, cached, unavailable, rate_limited, not_configured, failed]
                        fetched_at:
                          type:
                          - string
                          - 'null'
                        message:
                          type: string
        default:
          $ref: '#/components/responses/Error'
  /workspaces/{workspace_id}/inspiration/networks:
    parameters:
    - $ref: '#/components/parameters/WorkspaceId'
    get:
      tags:
      - Inspiration
      summary: Networks of the feed
      description: Which networks this server can read (X needs a token), and whether the feed is simulated (test mode).
        Requires the `read` scope.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                        name:
                          type: string
                        available:
                          type: boolean
                        simulated:
                          type: boolean
        default:
          $ref: '#/components/responses/Error'
  /workspaces/{workspace_id}/inspiration/remix:
    parameters:
    - $ref: '#/components/parameters/WorkspaceId'
    post:
      tags:
      - Inspiration
      summary: Remix a post into drafts
      description: 'Starts a text generation (the same as POST /workspaces/{workspace_id}/generations with kind text) that
        writes original drafts from the idea of the post in the brand voice. The post''s wording is not copied and its text is
        treated as data. Free, counted against the daily text allowance. Send an `Idempotency-Key` to make a retry safe.
        Requires the `publish` scope.'
      parameters:
      - name: Idempotency-Key
        in: header
        required: false
        schema:
          type: string
          maxLength: 255
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - text
              - platforms
              properties:
                text:
                  type: string
                  maxLength: 5000
                network:
                  type: string
                angle:
                  type: string
                  maxLength: 300
                  description: Your own angle on the idea.
                platforms:
                  type: array
                  items:
                    type: string
                language:
                  type: string
      responses:
        '202':
          description: Started; poll the generation.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Generation'
        '200':
          description: The same Idempotency-Key was sent before; this is that generation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Generation'
        '429':
          description: The daily text allowance is used up.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        default:
          $ref: '#/components/responses/Error'
  /workspaces/{workspace_id}/prompts:
    parameters:
    - $ref: '#/components/parameters/WorkspaceId'
    get:
      tags:
      - Prompts
      summary: List prompts
      description: Built in prompts first, then the workspace's own, ordered by title. Requires the `read` scope.
      parameters:
      - name: q
        in: query
        schema:
          type: string
          maxLength: 100
        description: Search in the title, description and instruction.
      - name: kind
        in: query
        schema:
          enum: [text, video_script]
      - name: source
        in: query
        schema:
          enum: [built_in, own]
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/Prompt'
        default:
          $ref: '#/components/responses/Error'
    post:
      tags:
      - Prompts
      summary: Create a prompt
      description: At most 200 prompts per workspace. Requires the `publish` scope.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PromptInput'
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Prompt'
        default:
          $ref: '#/components/responses/Error'
  /workspaces/{workspace_id}/prompts/{prompt_id}:
    parameters:
    - $ref: '#/components/parameters/WorkspaceId'
    - name: prompt_id
      in: path
      required: true
      schema:
        type: string
    get:
      tags:
      - Prompts
      summary: Get a prompt
      description: Requires the `read` scope.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Prompt'
        default:
          $ref: '#/components/responses/Error'
    patch:
      tags:
      - Prompts
      summary: Change a prompt
      description: Only the workspace's own prompts; a built in prompt answers 409 (`prompt_read_only`). Generations already
        made keep the text they were made with. Requires the `publish` scope.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PromptInput'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Prompt'
        '409':
          description: A built in prompt (`prompt_read_only`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        default:
          $ref: '#/components/responses/Error'
    delete:
      tags:
      - Prompts
      summary: Delete a prompt
      description: Only the workspace's own prompts. Requires the `publish` scope.
      responses:
        '204':
          description: Deleted
        '409':
          description: A built in prompt (`prompt_read_only`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        default:
          $ref: '#/components/responses/Error'
  /workspaces/{workspace_id}/prompts/{prompt_id}/duplicate:
    parameters:
    - $ref: '#/components/parameters/WorkspaceId'
    - name: prompt_id
      in: path
      required: true
      schema:
        type: string
    post:
      tags:
      - Prompts
      summary: Duplicate a prompt
      description: Makes a copy in the workspace, titled with "(copy)", of a built in prompt or one of the workspace's own.
        Requires the `publish` scope.
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Prompt'
        default:
          $ref: '#/components/responses/Error'
  /workspaces/{workspace_id}/strategy:
    parameters:
    - $ref: '#/components/parameters/WorkspaceId'
    get:
      tags:
      - Marketing strategist
      summary: The strategist and the plan
      description: The latest interview with its messages, the latest plan, the list of versions, the last check-ins and the
        strategist's meter. Requires the `read` scope.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StrategyOverview'
        default:
          $ref: '#/components/responses/Error'
  /workspaces/{workspace_id}/strategy/sessions:
    parameters:
    - $ref: '#/components/parameters/WorkspaceId'
    post:
      tags:
      - Marketing strategist
      summary: Start an interview
      description: 'Reads the intake and what the workspace shows, and asks the first question. At least one of `urls`,
        `text` and `media_ids` is useful; with none, every question is asked. Pages that cannot be read are named as such
        and skipped. Photos must be JPEG, PNG or WebP; PDFs are read by the model. Send an `Idempotency-Key` to make a
        retry safe: the same key returns the same session (200), with other input it is refused (422). When the included
        allowance and the balance are used up the answer is a notice instead of a question. Requires the `publish` scope.'
      parameters:
      - $ref: '#/components/parameters/StrategyIdempotencyKey'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/StrategyIntake'
      responses:
        '201':
          description: Started
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StrategySession'
        '200':
          description: The same Idempotency-Key was sent before; this is that session
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StrategySession'
        '503':
          description: Not set up on this server yet (`provider_not_configured`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        default:
          $ref: '#/components/responses/Error'
  /workspaces/{workspace_id}/strategy/sessions/{session_id}:
    parameters:
    - $ref: '#/components/parameters/WorkspaceId'
    - $ref: '#/components/parameters/StrategySessionId'
    get:
      tags:
      - Marketing strategist
      summary: Get an interview
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StrategySession'
        default:
          $ref: '#/components/responses/Error'
  /workspaces/{workspace_id}/strategy/sessions/{session_id}/messages:
    parameters:
    - $ref: '#/components/parameters/WorkspaceId'
    - $ref: '#/components/parameters/StrategySessionId'
    post:
      tags:
      - Marketing strategist
      summary: Answer
      description: 'Answers the current question with `text` or a clicked suggestion (`choice`), or skips it (`skip`). The
        answer has the next question, or the news that the plan can be written. After the plan, a message is a change to the
        plan and writes a new version. One answer at a time per interview (409 `strategy_busy`). The same `Idempotency-Key`
        returns the stored answer (200). Requires the `publish` scope.'
      parameters:
      - $ref: '#/components/parameters/StrategyIdempotencyKey'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                text:
                  type: string
                  maxLength: 2000
                choice:
                  type: string
                  maxLength: 2000
                  description: A suggested answer that was clicked.
                skip:
                  type: boolean
      responses:
        '201':
          description: Answered. `messages` holds this turn only, the person's message first.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StrategySession'
        '200':
          description: The same Idempotency-Key was sent before; this is the stored answer
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StrategySession'
        '409':
          description: Still answering the last message (`strategy_busy`), or an answer that took too long was stopped and not
            charged (`strategy_turn_lost`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        default:
          $ref: '#/components/responses/Error'
  /workspaces/{workspace_id}/strategy/sessions/{session_id}/plan:
    parameters:
    - $ref: '#/components/parameters/WorkspaceId'
    - $ref: '#/components/parameters/StrategySessionId'
    post:
      tags:
      - Marketing strategist
      summary: Write the plan
      description: Writes a new plan version from the interview. Needs at least 3 answers, or every question answered (409
        `strategy_not_ready`). The same `Idempotency-Key` returns the version it wrote (200). The first plan also starts the
        weekly check-in. Requires the `publish` scope.
      parameters:
      - $ref: '#/components/parameters/StrategyIdempotencyKey'
      responses:
        '201':
          description: Written
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StrategyPlan'
        '200':
          description: The same Idempotency-Key was sent before
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StrategyPlan'
        '402':
          description: The allowance and the balance are used up (`insufficient_credits`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        default:
          $ref: '#/components/responses/Error'
  /workspaces/{workspace_id}/strategy/plans:
    parameters:
    - $ref: '#/components/parameters/WorkspaceId'
    get:
      tags:
      - Marketing strategist
      summary: List plan versions
      description: Newest first. Each version says why it was made (`interview`, `edit` or `checkin`).
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/StrategyPlanVersion'
        default:
          $ref: '#/components/responses/Error'
  /workspaces/{workspace_id}/strategy/plans/{version}:
    parameters:
    - $ref: '#/components/parameters/WorkspaceId'
    - $ref: '#/components/parameters/StrategyPlanVersionParam'
    get:
      tags:
      - Marketing strategist
      summary: Get a plan version
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StrategyPlan'
        default:
          $ref: '#/components/responses/Error'
  /workspaces/{workspace_id}/strategy/plans/{version}/pdf:
    parameters:
    - $ref: '#/components/parameters/WorkspaceId'
    - $ref: '#/components/parameters/StrategyPlanVersionParam'
    get:
      tags:
      - Marketing strategist
      summary: A plan version as a PDF
      description: Standard PDF fonts, so letters outside Latin show as "?". The page in the app prints the plan too.
      responses:
        '200':
          description: The PDF
          content:
            application/pdf:
              schema:
                type: string
                format: binary
        default:
          $ref: '#/components/responses/Error'
  /workspaces/{workspace_id}/strategy/plans/{version}/brand:
    parameters:
    - $ref: '#/components/parameters/WorkspaceId'
    - $ref: '#/components/parameters/StrategyPlanVersionParam'
    post:
      tags:
      - Marketing strategist
      summary: Put the suggested tone and audience in the brand profile
      description: Only the fields named. Nothing in the brand profile changes without this call. Requires the `publish` scope.
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                fields:
                  type: array
                  items:
                    type: string
                    enum:
                    - tone
                    - audience
      responses:
        '200':
          description: The brand profile after the change
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BrandProfile'
        default:
          $ref: '#/components/responses/Error'
  /workspaces/{workspace_id}/strategy/week:
    parameters:
    - $ref: '#/components/parameters/WorkspaceId'
    post:
      tags:
      - Marketing strategist
      summary: Make a week of drafts from the plan
      description: 'Week 1 is days 1 to 7 of the calendar, week 5 days 29 and 30. Written posts get their text from the
        strategist (on its allowance, no credits); pictures and videos become proposals with the tool, a prefilled path in the
        app and the price when it is known (designs). Drafts are dated from the plan''s start date and wait for approval.
        Making the same week of the same version again returns the same drafts. `Idempotency-Key` is required; with another
        week or version it is refused (422). Requires the `publish` scope.'
      parameters:
      - name: Idempotency-Key
        in: header
        required: true
        schema:
          type: string
          maxLength: 255
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                week:
                  type: integer
                  minimum: 1
                  maximum: 5
                  default: 1
                version:
                  type: integer
                  minimum: 1
                  description: The plan version; the latest when left out.
      responses:
        '201':
          description: Made
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StrategyWeek'
        '200':
          description: The same Idempotency-Key was sent before
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StrategyWeek'
        default:
          $ref: '#/components/responses/Error'
  /workspaces/{workspace_id}/strategy/drafts:
    parameters:
    - $ref: '#/components/parameters/WorkspaceId'
    get:
      tags:
      - Marketing strategist
      summary: List drafts
      parameters:
      - name: from
        in: query
        schema:
          type: string
          format: date
      - name: to
        in: query
        description: The day after the last one.
        schema:
          type: string
          format: date
      - name: status
        in: query
        schema:
          type: string
          enum:
          - draft
          - approved
          - dismissed
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/StrategyDraft'
        default:
          $ref: '#/components/responses/Error'
  /workspaces/{workspace_id}/strategy/drafts/{draft_id}:
    parameters:
    - $ref: '#/components/parameters/WorkspaceId'
    - name: draft_id
      in: path
      required: true
      schema:
        type: string
    patch:
      tags:
      - Marketing strategist
      summary: Change or dismiss a draft
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                text:
                  type: string
                  maxLength: 10000
                date:
                  type: string
                  format: date
                status:
                  type: string
                  enum:
                  - draft
                  - dismissed
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StrategyDraft'
        default:
          $ref: '#/components/responses/Error'
  /workspaces/{workspace_id}/strategy/drafts/{draft_id}/approve:
    parameters:
    - $ref: '#/components/parameters/WorkspaceId'
    - name: draft_id
      in: path
      required: true
      schema:
        type: string
    post:
      tags:
      - Marketing strategist
      summary: Approve a written draft as a post
      description: Makes the post, at `scheduled_at`, in the queue (`queue`), or at 09:00 UTC on the draft's day when neither
        is given. Approving again returns the same post. Proposals for pictures and videos are made in their tool instead
        (409 `draft_needs_media`). Requires the `publish` scope.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                account_ids:
                  type: array
                  minItems: 1
                  items:
                    type: string
                text:
                  type: string
                scheduled_at:
                  type: string
                  format: date-time
                queue:
                  type: boolean
              required:
              - account_ids
      responses:
        '201':
          description: Approved; `post` is the post that was made
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StrategyDraft'
        default:
          $ref: '#/components/responses/Error'
  /workspaces/{workspace_id}/strategy/checkins:
    parameters:
    - $ref: '#/components/parameters/WorkspaceId'
    get:
      tags:
      - Marketing strategist
      summary: List weekly check-ins
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/StrategyCheckin'
        default:
          $ref: '#/components/responses/Error'
    post:
      tags:
      - Marketing strategist
      summary: Run this week's check-in now
      description: Once per ISO week, the same as the weekly job, and never at the same time as it (the week is locked).
        Skipped at no charge, and not counted against the daily limit, when nothing was published in the last seven days,
        the numbers are the same as last time, or the allowance and the balance are used up. Requires the `publish` scope.
      responses:
        '201':
          description: Done, with a new plan version
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StrategyCheckin'
        '200':
          description: Skipped, or already done this week
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StrategyCheckin'
        default:
          $ref: '#/components/responses/Error'
  /workspaces/{workspace_id}/content-packs/options:
    parameters:
    - $ref: '#/components/parameters/WorkspaceId'
    get:
      tags:
      - Content packs
      summary: Content pack options
      description: The kinds of pack and the languages, and the limits. Answers 403 when content packs are off. Requires the `read` scope.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ContentPackOptions'
        default:
          $ref: '#/components/responses/Error'
  /workspaces/{workspace_id}/content-packs:
    parameters:
    - $ref: '#/components/parameters/WorkspaceId'
    post:
      tags:
      - Content packs
      summary: Plan a content pack
      description: 'Reads the text and the photos, builds the items, writes the post texts and prices it all. Free; counts
        against the daily text allowance. Saved as a proposal (status `proposed`), or with `dry_run` returned without
        being saved (`id` is null). With an `Idempotency-Key` a repeat of the same request gives back the first pack
        (200) without reading anything again. Requires the `publish` scope.'
      parameters:
      - name: Idempotency-Key
        in: header
        required: false
        schema:
          type: string
          maxLength: 200
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ContentPackInput'
      responses:
        '201':
          description: Planned and saved
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ContentPack'
        '200':
          description: Planned, not saved (dry_run)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ContentPack'
        '422':
          description: A file is not a finished photo or video in this workspace (`media_not_found`), or the link could not be read and no text was given (`link_unreadable`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          description: The daily allowance for free text is used up (`daily_limit_reached`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '502':
          description: The text could not be read into a pack (`no_pack`). Try again.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        default:
          $ref: '#/components/responses/Error'
    get:
      tags:
      - Content packs
      summary: List content packs
      description: Newest first, as summaries without specs, designs and texts. Requires the `read` scope.
      parameters:
      - name: limit
        in: query
        schema:
          type: integer
          minimum: 1
          maximum: 100
          default: 25
      - name: cursor
        in: query
        schema:
          type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/ContentPack'
                  next_cursor:
                    type:
                    - string
                    - 'null'
        default:
          $ref: '#/components/responses/Error'
  /workspaces/{workspace_id}/content-packs/drafts:
    parameters:
    - $ref: '#/components/parameters/WorkspaceId'
    get:
      tags:
      - Content packs
      summary: Content pack drafts by day
      description: 'The items of the packs being made or made, as drafts for the calendar: their day, whether they are
        ready, their files and texts. Requires the `read` scope.'
      parameters:
      - name: from
        in: query
        schema:
          type: string
          format: date
      - name: to
        in: query
        description: The day after the last day.
        schema:
          type: string
          format: date
      - name: status
        in: query
        schema:
          type: string
          enum:
          - draft
          - approved
          - dismissed
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/ContentPackDraft'
        default:
          $ref: '#/components/responses/Error'
  /workspaces/{workspace_id}/content-packs/{pack_id}:
    parameters:
    - $ref: '#/components/parameters/WorkspaceId'
    - name: pack_id
      in: path
      required: true
      schema:
        type: string
    get:
      tags:
      - Content packs
      summary: Get a content pack
      description: The pack with its facts, photos, items, progress and what was charged. A pack being made moves on when it is read. Requires the `read` scope.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ContentPack'
        default:
          $ref: '#/components/responses/Error'
    patch:
      tags:
      - Content packs
      summary: Change a proposal
      description: 'Before it is made: leave items out or put them back, move their days, change their texts, rename it.
        The price is worked out again. Requires the `publish` scope.'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                title:
                  type: string
                  maxLength: 120
                items:
                  type: array
                  items:
                    type: object
                    required:
                    - id
                    properties:
                      id:
                        type: string
                        description: The item, such as video, reel, carousel, image_1.
                      include:
                        type: boolean
                      date:
                        type: string
                        format: date
                      texts:
                        type: object
                        additionalProperties:
                          type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ContentPack'
        '409':
          description: The pack is being made or is made (`pack_started`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        default:
          $ref: '#/components/responses/Error'
  /workspaces/{workspace_id}/content-packs/{pack_id}/make:
    parameters:
    - $ref: '#/components/parameters/WorkspaceId'
    - name: pack_id
      in: path
      required: true
      schema:
        type: string
    post:
      tags:
      - Content packs
      summary: Make a content pack
      description: 'Makes every item the proposal includes, for the price shown. The whole price must be covered by the
        balance before anything starts. Photos that were never analysed are analysed first. Each item is made by its own
        tool under a key of the pack and the item, so it is made and charged once however often this is called, and
        never for more than the credits the item was shown for (a price that rose since is held). Requires the `publish` scope.'
      parameters:
      - name: Idempotency-Key
        in: header
        required: true
        schema:
          type: string
          maxLength: 200
      responses:
        '202':
          description: Started
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ContentPack'
        '200':
          description: The same Idempotency-Key was sent before; this is that pack
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ContentPack'
        '400':
          description: No Idempotency-Key (`idempotency_key_required`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '402':
          description: The balance does not cover the whole price (`insufficient_credits`). Nothing was started.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '409':
          description: The pack was already made with another key (`pack_started`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: Every item is left out (`pack_empty`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        default:
          $ref: '#/components/responses/Error'
  /workspaces/{workspace_id}/content-packs/{pack_id}/drafts/{draft_id}:
    parameters:
    - $ref: '#/components/parameters/WorkspaceId'
    - name: pack_id
      in: path
      required: true
      schema:
        type: string
    - name: draft_id
      in: path
      required: true
      schema:
        type: string
    patch:
      tags:
      - Content packs
      summary: Change a draft
      description: Move a draft to another day, change its texts, or dismiss it (and back). Requires the `publish` scope.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                date:
                  type: string
                  format: date
                texts:
                  type: object
                  additionalProperties:
                    type: string
                status:
                  type: string
                  enum:
                  - draft
                  - dismissed
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ContentPackItem'
        '409':
          description: The draft is already a post (`draft_approved`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        default:
          $ref: '#/components/responses/Error'
  /workspaces/{workspace_id}/content-packs/{pack_id}/drafts/{draft_id}/approve:
    parameters:
    - $ref: '#/components/parameters/WorkspaceId'
    - name: pack_id
      in: path
      required: true
      schema:
        type: string
    - name: draft_id
      in: path
      required: true
      schema:
        type: string
    post:
      tags:
      - Content packs
      summary: Approve a draft
      description: 'Makes the draft a post on the accounts given, with the files made and the text for each network,
        scheduled for 09:00 on the draft''s day in `timezone` (else the first account''s posting schedule, else UTC), at
        `scheduled_at`, or in the next free slot (`queue`). Approving again gives back the same post. Requires the
        `publish` scope.'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - account_ids
              properties:
                account_ids:
                  type: array
                  minItems: 1
                  maxItems: 30
                  items:
                    type: string
                scheduled_at:
                  type: string
                  format: date-time
                queue:
                  type: boolean
                timezone:
                  type: string
                  description: An IANA time zone such as Europe/Stockholm, for 09:00 on the draft's day.
      responses:
        '201':
          description: The post was made
          content:
            application/json:
              schema:
                allOf:
                - $ref: '#/components/schemas/ContentPackItem'
                - type: object
                  properties:
                    post:
                      $ref: '#/components/schemas/Post'
        '409':
          description: The item is not made yet or failed (`draft_not_ready`), or the draft was dismissed (`draft_dismissed`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        default:
          $ref: '#/components/responses/Error'
webhooks:
  event:
    post:
      summary: Event delivered to your endpoint
      description: 'Signed with HMAC-SHA256. Header `Everyspoke-Signature: t=<unix>,v1=<hex>` where the signature covers `<t>.<raw
        body>` with your endpoint secret. Reject events older than five minutes. Retried after 1 min, 5 min, 30 min, 2 h,
        6 h and 12 h until your endpoint answers 2xx.'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WebhookEnvelope'
      responses:
        '200':
          description: Received
  /imports/config:
    get:
      tags:
      - Imports
      summary: Public ids for the file pickers
      description: The public client ids the browser needs for the Google Picker and the Dropbox Chooser. Each provider reports
        `status` of `ready` or `not_configured`. Nothing secret is returned. Requires the `read` scope.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
        default:
          $ref: '#/components/responses/Error'
  /workspaces/{workspace_id}/imports/dropbox:
    parameters:
    - $ref: '#/components/parameters/WorkspaceId'
    post:
      tags:
      - Imports
      summary: Import files picked with the Dropbox Chooser
      description: Send the links the Chooser returned (use the direct link type). Only https links on dropbox.com and dropboxusercontent.com
        are accepted. At most 10 files. Requires the `publish` scope.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - files
              properties:
                files:
                  type: array
                  items:
                    type: object
                    required:
                    - url
                    properties:
                      url:
                        type: string
                      name:
                        type: string
      responses:
        '201':
          description: At least one file was imported. Each item has `media` or `error`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ImportResult'
        '200':
          description: No file could be imported. Each item has an `error`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ImportResult'
        default:
          $ref: '#/components/responses/Error'
  /workspaces/{workspace_id}/imports/google_drive:
    parameters:
    - $ref: '#/components/parameters/WorkspaceId'
    post:
      tags:
      - Imports
      summary: Import files picked with the Google Picker
      description: Send the short lived access token the browser got for the `drive.file` scope and the picked file ids. The
        token is used for the download only. It is never stored or logged. At most 10 files. Requires the `publish` scope.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - access_token
              - file_ids
              properties:
                access_token:
                  type: string
                file_ids:
                  type: array
                  items:
                    type: string
      responses:
        '201':
          description: At least one file was imported.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ImportResult'
        '200':
          description: No file could be imported.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ImportResult'
        default:
          $ref: '#/components/responses/Error'
  /workspaces/{workspace_id}/imports/canva:
    parameters:
    - $ref: '#/components/parameters/WorkspaceId'
    get:
      tags:
      - Imports
      summary: Is Canva connected
      description: Requires the `read` scope.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  connected:
                    type: boolean
                  connected_at:
                    type:
                    - string
                    - 'null'
        default:
          $ref: '#/components/responses/Error'
    delete:
      tags:
      - Imports
      summary: Disconnect Canva
      description: Requires the `connect` scope.
      responses:
        '200':
          description: OK
        default:
          $ref: '#/components/responses/Error'
  /workspaces/{workspace_id}/imports/canva/connect:
    parameters:
    - $ref: '#/components/parameters/WorkspaceId'
    post:
      tags:
      - Imports
      summary: Start connecting Canva
      description: Returns the Canva address to open in a browser (OAuth 2.0 with PKCE). `return_url` must be on the Everyspoke
        web app. Requires the `connect` scope. Answers 503 `not_configured` until Canva credentials are set.
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                return_url:
                  type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  authorize_url:
                    type: string
        default:
          $ref: '#/components/responses/Error'
  /workspaces/{workspace_id}/imports/canva/designs:
    parameters:
    - $ref: '#/components/parameters/WorkspaceId'
    get:
      tags:
      - Imports
      summary: List Canva designs
      description: Requires the `read` scope and a connected Canva.
      parameters:
      - name: query
        in: query
        schema:
          type: string
      - name: continuation
        in: query
        schema:
          type: string
      - name: limit
        in: query
        schema:
          type: integer
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      type: object
                  continuation:
                    type:
                    - string
                    - 'null'
        default:
          $ref: '#/components/responses/Error'
  /workspaces/{workspace_id}/imports/canva/export:
    parameters:
    - $ref: '#/components/parameters/WorkspaceId'
    post:
      tags:
      - Imports
      summary: Export a Canva design and import it as media
      description: Send `design_id` and `format` (png, jpg, gif or mp4), or the `export_id` of an export that was still running.
        Answers 202 with an `export_id` when Canva is not done after about 15 seconds. Requires the `publish` scope.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                design_id:
                  type: string
                export_id:
                  type: string
                format:
                  type: string
                  enum:
                  - png
                  - jpg
                  - gif
                  - mp4
      responses:
        '201':
          description: Imported.
          content:
            application/json:
              schema:
                type: object
        '202':
          description: Still exporting. Send the `export_id` again.
        default:
          $ref: '#/components/responses/Error'
  /mcp:
    servers:
    - url: https://everyspoke-api.dahllof-richard.workers.dev
    post:
      tags:
      - MCP
      summary: Remote MCP server
      description: Model Context Protocol over Streamable HTTP (revision 2026-07-28, older handshakes accepted). One JSON-RPC
        message per POST. Authenticate with an API key as a bearer token. See docs/api/mcp.md. GET and DELETE answer 405.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
      responses:
        '200':
          description: JSON-RPC response
        '202':
          description: Notification accepted
        '401':
          description: Bad or missing API key
        '403':
          description: Origin not allowed
  /workspaces/{workspace_id}/automations:
    parameters:
    - $ref: '#/components/parameters/WorkspaceId'
    get:
      tags:
      - Automations
      summary: List automations
      description: Automations answer comments that contain a keyword with a private message (up to 3 link buttons) and an
        optional public reply. They work on Facebook and Instagram and need the automations feature (off until switched on
        for your organization). Requires the `read` scope.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/Automation'
                  next_cursor:
                    type:
                    - string
                    - 'null'
                required:
                - data
        default:
          $ref: '#/components/responses/Error'
    post:
      tags:
      - Automations
      summary: Create an automation
      description: 'Rules: at most 2 keywords; a private message of up to 1000 characters (640 with buttons) and up to 3 https
        link buttons; up to 5 public reply variants (one is picked per comment). Only comments written after the automation
        exists are answered, only top level comments, and a comment is never answered twice, whatever automations match.
        The platform allows one private reply per comment, within 7 days of the comment. With gates the first private message
        asks the person to answer, and the link follows once the gates are met within 3 days. Two active automations cannot
        share a keyword on the same account and scope (409 `keyword_in_use`). Requires the `publish` scope.'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AutomationInput'
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Automation'
        default:
          $ref: '#/components/responses/Error'
  /automations/{automation_id}:
    parameters:
    - $ref: '#/components/parameters/AutomationId'
    get:
      tags:
      - Automations
      summary: Get an automation with its statistics
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                allOf:
                - $ref: '#/components/schemas/Automation'
                - type: object
                  properties:
                    stats:
                      $ref: '#/components/schemas/AutomationStats'
        default:
          $ref: '#/components/responses/Error'
    patch:
      tags:
      - Automations
      summary: Change or pause an automation
      description: Set `status` to `paused` to stop answering new comments. The account and post cannot be changed.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                keywords:
                  type: array
                  items:
                    type: string
                match:
                  type: string
                  enum:
                  - contains
                  - exact
                public_replies:
                  type: array
                  items:
                    type: string
                message:
                  $ref: '#/components/schemas/AutomationMessage'
                gates:
                  $ref: '#/components/schemas/AutomationGates'
                status:
                  type: string
                  enum:
                  - active
                  - paused
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Automation'
        default:
          $ref: '#/components/responses/Error'
    delete:
      tags:
      - Automations
      summary: Delete an automation
      description: People it was still waiting for are not messaged. Collected contacts are kept.
      responses:
        '204':
          description: Deleted
        default:
          $ref: '#/components/responses/Error'
  /automations/{automation_id}/stats:
    parameters:
    - $ref: '#/components/parameters/AutomationId'
    get:
      tags:
      - Automations
      summary: Statistics of an automation
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AutomationStats'
        default:
          $ref: '#/components/responses/Error'
  /automations/{automation_id}/runs:
    parameters:
    - $ref: '#/components/parameters/AutomationId'
    get:
      tags:
      - Automations
      summary: The log of what the automation did, newest first
      parameters:
      - $ref: '#/components/parameters/Cursor'
      - $ref: '#/components/parameters/Limit'
      - name: status
        in: query
        schema:
          type: string
          enum:
          - queued
          - sending
          - waiting
          - checking
          - completed
          - failed
          - unknown
          - expired
          - canceled
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/AutomationRun'
                  next_cursor:
                    type:
                    - string
                    - 'null'
                required:
                - data
        default:
          $ref: '#/components/responses/Error'
  /automations/{automation_id}/runs/{run_id}/retry:
    parameters:
    - $ref: '#/components/parameters/AutomationId'
    - name: run_id
      in: path
      required: true
      schema:
        type: string
    post:
      tags:
      - Automations
      summary: Try a failed run again
      description: Only a run whose private message definitely was not sent. A run whose result is `unknown` is never sent
        again, so look at the comment on the network first (409 `run_not_retryable`).
      responses:
        '202':
          description: Queued
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                  status:
                    type: string
        default:
          $ref: '#/components/responses/Error'
  /workspaces/{workspace_id}/contacts:
    parameters:
    - $ref: '#/components/parameters/WorkspaceId'
    get:
      tags:
      - Automations
      summary: Contacts collected by automations
      description: With `format=csv` the list is streamed as a CSV file. A contact is also sent as the `contact.collected`
        webhook event when it is collected.
      parameters:
      - $ref: '#/components/parameters/Cursor'
      - $ref: '#/components/parameters/Limit'
      - name: automation_id
        in: query
        schema:
          type: string
      - name: format
        in: query
        schema:
          type: string
          enum:
          - json
          - csv
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/Contact'
                  next_cursor:
                    type:
                    - string
                    - 'null'
                required:
                - data
            text/csv:
              schema:
                type: string
        default:
          $ref: '#/components/responses/Error'
  /workspaces/{workspace_id}/contacts/{contact_id}:
    parameters:
    - $ref: '#/components/parameters/WorkspaceId'
    - name: contact_id
      in: path
      required: true
      schema:
        type: string
    delete:
      tags:
      - Automations
      summary: Delete a contact
      responses:
        '204':
          description: Deleted
        default:
          $ref: '#/components/responses/Error'
  /workspaces/{workspace_id}/ad-accounts:
    parameters:
    - $ref: '#/components/parameters/WorkspaceId'
    get:
      tags:
      - Boosts
      summary: The client's connected ad accounts
      description: 'Ad accounts are connected with a connect link that lists `ads_meta`, `ads_linkedin` or `ads_tiktok` in
        `platforms` (each needs its boost feature). They are accounts of kind `ad_account`: you cannot publish to them, and
        they are left out of `GET /workspaces/{id}/accounts` unless you ask for `kind=ad_account`. The money is spent in
        the client''s own ad account, never ours.'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/AdAccount'
                  providers:
                    type: array
                    description: Which ad systems can be connected and used now. When none can, the answer is 403 `feature_unavailable`.
                    items:
                      type: object
                      properties:
                        provider:
                          type: string
                          enum:
                          - meta
                          - linkedin
                          - tiktok
                        available:
                          type: boolean
                  next_cursor:
                    type:
                    - 'null'
                required:
                - data
        default:
          $ref: '#/components/responses/Error'
  /workspaces/{workspace_id}/boosts:
    parameters:
    - $ref: '#/components/parameters/WorkspaceId'
    get:
      tags:
      - Boosts
      summary: Boosts of a workspace, newest first
      parameters:
      - $ref: '#/components/parameters/Limit'
      - name: status
        in: query
        schema:
          type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/Boost'
                  next_cursor:
                    type:
                    - 'null'
                required:
                - data
        default:
          $ref: '#/components/responses/Error'
  /posts/{post_id}/boosts:
    parameters:
    - $ref: '#/components/parameters/PostId'
    get:
      tags:
      - Boosts
      summary: Boosts of a post, with their ad statistics
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/Boost'
                  next_cursor:
                    type:
                    - 'null'
                required:
                - data
        default:
          $ref: '#/components/responses/Error'
    post:
      tags:
      - Boosts
      summary: Boost a published post
      description: 'Creates a campaign in the client''s ad account that promotes the published post. Needs the boost feature for
        the ad system (`boost.meta` for Facebook and Instagram, `boost.linkedin`, `boost.tiktok`). The Idempotency-Key makes
        a retry return the same boost; a post can have only one boost that is not finished (409 `boost_exists`). If approvals
        are on for the workspace, the boost waits for the same steps as a post. If the ad system does not confirm the creation
        the boost is `unknown` and is never created again by us: look in the ad account. Requires the `publish` scope.'
      parameters:
      - $ref: '#/components/parameters/IdempotencyKeyRequired'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BoostInput'
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Boost'
        '200':
          description: The boost this Idempotency-Key made before
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Boost'
        default:
          $ref: '#/components/responses/Error'
  /boosts/{boost_id}:
    parameters:
    - $ref: '#/components/parameters/BoostId'
    get:
      tags:
      - Boosts
      summary: Get a boost
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Boost'
        default:
          $ref: '#/components/responses/Error'
  /boosts/{boost_id}/stop:
    parameters:
    - $ref: '#/components/parameters/BoostId'
    post:
      tags:
      - Boosts
      summary: Stop a boost that runs, or cancel one that has not reached the ad system
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Boost'
        default:
          $ref: '#/components/responses/Error'
  /boosts/{boost_id}/retry:
    parameters:
    - $ref: '#/components/parameters/BoostId'
    post:
      tags:
      - Boosts
      summary: Continue a boost that failed
      description: Only a boost with status `failed`. What was already created in the ad account is reused. An `unknown`
        boost cannot be retried.
      responses:
        '202':
          description: Queued
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Boost'
        default:
          $ref: '#/components/responses/Error'
  /boosts/{boost_id}/approve:
    parameters:
    - $ref: '#/components/parameters/BoostId'
    post:
      tags:
      - Boosts
      summary: Approve the step a boost is waiting at
      description: Same rules as for posts. A client step needs a key with the `admin` scope.
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                comment:
                  type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Boost'
        default:
          $ref: '#/components/responses/Error'
  /boosts/{boost_id}/reject:
    parameters:
    - $ref: '#/components/parameters/BoostId'
    post:
      tags:
      - Boosts
      summary: Reject a boost
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                comment:
                  type: string
              required:
              - comment
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Boost'
        default:
          $ref: '#/components/responses/Error'
  /boosts/{boost_id}/approvals:
    parameters:
    - $ref: '#/components/parameters/BoostId'
    get:
      tags:
      - Boosts
      summary: Approval history of a boost
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/ApprovalEvent'
                required:
                - data
        default:
          $ref: '#/components/responses/Error'
  /workspaces/{workspace_id}/listening:
    parameters:
    - $ref: '#/components/parameters/WorkspaceId'
    get:
      tags:
      - Listening
      summary: Listening set up, terms, usage and what is covered
      description: Listening is a paid add-on (the listening feature). `coverage` says which networks can and cannot be listened
        to. Facebook, TikTok and LinkedIn have no official search API. X charges per post read, so reading is capped per month.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Listening'
        default:
          $ref: '#/components/responses/Error'
    put:
      tags:
      - Listening
      summary: Choose sources, Mastodon servers and the Instagram account
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                sources:
                  type: array
                  items:
                    $ref: '#/components/schemas/ListeningSource'
                mastodon_servers:
                  type: array
                  maxItems: 5
                  items:
                    type: string
                    description: An https address with no path, for example https://mastodon.social.
                instagram_account_id:
                  type:
                  - string
                  - 'null'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListeningConfig'
        default:
          $ref: '#/components/responses/Error'
  /workspaces/{workspace_id}/listening/terms:
    parameters:
    - $ref: '#/components/parameters/WorkspaceId'
    get:
      tags:
      - Listening
      summary: List terms
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/ListeningTerm'
                  next_cursor:
                    type:
                    - 'null'
                required:
                - data
        default:
          $ref: '#/components/responses/Error'
    post:
      tags:
      - Listening
      summary: Listen for a keyword, a name or a hashtag
      description: At most 20 terms per workspace.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                text:
                  type: string
                  minLength: 2
                  maxLength: 100
                kind:
                  type: string
                  enum:
                  - keyword
                  - name
                  - hashtag
                  default: keyword
              required:
              - text
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListeningTerm'
        default:
          $ref: '#/components/responses/Error'
  /workspaces/{workspace_id}/listening/terms/{term_id}:
    parameters:
    - $ref: '#/components/parameters/WorkspaceId'
    - name: term_id
      in: path
      required: true
      schema:
        type: string
    delete:
      tags:
      - Listening
      summary: Stop listening for a term and remove what it found
      responses:
        '204':
          description: Deleted
        default:
          $ref: '#/components/responses/Error'
  /workspaces/{workspace_id}/listening/matches:
    parameters:
    - $ref: '#/components/parameters/WorkspaceId'
    get:
      tags:
      - Listening
      summary: What was found, newest first
      description: Each post is stored once per term and source. Matches are kept for 90 days.
      parameters:
      - $ref: '#/components/parameters/Cursor'
      - $ref: '#/components/parameters/Limit'
      - name: term_id
        in: query
        schema:
          type: string
      - name: source
        in: query
        schema:
          $ref: '#/components/schemas/ListeningSource'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/ListeningMatch'
                  next_cursor:
                    type:
                    - string
                    - 'null'
                required:
                - data
        default:
          $ref: '#/components/responses/Error'
  /workspaces/{workspace_id}/listening/alerts:
    parameters:
    - $ref: '#/components/parameters/WorkspaceId'
    get:
      tags:
      - Listening
      summary: Alerts for a jump in volume
      description: An alert is made at most once a day per term, when the last 24 hours have at least 10 matches and 3 times
        the daily average of the 7 days before. The `listening.spike` webhook event carries the same.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      type: object
                      properties:
                        term_id:
                          type: string
                        day:
                          type: string
                        count:
                          type: integer
                        baseline:
                          type: number
                        alerted_at:
                          type: string
                          format: date-time
                required:
                - data
        default:
          $ref: '#/components/responses/Error'
  /workspaces/{workspace_id}/editor-options:
    parameters:
    - $ref: '#/components/parameters/WorkspaceId'
    get:
      tags:
      - Video editor
      summary: What the video editor offers here
      description: 'The video formats, the output kinds (video, or a slideshow of still images for a carousel post), the
        music moods, the limits of a video made from pictures, and the models a picture can be animated with, with the
        price in credits of each length. Requires the `read` scope.'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  object:
                    enum: [editor_options]
                  aspect_ratios:
                    type: array
                    items:
                      type: string
                  outputs:
                    type: array
                    items:
                      enum: [video, slideshow]
                  music_moods:
                    type: array
                    items:
                      type: string
                  animate:
                    $ref: '#/components/schemas/AnimateOptions'
                  from_images:
                    type: object
                    properties:
                      max_images:
                        type: integer
                      min_seconds:
                        type: number
                      max_seconds:
                        type: number
                  renderer_feature_level:
                    type: integer
        default:
          $ref: '#/components/responses/Error'
  /workspaces/{workspace_id}/campaign-videos/from-images:
    parameters:
    - $ref: '#/components/parameters/WorkspaceId'
    post:
      tags:
      - Video editor
      summary: Make it a video
      description: 'A campaign video from 1 to 10 finished pictures. One picture: one scene with a camera move that visits
        its parts in reading order (the product and faces from its media analysis when it has one; bands from the top for a
        design or a picture with text) and holds on each, on a blurred copy of the picture where it does not fill the frame.
        Several pictures: one scene per slide with a slow push in, each pushed on by the next. Optional title scene, call to
        action at the end and library music; no voiceover, so no captions. Free: nothing is charged until it is rendered.
        Requires the `publish` scope.'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                media_ids:
                  type: array
                  minItems: 1
                  maxItems: 10
                  items:
                    type: string
                aspect_ratio:
                  enum: ['9:16', '1:1', '4:5', '16:9']
                  description: Default the format closest to the first picture.
                title:
                  type: string
                  maxLength: 90
                cta:
                  type: string
                  maxLength: 40
                music:
                  type: string
                  nullable: true
                  enum: [energetic, upbeat, playful, calm, uplifting, cinematic]
                seconds:
                  type: number
                  minimum: 4
                  maximum: 20
                  description: How long a single picture is shown. Default the pace of the camera tour.
              required: [media_ids]
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CampaignVideo'
        '422':
          description: A picture is not a finished image in this workspace (`media_not_found`, `media_type_unsupported`), or its
            size cannot be read (`media_unreadable`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        default:
          $ref: '#/components/responses/Error'
  /workspaces/{workspace_id}/media/{media_id}/variants:
    parameters:
    - $ref: '#/components/parameters/WorkspaceId'
    - name: media_id
      in: path
      required: true
      schema:
        type: string
    get:
      tags:
      - Video editor
      summary: Versions and animations of a picture
      description: 'The versions of a picture, the original first (number 1); a version of a version belongs to the same
        original. Its animations. And what a new version costs on each quality (`options.tiers`) and an animation on each
        model and length (`options.animate`). `made_as` says how the original was made: `design` (a new version is the same
        design made again; no prompt), `image` (from its prompt) or `upload` (from a prompt, with the picture as the
        reference). Each tier and each animation length carries a `quote_token`: sent back in the `Everyspoke-Quote`
        header within 30 minutes, the version or the animation is never charged more than that price. Requires the
        `read` scope.'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  object:
                    enum: [image_variants]
                  media_id:
                    type: string
                  root_media_id:
                    type: string
                  made_as:
                    enum: [design, image, upload]
                  prompt:
                    type: string
                    nullable: true
                  versions:
                    type: array
                    items:
                      type: object
                      properties:
                        number:
                          type: integer
                        original:
                          type: boolean
                        media_id:
                          type: string
                          nullable: true
                        status:
                          enum: [queued, running, completed, failed]
                        generation_id:
                          type: string
                          nullable: true
                        tier:
                          type: string
                          nullable: true
                        prompt:
                          type: string
                          nullable: true
                        credits_used:
                          type: integer
                  animations:
                    type: array
                    items:
                      type: object
                      properties:
                        generation_id:
                          type: string
                        status:
                          enum: [queued, running, completed, failed]
                        media_id:
                          type: string
                          nullable: true
                        model:
                          type: string
                        seconds:
                          type: integer
                        credits_used:
                          type: integer
                  options:
                    type: object
                    properties:
                      tiers:
                        type: array
                        items:
                          type: object
                          properties:
                            id:
                              type: string
                            label:
                              type: string
                            credits:
                              type: integer
                      prompt_editable:
                        type: boolean
                      animate:
                        type: array
                        items:
                          $ref: '#/components/schemas/AnimateModel'
                      default_motion:
                        type: string
        default:
          $ref: '#/components/responses/Error'
  /workspaces/{workspace_id}/media/{media_id}/versions:
    parameters:
    - $ref: '#/components/parameters/WorkspaceId'
    - name: media_id
      in: path
      required: true
      schema:
        type: string
    post:
      tags:
      - Video editor
      summary: Make another version
      description: 'Makes a new version of a picture, kept beside the others; nothing is deleted. A generation of kind
        `image` with origin `image_version`, charged at the price `variants` shows and refunded if it fails. Send an
        `Idempotency-Key` so a retry is charged once. Requires the `publish` scope.'
      parameters:
      - name: Idempotency-Key
        in: header
        required: false
        schema:
          type: string
          maxLength: 200
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                prompt:
                  type: string
                  maxLength: 4000
                  description: What the new version shows. Required for an upload; not allowed for a design.
                tier:
                  type: string
                  description: A tier from `options.tiers`. Default standard.
      responses:
        '202':
          description: Started
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Generation'
        '200':
          description: The same Idempotency-Key was sent before; this is that generation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Generation'
        '422':
          description: A drawn design looks the same when made again (`version_not_available`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        default:
          $ref: '#/components/responses/Error'
  /workspaces/{workspace_id}/media/{media_id}/animate:
    parameters:
    - $ref: '#/components/parameters/WorkspaceId'
    - name: media_id
      in: path
      required: true
      schema:
        type: string
    post:
      tags:
      - Video editor
      summary: Animate this image
      description: 'The picture becomes the first frame of a short clip made by a video model. A generation of kind `video`
        with origin `image_animate`, charged at the price `variants` or `editor-options` shows when it starts and refunded if
        it fails. Without a prompt the motion keeps every word and logo in the picture unchanged. The clip is in the format
        closest to the picture (16:9, 9:16 or 1:1). Requires the `publish` scope.'
      parameters:
      - name: Idempotency-Key
        in: header
        required: false
        schema:
          type: string
          maxLength: 200
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                model:
                  type: string
                  description: A model from `options.animate`. Default the cheapest.
                duration_seconds:
                  type: integer
                  description: A length the model offers. Default its shortest.
                prompt:
                  type: string
                  maxLength: 800
      responses:
        '202':
          description: Started
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Generation'
        '200':
          description: The same Idempotency-Key was sent before; this is that generation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Generation'
        '422':
          description: No video model is offered here (`model_not_available`), or the picture is HEIC (`media_type_unsupported`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        default:
          $ref: '#/components/responses/Error'
components:
  securitySchemes:
    apiKey:
      type: http
      scheme: bearer
    session:
      type: http
      scheme: bearer
      description: Session token from login, `es_sess_...`. Used by the Everyspoke web app. Accepted wherever an API key is,
        with permissions from the member role.
  parameters:
    StrategySessionId:
      name: session_id
      in: path
      required: true
      schema:
        type: string
    StrategyPlanVersionParam:
      name: version
      in: path
      required: true
      description: A version number, or `latest`.
      schema:
        type: string
    StrategyIdempotencyKey:
      name: Idempotency-Key
      in: header
      required: false
      schema:
        type: string
        maxLength: 255
    CampaignVideoId:
      name: video_id
      in: path
      required: true
      schema:
        type: string
    VideoChatId:
      name: chat_id
      in: path
      required: true
      schema:
        type: string
    WorkspaceId:
      name: workspace_id
      in: path
      required: true
      schema:
        type: string
    AccountId:
      name: account_id
      in: path
      required: true
      schema:
        type: string
    PostId:
      name: post_id
      in: path
      required: true
      schema:
        type: string
    MediaId:
      name: media_id
      in: path
      required: true
      schema:
        type: string
    WebhookId:
      name: webhook_id
      in: path
      required: true
      schema:
        type: string
    Cursor:
      name: cursor
      in: query
      schema:
        type: string
    Limit:
      name: limit
      in: query
      schema:
        type: integer
        minimum: 1
        maximum: 100
        default: 25
    Quote:
      name: Everyspoke-Quote
      in: header
      description: The `quote_token` from `POST /generations/quote`, `POST /designs/quote` or `POST /designs/fill` for this
        exact request. Within 30 minutes of the quote you are never charged more than the quoted credits, even if prices
        rose meanwhile. An expired, unreadable or unverifiable quote, or one for a changed request, is ignored and the current
        price applies; a quote from another workspace answers 422 `quote_invalid`.
      schema:
        type: string
    IdempotencyKey:
      name: Idempotency-Key
      in: header
      schema:
        type: string
        maxLength: 255
    IdempotencyKeyRequired:
      name: Idempotency-Key
      in: header
      required: true
      schema:
        type: string
        maxLength: 255
      description: Any unique string, e.g. a UUID. Retrying with the same key returns the same post.
    ReviewerId:
      name: reviewer_id
      in: path
      required: true
      schema:
        type: string
    ConversationId:
      name: conversation_id
      in: path
      required: true
      schema:
        type: string
    MessageId:
      name: message_id
      in: path
      required: true
      schema:
        type: string
    AutomationId:
      name: automation_id
      in: path
      required: true
      schema:
        type: string
    BoostId:
      name: boost_id
      in: path
      required: true
      schema:
        type: string
  responses:
    Error:
      description: Error
      headers:
        Retry-After:
          description: Seconds to wait, sent with 429.
          schema:
            type: integer
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  schemas:
    StrategyIntake:
      type: object
      properties:
        urls:
          type: array
          maxItems: 5
          items:
            type: string
            format: uri
          description: https addresses of the business's pages.
        text:
          type: string
          maxLength: 20000
          description: The business in its own words, or text pasted from a document.
        media_ids:
          type: array
          maxItems: 8
          items:
            type: string
          description: Product photos (JPEG, PNG, WebP) or PDFs from the media library.
    StrategyMeter:
      type: object
      description: The strategist's own meter, separate from the video chat's.
      properties:
        thread_credits:
          type: number
          description: What this interview has cost so far, in credits.
        included_left:
          type: number
        included_month:
          type: number
        balance:
          type: integer
        owed:
          type: integer
        can_chat:
          type: boolean
    StrategyQuestion:
      type: object
      properties:
        key:
          type: string
          enum:
          - best_customer
          - main_offer
          - goal_90_days
          - time_budget
          - tone
          - tried_before
          - networks
          - local_or_online
        text:
          type: string
        suggestions:
          type: array
          minItems: 2
          maxItems: 4
          items:
            type: string
    StrategyMessage:
      type: object
      properties:
        id:
          type: string
        role:
          type: string
          enum:
          - user
          - assistant
        kind:
          type: string
          enum:
          - text
          - choice
          - question
          - plan
          - notice
        text:
          type: string
        question:
          oneOf:
          - $ref: '#/components/schemas/StrategyQuestion'
          - type: 'null'
        ack:
          type:
          - string
          - 'null'
        plan_version:
          type:
          - integer
          - 'null'
        sources:
          type: array
          items:
            type: object
            properties:
              url:
                type: string
              title:
                type:
                - string
                - 'null'
              readable:
                type: boolean
        actions:
          type: array
          items:
            type: object
            properties:
              type:
                type: string
                enum:
                - buy_credits
                - retry
                - write_plan
        created_at:
          type: string
          format: date-time
    StrategySession:
      type: object
      properties:
        id:
          type: string
        status:
          type: string
          enum:
          - interview
          - ready
          - planned
        language:
          type:
          - string
          - 'null'
        stage:
          type:
          - string
          - 'null'
          enum:
          - starting_from_zero
          - some_activity
          - has_audience
          - null
        sources:
          type: array
          items:
            type: object
        research:
          type: object
          description: What the sources say, each claim with its source.
        answers:
          type: object
          additionalProperties:
            type: object
            properties:
              value:
                type: string
              from:
                type: string
                enum:
                - person
                - data
              source:
                type:
                - string
                - 'null'
              skipped:
                type: boolean
        question:
          oneOf:
          - $ref: '#/components/schemas/StrategyQuestion'
          - type: 'null'
        remaining:
          type: array
          items:
            type: string
        can_write_plan:
          type: boolean
        plan_version:
          type:
          - integer
          - 'null'
        meter:
          $ref: '#/components/schemas/StrategyMeter'
        messages:
          type: array
          items:
            $ref: '#/components/schemas/StrategyMessage'
    StrategyClaim:
      type: object
      properties:
        text:
          type: string
        source:
          type: string
          description: A URL that was read, `your_text`, `document:<media id>`, `photo:<media id>`, `answer:<key>` or
            `workspace:accounts|stats|brand`.
    StrategyPlanBody:
      type: object
      properties:
        language:
          type: string
        start_date:
          type: string
          format: date
        summary:
          type: string
        starting_point:
          type: string
        audience:
          type: object
          properties:
            who:
              type: string
            problems:
              type: array
              items:
                type: string
            where_they_are:
              type: string
        positioning:
          type: object
          properties:
            statement:
              type: string
            key_messages:
              type: array
              items:
                type: string
            proof_points:
              type: array
              items:
                $ref: '#/components/schemas/StrategyClaim'
        pillars:
          type: array
          minItems: 3
          maxItems: 5
          items:
            type: object
            properties:
              name:
                type: string
              why:
                type: string
              examples:
                type: array
                items:
                  type: string
        channels:
          type: array
          items:
            type: object
            properties:
              network:
                type: string
              why:
                type: string
              posts_per_week:
                type: integer
              formats:
                type: array
                items:
                  type: string
        offers:
          type: array
          items:
            type: object
            properties:
              title:
                type: string
              idea:
                type: string
              when:
                type: string
        kpis:
          type: array
          items:
            type: object
            properties:
              name:
                type: string
              target_30_days:
                type: string
              target_90_days:
                type: string
              why:
                type: string
        calendar:
          type: array
          items:
            type: object
            properties:
              day:
                type: integer
                minimum: 1
                maximum: 30
              network:
                type: string
              pillar:
                type: string
              idea:
                type: string
              hook:
                type: string
              cta:
                type: string
              tool:
                type: string
                enum:
                - write_post
                - design
                - story
                - clips
                - talking_head
                - video
        competitors:
          type: array
          description: Only businesses the sources name, each with its source.
          items:
            allOf:
            - $ref: '#/components/schemas/StrategyClaim'
            - type: object
              properties:
                name:
                  type: string
        assumptions:
          type: array
          items:
            type: string
        sources:
          type: array
          items:
            type: object
            properties:
              id:
                type: string
              title:
                type:
                - string
                - 'null'
        brand_suggestion:
          type: object
          properties:
            tone:
              type: string
            audience:
              type: string
        updates:
          type: array
          description: Weekly check-in notes, newest first.
          items:
            type: object
            properties:
              week:
                type: string
              worked:
                type: array
                items:
                  type: string
              change:
                type: array
                items:
                  type: string
              suggestions:
                type: array
                items:
                  type: object
                  properties:
                    section:
                      type: string
                    text:
                      type: string
    StrategyPlanVersion:
      type: object
      properties:
        version:
          type: integer
        reason:
          type: string
          enum:
          - interview
          - edit
          - checkin
        summary:
          type: string
        session_id:
          type:
          - string
          - 'null'
        created_at:
          type: string
          format: date-time
    StrategyPlan:
      allOf:
      - $ref: '#/components/schemas/StrategyPlanVersion'
      - type: object
        properties:
          plan:
            $ref: '#/components/schemas/StrategyPlanBody'
    StrategyDraft:
      type: object
      properties:
        id:
          type: string
        plan_version:
          type: integer
        week:
          type: integer
        day:
          type: integer
        date:
          type: string
          format: date
        network:
          type:
          - string
          - 'null'
        tool:
          type: string
        title:
          type: string
        text:
          type:
          - string
          - 'null'
          description: The post text, for written drafts.
        proposal:
          type:
          - object
          - 'null'
          description: For pictures and videos, what to open.
          properties:
            tool:
              type: string
            label:
              type: string
            path:
              type: string
              description: The tool's page under /w/{workspace}/create in the app, prefilled.
            brief:
              type: string
            price:
              type: object
              properties:
                credits:
                  type:
                  - integer
                  - 'null'
                note:
                  type: string
        status:
          type: string
          enum:
          - draft
          - approved
          - dismissed
        post_id:
          type:
          - string
          - 'null'
    StrategyWeek:
      type: object
      properties:
        plan_version:
          type: integer
        week:
          type: integer
        drafts:
          type: array
          items:
            $ref: '#/components/schemas/StrategyDraft'
    StrategyCheckin:
      type: object
      properties:
        week:
          type: string
          description: ISO week, like 2026-W49.
        status:
          type: string
          enum:
          - done
          - skipped
        reason:
          type: string
          description: Why it was skipped (`nothing_published`, `nothing_changed`, `allowance_used`, `not_configured`, `in_progress` when another run of the same week holds it), or `already_done`.
        plan_version:
          type:
          - integer
          - 'null'
        note:
          type: object
    StrategyOverview:
      type: object
      properties:
        session:
          oneOf:
          - $ref: '#/components/schemas/StrategySession'
          - type: 'null'
        plan:
          oneOf:
          - $ref: '#/components/schemas/StrategyPlan'
          - type: 'null'
        versions:
          type: array
          items:
            $ref: '#/components/schemas/StrategyPlanVersion'
        checkins:
          type: array
          items:
            $ref: '#/components/schemas/StrategyCheckin'
        meter:
          $ref: '#/components/schemas/StrategyMeter'
    DesignField:
      type: object
      description: One field of a template's input schema. List fields have `fields` for one item. A list of one-field items
        (and a list whose items have one required text field) also accepts plain strings.
      properties:
        key:
          type: string
        type:
          type: string
          enum: [text, textarea, select, boolean, color, media, number, list]
        label:
          type: string
        help:
          type: string
        required:
          type: boolean
        max_length:
          type: integer
        options:
          type: array
          items:
            type: object
            properties:
              value:
                type: string
              label:
                type: string
        default: {}
        min:
          type: integer
        max:
          type: integer
        fields:
          type: array
          items:
            $ref: '#/components/schemas/DesignField'
        min_items:
          type: integer
        max_items:
          type: integer
        ai:
          type: boolean
          description: Written by the writer when a design is made from a prompt.
        group:
          type: string
          enum: [content, style]
        accept:
          type: string
          enum: [image]
      required: [key, type, label, group]
    DesignTemplate:
      type: object
      properties:
        object:
          const: design_template
        id:
          type: string
          enum: [paper_quotes, highlight_quotes, post_cards, tips_minimal, tips_bold, when_then, single_quote, ai_infographic, ai_carousel, product_scene]
        name:
          type: string
        description:
          type: string
        engine:
          type: string
          enum: [svg, ai]
          description: '`svg`: drawn by Everyspoke (the "when this, then that" slideshow generates one picture for its hook
            unless `ai_hook_image` is false or `hook_media_id` is given). `ai`: made by the image model.'
        output:
          type: string
          enum: [carousel, images, image]
        aspect_ratios:
          type: array
          items:
            type: string
            enum: ['1:1', '4:5', '9:16', '16:9']
        default_aspect_ratio:
          type: string
        fields:
          type: array
          items:
            $ref: '#/components/schemas/DesignField'
        sample:
          type: object
          additionalProperties: true
        list_field:
          type: [string, 'null']
          description: The list that `slide_count` applies to.
        thumbnail_url:
          type: string
        price:
          type: object
          properties:
            per_image:
              description: Credits per image. For generated templates an object by picture quality tier.
              oneOf:
              - type: integer
              - type: object
                additionalProperties:
                  type: integer
            hook_image:
              type: object
              description: when_then only. Credits of the generated hook picture by picture quality tier.
              additionalProperties:
                type: integer
    DesignInput:
      type: object
      properties:
        template:
          type: string
        aspect_ratio:
          type: string
          enum: ['1:1', '4:5', '9:16', '16:9']
          description: Defaults to the template's default. Each template lists the shapes it offers.
        prompt:
          type: string
          maxLength: 4000
          description: A short brief. The content fields not given in `inputs` are written from it.
        inputs:
          type: object
          additionalProperties: true
          description: Field values, checked against the template's fields. Unknown keys are refused. Wrap words in `*stars*`
            to highlight or colour them where the template supports it.
        slide_count:
          type: integer
          minimum: 1
          maximum: 10
          description: With a prompt only.
        language:
          type: string
          description: With a prompt, the language to write in when it is not the language of the prompt.
      required: [template]
    DesignPrice:
      type: object
      properties:
        credits:
          type: integer
        images:
          type: integer
          description: Images the design makes.
        generated_images:
          type: integer
          description: Images made by the image model, priced cost-plus per image.
        model:
          type: string
    Design:
      type: object
      properties:
        object:
          const: design
        id:
          type: string
          description: The id of the generation behind the design (`gen_...`).
        workspace_id:
          type: string
        template:
          type: string
        aspect_ratio:
          type: string
        status:
          type: string
          enum: [queued, running, completed, failed]
        credits_used:
          type: integer
        prompt:
          type: [string, 'null']
        inputs:
          type: [object, 'null']
          additionalProperties: true
          description: The inputs it was made from, including what the writer wrote.
        images:
          type: array
          items:
            type: object
            properties:
              type:
                const: media
              media_id:
                type: string
              content_type:
                type: string
              bytes:
                type: integer
              index:
                type: integer
              width:
                type: integer
              height:
                type: integer
        text:
          type: object
          description: For an infographic, the title and facts the description was condensed to.
          properties:
            title:
              type: string
            facts:
              type: array
              items:
                type: string
        error:
          type: [object, 'null']
          properties:
            code:
              type: string
            message:
              type: string
        created_at:
          type: string
          format: date-time
        completed_at:
          type: [string, 'null']
          format: date-time
    SpecProblem:
      type: object
      properties:
        path:
          type: string
          description: Where in the spec, e.g. `scenes[1].elements[0].text`.
        code:
          type: string
        message:
          type: string
      required:
      - path
      - code
      - message
    ColorRef:
      type: string
      description: A colour of the workspace brand profile, never a hex value.
      enum:
      - brand.primary
      - brand.secondary
      - brand.accent
      - brand.background
      - brand.text
      - neutral.white
      - neutral.black
    Fill:
      oneOf:
      - type: object
        properties:
          type:
            const: solid
          color:
            $ref: '#/components/schemas/ColorRef'
          opacity:
            type: number
            minimum: 0
            maximum: 1
        required:
        - type
        - color
      - type: object
        properties:
          type:
            enum:
            - linear
            - radial
          angle:
            type: number
            minimum: 0
            maximum: 360
          stops:
            type: array
            minItems: 2
            maxItems: 4
            items:
              type: object
              properties:
                color:
                  $ref: '#/components/schemas/ColorRef'
                at:
                  type: number
                  minimum: 0
                  maximum: 1
              required:
              - color
              - at
        required:
        - type
        - stops
    MediaSource:
      oneOf:
      - type: object
        description: A finished file in the workspace. For a video, start_seconds and end_seconds pick the part that plays
          (proposals take them from the file's analysis); the clip plays from start_seconds.
        properties:
          kind:
            const: library
          media_id:
            type: string
          start_seconds:
            type: number
            minimum: 0
          end_seconds:
            type: number
            minimum: 0
            description: Must be after start_seconds.
        required:
        - kind
        - media_id
      - type: object
        description: An image or clip to generate when the video is rendered (charged then, like a generation).
        properties:
          kind:
            const: generate
          type:
            enum:
            - image
            - video
          prompt:
            type: string
            maxLength: 800
          duration_seconds:
            type: integer
            minimum: 2
            maximum: 8
        required:
        - kind
        - type
        - prompt
      - type: object
        description: In a template only. Filled with a file when the template is used.
        properties:
          kind:
            const: placeholder
          key:
            type: string
          accept:
            enum:
            - image
            - video
            - any
        required:
        - kind
        - key
        - accept
    GridBox:
      type: object
      description: A place on the 12 by 12 grid inside the safe area. col and row start at 1.
      properties:
        col:
          type: integer
          minimum: 1
          maximum: 12
        row:
          type: integer
          minimum: 1
          maximum: 12
        col_span:
          type: integer
          minimum: 1
          maximum: 12
        row_span:
          type: integer
          minimum: 1
          maximum: 12
      required:
      - col
      - row
      - col_span
      - row_span
    Motion:
      type: object
      properties:
        preset:
          type: string
          enum:
          - none
          - fade
          - slide
          - scale
          - kinetic
          - typewriter
          - counter
          - ken_burns
          - wipe
          description: kinetic (word by word), typewriter and counter are for text; ken_burns is for images and video; slide
            and wipe need a direction.
        start:
          type: number
          description: Seconds after the scene starts, in steps of 0.05.
        duration:
          type: number
        direction:
          enum:
          - up
          - down
          - left
          - right
        easing:
          enum:
          - linear
          - ease_out
          - ease_in_out
          - spring
      required:
      - preset
      - start
      - duration
    CampaignElement:
      type: object
      description: 'One layer of a scene. `type` text (with `role` headline, body, kicker or cta, at most 90, 240, 40 and 40
        characters), media (with `source`), logo (the brand logo) or shape (rect, circle or line with a `fill`).'
      properties:
        id:
          type: string
          pattern: ^[a-z0-9][a-z0-9_-]{0,31}$
        type:
          enum:
          - text
          - media
          - logo
          - shape
        role:
          enum:
          - headline
          - body
          - kicker
          - cta
        text:
          type: string
        box:
          $ref: '#/components/schemas/GridBox'
        align:
          enum:
          - start
          - center
          - end
        valign:
          enum:
          - start
          - center
          - end
        size:
          enum:
          - s
          - m
          - l
          - xl
          - xxl
        weight:
          enum:
          - regular
          - bold
          - black
        color:
          $ref: '#/components/schemas/ColorRef'
        font:
          enum:
          - brand.heading
          - brand.body
        uppercase:
          type: boolean
        background:
          $ref: '#/components/schemas/Fill'
        counter:
          type: object
          properties:
            from:
              type: number
            to:
              type: number
            decimals:
              type: integer
            prefix:
              type: string
            suffix:
              type: string
          required:
          - from
          - to
        source:
          $ref: '#/components/schemas/MediaSource'
        fit:
          enum:
          - cover
          - contain
        radius:
          type: number
        zoom:
          type: object
          properties:
            from:
              type: number
            to:
              type: number
        shape:
          enum:
          - rect
          - circle
          - line
        fill:
          $ref: '#/components/schemas/Fill'
        enter:
          $ref: '#/components/schemas/Motion'
        exit:
          type: object
          properties:
            preset:
              enum:
              - fade
              - slide
              - scale
              - wipe
            duration:
              type: number
            direction:
              enum:
              - up
              - down
              - left
              - right
          required:
          - preset
          - duration
      required:
      - id
      - type
      - box
    CampaignScene:
      oneOf:
      - $ref: '#/components/schemas/DesignedCampaignScene'
      - $ref: '#/components/schemas/FreeCampaignScene'
    DesignedCampaignScene:
      type: object
      description: 'A finished, art directed scene: pick a type and fill its slots. Layout, type sizes, colour and motion
        come from the type and adapt to the format and the brand. What each type needs (slots, number of items and
        files, the seconds it takes to read) is checked, and every problem is listed. Proposals are made of these.'
      properties:
        id:
          type: string
        type:
          enum:
              - kinetic_headline
              - word_stack
              - marker_highlight
              - photo_headline
              - split_image
              - photo_stack
              - carousel
              - video_text
              - split_clip
              - clip_montage
              - screen_demo
              - big_number
              - stat_trio
              - checklist
              - steps
              - before_after
              - quote
              - product_trio
              - offer_badge
              - date_reveal
              - location
              - end_card
        duration:
          type: number
          minimum: 1
          maximum: 20
        palette:
          enum: [auto, light, dark, primary, accent]
          description: Which brand palette the scene is set in. auto alternates light, dark and primary.
        kicker:
          type: string
          maxLength: 32
        headline:
          type: string
          maxLength: 80
        highlight:
          type: string
          maxLength: 40
          description: Words of the headline to mark. Must be part of the headline.
        body:
          type: string
          maxLength: 140
        value:
          type: string
          maxLength: 14
          description: A figure the scene is built around, such as "-30%" or "Mon 3 Mar". Numbers in it count up.
        cta:
          type: string
          maxLength: 30
        items:
          type: array
          maxItems: 4
          items:
            type: object
            properties:
              text:
                type: string
                maxLength: 48
              detail:
                type: string
                maxLength: 64
              value:
                type: string
                maxLength: 12
            required:
            - text
        media:
          type: array
          maxItems: 4
          description: Media sources, as for a free scene background.
          items: {}
        transition:
          $ref: '#/components/schemas/CampaignTransition'
        voiceover:
          type: string
          maxLength: 400
      required:
      - id
      - type
      - duration
    CampaignTransition:
      type: object
      description: 'How this scene comes in over the one before. At most 1 second and half the scene. `none` is a plain
        cut and `cut` a cut on the beat with a short punch in; neither overlaps the scenes. `push` pushes the old scene out,
        `blur_slide` is a fast slide with motion blur, `mask_wipe` opens the new scene from a growing circle, `zoom_through`
        rushes into the next scene, `color_sweep` hides the cut behind a band in the brand accent colour. `slide`, `wipe`,
        `push` and `blur_slide` need a `direction`. `fade_black` dips to black and up again (renderer level 3). Proposals
        pick one per scene.'
      properties:
        type:
          enum:
          - none
          - cut
          - fade
          - slide
          - wipe
          - zoom
          - push
          - blur_slide
          - mask_wipe
          - zoom_through
          - color_sweep
          - fade_black
        duration:
          type: number
        direction:
          enum:
          - up
          - down
          - left
          - right
      required:
      - type
      - duration
    FreeCampaignScene:
      type: object
      description: The advanced form, elements placed freely on the 12 by 12 grid. A scene without a type is free.
      properties:
        id:
          type: string
        type:
          enum: [free]
        duration:
          type: number
          minimum: 1
          maximum: 20
          description: Seconds, in steps of 0.1.
        background:
          description: 'A fill, or `{"type":"media","source":...,"zoom":{"from","to"},"dim":0.3}`. With `"fit": "contain"`,
            `"blur_fill": true` fills the bars with a blurred, enlarged copy of the same picture (renderer level 3).
            `"camera"` (a CameraMove) moves the view over the picture instead of a zoom (renderer level 4).'
        elements:
          type: array
          maxItems: 8
          items:
            $ref: '#/components/schemas/CampaignElement'
        transition:
          $ref: '#/components/schemas/CampaignTransition'
        voiceover:
          type: string
          maxLength: 400
          description: What the voice says in this scene. Must fit the scene at about 3 words a second. In a clip video
            (`clips` set) it is what is said in the clip, up to 1200 characters, at the clip's own pace.
        voiceover_words:
          type: array
          maxItems: 300
          description: Clip videos only. Each word of `voiceover` with when it is said, in seconds from the start of the
            scene (from speech recognition). Captions follow these; the music ducks under them. A scene with words must have
            a clip that plays its own sound as its background.
          items:
            type: object
            properties:
              text:
                type: string
              start:
                type: number
              end:
                type: number
            required: [text, start, end]
      required:
      - id
      - duration
      - background
      - elements
    AnimateModel:
      type: object
      properties:
        model:
          type: string
        label:
          type: string
          description: Our own name for the look, shown to people.
        durations:
          type: array
          items:
            type: object
            properties:
              seconds:
                type: integer
              credits:
                type: integer
    AnimateOptions:
      type: object
      properties:
        models:
          type: array
          items:
            $ref: '#/components/schemas/AnimateModel'
        default_prompt:
          type: string
    CameraMove:
      type: object
      description: 'A camera move over a picture (renderer level 4). Keys are points of the picture itself (0 to 1 from its
        top left) with a zoom where 1 is the whole picture fitted into the frame, so the same move works in every format.
        The view eases from key to key and holds before the first and after the last; it never runs past the edge of a
        picture that is larger than the view. Replaces `zoom`.'
      properties:
        aspect:
          type: number
          minimum: 0.1
          maximum: 10
          description: The picture's width divided by its height.
        keys:
          type: array
          minItems: 1
          maxItems: 24
          items:
            type: object
            properties:
              at:
                type: number
                description: Seconds from the start of the scene, in order.
              x:
                type: number
                minimum: 0
                maximum: 1
              y:
                type: number
                minimum: 0
                maximum: 1
              zoom:
                type: number
                minimum: 1
                maximum: 4
            required: [at, x, y, zoom]
      required: [aspect, keys]
    OverlayClip:
      type: object
      properties:
        track:
          enum: [text, shape, image, video]
          description: 'Which track it is on: text takes a text element, shape a shape, image a picture or the logo, video
            a clip.'
        start:
          type: number
          minimum: 0
          description: Seconds from the start of the video, in steps of 0.05.
        duration:
          type: number
          minimum: 0.3
          description: Seconds, in steps of 0.05.
        element:
          $ref: '#/components/schemas/CampaignElement'
      required: [track, start, duration, element]
    CampaignVideoSpec:
      type: object
      description: 'Version 1. Up to 12 scenes and 60 seconds, 30 frames a second. Colours and fonts are references to the
        brand profile, so changing the brand changes the video. Up to 4 generated images or clips.'
      properties:
        version:
          const: 1
        aspect_ratio:
          enum:
          - '9:16'
          - '1:1'
          - '4:5'
          - '16:9'
        fps:
          const: 30
        title:
          type: string
          maxLength: 100
        look:
          type: object
          description: How designed scenes look across the video.
          properties:
            pace:
              enum: [fast, steady, calm]
            texture:
              enum: [none, blobs, grain, lines]
            wordmark:
              type: boolean
              description: The brand name (or logo) in the corner of every scene but the end card.
            progress:
              type: boolean
        scenes:
          type: array
          minItems: 1
          maxItems: 12
          items:
            $ref: '#/components/schemas/CampaignScene'
        voiceover:
          oneOf:
          - type: 'null'
          - type: object
            properties:
              voice_id:
                type:
                - string
                - 'null'
              captions:
                type: boolean
                description: Burn the voiceover text into the video as captions.
              language:
                type: string
              caption_style:
                enum: [minimal, bold, highlight, word_by_word]
                description: How the captions look (renderer level 3). A dark pill when not set.
            required:
            - voice_id
            - captions
        music:
          description: 'Background music, or null for none. It fades in and out and ducks under the voiceover; the
            finished video is set to about -14 LUFS. `source.kind: library` is a track from the bundled library (CC0, free:
            `bright-drive`, `happy-steps`, `gentle-piano`, `calm-lift`). `generate` makes an instrumental track with the
            music model when the video is rendered, charged then as its own price item (cost-plus); once made it is kept
            in the video as `media`, so a second render does not pay again. `media` is an audio file in the workspace (MP3,
            WAV, M4A (`audio/mp4` or `audio/x-m4a`) or raw AAC (`audio/aac`), at most 25 MB; longer than the video is
            fine, it is cut; shorter fades out at its own end).'
          oneOf:
          - type: 'null'
          - type: object
            properties:
              source:
                oneOf:
                - type: object
                  properties:
                    kind:
                      enum: [library]
                    track_id:
                      type: string
                  required: [kind, track_id]
                - type: object
                  properties:
                    kind:
                      enum: [generate]
                    prompt:
                      type: string
                      maxLength: 600
                  required: [kind, prompt]
                - type: object
                  properties:
                    kind:
                      enum: [media]
                    media_id:
                      type: string
                  required: [kind, media_id]
              mood:
                enum: [energetic, upbeat, playful, calm, uplifting, cinematic]
              volume:
                type: number
                minimum: 0
                maximum: 1
                description: How loud the music is against the rest. Default 1.
            required: [source, mood]
        sound_effects:
          type: boolean
          description: Subtle sounds on transitions, counters, checklist ticks and buttons, made in code. Off unless true,
            so a video saved before sound effects existed sounds the same when rendered again. Proposals set it (on unless
            the video has a voiceover).
        overlays:
          type: array
          maxItems: 40
          description: 'The free editor''s overlay tracks (renderer feature level 4, free_editor feature): text, shapes,
            pictures and clips placed at any time over the scenes, drawn above them in list order. The scenes are the main
            track. Each clip is shown from `start` for `duration` seconds and must end before the video ends; its element is
            laid out on the grid like an element of a free scene and its motions count from the clip''s start. Pictures and
            clips must be files of the media library; a clip plays without its sound. The element id is the clip id.'
          items:
            $ref: '#/components/schemas/OverlayClip'
        clips:
          type: object
          description: 'Set on a video made with the clip tools. Such a video may be up to 90 seconds and 40 scenes (a long
            clip is several contiguous scenes) with up to 6 generated cutaways; its scenes carry the words said in each clip
            (`voiceover_words`), each clip plays its own sound, which fades across transitions, and no voice is made. Media
            elements may be `full_frame` (edge to edge) or a `card` (a border and a shadow). Needs the clip_tools feature and
            renderer feature level 3.'
          properties:
            tool:
              enum: [combine, talking_head]
            title:
              type: object
              description: A title over the picture, in a pill in the brand colour, kept clear of the captions.
              properties:
                text:
                  type: string
                  maxLength: 80
                position:
                  enum: [top, center, bottom]
                start:
                  type: number
                duration:
                  type: number
                  minimum: 1
                  maximum: 10
              required: [text, position, start, duration]
          required: [tool]
      required:
      - version
      - aspect_ratio
      - fps
      - scenes
      - music
    AiVideoSettings:
      type: object
      properties:
        prompt:
          type: string
          maxLength: 800
        model:
          type: string
          description: A model from the options of an ai_video proposal.
        duration_seconds:
          type: integer
          minimum: 2
          maximum: 20
          description: Snapped to a length the model makes (Veo makes 4, 6 or 8 seconds) and priced on that length.
        aspect_ratio:
          enum:
          - '9:16'
          - '16:9'
          - '1:1'
        image_media_id:
          type:
          - string
          - 'null'
          description: A start image (image to video), for example a keyframe made first.
      required:
      - prompt
      - model
    CampaignPrice:
      type: object
      properties:
        credits:
          type: integer
        items:
          type: array
          items:
            type: object
            properties:
              item:
                enum:
                - render
                - image
                - video
                - voice
              credits:
                type: integer
              ref:
                type: string
              seconds:
                type: number
              model:
                type:
                - string
                - 'null'
            required:
            - item
            - credits
      required:
      - credits
      - items
    CampaignProposalInput:
      type: object
      properties:
        description:
          type: string
          minLength: 10
          maxLength: 2000
        aspect_ratio:
          enum:
          - '9:16'
          - '1:1'
          - '4:5'
          - '16:9'
          default: '9:16'
        duration_seconds:
          type: integer
          minimum: 5
          maximum: 60
          default: 15
        media_ids:
          type: array
          maxItems: 10
          items:
            type: string
        language:
          type: string
        kinds:
          type: object
          description: How many of each kind. Default {"campaign":3,"mixed":1,"ai_video":1}.
          properties:
            campaign:
              type: integer
              minimum: 0
              maximum: 3
            mixed:
              type: integer
              minimum: 0
              maximum: 2
            ai_video:
              type: integer
              minimum: 0
              maximum: 2
      required:
      - description
    CampaignProposal:
      type: object
      properties:
        object:
          const: campaign_video_proposal
        index:
          type: integer
        kind:
          enum:
          - campaign
          - mixed
          - ai_video
        method:
          type: string
          description: What kind of production this is, in plain words.
        title:
          type: string
        concept:
          type: string
        preview:
          enum:
          - browser
          - browser_with_stand_ins
          - none
        spec:
          oneOf:
          - $ref: '#/components/schemas/CampaignVideoSpec'
          - type: 'null'
        ai_video:
          oneOf:
          - type: 'null'
          - type: object
            properties:
              prompt:
                type: string
              duration_seconds:
                type: integer
              aspect_ratio:
                type: string
              options:
                type: array
                description: Up to two models, cheapest first, each with its own price.
                items:
                  type: object
                  properties:
                    model:
                      type: string
                    label:
                      type: string
                    seconds:
                      type: integer
                    resolution:
                      type: string
                    audio:
                      type: boolean
                    credits:
                      type: integer
              keyframe:
                description: A still of the first frame, made with the image model only if you ask (POST /generations), priced
                  on its own.
                oneOf:
                - type: 'null'
                - type: object
                  properties:
                    prompt:
                      type: string
                    credits:
                      type: integer
        price:
          $ref: '#/components/schemas/CampaignPrice'
      required:
      - kind
      - method
      - title
      - preview
      - spec
      - ai_video
      - price
    CampaignVideoInput:
      type: object
      description: Exactly one of `spec`, `ai_video` or `template_id`.
      properties:
        title:
          type: string
          maxLength: 100
        spec:
          $ref: '#/components/schemas/CampaignVideoSpec'
        ai_video:
          $ref: '#/components/schemas/AiVideoSettings'
        template_id:
          type: string
        values:
          type: object
          properties:
            text:
              type: object
              additionalProperties:
                type: string
            media:
              type: object
              additionalProperties:
                type: string
    CampaignRender:
      type: object
      properties:
        object:
          const: campaign_render
        id:
          type: string
        video_id:
          type: string
        status:
          enum:
          - rendering
          - done
          - failed
        progress:
          type: number
          minimum: 0
          maximum: 1
        media_id:
          type:
          - string
          - 'null'
          description: The MP4 in the media library, when done.
        assets_only:
          type: boolean
          description: A run that only made the scene pictures and clips (AI video formats, POST .../scenes/generate). It has
            no video file and no render charge.
        credits:
          type: object
          properties:
            quoted:
              type: integer
            charged:
              type: integer
            items:
              type: array
              items:
                type: object
        error:
          oneOf:
          - type: 'null'
          - type: object
            properties:
              code:
                type: string
              message:
                type: string
        created_at:
          type: string
          format: date-time
        finished_at:
          type:
          - string
          - 'null'
          format: date-time
      required:
      - id
      - video_id
      - status
      - progress
      - media_id
      - credits
      - error
    VideoChatMessageInput:
      type: object
      properties:
        text:
          type: string
          maxLength: 4000
        media_ids:
          type: array
          items:
            type: string
          description: Photos and clips in this workspace. Together with links at most 5.
        links:
          type: array
          items:
            type: string
            format: uri
          description: Public https pages to read.
    VideoChatMessage:
      type: object
      properties:
        object:
          const: video_chat_message
        id:
          type: string
        role:
          type: string
          enum: [user, assistant]
        kind:
          type: string
          enum: [text, choice, proposals, drafts, notice]
          description: '`choice` is a proposal the person picked, `proposals` holds the versions made, `drafts` holds the
            images, carousels and posts the assistant planned (with design templates and the content tools on),
            `notice` comes from Everyspoke rather than the assistant (out of credits, a failure, a continued chat).'
        text:
          type: string
        quick_replies:
          type: array
          items:
            type: string
          description: Short answers to show as buttons. Sending one is an ordinary message.
        proposals:
          type: [array, 'null']
          items:
            $ref: '#/components/schemas/CampaignProposal'
        drafts:
          type: [array, 'null']
          description: 'Planned, not made: nothing is charged. A `design` has its template, shape and inputs written for
            it (open them in POST /designs, which charges `price.credits`); a `post` is a free text generation
            (`generation_id`) with a draft per network.'
          items:
            type: object
            properties:
              type:
                enum: [design, post]
              template:
                type: string
              name:
                type: string
              engine:
                enum: [svg, ai]
              aspect_ratio:
                type: string
              brief:
                type: string
              inputs:
                type: object
              summary:
                type: string
              price:
                type: object
                properties:
                  credits:
                    type: integer
              generation_id:
                type: string
              about:
                type: string
              platforms:
                type: array
                items:
                  type: string
        attachments:
          type: [object, 'null']
          properties:
            media:
              type: array
              items:
                type: object
                properties:
                  id:
                    type: string
                  name:
                    type: string
                  type:
                    type: string
                    enum: [image, video]
            links:
              type: array
              items:
                type: object
                properties:
                  url:
                    type: string
                  title:
                    type: [string, 'null']
                  readable:
                    type: boolean
        actions:
          type: array
          description: 'Buttons the answer offers: `analyse` (media_ids and its price in credits, through POST
            /workspaces/{id}/media-analyses), `buy_credits`, `retry`.'
          items:
            type: object
            properties:
              type:
                type: string
                enum: [analyse, buy_credits, retry]
              media_ids:
                type: array
                items:
                  type: string
              credits:
                type: integer
        created_at:
          type: string
          format: date-time
    VideoChat:
      type: object
      properties:
        object:
          const: video_chat
        id:
          type: string
        workspace_id:
          type: string
        title:
          type: string
        status:
          type: string
          enum: [open, closed]
        aspect_ratio:
          type: string
        brief:
          type: object
          description: What the assistant knows so far, in a few words per field (topic, offer, audience, call_to_action,
            details, tone, voice, length_seconds, language).
        video_id:
          type: [string, 'null']
          description: The campaign video the chat is about, once a proposal is picked.
        chosen_index:
          type: [integer, 'null']
        proposals:
          type: array
          items:
            $ref: '#/components/schemas/CampaignProposal'
        continued_from:
          type: [string, 'null']
        continued_in:
          type: [string, 'null']
        user_messages:
          type: integer
        max_user_messages:
          type: integer
        meter:
          type: object
          description: 'What the conversation has cost and what is left. Each answer costs what the provider charged, with
            the usual markup, in fractions of a credit; the included chat of the month is used first, and whole credits are
            then debited as the fractions of all chats of the organization add up.'
          properties:
            thread_credits:
              type: number
              description: This conversation so far, included chat and credits alike, to two decimals.
            included_left:
              type: number
              description: Included chat left this month, in credits.
            included_month:
              type: number
            balance:
              type: integer
              description: The credit balance of the organization.
            owed:
              type: integer
              description: Whole credits due that the balance could not pay yet. They are paid first when credits are added.
            can_chat:
              type: boolean
        messages:
          type: array
          description: In GET, the whole conversation. In POST, the messages of this turn, the one sent first.
          items:
            $ref: '#/components/schemas/VideoChatMessage'
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
    CampaignVideo:
      type: object
      properties:
        object:
          const: campaign_video
        id:
          type: string
        workspace_id:
          type: string
        kind:
          enum:
          - campaign
          - mixed
          - ai_video
        title:
          type: string
        spec:
          oneOf:
          - $ref: '#/components/schemas/CampaignVideoSpec'
          - type: 'null'
        ai_video:
          oneOf:
          - $ref: '#/components/schemas/AiVideoSettings'
          - type: 'null'
        template_id:
          type:
          - string
          - 'null'
        price:
          $ref: '#/components/schemas/CampaignPrice'
        latest_render:
          oneOf:
          - $ref: '#/components/schemas/CampaignRender'
          - type: 'null'
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
      required:
      - id
      - kind
      - title
      - spec
      - ai_video
      - price
      - latest_render
    CampaignTemplate:
      type: object
      properties:
        object:
          const: campaign_template
        id:
          type: string
        workspace_id:
          type: string
        name:
          type: string
        description:
          type:
          - string
          - 'null'
        aspect_ratio:
          type: string
        spec:
          $ref: '#/components/schemas/CampaignVideoSpec'
        fields:
          type: array
          items:
            type: object
            properties:
              key:
                type: string
              kind:
                enum:
                - text
                - media
              role:
                type: string
              accept:
                type: string
              default:
                type:
                - string
                - 'null'
            required:
            - key
            - kind
            - default
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
      required:
      - id
      - name
      - spec
      - fields
    Member:
      type: object
      properties:
        id:
          type: string
        email:
          type: string
        name:
          type: string
        role:
          type: string
          enum:
          - owner
          - admin
          - editor
          - viewer
        email_verified:
          type: boolean
        workspace_ids:
          type: array
          items:
            type: string
        created_at:
          type: string
          format: date-time
    Invite:
      type: object
      properties:
        id:
          type: string
        email:
          type: string
        role:
          type: string
        workspace_ids:
          type: array
          items:
            type: string
        expires_at:
          type: string
          format: date-time
        created_at:
          type: string
          format: date-time
    SessionResult:
      type: object
      properties:
        session_token:
          type: string
        expires_at:
          type: string
          format: date-time
        member:
          $ref: '#/components/schemas/Member'
        organization:
          type: object
          properties:
            id:
              type: string
            name:
              type: string
    PlatformId:
      type: string
      enum:
      - facebook
      - instagram
      - linkedin
      - tiktok
      - x
      - youtube
      - threads
      - pinterest
      - bluesky
      - google_business
      - slack
      - discord
      - mastodon
      - telegram
    Scope:
      type: string
      enum:
      - read
      - publish
      - connect
      - metrics
      - admin
    Error:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              description: Stable machine readable code, e.g. `daily_limit_reached`.
            message:
              type: string
              description: Plain language, safe to show to people.
            retryable:
              type: boolean
            target:
              type: string
            details:
              description: Extra information. A list of problems, or for `invalid_spec` an object with `problems`, each
                with the `path` in the spec, a `code` and a `message`.
              oneOf:
              - type: array
                items:
                  type: object
                  properties:
                    code:
                      type: string
                    message:
                      type: string
                    target:
                      type: string
              - type: object
                properties:
                  problems:
                    type: array
                    items:
                      $ref: '#/components/schemas/SpecProblem'
            request_id:
              type: string
          required:
          - code
          - message
      required:
      - error
    Workspace:
      type: object
      properties:
        id:
          type: string
          examples:
          - ws_01m8hdza8bgyqhcb8v40jaz69g
        name:
          type: string
        external_id:
          type:
          - string
          - 'null'
        created_at:
          type: string
          format: date-time
      required:
      - id
      - name
      - created_at
    ConnectLink:
      type: object
      properties:
        id:
          type: string
        url:
          type: string
          format: uri
        expires_at:
          type: string
          format: date-time
      required:
      - id
      - url
      - expires_at
    Account:
      type: object
      properties:
        id:
          type: string
        workspace_id:
          type: string
        platform:
          $ref: '#/components/schemas/PlatformId'
        kind:
          type: string
          enum:
          - page
          - profile
          - organization
          - channel
          - board
          - location
        name:
          type: string
        handle:
          type:
          - string
          - 'null'
        avatar_url:
          type:
          - string
          - 'null'
          format: uri
        status:
          type: string
          enum:
          - active
          - expiring
          - disconnected
          - missing_permissions
        token_expires_at:
          type:
          - string
          - 'null'
          format: date-time
        connected_at:
          type: string
          format: date-time
      required:
      - id
      - workspace_id
      - platform
      - name
      - status
    Media:
      type: object
      properties:
        id:
          type: string
        status:
          type: string
          enum:
          - awaiting_upload
          - ready
        content_type:
          type: string
        bytes:
          type: integer
        filename:
          type:
          - string
          - 'null'
        created_at:
          type: string
          format: date-time
        keep:
          type: boolean
          description: Kept in the media library. Other media is removed 30 days after upload, unless a waiting post still
            uses it.
        analysis_status:
          type: string
          enum:
          - none
          - pending
          - done
          - failed
        analysis:
          oneOf:
          - $ref: '#/components/schemas/MediaUnderstanding'
          - type: 'null'
        variants:
          type: object
          description: Copies made when the file was analysed, by name (normalized, proxy, poster).
          additionalProperties:
            type: object
            properties:
              content_type:
                type: string
              bytes:
                type: integer
              width:
                type: integer
              height:
                type: integer
      required:
      - id
      - status
    MediaAnalysisInput:
      type: object
      required:
      - media_ids
      properties:
        media_ids:
          type: array
          minItems: 1
          maxItems: 50
          items:
            type: string
    MediaAnalysisQuote:
      type: object
      properties:
        object:
          type: string
          const: media_analysis_quote
        credits:
          type: integer
        summary:
          type: string
          description: 'For example "Analyse 12 images and 2 videos: 9 credits".'
        images:
          type: object
          properties:
            count:
              type: integer
            credits:
              type: integer
        videos:
          type: object
          properties:
            count:
              type: integer
            seconds:
              type: number
            credits:
              type: integer
        items:
          type: array
          items:
            type: object
            properties:
              media_id:
                type: string
              type:
                enum:
                - image
                - video
              state:
                enum:
                - new
                - analysed
                - in_progress
              seconds:
                type: number
      required:
      - credits
      - summary
    MediaAnalysis:
      type: object
      properties:
        object:
          type: string
          const: media_analysis
        id:
          type: string
        status:
          enum:
          - in_progress
          - done
          - failed
        summary:
          type: string
        credits:
          type: object
          properties:
            quoted:
              type: integer
            charged:
              type: integer
            refunded:
              type: integer
        files:
          type: array
          items:
            type: object
            properties:
              media_id:
                type: string
              type:
                enum:
                - image
                - video
              status:
                enum:
                - in_progress
                - done
                - failed
        created_at:
          type: string
          format: date-time
        finished_at:
          type:
          - string
          - 'null'
          format: date-time
    FrameBox:
      type: object
      description: Fractions of the picture (0 to 1) from the top left.
      properties:
        x:
          type: number
        y:
          type: number
        w:
          type: number
        h:
          type: number
    MediaUnderstanding:
      type: object
      description: What a photo or video shows, from its analysis.
      properties:
        type:
          enum:
          - image
          - video
        description:
          type: string
        subjects:
          type: array
          items:
            type: string
        colors:
          type: array
          items:
            type: string
        uses:
          type: array
          items:
            enum:
            - hero
            - product_card
            - background
            - detail
            - people
            - screen
        orientation:
          enum:
          - portrait
          - landscape
          - square
        width:
          type: integer
        height:
          type: integer
        quality:
          type: object
          properties:
            blurry:
              type: boolean
            dark:
              type: boolean
            issues:
              type: array
              items:
                type: string
        frames:
          type: array
          description: The photo itself, or the sampled frames of a video with their time (t, seconds).
          items:
            type: object
            properties:
              t:
                type: number
              description:
                type: string
              faces:
                type: array
                items:
                  $ref: '#/components/schemas/FrameBox'
              product:
                oneOf:
                - $ref: '#/components/schemas/FrameBox'
                - type: 'null'
              focus:
                type: object
                properties:
                  x:
                    type: number
                  y:
                    type: number
              text_areas:
                type: array
                description: Where a headline can sit without covering a face or the product.
                items:
                  enum:
                  - top
                  - bottom
                  - left
                  - right
                  - center
              blurry:
                type: boolean
              dark:
                type: boolean
              has_text:
                type: boolean
              score:
                type: integer
                minimum: 1
                maximum: 5
        duration:
          type: number
        fps:
          type: number
        has_audio:
          type: boolean
        rotation:
          type: integer
        clips:
          type: array
          description: Ranges of the video worth using, best first.
          items:
            type: object
            properties:
              start:
                type: number
              end:
                type: number
              description:
                type: string
              score:
                type: integer
        speech:
          type: object
          properties:
            status:
              enum:
              - done
              - no_audio
              - no_speech
              - unsupported
              - failed
            text:
              type: string
            language:
              type:
              - string
              - 'null'
            segments:
              type: array
              items:
                type: object
                properties:
                  start:
                    type: number
                  end:
                    type: number
                  text:
                    type: string
    MediaUpload:
      type: object
      properties:
        media:
          $ref: '#/components/schemas/Media'
        upload_url:
          type: string
          format: uri
        part_size:
          type: integer
        part_urls:
          type: array
          items:
            type: string
            format: uri
        method:
          type: string
          enum:
          - PUT
      required:
      - media
    Content:
      type: object
      properties:
        text:
          type: string
        media_ids:
          type: array
          items:
            type: string
        type:
          type: string
          enum:
          - post
          - reel
          - story
          - carousel
          - short
          - pin
          - document
          - poll
          - thread
          default: post
          description: 'Which post types a platform takes is listed in `GET /platforms`. On Facebook a `post` with one video
            becomes a Page video and `reel` a Page reel. Meta requires a reel to be one vertical 9:16 video of 3 to 90 seconds,
            at least 540x960; we check this when the size and length can be read from the header of the file (MP4 and MOV), otherwise
            Facebook decides when the post is sent. Facebook videos can be at most 250 MB. A link on a Facebook video is added
            to the description. A video can take minutes to process; if it is still processing when we stop waiting, the target
            is published with the warning `still_processing`.'
        first_comment:
          type: string
        link:
          type: string
          format: uri
        options:
          type: object
          additionalProperties: true
          description: 'Platform settings, in snake_case. Facebook: `title` (the title of a video or reel), `ai_generated:
            true` (marks a reel as made with AI).'
        thread:
          type: array
          maxItems: 24
          description: The posts that follow the first one, published in order as replies on X, Threads, Bluesky and Mastodon,
            and as consecutive messages on Discord (webhooks cannot reply). Each part is checked like a post of its own. If
            a part fails, the rest is left unsent and the target gets the warning `thread_incomplete`; retry with `POST /posts/{post_id}/targets/{target_id}/retry-thread`,
            which never sends a part that is already out.
          items:
            type: object
            properties:
              text:
                type: string
              media_ids:
                type: array
                items:
                  type: string
    PostCreate:
      type: object
      properties:
        workspace_id:
          type: string
        scheduled_at:
          type:
          - string
          - 'null'
          format: date-time
          description: Omit or null to publish now. At most 18 months ahead.
        content:
          $ref: '#/components/schemas/Content'
        targets:
          type: array
          minItems: 1
          maxItems: 50
          items:
            type: object
            properties:
              account_id:
                type: string
              content:
                allOf:
                - $ref: '#/components/schemas/Content'
                description: Overrides the shared content for this target, field by field.
            required:
            - account_id
        links:
          $ref: '#/components/schemas/LinkOptions'
        queue:
          type: boolean
          description: Instead of `scheduled_at`, use the next free posting time of the target accounts (see `/accounts/{account_id}/queue`).
            With several targets the time must be a posting time of all of them. Never together with `scheduled_at`.
      required:
      - workspace_id
      - targets
    TargetStatus:
      type: string
      enum:
      - queued
      - sending
      - retrying
      - published
      - failed
      - unknown
      - canceled
      - deleting
      - deleted
      - awaiting_approval
      - rejected
      - expired
      description: '`unknown` means the platform did not confirm whether the post was created. Such targets are never retried
        automatically. `awaiting_approval` targets wait for approval and are never sent before it. `rejected` was sent back
        with a comment, and `expired` was not approved before its scheduled time. Change a rejected or expired post to start
        approval again.'
    Target:
      type: object
      properties:
        id:
          type: string
        account_id:
          type: string
        platform:
          $ref: '#/components/schemas/PlatformId'
        status:
          $ref: '#/components/schemas/TargetStatus'
        platform_post_id:
          type:
          - string
          - 'null'
        url:
          type:
          - string
          - 'null'
          format: uri
        published_at:
          type:
          - string
          - 'null'
          format: date-time
        warnings:
          type: array
          items:
            type: string
          description: The post is live but something extra failed, e.g. `first_comment_failed`, or a video was still processing
            when we stopped waiting (`still_processing`).
        error:
          type:
          - object
          - 'null'
          properties:
            code:
              type: string
            message:
              type: string
            retryable:
              type: boolean
        fee:
          type:
          - object
          - 'null'
          description: Fee the network charges for this post (today only X), passed on at cost and known when the post is
            created.
          properties:
            amount_usd:
              type: number
            currency:
              type: string
              enum:
              - USD
        thread:
          type:
          - array
          - 'null'
          description: The parts after the first, when the post is a thread.
          items:
            $ref: '#/components/schemas/ThreadPart'
      required:
      - id
      - account_id
      - platform
      - status
      - warnings
    Post:
      type: object
      properties:
        id:
          type: string
        workspace_id:
          type: string
        scheduled_at:
          type:
          - string
          - 'null'
          format: date-time
        created_at:
          type: string
          format: date-time
        content:
          $ref: '#/components/schemas/Content'
        targets:
          type: array
          items:
            $ref: '#/components/schemas/Target'
        approval:
          $ref: '#/components/schemas/Approval'
        links:
          anyOf:
          - $ref: '#/components/schemas/LinkOptions'
          - type: 'null'
        recurrence_id:
          type:
          - string
          - 'null'
          description: Set when this post is one occurrence of a recurring post.
      required:
      - id
      - workspace_id
      - created_at
      - targets
    PostListItem:
      type: object
      properties:
        id:
          type: string
        scheduled_at:
          type:
          - string
          - 'null'
          format: date-time
        created_at:
          type: string
          format: date-time
        canceled_at:
          type:
          - string
          - 'null'
          format: date-time
        statuses:
          type: array
          items:
            $ref: '#/components/schemas/TargetStatus'
        at:
          type: string
          format: date-time
          description: 'Where a calendar places the post: when it went out, else when it is scheduled, else when it was made.'
        account_ids:
          type: array
          items:
            type: string
        preview:
          type: string
          description: The first 160 characters of the text.
        approval_status:
          type:
          - string
          - 'null'
        recurrence_id:
          type:
          - string
          - 'null'
      required:
      - id
      - created_at
      - statuses
    MetricName:
      type: string
      enum:
      - views
      - reach
      - likes
      - comments
      - shares
      - saves
      - clicks
      - watch_time_ms
      - followers
      - followers_new
    MetricSeries:
      type: object
      properties:
        target_id:
          type: string
        account_id:
          type: string
        metric:
          $ref: '#/components/schemas/MetricName'
        samples:
          type: array
          items:
            type: object
            properties:
              measured_at:
                type: string
                format: date-time
              value:
                type:
                - number
                - 'null'
                description: Null when the platform gave no value. Never reported as zero.
              missing_reason:
                type:
                - string
                - 'null'
                enum:
                - not_supported
                - not_yet_available
                - permission_missing
                - platform_error
                - expired
                - null
              source:
                type: string
                description: The platform metric the value came from.
            required:
            - measured_at
            - value
            - source
      required:
      - metric
      - samples
    MetricSeriesList:
      type: object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/MetricSeries'
      required:
      - data
    WebhookEvent:
      type: string
      enum:
      - post.published
      - post.failed
      - post.unknown
      - account.connected
      - account.disconnected
      - token.expiring
      - metrics.updated
      - approval.requested
      - approval.approved
      - approval.rejected
      - approval.expired
      - comment.received
      - generation.completed
      - generation.failed
      - contact.collected
      - automation.run_failed
      - automation.run_unknown
      - boost.started
      - boost.failed
      - listening.spike
    WebhookEndpoint:
      type: object
      properties:
        id:
          type: string
        url:
          type: string
          format: uri
        events:
          type: array
          items:
            $ref: '#/components/schemas/WebhookEvent'
        active:
          type: boolean
        created_at:
          type: string
          format: date-time
      required:
      - id
      - url
      - events
      - active
    WebhookDelivery:
      type: object
      properties:
        id:
          type: string
        event:
          $ref: '#/components/schemas/WebhookEvent'
        status:
          type: string
          enum:
          - pending
          - retrying
          - delivered
          - failed
        attempts:
          type: integer
        response_code:
          type:
          - integer
          - 'null'
        created_at:
          type: string
          format: date-time
        delivered_at:
          type:
          - string
          - 'null'
          format: date-time
        next_attempt_at:
          type:
          - string
          - 'null'
          format: date-time
      required:
      - id
      - event
      - status
      - attempts
    WebhookEnvelope:
      type: object
      properties:
        id:
          type: string
        type:
          $ref: '#/components/schemas/WebhookEvent'
        created_at:
          type: string
          format: date-time
        workspace_id:
          type: string
        data:
          type: object
          additionalProperties: true
      required:
      - id
      - type
      - created_at
      - workspace_id
      - data
      description: 'New events: `approval.requested` (data: post_id, step, step_name, reviewer), `approval.approved` (adds
        comment, final), `approval.rejected` (adds comment), `approval.expired` (not approved before its time), and `comment.received`
        (conversation_id, message_id, post_id, target_id, account_id, platform, author_name, text, created_at), `generation.completed`
        (generation_id, kind, credits_used) and `generation.failed` (generation_id, kind, error_code, credits_refunded). `contact.collected`
        (contact_id, automation_id, run_id, platform, name, email), `automation.run_failed` and `automation.run_unknown` (run_id,
        automation_id, comment_id, error_code), `boost.started` and `boost.failed` (boost_id, post_id, status, error_code on
        failure), and `listening.spike` (term_id, term, matches_last_24h, daily_average_before). Approval events for a boost carry
        `boost_id` and a null `post_id`.'
    BrandProfile:
      type: object
      properties:
        name:
          type:
          - string
          - 'null'
        colors:
          type: object
          properties:
            primary:
              type: string
            secondary:
              type: string
            accent:
              type: string
            background:
              type: string
            text:
              type: string
          required:
          - primary
          - secondary
          - accent
          - background
          - text
        fonts:
          type: object
          description: Names kept for your own use. Image templates use the Inter font.
          properties:
            heading:
              type:
              - string
              - 'null'
            body:
              type:
              - string
              - 'null'
        logo_media_id:
          type:
          - string
          - 'null'
        tone:
          type:
          - string
          - 'null'
        audience:
          type:
          - string
          - 'null'
          description: Who the brand speaks to. Used when posts are written.
        words_to_use:
          type: array
          items:
            type: string
        words_to_avoid:
          type: array
          items:
            type: string
        language:
          type:
          - string
          - 'null'
          description: The language the brand usually posts in (ISO 639-1). Content made from a text follows the text; this is the fallback when it does not tell.
        updated_at:
          type:
          - string
          - 'null'
          format: date-time
      required:
      - colors
      - fonts
      - words_to_use
      - words_to_avoid
    BrandProfileInput:
      type: object
      properties:
        name:
          type: string
        colors:
          type: object
          description: Hex colours like `#1F3A5F`.
          additionalProperties:
            type: string
        fonts:
          type: object
          properties:
            heading:
              type: string
            body:
              type: string
        logo_media_id:
          type: string
        tone:
          type: string
          maxLength: 1000
        audience:
          type: string
          maxLength: 1000
        words_to_use:
          type: array
          maxItems: 50
          items:
            type: string
        words_to_avoid:
          type: array
          maxItems: 50
          items:
            type: string
        language:
          type:
          - string
          - 'null'
          pattern: ^[a-z]{2}$
          description: Two letter language code, or null.
    GenerationKind:
      type: string
      enum:
      - text
      - image
      - video
      - voice
      - captions
      - music
    GenerationSource:
      type: object
      description: 'What to write from. `text`: `text`. `url`: `url` of a public page or PDF. `youtube`: `url`, and optionally
        `transcript` (the official API only gives a video''s own transcript to its owner, so for other videos the drafts use
        title and description unless you paste it). `pdf`: `media_id` of an uploaded PDF, or `url`. `audio`: `media_id` of
        an audio or video file, which is transcribed first.'
      properties:
        type:
          type: string
          enum:
          - text
          - url
          - youtube
          - pdf
          - audio
        text:
          type: string
        url:
          type: string
        transcript:
          type: string
        media_id:
          type: string
      required:
      - type
    GenerationInput:
      type: object
      properties:
        kind:
          $ref: '#/components/schemas/GenerationKind'
        prompt:
          type: string
          description: The idea, the instruction, the image or video description, or the text to speak, depending on `kind`.
        source:
          $ref: '#/components/schemas/GenerationSource'
        platforms:
          type: array
          description: For `text`. Platform ids from `GET /platforms`.
          items:
            type: string
        options:
          type: object
          description: 'text: `language`, and `prompt_id` (a writing framework from GET /workspaces/{workspace_id}/prompts, needs the prompt_library feature; its text is copied into the request as `framework`). image: `aspect_ratio` (1:1, 4:5, 9:16, 16:9), or `template` (quote_card, carousel,
            slideshow) with `quote` and `author`, or `slides` ([{title, body}]) or `slide_count` to have them written; `tier`
            (picture quality: quick, balanced, standard or pro, default standard, credits per picture in `GET /credits`
            image_prices; with `reference_media_ids` quick and balanced are made on standard). video:
            `mode` (template or avatar), `duration_seconds` (5 or 10, or 2 to 20 with `model`), `model` (a video model from the
            price table, for example google/veo-3.1-lite), `aspect_ratio`, `image_media_id`; avatar needs `image_media_id`
            and `audio_media_id`. voice: `voice_id`. captions: `language`.'
          additionalProperties: true
      required:
      - kind
    GenerationOutput:
      type: object
      description: 'One of: `type: text` (a draft: platform, text, characters, max_length, warnings such as `shortened_to_fit`
        or `contains_avoided_words:word`), `type: media` (media_id, content_type, bytes; use it in a post or `GET /media/{id}`),
        `type: captions` (language, text, srt, vtt, words), `type: source` (title, url, notes about what was read).'
      properties:
        type:
          type: string
          enum:
          - text
          - media
          - captions
          - source
      required:
      - type
      additionalProperties: true
    Generation:
      type: object
      properties:
        id:
          type: string
        object:
          type: string
          enum:
          - generation
        workspace_id:
          type: string
        kind:
          $ref: '#/components/schemas/GenerationKind'
        status:
          type: string
          enum:
          - queued
          - running
          - completed
          - failed
        request:
          type: object
          additionalProperties: true
        outputs:
          type: array
          items:
            $ref: '#/components/schemas/GenerationOutput'
        credits_used:
          type: integer
          description: Credits taken. Returned in full if the generation fails.
        error:
          type:
          - object
          - 'null'
          properties:
            code:
              type: string
            message:
              type: string
        origin:
          type: string
          enum:
          - api
          - rss
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
        completed_at:
          type:
          - string
          - 'null'
          format: date-time
      required:
      - id
      - object
      - kind
      - status
      - outputs
      - credits_used
      - error
    Feed:
      type: object
      properties:
        id:
          type: string
        url:
          type: string
        title:
          type:
          - string
          - 'null'
        platforms:
          type: array
          items:
            type: string
        language:
          type:
          - string
          - 'null'
        active:
          type: boolean
        check_every_minutes:
          type: integer
        last_checked_at:
          type:
          - string
          - 'null'
          format: date-time
        last_status:
          type:
          - string
          - 'null'
          enum:
          - ok
          - failing
          - null
        created_at:
          type: string
          format: date-time
      required:
      - id
      - url
      - platforms
      - active
    Credits:
      type: object
      properties:
        mode:
          type: string
          enum:
          - test
          - live
        balance:
          type: integer
        plan:
          type: string
        monthly_grant:
          type: integer
        period:
          type: string
          description: The current month, `YYYY-MM`.
        prices:
          type: object
          description: Credits per kind. `video` is the price of a 5 second clip. Images and video are priced from the model's
            cost (cost-plus), so a longer clip is not always a multiple of it; see `video_prices`.
          additionalProperties:
            type: integer
        image_prices:
          type: object
          description: Credits for one generated picture on each picture quality tier offered here (`options.tier` of an
            image generation), keyed by tier.
          additionalProperties:
            type: integer
        video_prices:
          type: object
          description: Credits for a clip of 5 and of 10 seconds, keyed by seconds.
          additionalProperties:
            type: integer
        music_prices:
          type: object
          description: Credits for music made for a video, priced from the music model's cost per track (cost-plus). One
            price for videos up to 30 seconds (a 30 second clip) and one for longer videos (a whole song).
          properties:
            up_to_30_seconds:
              type: integer
            longer:
              type: integer
        ledger:
          type: array
          items:
            type: object
            properties:
              id:
                type: integer
              kind:
                type: string
                enum:
                - grant
                - purchase
                - usage
                - refund
                - adjustment
              amount:
                type: integer
              generation_id:
                type:
                - string
                - 'null'
              workspace_id:
                type:
                - string
                - 'null'
              note:
                type:
                - string
                - 'null'
              created_at:
                type: string
                format: date-time
            required:
            - id
            - kind
            - amount
            - created_at
        next_cursor:
          type:
          - string
          - 'null'
      required:
      - mode
      - balance
      - plan
      - monthly_grant
      - prices
      - ledger
    Platform:
      type: object
      properties:
        id:
          $ref: '#/components/schemas/PlatformId'
        status:
          type: string
          enum:
          - available
          - pending_approval
          - coming_soon
          description: '`coming_soon` also covers a network that is switched off for your organization.'
        post_types:
          type: array
          items:
            type: string
        text_max_length:
          type: integer
        media:
          type: object
          properties:
            image_types:
              type: array
              items:
                type: string
            video_types:
              type: array
              items:
                type: string
            max_image_bytes:
              type: integer
            max_video_bytes:
              type: integer
            max_video_duration_ms:
              type:
              - integer
              - 'null'
            max_items:
              type: integer
        daily_post_limit:
          type:
          - integer
          - 'null'
        first_comment:
          type: boolean
        metrics:
          type: object
          properties:
            post:
              type: array
              items:
                $ref: '#/components/schemas/MetricName'
            account:
              type: array
              items:
                $ref: '#/components/schemas/MetricName'
        inbox:
          type:
          - object
          - 'null'
          description: What the inbox can do on this network.
          properties:
            comments:
              type: boolean
            reply:
              type: boolean
            hide:
              type: boolean
            delete:
              type: boolean
              description: Delete somebody else's comment.
            direct_messages:
              type: boolean
            private_replies:
              type: boolean
              description: A private message can answer a comment (Facebook and Instagram, used by automations).
            follow_check:
              type: boolean
              description: The network can say whether a person follows the account (Instagram).
      required:
      - id
      - status
    BillingUrl:
      type: object
      properties:
        url:
          type: string
          description: Open this address in the browser.
    MfaRequired:
      type: object
      properties:
        mfa_required:
          type: boolean
        mfa_token:
          type: string
        expires_at:
          type: string
          format: date-time
    SpendingCap:
      type: object
      properties:
        monthly_cap_cents:
          type: integer
        default:
          type: boolean
        used_cents:
          type: integer
        currency:
          type: string
    Invoice:
      type: object
      properties:
        id:
          type: string
        number:
          type:
          - string
          - 'null'
        status:
          type: string
        currency:
          type: string
        total:
          type: integer
          description: In the smallest unit of the currency.
        amount_paid:
          type: integer
        created_at:
          type:
          - string
          - 'null'
        hosted_invoice_url:
          type:
          - string
          - 'null'
        pdf_url:
          type:
          - string
          - 'null'
    Billing:
      type: object
      properties:
        plan:
          type: string
          enum:
          - free
          - creator
          - agency
          - agency_pro
          - scale
          - enterprise
        plan_name:
          type: string
        status:
          type: string
          description: none, active, trialing, past_due, unpaid, canceled or incomplete.
        interval:
          type:
          - string
          - 'null'
        currency:
          type:
          - string
          - 'null'
        current_period_end:
          type:
          - string
          - 'null'
        cancel_at_period_end:
          type: boolean
        past_due_since:
          type:
          - string
          - 'null'
        grace_ends_at:
          type:
          - string
          - 'null'
        grace_days:
          type: integer
        publishing_paused:
          type: boolean
        billing_enabled:
          type: boolean
        has_payment_account:
          type: boolean
        next_plan:
          type:
          - string
          - 'null'
        limits:
          type: object
          properties:
            accounts_included:
              type:
              - integer
              - 'null'
            posts_per_month:
              type:
              - integer
              - 'null'
            credits_per_month:
              type: integer
        usage:
          type: object
          properties:
            accounts:
              type: integer
            extra_accounts:
              type: integer
            posts_this_month:
              type: integer
            credits_balance:
              type: integer
        plans:
          type: array
          items:
            type: object
            properties:
              id:
                type: string
              name:
                type: string
              accounts_included:
                type: integer
              credits_per_month:
                type: integer
              purchasable:
                type: object
                description: For each currency, the intervals that can be bought now.
                additionalProperties:
                  type: array
                  items:
                    type: string
              amounts:
                type: object
                description: Price in the smallest currency unit for each currency and interval, read from Stripe. Null if Stripe could not be asked.
                additionalProperties:
                  type: object
                  additionalProperties:
                    type:
                    - integer
                    - 'null'
              extra_account_amounts:
                type: object
                description: Monthly price of each account above the plan, same shape as amounts.
                additionalProperties:
                  type: object
                  additionalProperties:
                    type:
                    - integer
                    - 'null'
        credit_packs:
          type: array
          items:
            type: object
            properties:
              id:
                type: string
              credits:
                type: integer
              currencies:
                type: array
                items:
                  type: string
    Status:
      type: object
      properties:
        checked_at:
          type: string
          format: date-time
        overall:
          type: string
          enum:
          - operational
          - degraded
          - outage
        platforms:
          type: array
          items:
            type: object
            properties:
              id:
                type: string
              status:
                type: string
                enum:
                - operational
                - degraded
                - outage
                - no_recent_posts
                - paused
              posts_24h:
                type: integer
              failed_24h:
                type: integer
    Organization:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
        plan:
          type: string
        brand:
          type: object
          properties:
            name:
              type:
              - string
              - 'null'
            logo_url:
              type:
              - string
              - 'null'
            color:
              type:
              - string
              - 'null'
            hide_everyspoke_brand:
              type: boolean
        allowed_redirect_origins:
          type: array
          items:
            type: string
        require_two_factor:
          type: boolean
          description: When true, every member must turn on two factor sign in. Change it with PATCH. The member who turns it on must have it on first.
      required:
      - id
      - name
      - plan
      - brand
      - allowed_redirect_origins
    ApiKey:
      type: object
      properties:
        id:
          type: string
        workspace_id:
          type:
          - string
          - 'null'
        prefix:
          type: string
          description: The first characters of the key, to recognise it.
        scopes:
          type: array
          items:
            $ref: '#/components/schemas/Scope'
        mode:
          type: string
          enum:
          - test
          - live
        created_at:
          type: string
          format: date-time
        expires_at:
          type:
          - string
          - 'null'
          format: date-time
        revoked_at:
          type:
          - string
          - 'null'
          format: date-time
        last_used_at:
          type:
          - string
          - 'null'
          format: date-time
      required:
      - id
      - prefix
      - scopes
      - mode
      - created_at
    ApprovalStep:
      type: object
      required:
      - name
      - reviewer
      properties:
        name:
          type: string
          maxLength: 60
        reviewer:
          type: string
          enum:
          - agency
          - client
          description: '`agency` steps are decided through the API by your team. `client` steps are decided by an invited
            reviewer on the review page.'
    ApprovalSettings:
      type: object
      required:
      - required
      - steps
      properties:
        required:
          type: boolean
          description: When true, new posts in this workspace wait in `awaiting_approval` until every step has approved them.
        steps:
          type: array
          minItems: 1
          maxItems: 5
          items:
            $ref: '#/components/schemas/ApprovalStep'
          description: Done in order. The default is one client step.
    Approval:
      type:
      - object
      - 'null'
      description: Null for posts that never needed approval.
      properties:
        status:
          type: string
          enum:
          - pending
          - approved
          - rejected
          - expired
        step:
          type: integer
          description: Index in `steps` of the step now waiting.
        steps:
          type: array
          items:
            $ref: '#/components/schemas/ApprovalStep'
    ApprovalEvent:
      type: object
      properties:
        step:
          type: integer
        step_name:
          type: string
        event:
          type: string
          enum:
          - requested
          - approved
          - rejected
          - expired
        source:
          type: string
          enum:
          - api
          - client
          - system
        actor:
          type: string
          description: An API key id, or `reviewer:<id>`.
        comment:
          type:
          - string
          - 'null'
        at:
          type: string
          format: date-time
    ApprovalDecision:
      type: object
      properties:
        comment:
          type: string
          maxLength: 2000
          description: 'Required when rejecting: say what should change.'
    Reviewer:
      type: object
      properties:
        id:
          type: string
        workspace_id:
          type: string
        email:
          type: string
          format: email
        name:
          type:
          - string
          - 'null'
        created_at:
          type: string
          format: date-time
        revoked_at:
          type:
          - string
          - 'null'
          format: date-time
        login_url:
          type: string
          format: uri
          description: 'Test workspaces only: the login link, since no email is sent. In live workspaces the link is only
            in the email.'
      required:
      - id
      - workspace_id
      - email
      - created_at
    InboxConversation:
      type: object
      properties:
        id:
          type: string
        post_id:
          type: string
        target_id:
          type: string
        account_id:
          type: string
        platform:
          $ref: '#/components/schemas/PlatformId'
        status:
          type: string
          enum:
          - open
          - done
        assigned_to:
          type:
          - string
          - 'null'
          description: A member id. Any short text for now.
        last_message_at:
          type: string
          format: date-time
        messages:
          type: integer
        preview:
          type:
          - object
          - 'null'
          properties:
            text:
              type:
              - string
              - 'null'
            author_name:
              type: string
            direction:
              type: string
              enum:
              - in
              - out
    InboxMessage:
      type: object
      properties:
        id:
          type: string
        direction:
          type: string
          enum:
          - in
          - out
        author:
          type: object
          properties:
            id:
              type:
              - string
              - 'null'
            name:
              type: string
            handle:
              type:
              - string
              - 'null'
        text:
          type:
          - string
          - 'null'
          description: Null once the comment is deleted.
        created_at:
          type: string
          format: date-time
        hidden:
          type: boolean
        deleted:
          type: boolean
        send_status:
          type: string
          enum:
          - sending
          - sent
          - failed
          description: For your own replies. A reply stuck in `sending` is never sent again on its own.
    InboxConversationDetail:
      type: object
      properties:
        conversation:
          $ref: '#/components/schemas/InboxConversation'
        messages:
          type: array
          items:
            $ref: '#/components/schemas/InboxMessage'
    LinkSettings:
      type: object
      properties:
        shorten:
          type: boolean
        utm:
          type: object
          properties:
            enabled:
              type: boolean
            medium:
              type:
              - string
              - 'null'
              description: Default `social`.
            campaign:
              type:
              - string
              - 'null'
    LinkOptions:
      type: object
      description: What this post asks for, over the workspace default.
      properties:
        shorten:
          type: boolean
          description: Links in the text and in `content.link` become short links, one per platform, made when each target
            is sent.
        utm:
          type: object
          properties:
            enabled:
              type: boolean
              description: Adds utm_source (the platform), utm_medium and utm_campaign. Parameters already in the address
                are kept.
            medium:
              type: string
            campaign:
              type: string
    PostLink:
      type: object
      properties:
        code:
          type: string
        short_url:
          type: string
          format: uri
        url:
          type: string
          description: The address you wrote.
        destination:
          type: string
          description: Where a click goes, with UTM parameters.
        target_id:
          type: string
        platform:
          type: string
        created_at:
          type: string
          format: date-time
        clicks:
          type: integer
          description: Readers only. Link previews and crawlers are not counted.
        by_platform:
          type: array
          items:
            type: object
            properties:
              platform:
                type: string
              clicks:
                type: integer
          description: From utm_source.
        by_country:
          type: array
          items:
            type: object
            properties:
              country:
                type: string
                description: Two letters, XX when unknown.
              clicks:
                type: integer
        by_device:
          type: array
          items:
            type: object
            properties:
              device:
                type: string
                enum:
                - mobile
                - tablet
                - desktop
                - other
              clicks:
                type: integer
        by_day:
          type: array
          items:
            type: object
            properties:
              day:
                type: string
                format: date
              clicks:
                type: integer
    ImportResult:
      type: object
      properties:
        data:
          type: array
          items:
            type: object
            properties:
              name:
                type:
                - string
                - 'null'
              media:
                type:
                - object
                - 'null'
              error:
                type:
                - object
                - 'null'
    QueueSettings:
      type: object
      properties:
        timezone:
          type: string
          example: Europe/Stockholm
        slots:
          type: array
          maxItems: 100
          items:
            type: object
            properties:
              weekday:
                type: string
                enum:
                - mon
                - tue
                - wed
                - thu
                - fri
                - sat
                - sun
              time:
                type: string
                example: 09:30
            required:
            - weekday
            - time
      required:
      - timezone
      - slots
    Queue:
      allOf:
      - $ref: '#/components/schemas/QueueSettings'
      - type: object
        properties:
          upcoming:
            type: array
            description: The next posting times and whether each is still free.
            items:
              type: object
              properties:
                at:
                  type: string
                  format: date-time
                free:
                  type: boolean
    BestTimes:
      type: object
      properties:
        confidence:
          type: string
          enum:
          - estimate
          - data
        posts_used:
          type: integer
        timezone:
          type: string
        times:
          type: array
          items:
            type: object
            properties:
              weekday:
                type: string
                enum:
                - mon
                - tue
                - wed
                - thu
                - fri
                - sat
                - sun
              hour:
                type: integer
              average_score:
                type: number
                description: Relative to the account's median post. 1 is typical.
              posts:
                type: integer
        method:
          type: string
    RecurringPostCreate:
      allOf:
      - $ref: '#/components/schemas/PostCreate'
      - type: object
        properties:
          scheduled_at:
            type: string
            format: date-time
            description: The time of the first post.
          repeat:
            type: object
            properties:
              every:
                type: integer
                minimum: 1
                maximum: 365
              unit:
                type: string
                enum:
                - day
                - week
              until:
                type: string
                format: date-time
                description: The last day a post may go out. At most 18 months ahead.
              timezone:
                type: string
                description: IANA time zone whose clock time every post keeps, also across daylight saving changes. Defaults to the
                  zone of the first account's posting times, or UTC.
            required:
            - every
            - unit
            - until
        required:
        - scheduled_at
        - repeat
    RecurringPost:
      type: object
      properties:
        id:
          type: string
        content:
          $ref: '#/components/schemas/Content'
        account_ids:
          type: array
          items:
            type: string
        every:
          type: integer
        unit:
          type: string
          enum:
          - day
          - week
        first_at:
          type: string
          format: date-time
        until_at:
          type: string
          format: date-time
        timezone:
          type: string
          description: The zone whose clock time each occurrence keeps.
        next_occurrence_at:
          type:
          - string
          - 'null'
          format: date-time
        posts_created:
          type: integer
        last_error:
          type:
          - string
          - 'null'
          description: Why the latest occurrence could not be made, e.g. an account was disconnected. That occurrence is skipped.
        status:
          type: string
          enum:
          - active
          - finished
          - canceled
        created_at:
          type: string
          format: date-time
    BulkResult:
      type: object
      properties:
        dry_run:
          type: boolean
        job_id:
          type: string
          description: Present when posts are being created. Use it to read progress.
        status:
          type: string
          enum:
          - running
          - done
        file_id:
          type: string
          description: Identifies this file. The same file always gives the same id and creates each post once.
        timezone:
          type: string
        summary:
          type: object
          properties:
            total:
              type: integer
            valid:
              type: integer
            invalid:
              type: integer
            created:
              type: integer
            existing:
              type: integer
            failed:
              type: integer
            posts:
              type: integer
            remaining:
              type: integer
              description: Rows still to be made.
        rows:
          type: array
          items:
            type: object
            properties:
              row:
                type: integer
                description: Line number in the file
                the header is line 1.: null
              status:
                type: string
                enum:
                - ok
                - error
                - created
                - exists
                - skipped
              account_ids:
                type: array
                items:
                  type: string
              scheduled_at:
                type:
                - string
                - 'null'
                description: A time, or `queue` in a preview of a row that uses the queue.
              text:
                type: string
              post_id:
                type: string
              problems:
                type: array
                items:
                  type: object
                  properties:
                    code:
                      type: string
                    message:
                      type: string
                    field:
                      type: string
    ReportSettings:
      type: object
      properties:
        auto_email:
          type: boolean
        recipients:
          type: array
          maxItems: 5
          items:
            type: string
            format: email
        last_sent_month:
          type:
          - string
          - 'null'
          readOnly: true
      required:
      - auto_email
      - recipients
    ReportPost:
      type: object
      properties:
        post_id:
          type: string
        account_id:
          type: string
        account_name:
          type: string
        platform:
          type: string
        published_at:
          type: string
          format: date-time
        url:
          type:
          - string
          - 'null'
        text:
          type: string
        views:
          type:
          - number
          - 'null'
        likes:
          type:
          - number
          - 'null'
        comments:
          type:
          - number
          - 'null'
        reach:
          type:
          - number
          - 'null'
        shares:
          type:
          - number
          - 'null'
    Report:
      type: object
      properties:
        month:
          type: string
        from:
          type: string
          format: date-time
        to:
          type: string
          format: date-time
        workspace:
          type: object
          properties:
            id:
              type: string
            name:
              type: string
        brand:
          type: object
          properties:
            name:
              type: string
            logo_url:
              type:
              - string
              - 'null'
            color:
              type:
              - string
              - 'null'
            hide_everyspoke_brand:
              type: boolean
        totals:
          type: object
          properties:
            posts:
              type: integer
            views:
              type:
              - number
              - 'null'
            likes:
              type:
              - number
              - 'null'
            comments:
              type:
              - number
              - 'null'
            reach:
              type:
              - number
              - 'null'
            shares:
              type:
              - number
              - 'null'
        top_posts:
          type: object
          description: Up to 5 posts for each ranking. Posts without that number are left out.
          properties:
            views:
              type: array
              items:
                $ref: '#/components/schemas/ReportPost'
            likes:
              type: array
              items:
                $ref: '#/components/schemas/ReportPost'
            comments:
              type: array
              items:
                $ref: '#/components/schemas/ReportPost'
            reach:
              type: array
              items:
                $ref: '#/components/schemas/ReportPost'
        accounts:
          type: array
          items:
            type: object
            properties:
              account_id:
                type: string
              name:
                type: string
              platform:
                type: string
              followers_start:
                type:
                - number
                - 'null'
              followers_end:
                type:
                - number
                - 'null'
              followers_change:
                type:
                - number
                - 'null'
              posts:
                type: integer
        audience:
          type: array
          description: Age, gender and country figures per account, only where the network gives them. Often empty.
          items:
            type: object
            properties:
              account_id:
                type: string
              name:
                type: string
              groups:
                type: array
                items:
                  type: object
                  properties:
                    kind:
                      type: string
                    values:
                      type: array
                      items:
                        type: object
                        properties:
                          key:
                            type: string
                          value:
                            type: number
        notes:
          type: array
          items:
            type: string
        generated_at:
          type: string
          format: date-time
    ThreadPart:
      type: object
      properties:
        index:
          type: integer
          description: 1 is the second post of the thread.
        status:
          type: string
          enum:
          - pending
          - sending
          - published
          - failed
          - not_sent
          - unknown
          - deleted
          description: '`not_sent` parts follow a failed part and were left unsent. `unknown` means the outcome is not known
            and the part is never resent automatically.'
        platform_post_id:
          type:
          - string
          - 'null'
        url:
          type:
          - string
          - 'null'
        published_at:
          type:
          - string
          - 'null'
          format: date-time
        error:
          type:
          - object
          - 'null'
          properties:
            code:
              type: string
            message:
              type: string
    AutomationMessage:
      type: object
      properties:
        text:
          type: string
          description: Up to 1000 characters, 640 when there are buttons.
        buttons:
          type: array
          maxItems: 3
          items:
            type: object
            properties:
              title:
                type: string
                maxLength: 20
              url:
                type: string
                description: An https address. Facebook shows these as buttons; Instagram gets them as lines of text.
            required:
            - title
            - url
      required:
      - text
    AutomationGates:
      type: object
      properties:
        follows_account:
          type: boolean
          description: Instagram only. Checked after the person answers, because Instagram only tells us about a person who has written to the account.
        email:
          type: boolean
          description: The person is asked to answer with an email address, which is stored as a contact.
        prompt:
          type:
          - string
          - 'null'
          description: The question sent first. A plain one is used when empty.
    AutomationInput:
      type: object
      properties:
        name:
          type: string
        account_id:
          type: string
          description: A connected Facebook or Instagram account.
        post_id:
          type:
          - string
          - 'null'
          description: One of your published posts on that account. Empty means every post on the account.
        keywords:
          type: array
          minItems: 1
          maxItems: 2
          items:
            type: string
        match:
          type: string
          enum:
          - contains
          - exact
          default: contains
        public_replies:
          type: array
          maxItems: 5
          items:
            type: string
            maxLength: 300
        message:
          $ref: '#/components/schemas/AutomationMessage'
        gates:
          $ref: '#/components/schemas/AutomationGates'
      required:
      - name
      - account_id
      - keywords
      - message
    Automation:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
        account_id:
          type: string
        post_id:
          type:
          - string
          - 'null'
        keywords:
          type: array
          items:
            type: string
        match:
          type: string
          enum:
          - contains
          - exact
        public_replies:
          type: array
          items:
            type: string
        message:
          $ref: '#/components/schemas/AutomationMessage'
        gates:
          $ref: '#/components/schemas/AutomationGates'
        status:
          type: string
          enum:
          - active
          - paused
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
      required:
      - id
      - name
      - account_id
      - keywords
      - status
    AutomationStats:
      type: object
      properties:
        automation_id:
          type: string
        triggered:
          type: integer
        completed:
          type: integer
        failed:
          type: integer
          description: Includes runs whose result is not confirmed.
        waiting:
          type: integer
        expired:
          type: integer
        canceled:
          type: integer
        contacts:
          type: integer
      required:
      - triggered
      - completed
      - failed
    AutomationRun:
      type: object
      properties:
        id:
          type: string
        automation_id:
          type: string
        comment_id:
          type: string
        comment_text:
          type:
          - string
          - 'null'
        author_name:
          type:
          - string
          - 'null'
        status:
          type: string
          enum:
          - queued
          - sending
          - waiting
          - checking
          - completed
          - failed
          - unknown
          - expired
          - canceled
        private_message:
          type: string
          description: pending, sending, sent, failed or unknown.
        public_reply:
          type: string
          description: none, pending, sending, sent, failed or unknown.
        gate_message:
          type: string
          description: The message sent after the gates were met. none, pending, sending, sent, failed or unknown.
        error_code:
          type:
          - string
          - 'null'
        error_message:
          type:
          - string
          - 'null'
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
      required:
      - id
      - status
    Contact:
      type: object
      properties:
        id:
          type: string
        automation_id:
          type: string
        platform:
          $ref: '#/components/schemas/PlatformId'
        account_id:
          type: string
        name:
          type:
          - string
          - 'null'
        handle:
          type:
          - string
          - 'null'
        email:
          type:
          - string
          - 'null'
        created_at:
          type: string
          format: date-time
      required:
      - id
      - automation_id
    AdAccount:
      type: object
      properties:
        id:
          type: string
        workspace_id:
          type: string
        platform:
          $ref: '#/components/schemas/PlatformId'
        provider:
          type:
          - string
          - 'null'
          enum:
          - meta
          - linkedin
          - tiktok
          - null
        kind:
          type: string
          enum:
          - ad_account
        name:
          type: string
        currency:
          type:
          - string
          - 'null'
        status:
          type: string
        connected_at:
          type: string
          format: date-time
      required:
      - id
      - kind
      - name
    BoostAudience:
      type: object
      properties:
        countries:
          type: array
          minItems: 1
          maxItems: 10
          items:
            type: string
            description: Two letter country code.
        age_min:
          type: integer
          minimum: 13
          maximum: 65
        age_max:
          type: integer
          minimum: 13
          maximum: 65
        interests:
          type: array
          maxItems: 10
          items:
            type: string
          description: Used on Meta, where an interest is looked up by name. LinkedIn does not use it.
      required:
      - countries
    BoostInput:
      type: object
      properties:
        target_id:
          type: string
          description: Which target of the post to boost. Optional when only one can be.
        ad_account_id:
          type: string
          description: Optional when the workspace has one ad account for that ad system.
        budget_minor:
          type: integer
          description: The total budget in the smallest unit of the ad account currency, for example 5000 for 50.00.
        duration_days:
          type: integer
          minimum: 1
          maximum: 30
        start_at:
          type: string
          format: date-time
          description: Within the next 7 days. Starts at once when left out.
        audience:
          $ref: '#/components/schemas/BoostAudience'
        spark_auth_code:
          type: string
          description: TikTok only. The Spark Ads authorization code made by the account that posted.
      required:
      - budget_minor
      - duration_days
      - audience
    Boost:
      type: object
      properties:
        id:
          type: string
        post_id:
          type: string
        target_id:
          type: string
        platform:
          $ref: '#/components/schemas/PlatformId'
        ad_account_id:
          type: string
        provider:
          type: string
          enum:
          - meta
          - linkedin
          - tiktok
        status:
          type: string
          enum:
          - awaiting_approval
          - queued
          - creating
          - scheduled
          - active
          - completed
          - stopped
          - rejected
          - canceled
          - failed
          - unknown
        budget:
          type: object
          properties:
            amount_minor:
              type: integer
            currency:
              type: string
        start_at:
          type: string
          format: date-time
        end_at:
          type: string
          format: date-time
        audience:
          $ref: '#/components/schemas/BoostAudience'
        approval:
          type:
          - object
          - 'null'
          properties:
            status:
              type: string
            step:
              type: integer
            steps:
              type: array
              items:
                type: object
        error:
          type:
          - object
          - 'null'
          properties:
            code:
              type: string
            message:
              type: string
        stats:
          type:
          - object
          - 'null'
          description: The latest reading from the ad system, in the ad account currency.
          properties:
            spend_minor:
              type:
              - integer
              - 'null'
            impressions:
              type:
              - integer
              - 'null'
            clicks:
              type:
              - integer
              - 'null'
            results:
              type:
              - integer
              - 'null'
            cost_per_result_minor:
              type:
              - integer
              - 'null'
              description: Null while there is no result.
            measured_at:
              type: string
              format: date-time
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
      required:
      - id
      - post_id
      - status
    ListeningSource:
      type: string
      enum:
      - x
      - bluesky
      - mastodon
      - youtube
      - instagram_hashtag
      - news
    ListeningConfig:
      type: object
      properties:
        sources:
          type: array
          items:
            $ref: '#/components/schemas/ListeningSource'
        mastodon_servers:
          type: array
          items:
            type: string
        instagram_account_id:
          type:
          - string
          - 'null'
    ListeningTerm:
      type: object
      properties:
        id:
          type: string
        text:
          type: string
        kind:
          type: string
          enum:
          - keyword
          - name
          - hashtag
        created_at:
          type: string
          format: date-time
        last_run_at:
          type:
          - string
          - 'null'
          format: date-time
        sources:
          type: array
          items:
            type: object
            properties:
              source:
                type: string
              status:
                type: string
                enum:
                - ok
                - error
              last_run_at:
                type:
                - string
                - 'null'
              error_code:
                type:
                - string
                - 'null'
      required:
      - id
      - text
      - kind
    ListeningMatch:
      type: object
      properties:
        id:
          type: string
        term_id:
          type: string
        term:
          type: string
        source:
          $ref: '#/components/schemas/ListeningSource'
        url:
          type:
          - string
          - 'null'
        author:
          type:
          - string
          - 'null'
        text:
          type: string
        published_at:
          type: string
          format: date-time
        found_at:
          type: string
          format: date-time
      required:
      - id
      - source
      - text
    Listening:
      type: object
      properties:
        config:
          $ref: '#/components/schemas/ListeningConfig'
        sources:
          type: array
          description: Which sources work for this workspace now, and why not when they do not.
          items:
            type: object
            properties:
              source:
                $ref: '#/components/schemas/ListeningSource'
              available:
                type: boolean
              reason:
                type:
                - string
                - 'null'
        terms:
          type: array
          items:
            $ref: '#/components/schemas/ListeningTerm'
        usage:
          type: object
          description: What the metered sources have used against their caps in the current period.
          properties:
            x:
              $ref: '#/components/schemas/ListeningUsage'
            youtube:
              $ref: '#/components/schemas/ListeningUsage'
        instagram_hashtags:
          type:
          - object
          - 'null'
          properties:
            used:
              type: integer
            limit:
              type: integer
            period_days:
              type: integer
        coverage:
          type: object
          description: What can and cannot be listened to, in plain words.
          properties:
            covered:
              type: array
              items:
                $ref: '#/components/schemas/ListeningCoverage'
            notCovered:
              type: array
              items:
                $ref: '#/components/schemas/ListeningCoverage'
      required:
      - config
      - sources
      - terms
      - usage
      - coverage
    ListeningUsage:
      type: object
      properties:
        period:
          type: string
        unit:
          type: string
        used:
          type: integer
        cap:
          type: integer
    ListeningCoverage:
      type: object
      properties:
        source:
          type: string
        name:
          type: string
        note:
          type: string
    VisualStyle:
      enum:
      - realistic
      - cartoon
      - anime
      - watercolor
      - oil_painting
      - sketch
      - cyberpunk
      - fantasy
      - minimalist
    StoryFormat:
      enum:
      - talking_character
      - narrated
      - hook_story
      - voiced_scenes
    CharacterTraits:
      type: object
      additionalProperties: false
      description: Fixed identity traits, each a short visual phrase of up to 160 characters, repeated word for word in every
        scene.
      properties:
        face:
          type: string
        hair:
          type: string
        age:
          type: string
        build:
          type: string
        clothing:
          type: string
        distinguishing_marks:
          type: string
    CharacterInput:
      type: object
      properties:
        name:
          type: string
          maxLength: 60
        description:
          type: string
          minLength: 20
          maxLength: 1200
        traits:
          $ref: '#/components/schemas/CharacterTraits'
        style:
          $ref: '#/components/schemas/VisualStyle'
        reference_media_id:
          type:
          - string
          - 'null'
    Character:
      type: object
      properties:
        object:
          const: character
        id:
          type: string
        workspace_id:
          type: string
        name:
          type: string
        description:
          type: string
        traits:
          $ref: '#/components/schemas/CharacterTraits'
        style:
          $ref: '#/components/schemas/VisualStyle'
        reference_media_id:
          type:
          - string
          - 'null'
        candidates:
          type: array
          items:
            type: object
            properties:
              generation_id:
                type: string
              status:
                enum:
                - queued
                - running
                - completed
                - failed
              media_id:
                type:
                - string
                - 'null'
        prices:
          type: object
          properties:
            candidate_image:
              type: integer
              description: Credits per candidate picture.
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
    StoryScene:
      type: object
      properties:
        description:
          type: string
          maxLength: 600
          description: What the picture shows. Refer to the character by name; their look is added from the character.
        narration:
          type: string
          maxLength: 400
          description: What is said (first person for a talking character).
        text:
          type: string
          maxLength: 90
          description: Text on screen.
        media_id:
          type: string
          description: Your own photo or clip instead of a generated picture.
        shows_character:
          type: boolean
    StoryRequest:
      type: object
      properties:
        format:
          $ref: '#/components/schemas/StoryFormat'
        brief:
          type: string
          maxLength: 2000
        script:
          type: string
          maxLength: 4000
        scenes:
          type: array
          maxItems: 12
          items:
            $ref: '#/components/schemas/StoryScene'
        aspect_ratio:
          enum:
          - '9:16'
          - '1:1'
          - '4:5'
          - '16:9'
          default: '9:16'
        duration_seconds:
          type: integer
          minimum: 5
          maximum: 60
          default: 30
        language:
          type: string
        style:
          $ref: '#/components/schemas/VisualStyle'
        character_id:
          type: string
          description: Required for talking_character.
        animate:
          enum:
          - none
          - first
          - all
          default: none
          description: Which scenes are animated from their still. A talking character is always animated.
        animation_model:
          type: string
          description: A model from story-options animation_models. Default the cheapest.
        image_tier:
          type: string
          enum: [quick, balanced, standard]
          default: standard
          description: Picture quality of the scene pictures and of the stills moving scenes start from (story-options
            image_tiers gives credits per picture). Scenes with the character are made on `standard` or better, until
            the cheaper tiers are tested with references; the quoted price shows this.
        talking_model:
          type:
          - string
          - 'null'
          description: For talking_character. Default a model that speaks, when offered; null for a voiceover instead.
        voice_id:
          type: string
        captions:
          type: object
          properties:
            'on':
              type: boolean
              default: true
            position:
              enum:
              - bottom
              - middle
              - top
              default: bottom
            highlight:
              type: string
              description: A colour reference such as brand.accent for the word being spoken.
        music:
          description: A music mood, or null for none.
          type:
          - string
          - 'null'
        transition:
          type: string
          default: auto
        trim_to_voice:
          type: boolean
          description: Make every scene as long as its voice line plus a short pause.
        title:
          type: string
        save:
          type: boolean
    StoryProposal:
      type: object
      properties:
        object:
          const: story_proposal
        format:
          $ref: '#/components/schemas/StoryFormat'
        title:
          type: string
        source:
          enum:
          - brief
          - script
          - scenes
        scenes:
          type: array
          items:
            type: object
        spec:
          type: object
          description: A CampaignVideoSpec with `story`, free scenes and media to generate (with `character_id`, `style`,
            `still_first`, `model`, `speech`).
        seconds:
          type: number
        target_seconds:
          type: integer
          description: The length asked for.
        estimated_seconds:
          type: number
          description: About how long the video runs, from the narration at the voice's pace. A plan more than 20 percent
            over the target is written again once, shorter; a note says so when it is still long. The render fits the scenes
            to the real voice.
        talking:
          type:
          - object
          - 'null'
          properties:
            model:
              type:
              - string
              - 'null'
            speaks:
              type: boolean
        caption_timing:
          enum:
          - recognized
          - estimated
        price:
          type: object
          properties:
            scenes:
              type: object
              description: The scene pictures and clips (POST .../scenes/generate).
            total:
              type: object
              description: The finished video, with the voice, caption timing, music and the render.
        notes:
          type: array
          items:
            type: string
        video:
          type:
          - object
          - 'null'

    ImageTierChoice:
      type: object
      description: A picture quality tier with our own name; the model behind it is not part of the API.
      properties:
        id:
          type: string
          enum: [quick, balanced, standard, pro]
        label:
          type: string
        about:
          type: string
        credits_per_image:
          type: integer
    ClipOptions:
      type: object
      properties:
        object:
          const: clip_options
        aspect_ratios:
          type: array
          items:
            type: string
        fits:
          type: array
          items:
            type: string
        transitions:
          type: array
          items:
            type: string
        caption_styles:
          type: array
          items:
            type: string
        caption_positions:
          type: array
          items:
            type: string
        title_positions:
          type: array
          items:
            type: string
        cutaway_layouts:
          type: array
          items:
            type: string
        styles:
          type: array
          items:
            type: object
        music:
          type: object
        cutaway_models:
          type: array
          items:
            type: object
            properties:
              model:
                type: string
              label:
                type: string
              seconds:
                type: number
        image_tiers:
          type: array
          description: Picture quality tiers offered here, cheapest first, with credits per picture.
          items:
            $ref: '#/components/schemas/ImageTierChoice'
        speech:
          enum: [recognized, analysis]
        limits:
          type: object
        prices:
          type: object
          properties:
            cutaway_image:
              type: integer
        renderer_feature_level:
          type: integer
    ClipQuote:
      type: object
      description: The price before anything is charged.
      properties:
        object:
          const: clip_quote
        tool:
          enum: [combine, talking_head]
        prepare:
          description: Clips that must be analysed first, and what that costs (null when all are ready).
          oneOf:
          - type: 'null'
          - type: object
            properties:
              media_ids:
                type: array
                items:
                  type: string
              credits:
                type: integer
              summary:
                type: string
        speech:
          type: object
          description: Recognizing the words, charged when the video is made. 0 for windows recognized before.
          properties:
            credits:
              type: integer
            seconds:
              type: integer
            source:
              enum: [recognized, analysis, none]
        cutaways:
          type: object
          description: Talking head only. Charged one by one when the video is rendered.
          properties:
            count:
              type: integer
            kind:
              enum: [image, video]
            credits:
              type: integer
            each:
              type: integer
        render:
          type: object
          properties:
            credits:
              type: integer
            seconds:
              type: number
            estimated:
              type: boolean
        music:
          type: object
          properties:
            credits:
              type: integer
        credits:
          type: integer
          description: Everything together, at most.
        notes:
          type: array
          items:
            type: string
    ClipVideo:
      type: object
      properties:
        object:
          const: clip_video
        tool:
          enum: [combine, talking_head]
        clips:
          type: array
          description: The part of each clip that is used (seconds in the file) and how many words were found in it.
          items:
            type: object
            properties:
              media_id:
                type: string
              start:
                type: number
              end:
                type: number
              words:
                type: integer
        seconds:
          type: number
        moments:
          type: array
          description: Talking head only.
          items:
            type: object
            properties:
              index:
                type: integer
              start:
                type: number
              duration:
                type: number
              kind:
                enum: [image, video]
              prompt:
                type: string
              said:
                type: string
                description: The words the cutaway goes over.
        picked_by:
          enum: [model, spread, given]
        transcript:
          type: object
          description: Talking head only. The sentences found, with their times in the clip.
        speech:
          description: What recognizing the words cost now, and where each clip's words came from.
          oneOf:
          - type: 'null'
          - type: object
            properties:
              credits:
                type: integer
              provider:
                type: string
              clips:
                type: array
                items:
                  type: object
                  properties:
                    media_id:
                      type: string
                    words:
                      type: integer
                    source:
                      enum: [recognized, analysis, none]
        price:
          type: object
          description: What rendering the saved video costs now (cutaways, music and the render), charged then.
        notes:
          type: array
          items:
            type: string
        video:
          $ref: '#/components/schemas/CampaignVideo'
    VideoReviewInput:
      type: object
      required:
      - media_id
      properties:
        media_id:
          type: string
          description: A video in the media library of this workspace.
        platform:
          type: string
          enum: [tiktok, instagram, youtube, facebook, linkedin, x, threads, any]
          default: any
          description: Where the video will be posted. Sets the suggested length.
        goal:
          type: string
          maxLength: 300
          description: Optional. What the video should achieve, in a few words. Only used by POST.
    VideoReviewQuote:
      type: object
      properties:
        object:
          type: string
          const: video_review_quote
        media_id:
          type: string
        platform:
          type: string
        credits:
          type: integer
          description: The whole price.
        analysis:
          type: object
          properties:
            credits:
              type: integer
            state:
              enum: [new, analysed, in_progress]
            seconds:
              type: number
        review:
          type: object
          properties:
            credits:
              type: integer
        summary:
          type: string
          description: 'For example "Analyse the video and review it: 10 credits".'
    VideoReviewScore:
      type: object
      properties:
        score:
          type: integer
          minimum: 0
          maximum: 100
        reason:
          type: string
    VideoReview:
      type: object
      properties:
        object:
          type: string
          const: video_review
        id:
          type: string
        media_id:
          type: string
        platform:
          type: string
        goal:
          type:
          - string
          - 'null'
        status:
          enum: [analysing, reviewing, done, failed]
        credits:
          type: object
          properties:
            analysis:
              type: integer
            review:
              type: integer
            refunded:
              type: integer
        analysis_id:
          type:
          - string
          - 'null'
          description: The media analysis this review asked for, when the video had not been analysed.
        review:
          description: Set when the review is done.
          oneOf:
          - type: 'null'
          - type: object
            properties:
              overall:
                type: integer
              summary:
                type: string
              scores:
                type: object
                properties:
                  hook:
                    $ref: '#/components/schemas/VideoReviewScore'
                  pacing:
                    $ref: '#/components/schemas/VideoReviewScore'
                  on_screen_text:
                    $ref: '#/components/schemas/VideoReviewScore'
                  audio:
                    $ref: '#/components/schemas/VideoReviewScore'
                  length:
                    $ref: '#/components/schemas/VideoReviewScore'
                  call_to_action:
                    $ref: '#/components/schemas/VideoReviewScore'
              fixes:
                type: array
                description: 3 to 7 fixes, most important first.
                items:
                  type: object
                  properties:
                    priority:
                      type: integer
                    title:
                      type: string
                    detail:
                      type: string
                    action:
                      enum: [add_captions, recut, write_caption, none]
                    apply:
                      type: object
                      description: The tool that carries the fix out (combine_clips, compose). Absent for none.
                      properties:
                        tool:
                          type: string
                        label:
                          type: string
              hook_line:
                type: string
                description: A new first line for the first 3 seconds.
              caption:
                type: string
        facts:
          description: What we measured ourselves (length, first words, shots, text on screen, suggested length).
          oneOf:
          - type: 'null'
          - type: object
        error:
          oneOf:
          - type: 'null'
          - type: object
            properties:
              code:
                type: string
              message:
                type: string
        created_at:
          type: string
          format: date-time
        finished_at:
          type:
          - string
          - 'null'
          format: date-time
    InspirationPost:
      type: object
      description: Only what the feed shows. The text is cut at 1000 characters.
      properties:
        network:
          type: string
          description: bluesky, mastodon, x or own.
        platform:
          type: string
          description: For your own posts, the network it was published on.
        id:
          type: string
          description: The network's own id of the post (an at:// URI, a status URI, a tweet id, or our target id).
        url:
          type:
          - string
          - 'null'
          description: The original post.
        author:
          type: object
          properties:
            handle:
              type: string
            name:
              type:
              - string
              - 'null'
            avatar:
              type:
              - string
              - 'null'
              description: Always null for outside posts; remote profile pictures are not passed on.
            followers:
              type:
              - integer
              - 'null'
            url:
              type:
              - string
              - 'null'
        text:
          type: string
        media:
          type: object
          properties:
            type:
              enum: [image, video, none]
            thumb:
              type:
              - string
              - 'null'
              description: A signed address on this API, valid for about an hour. The thumbnail is copied once when the
                result is cached (at most 300 kB); null when there is none or it could not be copied.
        counts:
          type: object
          description: null where the network does not give the number. Shares include quotes where the network counts them.
          properties:
            likes:
              type:
              - integer
              - 'null'
            comments:
              type:
              - integer
              - 'null'
            shares:
              type:
              - integer
              - 'null'
        published_at:
          type: string
          format: date-time
        language:
          type:
          - string
          - 'null'
    PromptInput:
      type: object
      description: For POST, title and instruction are required and kind defaults to text. For PATCH, send what changes.
      properties:
        title:
          type: string
          maxLength: 80
        description:
          type: string
          maxLength: 200
        instruction:
          type: string
          maxLength: 4000
          description: How the post or script is built. Tone and words come from the brand profile.
        kind:
          enum: [text, video_script]
    Prompt:
      type: object
      properties:
        object:
          type: string
          const: prompt
        id:
          type: string
          description: builtin_... for built in prompts, prm_... for the workspace's own.
        title:
          type: string
        description:
          type: string
        instruction:
          type: string
        kind:
          enum: [text, video_script]
        built_in:
          type: boolean
        created_at:
          type:
          - string
          - 'null'
          format: date-time
        updated_at:
          type:
          - string
          - 'null'
          format: date-time
    ContentPackOptions:
      type: object
      properties:
        object:
          type: string
          const: content_pack_options
        types:
          type: array
          items:
            type: object
            properties:
              id:
                type: string
              label:
                type: string
              about:
                type: string
        languages:
          type: array
          items:
            type: object
            properties:
              id:
                type: string
              label:
                type: string
        max_media:
          type: integer
        max_text:
          type: integer
    ContentPackInput:
      type: object
      required:
      - media_ids
      properties:
        media_ids:
          type: array
          minItems: 1
          maxItems: 40
          items:
            type: string
        text:
          type: string
          maxLength: 6000
          description: The text about it. Send text, url or both.
        url:
          type: string
          description: A public https page to read the text from (read with the bounded safe fetch).
        type:
          type: string
          enum:
          - auto
          - real_estate
          - product
          - restaurant
          - event
          - offer
          - general
          default: auto
        language:
          type: string
          description: auto (the default) follows the text, then the brand profile's language. Or sv, en, nb, da, fi, de, fr, es, nl, it, pl, pt.
        generated_images:
          type: boolean
          default: false
          description: Also make the product in a generated scene. Never for real estate.
        networks:
          type: array
          items:
            type: string
          description: Networks to write the post texts for. Default the connected accounts, else instagram, facebook and linkedin.
        start_date:
          type: string
          format: date
          description: The first day of the suggested schedule. Default tomorrow.
        analyse:
          type: boolean
          default: true
          description: Analyse photos that were never analysed before the pack is made (priced into the pack).
        dry_run:
          type: boolean
          default: false
    ContentPackItem:
      type: object
      properties:
        id:
          type: string
          description: video, reel, carousel, image_1 to image_3, scene_1.
        draft_id:
          type:
          - string
          - 'null'
        kind:
          type: string
          enum:
          - video
          - reel
          - carousel
          - image
          - scene_image
        title:
          type: string
        about:
          type: string
        aspect_ratio:
          type:
          - string
          - 'null'
        include:
          type: boolean
        status:
          type: string
          enum:
          - planned
          - left_out
          - waiting
          - making
          - done
          - failed
        credits:
          type: object
          properties:
            quoted:
              type: integer
            charged:
              type: integer
        date:
          type: string
          format: date
        texts:
          type: object
          additionalProperties:
            type: string
          description: The post text per network.
        media_ids:
          type: array
          items:
            type: string
          description: The person's photos the item uses.
        outputs:
          type: array
          items:
            type: string
          description: The media made (the video, or the slides in order).
        video_id:
          type:
          - string
          - 'null'
        render_id:
          type:
          - string
          - 'null'
        design_id:
          type:
          - string
          - 'null'
        error:
          type:
          - object
          - 'null'
          properties:
            code:
              type: string
            message:
              type: string
        draft:
          type: object
          properties:
            status:
              type: string
              enum:
              - draft
              - approved
              - dismissed
            post_id:
              type:
              - string
              - 'null'
        spec:
          type: object
          description: For a video or reel, the campaign video spec it is rendered from.
        design:
          type: object
          description: For slides and images, the design request it is made from.
    ContentPack:
      type: object
      properties:
        object:
          type: string
          const: content_pack
        id:
          type:
          - string
          - 'null'
        status:
          type: string
          enum:
          - proposed
          - analysing
          - making
          - done
          - partial
          - failed
        type:
          type: string
        type_label:
          type: string
        language:
          type: string
        language_label:
          type: string
        title:
          type: string
        facts:
          type: array
          description: The facts read from the text, as the pack writes them (3 450 000 kr, 4 rum och kök, Visning söndag 13-14).
          items:
            type: object
            properties:
              label:
                type: string
              value:
                type: string
        notes:
          type: array
          items:
            type: string
        networks:
          type: array
          items:
            type: string
        source:
          type: object
          properties:
            url:
              type:
              - string
              - 'null'
            media_ids:
              type: array
              items:
                type: string
        photos:
          type: object
          properties:
            used:
              type: array
              items:
                type: object
                properties:
                  id:
                    type: string
                  type:
                    type: string
                  role:
                    type: string
                  caption:
                    type: string
            dropped:
              type: array
              items:
                type: object
                properties:
                  id:
                    type: string
                  type:
                    type: string
                  role:
                    type: string
                  reason:
                    type: string
                    description: blurry, dark, duplicate or off_topic.
        price:
          type: object
          properties:
            credits:
              type: integer
              description: The whole pack with the items included now.
            analysis:
              type:
              - object
              - 'null'
              properties:
                credits:
                  type: integer
                media_ids:
                  type: array
                  items:
                    type: string
                summary:
                  type:
                  - string
                  - 'null'
            items:
              type: array
              items:
                type: object
                properties:
                  id:
                    type: string
                  kind:
                    type: string
                  credits:
                    type: integer
                  include:
                    type: boolean
        charged:
          type: integer
        progress:
          type: number
          minimum: 0
          maximum: 1
        items:
          type: array
          items:
            $ref: '#/components/schemas/ContentPackItem'
        error:
          type:
          - object
          - 'null'
        created_at:
          type: string
          format: date-time
        started_at:
          type:
          - string
          - 'null'
          format: date-time
        finished_at:
          type:
          - string
          - 'null'
          format: date-time
    ContentPackDraft:
      type: object
      properties:
        object:
          type: string
          const: content_pack_draft
        id:
          type: string
        pack_id:
          type: string
        pack_title:
          type: string
        item:
          type: string
        kind:
          type: string
        date:
          type: string
          format: date
        status:
          type: string
          enum:
          - draft
          - approved
          - dismissed
        ready:
          type: boolean
        making:
          type: boolean
        outputs:
          type: array
          items:
            type: string
        texts:
          type: object
          additionalProperties:
            type: string
        post_id:
          type:
          - string
          - 'null'
