Shruwd Prompts API

The fixed questions asked of each engine every cycle.

GitHub OpenAPI

Operations 4

GET /brands/{brandId}/prompts List prompts #
POST /brands/{brandId}/prompts Add prompts #
PATCH /prompts/{promptGroupId} Edit a prompt #
DELETE /prompts/{promptGroupId} Deactivate a prompt #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/shruwd-io:shruwd-io-prompts-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

shruwd-io-prompts-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Shruwd Prompts API
  version: '1'
  summary: Measure how a brand appears in AI answers, diagnose why, and prove movement.
  description: 'Shruwd tracks how a brand and its competitors show up in AI-generated answers

    (Google AI Overviews, Google AI Mode, ChatGPT, Gemini and Perplexity), sets that beside first-party AI-crawler

    logs, diagnoses **why** the brand is or is not cited, and re-checks

    whether a fix moved anything.


    **Authentication.** `Authorization: Bearer sh_live_…`. Keys are minted in the

    dashboard and carry scopes: `read` (every GET), `write` (everything else), or

    `default` (both). A dashboard session works too.


    **Tenant.** A key works on the one workspace it was minted for. A dashboard

    session works on the workspace named by the `X-Shruwd-Workspace` header, else

    the caller''s own; a key ignores the header. Within it, the caller reaches the

    brands they have access to: every brand for the workspace''s owner, a

    member''s own brands otherwise. A brand, prompt, entity, suggestion or finding

    that belongs to another workspace, or to a brand the caller cannot reach, is a

    `404`, indistinguishable from one that does not exist.


    **Roles.** Access is per brand. The workspace''s owner has every brand, and

    alone creates and archives brands and handles billing. Everyone else is a

    member of specific brands with a role on each: `viewer`, `editor` or

    `admin`. A request is judged on the caller''s role on the brand it acts on:

    reads need `viewer`, writes `editor`, minting an ingest token `admin`. A key

    reaches its holder''s brands, as they change, and never exceeds their role on

    any of them. Refusals are `403 not_a_member` and `403 insufficient_role`.


    **Errors.** The body is always `{ code, message, retryable, details? }` with the

    HTTP status. `retryable: true` (429, 5xx) may be retried with backoff;

    `Retry-After` is set on 429.


    **Rate limits.** Per key, per minute: 120 GET, 30 for everything else.


    **Metrics.** Every metric is a `DisplayableMetric`: a point estimate with its

    95% interval and `n`, or `insufficient_data` when fewer than ten responses

    exist, or `undefined` when the denominator is zero. `insufficient_data` is

    **not** zero. Do not report it as a number.


    **Measurement is asynchronous.** Creating a brand or a cycle schedules work;

    results arrive over the following hours and are read from `visibility`,

    `crawlers` and `findings`.'
  contact:
    name: Shruwd
    url: https://shruwd.io
  x-logo:
    url: https://shruwd.io/android-chrome-192x192.png
servers:
- url: https://shruwd.io/api/v1
security:
- apiKey: []
tags:
- name: Prompts
  description: The fixed questions asked of each engine every cycle.
paths:
  /brands/{brandId}/prompts:
    parameters:
    - $ref: '#/components/parameters/brandId'
    get:
      operationId: listPrompts
      tags:
      - Prompts
      summary: List prompts
      description: 'Active prompts. With `engine`, each prompt carries its `coverage` over

        the window from the rollups. Per-prompt coverage is often below n = 10;

        the metric says `insufficient_data` rather than showing a number.

        With `engine=all`, each prompt carries `byEngine` instead: its coverage

        and autocorrect on every engine the plan measures, and `window.engines`

        lists them. There is no number across engines per prompt.'
      parameters:
      - name: includeInactive
        in: query
        schema:
          type: string
          enum:
          - '1'
        description: Also return deactivated prompts.
      - $ref: '#/components/parameters/engineOrAllOptional'
      - $ref: '#/components/parameters/from'
      - $ref: '#/components/parameters/to'
      responses:
        '200':
          description: Prompts.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PromptList'
        '404':
          $ref: '#/components/responses/NotFound'
        default:
          $ref: '#/components/responses/Error'
    post:
      operationId: addPrompts
      tags:
      - Prompts
      summary: Add prompts
      description: 'Batch, atomic. `intent` is required: it decides which diagnostic rules

        apply. Text is 1–500 characters (ChatGPT''s cap, the tightest engine''s).

        A duplicate of an active prompt is `409 duplicate_prompt`. If the batch

        would exceed the plan''s prompt allowance — one pool across every brand in

        the workspace, not a per-brand limit — nothing is created and

        `409 plan_limit` carries `limit`, `current` and `submitted`.'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AddPromptsRequest'
      responses:
        '201':
          description: Created.
          content:
            application/json:
              schema:
                type: object
                required:
                - prompts
                properties:
                  prompts:
                    type: array
                    items:
                      $ref: '#/components/schemas/Prompt'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          description: '`plan_limit` or `duplicate_prompt`.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: '`invalid_prompt`, `invalid_intent`, `invalid_tags`, `invalid_page` (not a URL, or not on the brand''s own domains: `details.domains`).'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        default:
          $ref: '#/components/responses/Error'
  /prompts/{promptGroupId}:
    parameters:
    - $ref: '#/components/parameters/promptGroupId'
    patch:
      operationId: updatePrompt
      tags:
      - Prompts
      summary: Edit a prompt
      description: 'A change to `text` or `intent` creates a new version under the same

        `promptGroupId` (new `promptId`, `version` incremented); runs already

        executed keep pointing at the version that produced them. `tags`,

        `active` and `page` change in place, and a new version keeps the page.

        Reactivating counts as a creation against the plan limit.


        `page` names the page on the brand''s own site that should answer the

        question. Findings about it name that page from the next measurement;

        with none set and none of the brand''s pages cited, a finding names no

        page (`recommendation.target` null). `null` clears it.'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PromptPatch'
      responses:
        '200':
          description: The current version.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Prompt'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          $ref: '#/components/responses/PlanLimit'
        '422':
          description: '`invalid_prompt`, `invalid_intent`, `invalid_tags`, `invalid_page` (not a URL, or not on the brand''s own domains: `details.domains`).'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        default:
          $ref: '#/components/responses/Error'
    delete:
      operationId: removePrompt
      tags:
      - Prompts
      summary: Deactivate a prompt
      description: Deactivates. Never deletes; the history it produced stays interpretable.
      responses:
        '200':
          description: Deactivated.
          content:
            application/json:
              schema:
                type: object
                required:
                - promptGroupId
                - active
                properties:
                  promptGroupId:
                    type: string
                  active:
                    type: boolean
                    const: false
        '404':
          $ref: '#/components/responses/NotFound'
        default:
          $ref: '#/components/responses/Error'
components:
  responses:
    NotFound:
      description: '`not_found`: no such resource in this workspace.'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    PlanLimit:
      description: '`plan_limit`: the plan does not allow this. `details` carries `limit` and `current`.'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Error:
      description: Every failure has this body.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  schemas:
    NewPrompt:
      type: object
      required:
      - text
      - intent
      properties:
        text:
          type: string
          minLength: 1
          maxLength: 500
          examples:
          - best project management software for small teams
        intent:
          $ref: '#/components/schemas/Intent'
        tags:
          type: array
          maxItems: 20
          items:
            type: string
            maxLength: 40
        page:
          type:
          - string
          - 'null'
          description: The page on the brand's own site that should answer this question. A full URL on one of the brand's own domains.
          examples:
          - https://example.com/pricing
    AddPromptsRequest:
      type: object
      required:
      - prompts
      properties:
        prompts:
          type: array
          minItems: 1
          items:
            $ref: '#/components/schemas/NewPrompt'
    DisplayableMetric:
      description: 'A metric that can be shown. Never a bare number: either a point

        estimate with its 95% interval and `n`, or an explicit reason there is

        no number. `insufficient_data` is **not** zero.

        '
      oneOf:
      - type: object
        required:
        - state
        - point
        - lo
        - hi
        - n
        properties:
          state:
            type: string
            const: ok
          point:
            type: number
            description: Proportion in [0, 1].
          lo:
            type: number
            description: Lower bound of the 95% interval.
          hi:
            type: number
            description: Upper bound of the 95% interval.
          n:
            type: integer
            description: Responses the estimate rests on.
      - type: object
        required:
        - state
        - n
        - needed
        properties:
          state:
            type: string
            const: insufficient_data
          n:
            type: integer
          needed:
            type: integer
            description: How many more responses would cross the floor of ten.
      - type: object
        required:
        - state
        - n
        - reason
        properties:
          state:
            type: string
            const: undefined
          n:
            type: integer
          reason:
            type: string
      discriminator:
        propertyName: state
    PromptAutocorrect:
      type: object
      required:
      - query
      - at
      properties:
        query:
          type: string
          description: The query the engine answered in place of the prompt.
        at:
          type: string
          format: date-time
          description: When that attempt ran.
    Prompt:
      type: object
      required:
      - promptGroupId
      - promptId
      - text
      - intent
      - tags
      - active
      - createdAt
      - version
      - page
      properties:
        promptGroupId:
          type: string
          description: Stable across edits. Use it for trends and for `PATCH`/`DELETE`.
        promptId:
          type: string
          description: The current version's id. Changes when text or intent is edited.
        text:
          type: string
        intent:
          $ref: '#/components/schemas/Intent'
        tags:
          type: array
          items:
            type: string
        active:
          type: boolean
        createdAt:
          type: string
          format: date-time
        version:
          type: integer
          minimum: 1
        page:
          type:
          - string
          - 'null'
          description: The page on the brand's own site that should answer this question, set by a person. Findings about it name this page. Null when none is set.
    Error:
      type: object
      required:
      - code
      - message
      - retryable
      properties:
        code:
          type: string
          description: Stable, machine-readable. E.g. `not_found`, `plan_limit`, `rate_limited`, `context_terms_required`.
        message:
          type: string
          description: For a person. May change between releases.
        retryable:
          type: boolean
          description: True when the same request may succeed later (429, 5xx).
        details:
          type: object
          additionalProperties: true
    PromptCoverage:
      type: object
      required:
      - promptGroupId
      - text
      - intent
      - nResponses
      - selfMentionCount
      - unbrandedCount
      - emptyCount
      - selfMentionRate
      properties:
        promptGroupId:
          type: string
        text:
          type: string
        intent:
          type: string
        nResponses:
          type: integer
        selfMentionCount:
          type: integer
        unbrandedCount:
          type: integer
          description: Responses that mentioned no tracked entity at all.
        emptyCount:
          type: integer
          description: Responses where the engine produced no AI answer.
        selfMentionRate:
          $ref: '#/components/schemas/DisplayableMetric'
    Intent:
      type: string
      enum:
      - informational
      - comparison
      - commercial
      - navigational
      - problem
      description: 'Why someone would ask the prompt. `informational` — learning about a

        topic. `comparison` — weighing named options. `commercial` — choosing

        what to buy. `navigational` — looking for a specific site or brand.

        `problem` — fixing something. The intent decides which diagnostic

        rules apply to the prompt''s results.

        '
    PromptPatch:
      type: object
      minProperties: 1
      properties:
        text:
          type: string
          minLength: 1
          maxLength: 500
        intent:
          $ref: '#/components/schemas/Intent'
        tags:
          type: array
          maxItems: 20
          items:
            type: string
            maxLength: 40
        active:
          type: boolean
        page:
          type:
          - string
          - 'null'
          description: The page on the brand's own site that should answer this question. Null clears it.
    PromptList:
      type: object
      required:
      - prompts
      - window
      properties:
        prompts:
          type: array
          items:
            allOf:
            - $ref: '#/components/schemas/Prompt'
            - type: object
              properties:
                coverage:
                  oneOf:
                  - $ref: '#/components/schemas/PromptCoverage'
                  - type: 'null'
                  description: Present only when `engine` was given.
                autocorrected:
                  oneOf:
                  - $ref: '#/components/schemas/PromptAutocorrect'
                  - type: 'null'
                  description: Present only when `engine` was given. Set when the latest attempt on that engine was answered for a different query (Google's autocorrect), so none of its answers there are counted.
                byEngine:
                  type: object
                  description: Present only with `engine=all`, in place of `coverage` and `autocorrected`, keyed by engine.
                  additionalProperties:
                    type: object
                    required:
                    - coverage
                    - autocorrected
                    properties:
                      coverage:
                        oneOf:
                        - $ref: '#/components/schemas/PromptCoverage'
                        - type: 'null'
                      autocorrected:
                        oneOf:
                        - $ref: '#/components/schemas/PromptAutocorrect'
                        - type: 'null'
        window:
          oneOf:
          - type: object
            required:
            - engine
            - from
            - to
            - historyFrom
            properties:
              engine:
                $ref: '#/components/schemas/EngineOrAll'
              engines:
                type: array
                items:
                  $ref: '#/components/schemas/Engine'
                description: With `engine=all`, the engines each prompt's `byEngine` covers.
              from:
                type: string
                format: date
              to:
                type: string
                format: date
              historyFrom:
                type:
                - string
                - 'null'
                format: date
          - type: 'null'
    EngineOrAll:
      description: 'An `Engine`, or `all`: every engine the plan measures in one read (visibility, visibility/series and prompts only).'
      oneOf:
      - $ref: '#/components/schemas/Engine'
      - type: string
        const: all
    Engine:
      type: string
      enum:
      - google_aio
      - google_ai_mode
      - chatgpt
      - gemini
      - perplexity
      description: '`google_aio` — Google AI Overviews. `google_ai_mode` — Google AI Mode, tracked since 2026-10-15. `chatgpt` — ChatGPT. `gemini` — Gemini, tracked since 2026-11-10. `perplexity` — Perplexity, asked through its Sonar API, tracked since 2026-11-11.'
  parameters:
    engineOrAllOptional:
      name: engine
      in: query
      schema:
        $ref: '#/components/schemas/EngineOrAll'
      description: When given, coverage over the window is attached to each prompt; `all` attaches every engine's under `byEngine`.
    to:
      name: to
      in: query
      schema:
        type: string
        format: date
      description: Last day, inclusive. Defaults to today (UTC).
    brandId:
      name: brandId
      in: path
      required: true
      schema:
        type: string
      description: The brand's id, or its `slug` — both name the same brand. Responses carry the id as `brandId`.
    from:
      name: from
      in: query
      schema:
        type: string
        format: date
      description: First day, inclusive. Defaults to 29 days before `to`. Clamped to the plan's history window.
    promptGroupId:
      name: promptGroupId
      in: path
      required: true
      schema:
        type: string
      description: The identity that survives edits. Not `promptId`.
  securitySchemes:
    apiKey:
      type: http
      scheme: bearer
      bearerFormat: sh_live_…
      description: An API key minted in the dashboard, or a dashboard session.