openapi: 3.2.0 info: title: APImetrics Monitors API description: API for the APImetrics platform termsOfService: http://apimetrics.io/tos/ contact: name: APIContext Support url: https://apicontext.io/ email: support@apicontext.com license: name: Apache 2.0 url: https://www.apache.org/licenses/LICENSE-2.0.html version: v2026-09-02 tags: - name: Monitors description: 'List, read, and trigger monitors. This resource provides a unified view across all monitor types (API, Browser, MCP, etc.) for a project. Use the type-specific endpoints to create or update monitors.' paths: /api/3/monitors/: get: tags: - Monitors summary: List all Monitors for a project operationId: list-monitors security: - OAuth2: [] - ApiKey: [] parameters: - name: cursor in: query required: false schema: anyOf: - type: string - type: 'null' title: Cursor - name: limit in: query required: false schema: type: integer default: 25 title: Limit - name: apimetrics-project-id in: header required: false schema: anyOf: - type: string - type: 'null' title: Apimetrics-Project-Id responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/api3__monitors__router___ListResponse' examples: api_monitor: summary: Project monitor list value: meta: project_id: ahJzfmFwaW1ldHJpY3MtcHJvZHIKCxIEVXNlchhiAgI more: false data: - meta: monitor_type: api name: Check payments API tags: - payments domain: api.example.com content_type: application/json accept: application/json created: '2025-01-15T10:00:00Z' last_update: '2025-01-15T10:00:00Z' owner: ahJzfmFwaW1ldHJpY3MtcHJvZHILCxIEVXNlchhiAgI workspace: global request: method: GET url: https://api.example.com/v1/health parameters: [] headers: - key: Accept value: application/json id: ahJzfmFwaW1ldHJpY3MtcHJvZHIUCxIKVGVzdFNldHVwMhiAgICA '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /api/3/monitors/{monitor_id}: get: tags: - Monitors summary: Read a Monitor by ID operationId: get-monitor security: - OAuth2: [] - ApiKey: [] parameters: - name: monitor_id in: path required: true schema: type: string pattern: ^[A-Za-z0-9_-]+$ title: Monitor ID - name: apimetrics-project-id in: header required: false schema: anyOf: - type: string - type: 'null' title: Apimetrics-Project-Id responses: '200': description: Successful Response content: application/json: schema: anyOf: - $ref: '#/components/schemas/TestSetup2Repr' - $ref: '#/components/schemas/BrowserTestSetupRepr' - $ref: '#/components/schemas/McpTestSetupRepr' title: Response Get-Monitor examples: api: summary: API monitor value: meta: monitor_type: api name: Check payments API tags: - payments domain: api.example.com content_type: application/json accept: application/json created: '2025-01-15T10:00:00Z' last_update: '2025-01-15T10:00:00Z' owner: ahJzfmFwaW1ldHJpY3MtcHJvZHILCxIEVXNlchhiAgI workspace: global request: method: GET url: https://api.example.com/v1/health parameters: [] headers: - key: Accept value: application/json id: ahJzfmFwaW1ldHJpY3MtcHJvZHIUCxIKVGVzdFNldHVwMhiAgICA '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /api/3/monitors/{monitor_id}/run: post: tags: - Monitors summary: Trigger a Monitor to run now operationId: run-monitor security: - OAuth2: [] - ApiKey: [] parameters: - name: monitor_id in: path required: true schema: type: string pattern: ^[A-Za-z0-9_-]+$ title: Monitor ID - name: apimetrics-project-id in: header required: false schema: anyOf: - type: string - type: 'null' title: Apimetrics-Project-Id requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/RunMonitorRequest' examples: immediate: summary: Run the monitor immediately value: context: {} location_id: '' run_delay: 0 with_context: summary: Run with variable substitution context value: context: env: staging location_id: '' run_delay: 0 responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/CallRunPayload' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' components: schemas: _RequestRepr: properties: method: type: string title: Method url: type: string title: Url parameters: anyOf: - items: $ref: '#/components/schemas/_TestParameterRepr' type: array - type: 'null' title: Parameters headers: anyOf: - items: $ref: '#/components/schemas/_TestParameterRepr' type: array - type: 'null' title: Headers auth_id: anyOf: - type: string - type: 'null' title: Auth Id token_id: anyOf: - type: string - type: 'null' title: Token Id body: anyOf: - type: string - additionalProperties: true type: object - type: 'null' title: Body file_id: anyOf: - type: string - type: 'null' title: File Id type: object required: - method - url - parameters - headers - auth_id - token_id - body title: _RequestRepr McpReadResourceStepRepr: properties: timeout_ms: type: integer maximum: 120000.0 minimum: 0.0 title: Timeout Ms description: Step timeout (milliseconds) wait_ms: type: integer maximum: 120000.0 minimum: 0.0 title: Wait Ms description: Time to wait after finishing step (milliseconds) step_type: type: string const: read_resource title: Step Type default: read_resource resource_uri: type: string title: Resource Uri description: URI of the resource to read additionalProperties: false type: object required: - timeout_ms - wait_ms - resource_uri title: McpReadResourceStepRepr McpListResourceTemplatesStepRepr: properties: timeout_ms: type: integer maximum: 120000.0 minimum: 0.0 title: Timeout Ms description: Step timeout (milliseconds) wait_ms: type: integer maximum: 120000.0 minimum: 0.0 title: Wait Ms description: Time to wait after finishing step (milliseconds) step_type: type: string const: list_resource_templates title: Step Type default: list_resource_templates additionalProperties: false type: object required: - timeout_ms - wait_ms title: McpListResourceTemplatesStepRepr BrowserTestSetupRepr: properties: id: type: string title: Id meta: $ref: '#/components/schemas/models__browser_call___MetaRepr' setup: $ref: '#/components/schemas/models__browser_call___SetupRepr' type: object required: - id - meta - setup title: BrowserTestSetupRepr models__mcp_test_setup___MetaRepr: properties: monitor_type: type: string enum: - api - www - mcp title: Monitor Type default: mcp name: type: string title: Name description: Display name for the monitor description: anyOf: - type: string - type: 'null' title: Description description: Optional description for the monitor tags: items: type: string type: array title: Tags description: Tags to apply to the monitor for grouping or advanced features domain: type: string title: Domain description: Domain of the target URL for this monitor created: type: string format: date-time title: Created last_update: type: string format: date-time title: Last Update owner: type: string title: Owner workspace: type: string title: Workspace type: object required: - name - tags - domain - created - last_update - owner - workspace title: _MetaRepr models__browser_call___SetupRepr: properties: url: type: string title: Url description: Target URL for this monitor browser_types: items: type: string enum: - chromium - firefox - webkit - camoufox type: array title: Browser Types description: Browsers which this monitor is permitted to run on user_agent: anyOf: - type: string - type: 'null' title: User Agent description: User-Agent header value for the monitor type: object required: - url - browser_types title: _SetupRepr models__mcp_test_setup___SetupRepr: properties: url: type: string title: Url description: Target URL for this monitor overall_timeout_ms: type: integer maximum: 120000.0 minimum: 0.0 title: Overall Timeout Ms description: Session timeout for the monitor (milliseconds) steps: items: oneOf: - $ref: '#/components/schemas/McpListToolsStepRepr' - $ref: '#/components/schemas/McpCallToolStepRepr' - $ref: '#/components/schemas/McpListResourcesStepRepr' - $ref: '#/components/schemas/McpListResourceTemplatesStepRepr' - $ref: '#/components/schemas/McpReadResourceStepRepr' - $ref: '#/components/schemas/McpListPromptsStepRepr' - $ref: '#/components/schemas/McpGetPromptStepRepr' - $ref: '#/components/schemas/McpWaitStepRepr' discriminator: propertyName: step_type mapping: call_tool: '#/components/schemas/McpCallToolStepRepr' get_prompt: '#/components/schemas/McpGetPromptStepRepr' list_prompts: '#/components/schemas/McpListPromptsStepRepr' list_resource_templates: '#/components/schemas/McpListResourceTemplatesStepRepr' list_resources: '#/components/schemas/McpListResourcesStepRepr' list_tools: '#/components/schemas/McpListToolsStepRepr' read_resource: '#/components/schemas/McpReadResourceStepRepr' wait: '#/components/schemas/McpWaitStepRepr' type: array minItems: 1 title: Steps description: Steps to execute during MCP session auth_id: anyOf: - type: string - type: 'null' title: Auth Id description: Auth Settings to use with the monitor token_id: anyOf: - type: string - type: 'null' title: Token Id description: Auth Token to use with the monitor type: object required: - url - overall_timeout_ms - steps title: _SetupRepr api3__monitors__router___ListResponse: properties: meta: $ref: '#/components/schemas/api3__monitors__router___ListResponseMeta' data: items: anyOf: - $ref: '#/components/schemas/TestSetup2Repr' - $ref: '#/components/schemas/BrowserTestSetupRepr' - $ref: '#/components/schemas/McpTestSetupRepr' type: array title: Data type: object required: - meta - data title: _ListResponse McpWaitStepRepr: properties: timeout_ms: type: integer maximum: 120000.0 minimum: 0.0 title: Timeout Ms description: Step timeout (milliseconds) wait_ms: type: integer maximum: 120000.0 minimum: 0.0 title: Wait Ms description: Time to wait after finishing step (milliseconds) step_type: type: string const: wait title: Step Type default: wait additionalProperties: false type: object required: - timeout_ms - wait_ms title: McpWaitStepRepr TestSetup2Repr: properties: meta: $ref: '#/components/schemas/models__call___MetaRepr' request: $ref: '#/components/schemas/_RequestRepr' id: type: string title: Id type: object required: - meta - request - id title: TestSetup2Repr McpGetPromptStepRepr: properties: timeout_ms: type: integer maximum: 120000.0 minimum: 0.0 title: Timeout Ms description: Step timeout (milliseconds) wait_ms: type: integer maximum: 120000.0 minimum: 0.0 title: Wait Ms description: Time to wait after finishing step (milliseconds) step_type: type: string const: get_prompt title: Step Type default: get_prompt prompt_name: type: string title: Prompt Name description: Name of the prompt to get parameters: anyOf: - additionalProperties: true type: object - type: 'null' title: Parameters description: Arguments to provide to the prompt template additionalProperties: false type: object required: - timeout_ms - wait_ms - prompt_name title: McpGetPromptStepRepr McpCallToolStepRepr: properties: timeout_ms: type: integer maximum: 120000.0 minimum: 0.0 title: Timeout Ms description: Step timeout (milliseconds) wait_ms: type: integer maximum: 120000.0 minimum: 0.0 title: Wait Ms description: Time to wait after finishing step (milliseconds) step_type: type: string const: call_tool title: Step Type default: call_tool tool_name: type: string title: Tool Name description: Name of the tool to call parameters: anyOf: - additionalProperties: true type: object - type: 'null' title: Parameters description: Arguments to provide for the tool call additionalProperties: false type: object required: - timeout_ms - wait_ms - tool_name title: McpCallToolStepRepr RunMonitorRequest: properties: context: additionalProperties: type: string type: object title: Context default: {} location_id: type: string title: Location Id default: '' run_delay: type: integer title: Run Delay default: 0 type: object title: RunMonitorRequest models__call___MetaRepr: properties: monitor_type: type: string const: api title: Monitor Type default: api name: type: string title: Name description: anyOf: - type: string - type: 'null' title: Description tags: anyOf: - items: type: string type: array - type: 'null' title: Tags domain: type: string title: Domain content_type: anyOf: - type: string - type: 'null' title: Content Type accept: anyOf: - type: string - type: 'null' title: Accept created: type: string format: date-time title: Created last_update: type: string format: date-time title: Last Update owner: type: string title: Owner workspace: anyOf: - type: string - type: 'null' title: Workspace type: object required: - name - description - tags - domain - content_type - accept - created - last_update - owner - workspace title: _MetaRepr McpTestSetupRepr: properties: id: type: string title: Id meta: $ref: '#/components/schemas/models__mcp_test_setup___MetaRepr' setup: $ref: '#/components/schemas/models__mcp_test_setup___SetupRepr' type: object required: - id - meta - setup title: McpTestSetupRepr McpListResourcesStepRepr: properties: timeout_ms: type: integer maximum: 120000.0 minimum: 0.0 title: Timeout Ms description: Step timeout (milliseconds) wait_ms: type: integer maximum: 120000.0 minimum: 0.0 title: Wait Ms description: Time to wait after finishing step (milliseconds) step_type: type: string const: list_resources title: Step Type default: list_resources additionalProperties: false type: object required: - timeout_ms - wait_ms title: McpListResourcesStepRepr api3__monitors__router___ListResponseMeta: properties: project_id: type: string title: Project Id next_cursor: anyOf: - type: string - type: 'null' title: Next Cursor more: type: boolean title: More type: object required: - project_id - next_cursor - more title: _ListResponseMeta 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 CallRunPayload: properties: call_id: type: string title: Call Id location_id: type: string title: Location Id result_id: type: string title: Result Id context: additionalProperties: true type: object title: Context user: anyOf: - additionalProperties: true type: object - type: 'null' title: User type: object required: - call_id - location_id - result_id - context title: CallRunPayload _TestParameterRepr: properties: key: type: string title: Key value: type: string title: Value type: object required: - key - value title: _TestParameterRepr models__browser_call___MetaRepr: properties: monitor_type: type: string enum: - api - www - mcp title: Monitor Type default: www name: type: string title: Name description: Display name for the monitor description: anyOf: - type: string - type: 'null' title: Description description: Optional description for the monitor tags: items: type: string type: array title: Tags description: Tags to apply to the monitor for grouping or advanced features domain: type: string title: Domain description: Domain of the target URL for this monitor created: type: string format: date-time title: Created last_update: type: string format: date-time title: Last Update owner: type: string title: Owner workspace: type: string title: Workspace type: object required: - name - domain - created - last_update - owner - workspace title: _MetaRepr McpListPromptsStepRepr: properties: timeout_ms: type: integer maximum: 120000.0 minimum: 0.0 title: Timeout Ms description: Step timeout (milliseconds) wait_ms: type: integer maximum: 120000.0 minimum: 0.0 title: Wait Ms description: Time to wait after finishing step (milliseconds) step_type: type: string const: list_prompts title: Step Type default: list_prompts additionalProperties: false type: object required: - timeout_ms - wait_ms title: McpListPromptsStepRepr HTTPValidationError: properties: detail: items: $ref: '#/components/schemas/ValidationError' type: array title: Detail type: object title: HTTPValidationError McpListToolsStepRepr: properties: timeout_ms: type: integer maximum: 120000.0 minimum: 0.0 title: Timeout Ms description: Step timeout (milliseconds) wait_ms: type: integer maximum: 120000.0 minimum: 0.0 title: Wait Ms description: Time to wait after finishing step (milliseconds) step_type: type: string const: list_tools title: Step Type default: list_tools additionalProperties: false type: object required: - timeout_ms - wait_ms title: McpListToolsStepRepr securitySchemes: OAuth2: type: oauth2 flows: authorizationCode: scopes: openid: OpenID Connect identity profile: User profile email: User email address authorizationUrl: https://auth.apimetrics.io/authorize?audience=https://client.apimetrics.io tokenUrl: https://auth.apimetrics.io/oauth/token ApiKey: type: apiKey in: header name: X-Api-Key