{
    "openapi": "3.0.3",
    "info": {
        "title": "GreenPay Status — Partner API",
        "version": "1.0.0",
        "description": "Monitoring for banks, wallets and payment services.\n\nWe never ask for credentials, database access or an inbound port: either your server sends us a heartbeat, or we poll one public health URL you publish.\n\nKeys look like `gp_live_sk_<id>_<secret>` and are sent as `Authorization: Bearer ...`. A `gp_sandbox_sk_...` key records everything but changes no state and sends no alert.",
        "contact": {
            "name": "Partner portal",
            "url": "https://greenpay.app/status/partners/"
        }
    },
    "servers": [
        {
            "url": "https://greenpay.app/status/api/v1"
        }
    ],
    "paths": {
        "/ping": {
            "get": {
                "summary": "Verify an API key and see what it may do",
                "description": "",
                "security": [
                    {
                        "bearerAuth": []
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Missing or invalid key"
                    },
                    "403": {
                        "description": "Revoked key, missing scope, or inactive organisation"
                    },
                    "429": {
                        "description": "Rate limited"
                    }
                }
            }
        },
        "/heartbeat": {
            "post": {
                "summary": "Send one heartbeat for one service",
                "description": "Requires the scope `heartbeat:write`.",
                "security": [
                    {
                        "bearerAuth": []
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Missing or invalid key"
                    },
                    "403": {
                        "description": "Revoked key, missing scope, or inactive organisation"
                    },
                    "429": {
                        "description": "Rate limited"
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object"
                            },
                            "example": {
                                "service": "mobile-app",
                                "status": "up",
                                "version": "2.4.1",
                                "latency_ms": 38
                            }
                        }
                    }
                }
            }
        },
        "/status": {
            "get": {
                "summary": "Current state of your services",
                "description": "Requires the scope `status:read`.",
                "security": [
                    {
                        "bearerAuth": []
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Missing or invalid key"
                    },
                    "403": {
                        "description": "Revoked key, missing scope, or inactive organisation"
                    },
                    "429": {
                        "description": "Rate limited"
                    }
                }
            }
        },
        "/uptime": {
            "get": {
                "summary": "Uptime of one service over N days (from the heartbeat log)",
                "description": "Requires the scope `status:read`.",
                "security": [
                    {
                        "bearerAuth": []
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Missing or invalid key"
                    },
                    "403": {
                        "description": "Revoked key, missing scope, or inactive organisation"
                    },
                    "429": {
                        "description": "Rate limited"
                    }
                },
                "parameters": [
                    {
                        "name": "service",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string"
                        },
                        "example": "mobile-app"
                    },
                    {
                        "name": "days",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string"
                        },
                        "example": "7"
                    }
                ]
            }
        },
        "/report": {
            "get": {
                "summary": "SLA report rebuilt from the state timeline, planned maintenance excluded",
                "description": "Requires the scope `status:read`.",
                "security": [
                    {
                        "bearerAuth": []
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Missing or invalid key"
                    },
                    "403": {
                        "description": "Revoked key, missing scope, or inactive organisation"
                    },
                    "429": {
                        "description": "Rate limited"
                    }
                },
                "parameters": [
                    {
                        "name": "days",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string"
                        },
                        "example": "30"
                    }
                ]
            }
        },
        "/maintenance": {
            "get": {
                "summary": "Your open maintenance windows",
                "description": "Requires the scope `status:read`.",
                "security": [
                    {
                        "bearerAuth": []
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Missing or invalid key"
                    },
                    "403": {
                        "description": "Revoked key, missing scope, or inactive organisation"
                    },
                    "429": {
                        "description": "Rate limited"
                    }
                }
            },
            "post": {
                "summary": "Schedule a maintenance window (nothing is flagged or announced inside it)",
                "description": "Requires the scope `maintenance:write`.",
                "security": [
                    {
                        "bearerAuth": []
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Missing or invalid key"
                    },
                    "403": {
                        "description": "Revoked key, missing scope, or inactive organisation"
                    },
                    "429": {
                        "description": "Rate limited"
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object"
                            },
                            "example": {
                                "service": "mobile-app",
                                "starts_at": 1758268800,
                                "ends_at": 1758276000,
                                "note": "upgrade"
                            }
                        }
                    }
                }
            }
        },
        "/incidents": {
            "get": {
                "summary": "Your incidents and their updates",
                "description": "Requires the scope `status:read`.",
                "security": [
                    {
                        "bearerAuth": []
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Missing or invalid key"
                    },
                    "403": {
                        "description": "Revoked key, missing scope, or inactive organisation"
                    },
                    "429": {
                        "description": "Rate limited"
                    }
                },
                "parameters": [
                    {
                        "name": "open",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string"
                        },
                        "example": "1"
                    }
                ]
            },
            "post": {
                "summary": "Open an incident in your own words",
                "description": "Requires the scope `incidents:write`.",
                "security": [
                    {
                        "bearerAuth": []
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Missing or invalid key"
                    },
                    "403": {
                        "description": "Revoked key, missing scope, or inactive organisation"
                    },
                    "429": {
                        "description": "Rate limited"
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object"
                            },
                            "example": {
                                "title": "بطء في التحويلات",
                                "severity": "major",
                                "service": "mobile-app",
                                "body": "نعمل على المشكلة",
                                "is_public": true
                            }
                        }
                    }
                }
            }
        },
        "/incidents/update": {
            "post": {
                "summary": "Post an update on an incident (state \"resolved\" closes it)",
                "description": "Requires the scope `incidents:write`.",
                "security": [
                    {
                        "bearerAuth": []
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Missing or invalid key"
                    },
                    "403": {
                        "description": "Revoked key, missing scope, or inactive organisation"
                    },
                    "429": {
                        "description": "Rate limited"
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object"
                            },
                            "example": {
                                "id": 12,
                                "state": "monitoring",
                                "body": "عاد النظام ونراقب"
                            }
                        }
                    }
                }
            }
        },
        "/probe-ips": {
            "get": {
                "summary": "Where our checks come from (public)",
                "description": "",
                "security": [],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Missing or invalid key"
                    },
                    "403": {
                        "description": "Revoked key, missing scope, or inactive organisation"
                    },
                    "429": {
                        "description": "Rate limited"
                    }
                }
            }
        }
    },
    "components": {
        "securitySchemes": {
            "bearerAuth": {
                "type": "http",
                "scheme": "bearer"
            }
        }
    }
}