Optimly Internal API

The Internal API from Optimly — 11 operation(s) for internal.

GitHub OpenAPI

Operations 11

POST /internal/scheduler/run-schedules Scheduler Run Schedules #
POST /internal/scheduler/marketing-scan Scheduler Marketing Scan #
POST /internal/scheduler/sweep Scheduler Sweep #
GET /internal/digest/daily Digest Daily #
POST /internal/traffic/ingest Traffic Ingest #
POST /internal/reports/traffic-weekly Reports Traffic Weekly #
POST /internal/index/add-brand Index Add Brand #
POST /internal/index/remove-brand Index Remove Brand #
POST /internal/magic-id/rotate Magic Id Rotate #
POST /internal/magic-id/survey Magic Id Survey #
POST /internal/health Deploy Verification #

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/optimly-ai:optimly-ai-internal-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

optimly-ai-internal-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Optimly Internal API
  version: 0.1.0
tags:
- name: Internal
paths:
  /internal/scheduler/run-schedules:
    post:
      summary: Scheduler Run Schedules
      description: 'Hourly scan (minute 7): `run_schedules` where

        `enabled ∧ next_due_at <= now()` → enqueue `run.create {trigger:

        ''scheduled''}` (dedupe_key = run.create:{brand_id}:{iso-week}) and advance

        `next_due_at` exactly 7 days.'
      operationId: scheduler_run_schedules_internal_scheduler_run_schedules_post
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                additionalProperties: true
                type: object
                title: Response Scheduler Run Schedules Internal Scheduler Run Schedules Post
      tags:
      - Internal
  /internal/scheduler/marketing-scan:
    post:
      summary: Scheduler Marketing Scan
      description: 'Bounded marketing scan. Marketing must be explicitly enabled; the scan

        itself only reserves and enqueues, and the worker re-checks consent.'
      operationId: scheduler_marketing_scan_internal_scheduler_marketing_scan_post
      parameters:
      - name: after
        in: query
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: After
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
                title: Response Scheduler Marketing Scan Internal Scheduler Marketing Scan Post
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      tags:
      - Internal
  /internal/scheduler/sweep:
    post:
      summary: Scheduler Sweep
      description: 'Expired-lease recovery + dead-task revival + stale-run reaping

        (+ ) + the retention purge — the safety net

        every 15 minutes.'
      operationId: scheduler_sweep_internal_scheduler_sweep_post
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                additionalProperties: true
                type: object
                title: Response Scheduler Sweep Internal Scheduler Sweep Post
      tags:
      - Internal
  /internal/digest/daily:
    get:
      summary: Digest Daily
      description: 'The daily digest → email to `OPS_NOTIFY_EMAILS` (`spec/10` §4).


        Builds from DB-queryable signals and **enqueues** one `email.send` per ops

        recipient rather than sending anything itself: the api holds no Resend

        credentials, and delivery is the worker''s job, with the queue''s retries and

        the `email_sends` log behind it (`spec/01` §4.2).


        The work item is keyed by the UTC date, so a second run on the same day

        queues nothing — "was the digest already sent today?" is a read of

        `email_sends`, not a stored counter (`spec/02` §8.6).


        Always 200, including when the recipient list is unconfigured (then

        `queued: 0`): a non-2xx would make the scheduler retry and the digest is

        display-only anyway — the DB stays the system of record.'
      operationId: digest_daily_internal_digest_daily_get
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                additionalProperties: true
                type: object
                title: Response Digest Daily Internal Digest Daily Get
      tags:
      - Internal
  /internal/traffic/ingest:
    post:
      summary: Traffic Ingest
      description: 'Daily traffic ingest (`spec/10` §3).


        Defaults to the previous complete UTC day; the scheduler runs it at 00:20.

        A 5xx is deliberate: the scheduler retries, and the `traffic_ingest_failed`

        log line is what the alert watches.'
      operationId: traffic_ingest_internal_traffic_ingest_post
      parameters:
      - name: day
        in: query
        required: false
        schema:
          anyOf:
          - type: string
            format: date
          - type: 'null'
          title: Day
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
                title: Response Traffic Ingest Internal Traffic Ingest Post
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      tags:
      - Internal
  /internal/reports/traffic-weekly:
    post:
      summary: Reports Traffic Weekly
      description: 'Weekly traffic report → `digest_ops` email with its own subject.


        Reusing the digest template avoids a fourth template key; the section and

        the subject carry the weekly framing.'
      operationId: reports_traffic_weekly_internal_reports_traffic_weekly_post
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                additionalProperties: true
                type: object
                title: Response Reports Traffic Weekly Internal Reports Traffic Weekly Post
      tags:
      - Internal
  /internal/index/add-brand:
    post:
      summary: Index Add Brand
      description: 'Ops add-a-brand: the public form is

        gone — unclaimed brands come from migration + ops only. Creates the

        unclaimed brand + slug + profile shell and enqueues the one

        `index.profile.refresh` (no measurement runs). No duplicate check (round

        19): a URL another brand holds still creates a row — the slug

        disambiguates; digest + ops delete are the backstop.'
      operationId: index_add_brand_internal_index_add_brand_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/IndexAddBrandRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                additionalProperties: true
                type: object
                title: Response Index Add Brand Internal Index Add Brand Post
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      tags:
      - Internal
  /internal/index/remove-brand:
    post:
      summary: Index Remove Brand
      description: 'Ops remove-a-brand: the hard delete (`spec/202610-brandindex-cleanup-

        proposal.md` §4) — the row and its dependents go, no tombstone, the slug

        is freed. Claimed brands refuse without `force` (409, like every

        report/DB drift refusal). The full export — every row needed to

        re-insert — rides back in the response: it is the only rollback (no

        restore tooling), so the invoker must persist it with the call''s audit

        record.'
      operationId: index_remove_brand_internal_index_remove_brand_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/IndexRemoveBrandRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                additionalProperties: true
                type: object
                title: Response Index Remove Brand Internal Index Remove Brand Post
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      tags:
      - Internal
  /internal/magic-id/rotate:
    post:
      summary: Magic Id Rotate
      description: Enqueue the daily token rotation (scheduler, 00:05 UTC).
      operationId: magic_id_rotate_internal_magic_id_rotate_post
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                additionalProperties: true
                type: object
                title: Response Magic Id Rotate Internal Magic Id Rotate Post
      tags:
      - Internal
  /internal/magic-id/survey:
    post:
      summary: Magic Id Survey
      description: Enqueue the daily grounded survey (scheduler, 12:00 UTC).
      operationId: magic_id_survey_internal_magic_id_survey_post
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                additionalProperties: true
                type: object
                title: Response Magic Id Survey Internal Magic Id Survey Post
      tags:
      - Internal
  /internal/health:
    post:
      summary: Deploy Verification
      description: Deploy verification endpoint.
      operationId: deploy_verification_internal_health_post
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                additionalProperties: true
                type: object
                title: Response Deploy Verification Internal Health Post
      tags:
      - Internal
components:
  schemas:
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
            - type: string
            - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
      - loc
      - msg
      - type
      title: ValidationError
    IndexRemoveBrandRequest:
      properties:
        brand_id:
          type: string
          format: uuid
          title: Brand Id
        force:
          type: boolean
          title: Force
          default: false
      type: object
      required:
      - brand_id
      title: IndexRemoveBrandRequest
      description: The ops remove body — IAM-invoker only, so plain required fields.
    IndexAddBrandRequest:
      properties:
        name:
          type: string
          title: Name
        website_url:
          type: string
          title: Website Url
      type: object
      required:
      - name
      - website_url
      title: IndexAddBrandRequest
      description: The ops add body — IAM-invoker only, so plain required fields.