> ## Documentation Index
> Fetch the complete documentation index at: https://docs.keenable.ai/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Keenable search and fetch work without an API key. To add them to code, use the official SDK for the project's language: https://docs.keenable.ai/sdks.md
> Read an API key from the KEENABLE_API_KEY environment variable. Never ask a user to paste a key into chat; send them to https://docs.keenable.ai/api-keys.md
> On 402 with an API key (code insufficient_credits), stop and ask a human to add credits; don't retry. On 429, wait the number of seconds in Retry-After, then retry.
> Every error, with its cause and fix: https://docs.keenable.ai/errors.md

# Run a monitor now

> Start a monitor run outside its schedule with POST /v1/monitors/{id}/trigger. The run returns queued; read it a few seconds later.

Start a run outside the schedule. The response is the run with `status` `queued`. Read it a few seconds later with [Get a run](https://docs.keenable.ai/api-reference/monitors/run.md), or wait for the `monitor.run.completed` event.


## OpenAPI

````yaml POST /v1/monitors/{id}/trigger
openapi: 3.0.3
info:
  title: Keenable API
  version: 1.0.0
  description: Web search, page fetching and monitors API.
servers:
  - url: https://api.keenable.ai
    description: Production
security:
  - apiKey: []
  - bearerAuth: []
paths:
  /v1/monitors/{id}/trigger:
    post:
      tags:
        - Monitors
      summary: Run a monitor now
      description: >-
        Start a run outside the schedule. The run comes back `queued`; read it
        with `GET /v1/monitors/{id}/runs/{run_id}` or wait for
        `monitor.run.completed`. Works in every status except `disabled`.
      operationId: monitors.trigger
      parameters:
        - $ref: '#/components/parameters/MonitorId'
      responses:
        '200':
          description: The queued run
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MonitorRun'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/MonitorForbidden'
        '404':
          $ref: '#/components/responses/MonitorNotFound'
        '409':
          description: >-
            The monitor is disabled (`request_rejected`). Set `status` to
            `active` first.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
        '429':
          $ref: '#/components/responses/MonitorRateLimited'
        '503':
          $ref: '#/components/responses/MonitorsUnavailable'
components:
  parameters:
    MonitorId:
      name: id
      in: path
      required: true
      schema:
        type: string
      description: The monitor's ID, such as `mon_3kq9z2c8f1a04b7d9e6f5a21`.
      example: mon_3kq9z2c8f1a04b7d9e6f5a21
  headers:
    XRequestId:
      description: ID of this request. Include it when you report a problem.
      schema:
        type: string
    RetryAfter:
      description: Seconds to wait before retrying.
      schema:
        type: integer
      example: 1
  schemas:
    MonitorRun:
      type: object
      required:
        - id
        - object
        - monitor_id
        - status
        - results
        - error
        - created_at
      properties:
        id:
          type: string
          example: mrun_7x1p4c9d2e8f0a3b5c6d7e8f
        object:
          type: string
          enum:
            - monitor_run
        monitor_id:
          type: string
        status:
          type: string
          enum:
            - queued
            - running
            - completed
            - failed
            - cancelled
          description: '`cancelled` is reserved and not used yet.'
        results:
          type: array
          items:
            $ref: '#/components/schemas/MonitorResult'
          nullable: true
          description: >-
            The pages found since the previous run and not returned by one
            before, most important first, at most `max_results`. `[]` when
            nothing is new, `null` until the run completes.
        output:
          type: object
          nullable: true
          description: >-
            With an `output_schema`, when the run found pages: `structured` (the
            summary in your schema), `text` and `grounding`.
          properties:
            structured:
              nullable: true
            text:
              type: string
              nullable: true
            grounding:
              type: array
              items:
                type: object
        error:
          type: object
          nullable: true
          description: Why a failed run failed.
          properties:
            code:
              type: string
            message:
              type: string
        changes:
          nullable: true
          description: 'Always `null`: not available yet.'
        usage:
          nullable: true
          description: 'Always `null`: monitors are free for now.'
        created_at:
          type: string
          format: date-time
          nullable: true
        started_at:
          type: string
          format: date-time
          nullable: true
        ended_at:
          type: string
          format: date-time
          nullable: true
    ApiError:
      type: object
      required:
        - error
      properties:
        error:
          type: string
          description: Short error title, such as `Invalid parameter` or `Not found`.
          example: Invalid parameter
        message:
          type: string
          description: What went wrong and what to change. Sometimes absent.
          example: '"max_results": must be an integer between 1 and 50'
        details:
          description: Structured details, when the error has any.
        retryAfter:
          type: integer
          description: >-
            Seconds to wait before retrying. Present on `429` responses from
            Keenable's own rate limits, matching the `Retry-After` header.
    MonitorResult:
      type: object
      description: A page the monitor accepted.
      required:
        - url
      properties:
        url:
          type: string
          example: https://huggingface.co/blog/example-model
        title:
          type: string
          nullable: true
        author:
          type: string
          nullable: true
          description: When the page names one. Always `null` in `monitor.hit` events.
        published_at:
          type: string
          format: date-time
          nullable: true
          description: >-
            When the page was published, as far as Keenable could establish it.
            A monitor doesn't send a page it couldn't date, so this is `null`
            only in rare cases, such as a changed page (one with `change`) that
            declares no date.
        published_at_source:
          type: string
          nullable: true
          description: >-
            Where `published_at` comes from: `declared` (the page's metadata),
            `url` (a date in the URL), `x` (the ID of an X post) or `text` (the
            page text). `url` and `text` dates are known to the day.
        acquired_at:
          type: string
          format: date-time
          nullable: true
          description: When Keenable's crawler fetched this version of the page.
        matched_at:
          type: string
          format: date-time
          nullable: true
          description: When the monitor accepted the page. Sort and deduplicate on it.
        image:
          type: string
          nullable: true
          description: The page's lead image. Always `null` in `monitor.hit` events.
        favicon:
          type: string
          nullable: true
          description: Always `null` for now.
        highlights:
          type: array
          items:
            type: string
          nullable: true
          description: Always `null` for now.
        summary:
          type: string
          nullable: true
          description: One line on what the page reports.
        importance:
          type: integer
          minimum: 1
          maximum: 5
          nullable: true
          description: >-
            How much the page matters for this monitor's topic, from 1 to 5.
            Pages under 3 aren't accepted.
        kind:
          type: string
          nullable: true
          description: >-
            `news`, `new_item` (a new release, listing or filing),
            `social_chatter` or `other`.
        source_type:
          type: string
          nullable: true
          description: >-
            `original` (the source or first-hand reporting) or `rewrite`
            (retells another outlet).
        score:
          type: number
          nullable: true
          description: >-
            A relevance score for ordering one monitor's pages. It isn't a
            probability and isn't capped at 1. Don't compare it across monitors.
        text:
          type: string
          description: The page text, with `search.content.text`. Left out after 3 days.
        change:
          $ref: '#/components/schemas/MonitorChange'
    MonitorChange:
      type: object
      description: On a page you already got that changed in substance.
      properties:
        previous_at:
          type: string
          nullable: true
          description: When the earlier version was matched.
        previous_title:
          type: string
          nullable: true
        previous_sent:
          type: boolean
          nullable: true
        ratio:
          type: number
          nullable: true
          description: How much of the text changed.
        added:
          nullable: true
          description: Text the new version added.
        removed:
          nullable: true
          description: Text the new version removed.
  responses:
    Unauthorized:
      description: >-
        No key was sent (`Missing authentication`), or the key is malformed,
        unknown or has the wrong prefix (`Authentication failed`, with
        `Malformed API key` or `Invalid API key` in `message`). Send a valid key
        in `X-API-Key` or `Authorization: Bearer`.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
    MonitorForbidden:
      description: >-
        Your key is valid but can't do this. `monitors_not_enabled`: Monitors is
        turned off for your organization; contact support@keenable.ai.
        `monitor_limit_reached`: your organization already has 100 active
        monitors; pause or delete one, then retry.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
    MonitorNotFound:
      description: >-
        No monitor or run with this ID belongs to your organization
        (`not_found`). Check the ID.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
    MonitorRateLimited:
      description: >-
        Your organization sent more than 120 Monitors requests, or more than 10
        creates, in the last minute (`rate_limited`). Wait, then retry.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
      headers:
        Retry-After:
          $ref: '#/components/headers/RetryAfter'
    MonitorsUnavailable:
      description: >-
        The Monitors service didn't answer (`monitors_unavailable`). The request
        may not have been applied. Retry after a few seconds; retry a create
        with the same `Idempotency-Key`.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
      headers:
        Retry-After:
          $ref: '#/components/headers/RetryAfter'
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: X-API-Key
      description: >-
        Your API key, such as `keen_...`. Create one in the Keenable console. If
        you send both this header and `Authorization`, the API uses this one.
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Your API key sent as `Authorization: Bearer keen_...`, for clients that
        only support bearer tokens.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.