{
  "openapi": "3.0.3",
  "info": {
    "title": "Statusfield REST API",
    "version": "2.0.0",
    "description": "Read-only workspace-scoped API. Available on Starter and higher plans, including eligible trials. Recorded vendor status is not a fresh probe or diagnosis. See https://statusfield.com/docs/api for limits and details."
  },
  "servers": [
    {
      "url": "https://statusfield.com"
    }
  ],
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "paths": {
    "/api/v2/services": {
      "get": {
        "summary": "Search the service catalog",
        "description": "Returns catalog metadata. Reading a service’s status requires an active workspace monitor.",
        "parameters": [
          {
            "name": "search",
            "in": "query",
            "required": false,
            "description": "Case-insensitive service name search.",
            "schema": {
              "type": "string",
              "maxLength": 100
            }
          },
          {
            "name": "category",
            "in": "query",
            "required": false,
            "description": "Category code.",
            "schema": {
              "type": "string",
              "maxLength": 100
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "Record ID returned as pagination.nextCursor.",
            "schema": {
              "type": "string",
              "pattern": "^[a-zA-Z0-9]{1,64}$"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Requested page size; values above 100 are capped.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data", "pagination"],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Service"
                      }
                    },
                    "pagination": {
                      "type": "object",
                      "required": ["nextCursor", "hasMore"],
                      "properties": {
                        "nextCursor": {
                          "type": "string",
                          "nullable": true
                        },
                        "hasMore": {
                          "type": "boolean"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Request, authentication, entitlement or quota error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Request, authentication, entitlement or quota error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Request, authentication, entitlement or quota error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Request, authentication, entitlement or quota error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Request, authentication, entitlement or quota error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Request, authentication, entitlement or quota error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v2/services/{slug}": {
      "get": {
        "summary": "Read a monitored service",
        "description": "Returns status and components only when the workspace actively monitors the service.",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "maxLength": 100
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "type": "object",
                      "allOf": [
                        {
                          "$ref": "#/components/schemas/Service"
                        },
                        {
                          "type": "object",
                          "required": ["statusCode", "status", "components"],
                          "properties": {
                            "statusCode": {
                              "type": "string"
                            },
                            "status": {
                              "type": "string"
                            },
                            "components": {
                              "type": "array",
                              "items": {
                                "$ref": "#/components/schemas/Component"
                              }
                            }
                          }
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Request, authentication, entitlement or quota error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Request, authentication, entitlement or quota error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Request, authentication, entitlement or quota error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Request, authentication, entitlement or quota error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Request, authentication, entitlement or quota error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Request, authentication, entitlement or quota error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Request, authentication, entitlement or quota error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v2/monitors": {
      "get": {
        "summary": "List workspace monitors",
        "description": "Lists monitors for the authenticated workspace.",
        "parameters": [
          {
            "name": "filter",
            "in": "query",
            "required": false,
            "description": "Use outages to return monitors in a non-operational state. Other values return the unfiltered list.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "id",
                          "createdAt",
                          "isCustom",
                          "type",
                          "expiresAt",
                          "service",
                          "component"
                        ],
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "createdAt": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "isCustom": {
                            "type": "boolean"
                          },
                          "type": {
                            "type": "string",
                            "description": "Monitor type: catalog, http, ssl, domain, heartbeat, manual, or custom."
                          },
                          "expiresAt": {
                            "type": "string",
                            "nullable": true
                          },
                          "service": {
                            "allOf": [
                              {
                                "$ref": "#/components/schemas/Service"
                              }
                            ],
                            "nullable": true
                          },
                          "component": {
                            "$ref": "#/components/schemas/Component"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Request, authentication, entitlement or quota error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Request, authentication, entitlement or quota error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Request, authentication, entitlement or quota error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Request, authentication, entitlement or quota error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Request, authentication, entitlement or quota error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Request, authentication, entitlement or quota error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v2/outages": {
      "get": {
        "summary": "List current vendor outages",
        "description": "Returns currently affected monitored catalog services, based on recorded root status.",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Requested maximum; values above 200 are capped.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 100
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "allOf": [
                          {
                            "$ref": "#/components/schemas/Service"
                          },
                          {
                            "type": "object",
                            "required": ["statusCode", "status", "updatedAt"],
                            "properties": {
                              "statusCode": {
                                "type": "string"
                              },
                              "status": {
                                "type": "string"
                              },
                              "updatedAt": {
                                "type": "string",
                                "format": "date-time"
                              }
                            }
                          }
                        ]
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Request, authentication, entitlement or quota error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Request, authentication, entitlement or quota error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Request, authentication, entitlement or quota error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Request, authentication, entitlement or quota error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Request, authentication, entitlement or quota error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Request, authentication, entitlement or quota error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v2/outages/history": {
      "get": {
        "summary": "Read vendor outage history",
        "description": "Returns recorded outage windows for monitored root components. The requested interval is capped to 30 days.",
        "parameters": [
          {
            "name": "from",
            "in": "query",
            "required": false,
            "description": "Start of the requested interval (ISO 8601).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "description": "End of the requested interval (ISO 8601).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "slug",
            "in": "query",
            "required": false,
            "description": "Filter to one monitored service slug.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data", "meta"],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "serviceSlug",
                          "serviceName",
                          "startedAt",
                          "startedBeforeWindow",
                          "resolvedAt",
                          "durationMinutes",
                          "statusCode",
                          "status"
                        ],
                        "properties": {
                          "serviceSlug": {
                            "type": "string"
                          },
                          "serviceName": {
                            "type": "string"
                          },
                          "startedAt": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "startedBeforeWindow": {
                            "type": "boolean"
                          },
                          "resolvedAt": {
                            "type": "string",
                            "nullable": true
                          },
                          "durationMinutes": {
                            "type": "number",
                            "nullable": true
                          },
                          "statusCode": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "meta": {
                      "type": "object",
                      "required": ["from", "to", "maxDays"],
                      "properties": {
                        "from": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "to": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "maxDays": {
                          "type": "integer"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Request, authentication, entitlement or quota error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Request, authentication, entitlement or quota error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Request, authentication, entitlement or quota error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Request, authentication, entitlement or quota error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Request, authentication, entitlement or quota error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Request, authentication, entitlement or quota error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "description": "Workspace API key (sf_…)."
      }
    },
    "schemas": {
      "Service": {
        "type": "object",
        "required": [
          "name",
          "slug",
          "categoryCode",
          "category",
          "iconUrl",
          "lastCheckedAt"
        ],
        "properties": {
          "name": {
            "type": "string"
          },
          "slug": {
            "type": "string"
          },
          "categoryCode": {
            "type": "string",
            "nullable": true
          },
          "category": {
            "type": "string",
            "nullable": true
          },
          "iconUrl": {
            "type": "string",
            "nullable": true
          },
          "lastCheckedAt": {
            "type": "string",
            "nullable": true
          }
        }
      },
      "Component": {
        "type": "object",
        "required": ["name", "statusCode", "status", "updatedAt"],
        "properties": {
          "name": {
            "type": "string"
          },
          "statusCode": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "Error": {
        "type": "object",
        "required": ["error", "message"],
        "properties": {
          "error": {
            "type": "string"
          },
          "message": {
            "type": "string"
          }
        },
        "additionalProperties": true
      }
    }
  }
}
