openapi: 3.2.0 info: title: Latitude Monitors API version: v1 description: Open-source AI agent monitoring platform. Full observability into what's failing in production. Discover underlying issues, get alerts when something breaks and verify your fix worked. servers: - url: https://api.latitude.so description: Production servers: - url: https://api.latitude.so tags: - name: Monitors paths: /v1/projects/{projectSlug}/monitors: get: tags: - Monitors x-fern-sdk-group-name: monitors x-fern-sdk-method-name: list summary: List monitors description: Returns the project's monitors, system monitors first, then by most recent activity. security: - ApiKeyAuth: [] operationId: listMonitors parameters: - schema: type: string description: Project slug (human-readable identifier) required: true description: Project slug (human-readable identifier) name: projectSlug in: path - schema: type: string description: Opaque cursor returned in a previous response's `nextCursor`. Omit on the first page. required: false description: Opaque cursor returned in a previous response's `nextCursor`. Omit on the first page. name: cursor in: query - schema: type: integer minimum: 1 maximum: 100 default: 50 description: Page size. Defaults to 50; max 100. required: false description: Page size. Defaults to 50; max 100. name: limit in: query - schema: type: string description: Filter by name (case-insensitive substring). required: false description: Filter by name (case-insensitive substring). name: search in: query responses: '200': description: Page of monitors content: application/json: schema: $ref: '#/components/schemas/PaginatedMonitors' '400': description: Validation error content: application/json: schema: $ref: '#/components/schemas/Error' '401': description: Unauthorized content: application/json: schema: $ref: '#/components/schemas/Error' '404': description: Not found content: application/json: schema: $ref: '#/components/schemas/Error' post: tags: - Monitors x-fern-sdk-group-name: monitors x-fern-sdk-method-name: create summary: Create monitor description: Creates a monitor with one rule. The slug is derived from `name`. security: - ApiKeyAuth: [] operationId: createMonitor parameters: - schema: type: string description: Project slug (human-readable identifier) required: true description: Project slug (human-readable identifier) name: projectSlug in: path requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/CreateMonitorBody' responses: '201': description: Monitor created content: application/json: schema: $ref: '#/components/schemas/Monitor' '400': description: Validation error content: application/json: schema: $ref: '#/components/schemas/Error' '401': description: Unauthorized content: application/json: schema: $ref: '#/components/schemas/Error' '404': description: Not found content: application/json: schema: $ref: '#/components/schemas/Error' /v1/projects/{projectSlug}/monitors/for-target: post: tags: - Monitors x-fern-sdk-group-name: monitors x-fern-sdk-method-name: listForTarget summary: List monitors for target description: Returns live monitors matching the supplied target type and/or filter subset. security: - ApiKeyAuth: [] operationId: listMonitorsForTarget parameters: - schema: type: string description: Project slug (human-readable identifier) required: true description: Project slug (human-readable identifier) name: projectSlug in: path requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/ListMonitorsForTargetBody' responses: '200': description: Matching monitors content: application/json: schema: $ref: '#/components/schemas/MonitorList' '400': description: Validation error content: application/json: schema: $ref: '#/components/schemas/Error' '401': description: Unauthorized content: application/json: schema: $ref: '#/components/schemas/Error' '404': description: Not found content: application/json: schema: $ref: '#/components/schemas/Error' /v1/projects/{projectSlug}/monitors/{monitorSlug}: get: tags: - Monitors x-fern-sdk-group-name: monitors x-fern-sdk-method-name: get summary: Get monitor description: Returns a single monitor by slug. security: - ApiKeyAuth: [] operationId: getMonitor parameters: - schema: type: string description: Project slug (human-readable identifier) required: true description: Project slug (human-readable identifier) name: projectSlug in: path - schema: type: string description: Monitor slug (human-readable identifier within the project). required: true description: Monitor slug (human-readable identifier within the project). name: monitorSlug in: path responses: '200': description: Monitor content: application/json: schema: $ref: '#/components/schemas/Monitor' '400': description: Validation error content: application/json: schema: $ref: '#/components/schemas/Error' '401': description: Unauthorized content: application/json: schema: $ref: '#/components/schemas/Error' '404': description: Not found content: application/json: schema: $ref: '#/components/schemas/Error' patch: tags: - Monitors x-fern-sdk-group-name: monitors x-fern-sdk-method-name: update summary: Update monitor description: Updates a monitor's metadata and incident severity. Target, trigger, metric, and conditions are fixed after creation. System monitor edits are restricted. security: - ApiKeyAuth: [] operationId: updateMonitor parameters: - schema: type: string description: Project slug (human-readable identifier) required: true description: Project slug (human-readable identifier) name: projectSlug in: path - schema: type: string description: Monitor slug (human-readable identifier within the project). required: true description: Monitor slug (human-readable identifier within the project). name: monitorSlug in: path requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/UpdateMonitorBody' responses: '200': description: Updated monitor content: application/json: schema: $ref: '#/components/schemas/Monitor' '400': description: Validation error content: application/json: schema: $ref: '#/components/schemas/Error' '401': description: Unauthorized content: application/json: schema: $ref: '#/components/schemas/Error' '403': description: System monitors cannot be edited content: application/json: schema: $ref: '#/components/schemas/Error' '404': description: Not found content: application/json: schema: $ref: '#/components/schemas/Error' delete: tags: - Monitors x-fern-sdk-group-name: monitors x-fern-sdk-method-name: delete summary: Delete monitor description: Deletes a monitor. System monitors cannot be deleted. security: - ApiKeyAuth: [] operationId: deleteMonitor parameters: - schema: type: string description: Project slug (human-readable identifier) required: true description: Project slug (human-readable identifier) name: projectSlug in: path - schema: type: string description: Monitor slug (human-readable identifier within the project). required: true description: Monitor slug (human-readable identifier within the project). name: monitorSlug in: path responses: '204': description: Monitor deleted '401': description: Unauthorized content: application/json: schema: $ref: '#/components/schemas/Error' '404': description: Not found content: application/json: schema: $ref: '#/components/schemas/Error' /v1/projects/{projectSlug}/monitors/{monitorSlug}/incidents: get: tags: - Monitors x-fern-sdk-group-name: monitors x-fern-sdk-method-name: listIncidents summary: List monitor incidents description: Returns the incidents opened by a monitor, most recent first. Each item's `notified` flag shows whether it triggered a notification. security: - ApiKeyAuth: [] operationId: listMonitorIncidents parameters: - schema: type: string description: Project slug (human-readable identifier) required: true description: Project slug (human-readable identifier) name: projectSlug in: path - schema: type: string description: Monitor slug (human-readable identifier within the project). required: true description: Monitor slug (human-readable identifier within the project). name: monitorSlug in: path - schema: type: string description: Opaque cursor returned in a previous response's `nextCursor`. Omit on the first page. required: false description: Opaque cursor returned in a previous response's `nextCursor`. Omit on the first page. name: cursor in: query - schema: type: integer minimum: 1 maximum: 100 default: 50 description: Page size. Defaults to 50; max 100. required: false description: Page size. Defaults to 50; max 100. name: limit in: query responses: '200': description: Page of incidents content: application/json: schema: $ref: '#/components/schemas/PaginatedMonitorIncidents' '400': description: Validation error content: application/json: schema: $ref: '#/components/schemas/Error' '401': description: Unauthorized content: application/json: schema: $ref: '#/components/schemas/Error' '404': description: Not found content: application/json: schema: $ref: '#/components/schemas/Error' /v1/projects/{projectSlug}/monitors/{monitorSlug}/mute: post: tags: - Monitors x-fern-sdk-group-name: monitors x-fern-sdk-method-name: mute summary: Mute monitor description: Mutes a monitor so its incidents stop sending notifications. Allowed on all monitors. security: - ApiKeyAuth: [] operationId: muteMonitor parameters: - schema: type: string description: Project slug (human-readable identifier) required: true description: Project slug (human-readable identifier) name: projectSlug in: path - schema: type: string description: Monitor slug (human-readable identifier within the project). required: true description: Monitor slug (human-readable identifier within the project). name: monitorSlug in: path responses: '200': description: Muted monitor content: application/json: schema: $ref: '#/components/schemas/Monitor' '400': description: Validation error content: application/json: schema: $ref: '#/components/schemas/Error' '401': description: Unauthorized content: application/json: schema: $ref: '#/components/schemas/Error' '404': description: Not found content: application/json: schema: $ref: '#/components/schemas/Error' /v1/projects/{projectSlug}/monitors/{monitorSlug}/unmute: post: tags: - Monitors x-fern-sdk-group-name: monitors x-fern-sdk-method-name: unmute summary: Unmute monitor description: Lifts a monitor's mute so its incidents notify again. security: - ApiKeyAuth: [] operationId: unmuteMonitor parameters: - schema: type: string description: Project slug (human-readable identifier) required: true description: Project slug (human-readable identifier) name: projectSlug in: path - schema: type: string description: Monitor slug (human-readable identifier within the project). required: true description: Monitor slug (human-readable identifier within the project). name: monitorSlug in: path responses: '200': description: Unmuted monitor content: application/json: schema: $ref: '#/components/schemas/Monitor' '400': description: Validation error content: application/json: schema: $ref: '#/components/schemas/Error' '401': description: Unauthorized content: application/json: schema: $ref: '#/components/schemas/Error' '404': description: Not found content: application/json: schema: $ref: '#/components/schemas/Error' components: schemas: Error: type: object properties: error: type: string required: - error AlertBaseline: type: object properties: kind: type: string enum: - average - period description: How the comparison rate is computed. `average` is the rolling rate over the last `lookback`; `period` is the equal-length window immediately before it (e.g. `lookback` of 1 day compares against yesterday) for daily/weekly seasonality. lookback: $ref: '#/components/schemas/AlertDuration' required: - kind - lookback description: Fixed-window baseline the current rate is compared against. AlertThresholdCondition: type: object properties: trigger: type: string enum: - threshold description: Opens once the measured value crosses the threshold. metric: $ref: '#/components/schemas/MonitorMetric' threshold: $ref: '#/components/schemas/AlertMetricThreshold' direction: type: string enum: - above - below description: Direction that opens the incident. Defaults to `above` when omitted. required: - trigger - metric - threshold MonitorFilterSet: type: object additionalProperties: type: array items: $ref: '#/components/schemas/FilterCondition' description: Additional filters applied when evaluating the monitor. MonitorConfig: type: object properties: filterSet: allOf: - $ref: '#/components/schemas/MonitorFilterSet' - description: Filters applied by the monitor rule. query: type: string nullable: true description: Semantic query applied by inline monitor targets. metric: allOf: - $ref: '#/components/schemas/MonitorMetric' - description: Metric evaluated by threshold and escalating monitor rules. condition: $ref: '#/components/schemas/AlertCondition' description: Rule configuration used when the monitor is evaluated. Monitor: type: object properties: id: type: string minLength: 24 maxLength: 24 description: Stable monitor identifier. organizationId: type: string minLength: 24 maxLength: 24 description: Organization that owns this monitor. projectId: type: string minLength: 24 maxLength: 24 description: Project this monitor belongs to. slug: type: string description: URL-safe slug derived from `name`. Unique within the project. name: type: string description: Human-readable name. description: type: string description: Free-form description. Empty string when not set. system: type: boolean description: '`true` for auto-provisioned system monitors, which cannot be deleted or edited; `false` otherwise.' target: $ref: '#/components/schemas/MonitorTarget' rule: $ref: '#/components/schemas/MonitorRule' mutedAt: type: string nullable: true description: ISO-8601 timestamp at which the monitor was muted, or `null` when active. deletedAt: type: string nullable: true description: ISO-8601 timestamp at which the monitor was deleted, or `null`. createdAt: type: string description: ISO-8601 timestamp of creation. updatedAt: type: string description: ISO-8601 timestamp of the last update. required: - id - organizationId - projectId - slug - name - description - system - target - rule - mutedAt - deletedAt - createdAt - updatedAt AlertDuration: oneOf: - type: object properties: unit: type: string enum: - minutes description: The duration is expressed in whole minutes; read `minutes`. minutes: type: number minimum: 0 exclusiveMinimum: true description: Number of minutes. required: - unit - minutes - type: object properties: unit: type: string enum: - hours description: The duration is expressed in whole hours; read `hours`. hours: type: number minimum: 0 exclusiveMinimum: true description: Number of hours. required: - unit - hours - type: object properties: unit: type: string enum: - days description: The duration is expressed in whole days; read `days`. days: type: number minimum: 0 exclusiveMinimum: true description: Number of days. required: - unit - days description: Length of the window used to compute the baseline rate. CreateMonitorBody: oneOf: - type: object properties: name: type: string minLength: 1 maxLength: 128 description: Human-readable name. Used to derive the slug. description: type: string maxLength: 2000 description: Optional free-form description. target: allOf: - $ref: '#/components/schemas/MonitorTarget' - description: Entity or filter set watched by the monitor. severity: type: string enum: - low - medium - high - urgent description: Severity assigned to incidents opened by this monitor. trigger: type: string enum: - match description: Opens a point incident when any matching event appears. metric: allOf: - $ref: '#/components/schemas/MonitorMetric' - description: Metric stored for later rule edits. Match monitors evaluate counts. required: - name - target - severity - trigger additionalProperties: false - type: object properties: name: type: string minLength: 1 maxLength: 128 description: Human-readable name. Used to derive the slug. description: type: string maxLength: 2000 description: Optional free-form description. target: allOf: - $ref: '#/components/schemas/MonitorTarget' - description: Entity or filter set watched by the monitor. severity: type: string enum: - low - medium - high - urgent description: Severity assigned to incidents opened by this monitor. trigger: type: string enum: - threshold description: Opens a point incident when the condition is met. metric: allOf: - $ref: '#/components/schemas/MonitorMetric' - description: Metric evaluated by the monitor rule. condition: allOf: - $ref: '#/components/schemas/AlertThresholdCondition' - description: Threshold condition that opens point incidents. required: - name - target - severity - trigger - condition - type: object properties: name: type: string minLength: 1 maxLength: 128 description: Human-readable name. Used to derive the slug. description: type: string maxLength: 2000 description: Optional free-form description. target: allOf: - $ref: '#/components/schemas/MonitorTarget' - description: Entity or filter set watched by the monitor. severity: type: string enum: - low - medium - high - urgent description: Severity assigned to incidents opened by this monitor. trigger: type: string enum: - escalating description: Opens and closes a sustained incident while the condition is met. metric: allOf: - $ref: '#/components/schemas/MonitorMetric' - description: Metric evaluated by the monitor rule. condition: allOf: - $ref: '#/components/schemas/AlertEscalatingCondition' - description: Escalating condition that opens sustained incidents. required: - name - target - severity - trigger - condition AlertEscalatingCondition: type: object properties: trigger: type: string enum: - escalating description: Opens when the monitor target is escalating or sustained. metric: $ref: '#/components/schemas/MonitorMetric' threshold: allOf: - $ref: '#/components/schemas/AlertMetricThreshold' - description: How the metric is compared when threshold-based. direction: type: string enum: - above - below description: Direction that opens the incident. Defaults to `above` when omitted. sensitivity: type: integer minimum: 1 maximum: 6 description: Detector sensitivity from 1 (noisiest) to 6 (strictest). Defaults to 3 when omitted. window: type: object properties: minutes: type: integer minimum: 5 description: How long the threshold must stay crossed before the incident opens. Minimum 5. required: - minutes description: Sustained-condition window. required: - trigger - metric - window MonitorTarget: type: object properties: type: type: string enum: - savedSearch - tool - user - session description: 'Product target category: `savedSearch`, `tool`, `user`, or `session`.' id: type: string nullable: true minLength: 24 maxLength: 24 description: Target entity id, or `null` for project-wide targets. filterSet: $ref: '#/components/schemas/MonitorFilterSet' query: type: string nullable: true description: Semantic query applied when evaluating inline trace targets. kind: type: string enum: - savedSearch - tool - user - session description: Normalized target kind returned on persisted monitors. stream: type: string enum: - traces - spans - sessions description: Telemetry stream evaluated by the monitor. savedSearchId: type: string nullable: true minLength: 24 maxLength: 24 description: Saved-search id for saved-search monitors, or `null` for inline targets. metric: allOf: - $ref: '#/components/schemas/MonitorMetric' - description: Default metric evaluated for this target. required: - type - id description: Entity or filter set watched by this monitor. PaginatedMonitorIncidents: type: object properties: items: type: array items: $ref: '#/components/schemas/MonitorIncident' description: Page of items, in the requested sort order. nextCursor: type: string nullable: true description: Opaque cursor for fetching the next page. `null` when there are no more pages. Pass it back in `cursor` to continue. hasMore: type: boolean description: '`true` when there is at least one more page after this one.' required: - items - nextCursor - hasMore PaginatedMonitors: type: object properties: items: type: array items: $ref: '#/components/schemas/Monitor' description: Page of items, in the requested sort order. nextCursor: type: string nullable: true description: Opaque cursor for fetching the next page. `null` when there are no more pages. Pass it back in `cursor` to continue. hasMore: type: boolean description: '`true` when there is at least one more page after this one.' required: - items - nextCursor - hasMore MonitorRule: type: object properties: trigger: type: string enum: - match - threshold - escalating description: 'When the monitor opens incidents: `match`, `threshold`, or `escalating`.' config: $ref: '#/components/schemas/MonitorConfig' severity: type: string enum: - low - medium - high - urgent description: 'Severity of incidents this monitor opens: `low`, `medium`, `high`, or `urgent`.' required: - trigger - config - severity description: Single rule evaluated by this monitor. MonitorIncident: type: object properties: id: type: string minLength: 24 maxLength: 24 description: Stable incident identifier. organizationId: type: string minLength: 24 maxLength: 24 description: Organization that owns this incident. projectId: type: string minLength: 24 maxLength: 24 description: Project this incident belongs to. sourceType: type: string enum: - monitor - signal description: 'Kind of entity that triggered the incident: `signal` or `monitor`.' sourceId: type: string minLength: 24 maxLength: 24 description: Id of the entity that triggered the incident (matches `sourceType`). severity: type: string enum: - low - medium - high - urgent description: 'Severity bucket assigned to the incident: `low`, `medium`, `high`, or `urgent`.' startedAt: type: string description: ISO-8601 timestamp at which the incident opened. endedAt: type: string nullable: true description: ISO-8601 timestamp at which the incident closed, or `null` if still open. createdAt: type: string description: ISO-8601 timestamp at which the incident row was created. condition: anyOf: - $ref: '#/components/schemas/AlertThresholdCondition' - $ref: '#/components/schemas/AlertEscalatingCondition' - nullable: true description: The monitor rule configuration when the incident opened, or `null` for signal incidents and match monitors. notified: type: boolean description: '`true` when this incident triggered at least one notification.' required: - id - organizationId - projectId - sourceType - sourceId - severity - startedAt - endedAt - createdAt - condition - notified ListMonitorsForTargetBody: type: object properties: targetType: type: string enum: - savedSearch - tool - user - session description: Optional target type to match. filterSetContains: allOf: - $ref: '#/components/schemas/MonitorFilterSet' - description: Filter subset to match against monitor targets. For one user use `userId`; for one tool use `operation = execute_tool` and `toolName`. required: - filterSetContains AlertMetricThreshold: oneOf: - type: object properties: mode: type: string enum: - absolute description: Compare the metric against a fixed value; read `value`. value: type: number minimum: 0 exclusiveMinimum: true description: Metric value that opens the incident. required: - mode - value - type: object properties: mode: type: string enum: - multiplier description: Compare the metric rate against `factor × baseline`; read `factor` and `baseline`. factor: type: number minimum: 0 exclusiveMinimum: true description: Multiple of the baseline rate that opens the incident (e.g. `3` = 3×). baseline: $ref: '#/components/schemas/AlertBaseline' required: - mode - factor - baseline - type: object properties: mode: type: string enum: - expected description: Compare against the seasonally-learned expected value for this time of day/week. sensitivity: type: integer minimum: 1 maximum: 6 description: Detector sensitivity from 1 (noisiest) to 6 (strictest). Defaults to 3 when omitted. required: - mode description: How the metric is compared. FilterCondition: type: object properties: op: type: string enum: - eq - neq - gt - gte - lt - lte - in - notIn - contains - notContains - gtePercentile description: Comparison operator applied to the field's value (e.g. `eq`, `neq`, `in`). The full operator list lives in the API reference. value: anyOf: - type: string - type: number - type: boolean - type: array items: anyOf: - type: string - type: number description: Right-hand value compared against the field. Arrays are required for `in` / `notIn`-style operators. required: - op - value UpdateMonitorBody: type: object properties: name: type: string minLength: 1 maxLength: 128 description: New name. Renaming may regenerate the slug — re-read the response or rely on `id`. description: type: string maxLength: 2000 description: New description. severity: type: string enum: - low - medium - high - urgent description: Replacement incident severity. AlertCondition: oneOf: - $ref: '#/components/schemas/AlertThresholdCondition' - $ref: '#/components/schemas/AlertEscalatingCondition' discriminator: propertyName: trigger mapping: threshold: '#/components/schemas/AlertThresholdCondition' escalating: '#/components/schemas/AlertEscalatingCondition' description: Condition that controls threshold or escalating incidents. MonitorMetric: oneOf: - type: object properties: kind: type: string enum: - count description: Count matching events in each evaluation bucket. required: - kind - type: object properties: kind: type: string enum: - errorRate description: Measure the fraction of matching events that errored. required: - kind - type: object properties: kind: type: string enum: - cacheHitRate description: Token-weighted prompt-cache hit rate (cache-read tokens over total input-side tokens), a 0..1 fraction. required: - kind - type: object properties: kind: type: string enum: - avg description: Average a numeric field over matching events. field: type: string enum: - duration - cost - tokens description: Numeric field to aggregate. required: - kind - field - type: object properties: kind: type: string enum: - sum description: Sum a numeric field over matching events. field: type: string enum: - duration - cost - tokens description: Numeric field to aggregate. required: - kind - field - type: object properties: kind: type: string enum: - min description: Find the minimum numeric field value over matching events. field: type: string enum: - duration - cost - tokens description: Numeric field to aggregate. required: - kind - field - type: object properties: kind: type: string enum: - max description: Find the maximum numeric field value over matching events. field: type: string enum: - duration - cost - tokens description: Numeric field to aggregate. required: - kind - field - type: object properties: kind: type: string enum: - median description: Find the median numeric field value over matching events. field: type: string enum: - duration - cost - tokens description: Numeric field to aggregate. required: - kind - field description: Metric measured over the monitor target. MonitorList: type: object properties: items: type: array items: $ref: '#/components/schemas/Monitor' description: Matching monitors. required: - items securitySchemes: ApiKeyAuth: type: http scheme: bearer bearerFormat: API key description: 'Organization-scoped API key, sent as `Authorization: Bearer `.' x-fern-bearer: name: apiKey env: LATITUDE_API_KEY