{
    "info": {
        "name": "GreenPay Status — Partner API",
        "description": "Import, then set api_key to a key from https://greenpay.app/status/partners/ (start with a sandbox key).",
        "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
    },
    "item": [
        {
            "name": "GET /ping",
            "request": {
                "method": "GET",
                "header": [
                    {
                        "key": "Authorization",
                        "value": "Bearer {{api_key}}"
                    }
                ],
                "url": {
                    "raw": "{{base_url}}/ping",
                    "host": [
                        "{{base_url}}"
                    ],
                    "path": [
                        "ping"
                    ]
                },
                "description": "Verify an API key and see what it may do"
            }
        },
        {
            "name": "POST /heartbeat",
            "request": {
                "method": "POST",
                "header": [
                    {
                        "key": "Authorization",
                        "value": "Bearer {{api_key}}"
                    },
                    {
                        "key": "Content-Type",
                        "value": "application/json"
                    }
                ],
                "url": {
                    "raw": "{{base_url}}/heartbeat",
                    "host": [
                        "{{base_url}}"
                    ],
                    "path": [
                        "heartbeat"
                    ]
                },
                "description": "Send one heartbeat for one service (scope: heartbeat:write)",
                "body": {
                    "mode": "raw",
                    "raw": "{\n    \"service\": \"mobile-app\",\n    \"status\": \"up\",\n    \"version\": \"2.4.1\",\n    \"latency_ms\": 38\n}"
                }
            }
        },
        {
            "name": "GET /status",
            "request": {
                "method": "GET",
                "header": [
                    {
                        "key": "Authorization",
                        "value": "Bearer {{api_key}}"
                    }
                ],
                "url": {
                    "raw": "{{base_url}}/status",
                    "host": [
                        "{{base_url}}"
                    ],
                    "path": [
                        "status"
                    ]
                },
                "description": "Current state of your services (scope: status:read)"
            }
        },
        {
            "name": "GET /uptime",
            "request": {
                "method": "GET",
                "header": [
                    {
                        "key": "Authorization",
                        "value": "Bearer {{api_key}}"
                    }
                ],
                "url": {
                    "raw": "{{base_url}}/uptime?service=mobile-app&days=7",
                    "host": [
                        "{{base_url}}"
                    ],
                    "path": [
                        "uptime"
                    ],
                    "query": [
                        {
                            "key": "service",
                            "value": "mobile-app"
                        },
                        {
                            "key": "days",
                            "value": "7"
                        }
                    ]
                },
                "description": "Uptime of one service over N days (from the heartbeat log) (scope: status:read)"
            }
        },
        {
            "name": "GET /report",
            "request": {
                "method": "GET",
                "header": [
                    {
                        "key": "Authorization",
                        "value": "Bearer {{api_key}}"
                    }
                ],
                "url": {
                    "raw": "{{base_url}}/report?days=30",
                    "host": [
                        "{{base_url}}"
                    ],
                    "path": [
                        "report"
                    ],
                    "query": [
                        {
                            "key": "days",
                            "value": "30"
                        }
                    ]
                },
                "description": "SLA report rebuilt from the state timeline, planned maintenance excluded (scope: status:read)"
            }
        },
        {
            "name": "GET /maintenance",
            "request": {
                "method": "GET",
                "header": [
                    {
                        "key": "Authorization",
                        "value": "Bearer {{api_key}}"
                    }
                ],
                "url": {
                    "raw": "{{base_url}}/maintenance",
                    "host": [
                        "{{base_url}}"
                    ],
                    "path": [
                        "maintenance"
                    ]
                },
                "description": "Your open maintenance windows (scope: status:read)"
            }
        },
        {
            "name": "POST /maintenance",
            "request": {
                "method": "POST",
                "header": [
                    {
                        "key": "Authorization",
                        "value": "Bearer {{api_key}}"
                    },
                    {
                        "key": "Content-Type",
                        "value": "application/json"
                    }
                ],
                "url": {
                    "raw": "{{base_url}}/maintenance",
                    "host": [
                        "{{base_url}}"
                    ],
                    "path": [
                        "maintenance"
                    ]
                },
                "description": "Schedule a maintenance window (nothing is flagged or announced inside it) (scope: maintenance:write)",
                "body": {
                    "mode": "raw",
                    "raw": "{\n    \"service\": \"mobile-app\",\n    \"starts_at\": 1758268800,\n    \"ends_at\": 1758276000,\n    \"note\": \"upgrade\"\n}"
                }
            }
        },
        {
            "name": "GET /incidents",
            "request": {
                "method": "GET",
                "header": [
                    {
                        "key": "Authorization",
                        "value": "Bearer {{api_key}}"
                    }
                ],
                "url": {
                    "raw": "{{base_url}}/incidents?open=1",
                    "host": [
                        "{{base_url}}"
                    ],
                    "path": [
                        "incidents"
                    ],
                    "query": [
                        {
                            "key": "open",
                            "value": "1"
                        }
                    ]
                },
                "description": "Your incidents and their updates (scope: status:read)"
            }
        },
        {
            "name": "POST /incidents",
            "request": {
                "method": "POST",
                "header": [
                    {
                        "key": "Authorization",
                        "value": "Bearer {{api_key}}"
                    },
                    {
                        "key": "Content-Type",
                        "value": "application/json"
                    }
                ],
                "url": {
                    "raw": "{{base_url}}/incidents",
                    "host": [
                        "{{base_url}}"
                    ],
                    "path": [
                        "incidents"
                    ]
                },
                "description": "Open an incident in your own words (scope: incidents:write)",
                "body": {
                    "mode": "raw",
                    "raw": "{\n    \"title\": \"بطء في التحويلات\",\n    \"severity\": \"major\",\n    \"service\": \"mobile-app\",\n    \"body\": \"نعمل على المشكلة\",\n    \"is_public\": true\n}"
                }
            }
        },
        {
            "name": "POST /incidents/update",
            "request": {
                "method": "POST",
                "header": [
                    {
                        "key": "Authorization",
                        "value": "Bearer {{api_key}}"
                    },
                    {
                        "key": "Content-Type",
                        "value": "application/json"
                    }
                ],
                "url": {
                    "raw": "{{base_url}}/incidents/update",
                    "host": [
                        "{{base_url}}"
                    ],
                    "path": [
                        "incidents",
                        "update"
                    ]
                },
                "description": "Post an update on an incident (state \"resolved\" closes it) (scope: incidents:write)",
                "body": {
                    "mode": "raw",
                    "raw": "{\n    \"id\": 12,\n    \"state\": \"monitoring\",\n    \"body\": \"عاد النظام ونراقب\"\n}"
                }
            }
        },
        {
            "name": "GET /probe-ips",
            "request": {
                "method": "GET",
                "header": [],
                "url": {
                    "raw": "{{base_url}}/probe-ips",
                    "host": [
                        "{{base_url}}"
                    ],
                    "path": [
                        "probe-ips"
                    ]
                },
                "description": "Where our checks come from (public)"
            }
        }
    ],
    "variable": [
        {
            "key": "base_url",
            "value": "https://greenpay.app/status/api/v1"
        },
        {
            "key": "api_key",
            "value": "gp_sandbox_sk_xxx_yyy"
        }
    ]
}