{
  "openapi": "3.0.3",
  "info": {
    "title": "Push Notification API",
    "version": "3.0",
    "contact": {
      "email": "admin@vsee.com"
    },
    "description": "\n\n### Endpoint Types\n| Value | Meaning |\n|-------|---------|\n| 10 | Email |\n| 30 | Apple Push Notification (APNS) |\n| 40 | Google Cloud Messaging (GCM/FCM) |\n\nThis API is primarily for mobile app push notification registration."
  },
  "servers": [
    {
      "url": "https://api.vseepreview.com/api_v3",
      "description": "Staging"
    }
  ],
  "x-readme": {
    "explorer-enabled": false,
    "proxy-enabled": false,
    "samples-languages": [
      "curl",
      "python",
      "javascript",
      "java"
    ]
  },
  "paths": {
    "/endpoints": {
      "post": {
        "summary": "Register device endpoint",
        "description": "Register a new device for push notifications\n\nRegister a device for push notifications.\n\n**Parameters:**\n- `key` \u2014 Device token (for Apple) or registration ID (for Android)\n- `type` \u2014 30 for Apple Push Notification, 40 for Google Cloud Messaging",
        "tags": [
          "Push Notifications"
        ],
        "parameters": [
          {
            "name": "X-ApiToken",
            "in": "header",
            "description": "API token",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "your_api_token"
          }
        ],
        "requestBody": {
          "description": "Device registration details",
          "required": true,
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "properties": {
                  "key": {
                    "type": "string",
                    "description": "Device token (Apple) or registration ID (Android)"
                  },
                  "type": {
                    "type": "integer",
                    "description": "Device type: 30=APNS (Apple), 40=GCM (Google)"
                  }
                },
                "required": [
                  "key",
                  "type"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful registration",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "key": {
                          "type": "string"
                        },
                        "user_id": {
                          "type": "string"
                        },
                        "type": {
                          "type": "integer"
                        },
                        "created": {
                          "type": "integer"
                        },
                        "modified": {
                          "type": "integer"
                        }
                      }
                    }
                  }
                },
                "examples": {
                  "Device Registered": {
                    "value": {
                      "data": {
                        "id": "551c5f64-a6d8-425d-b89c-581fac1f0144",
                        "key": "123456",
                        "user_id": "201",
                        "type": 30,
                        "created": 1427922788,
                        "modified": 1427922788
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-auth-type": "user-token"
      },
      "get": {
        "summary": "List endpoints",
        "description": "Retrieve all notification endpoints for current user",
        "tags": [
          "Push Notifications"
        ],
        "parameters": [
          {
            "name": "X-ApiToken",
            "in": "header",
            "description": "API token",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "your_api_token"
          },
          {
            "name": "type",
            "in": "query",
            "description": "Device type: 30=APNS, 40=GCM. Empty for all types.",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "example": 30
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "key": {
                            "type": "string"
                          },
                          "user_id": {
                            "type": "string"
                          },
                          "type": {
                            "type": "integer"
                          },
                          "created": {
                            "type": "integer"
                          },
                          "modified": {
                            "type": "integer"
                          }
                        }
                      }
                    }
                  }
                },
                "examples": {
                  "Endpoints List": {
                    "value": {
                      "data": [
                        {
                          "id": "551c5f64-a6d8-425d-b89c-581fac1f0144",
                          "key": "123456",
                          "user_id": "201",
                          "type": 30,
                          "arn": "arn:aws:sns:us-west-2:048881245029:endpoint/APNS/com.vsee.isos.TeleAssistance/203fd06c-e559-3fba-a47f-87844eca4e6e",
                          "created": 1427922788,
                          "modified": 1427922788
                        },
                        {
                          "id": "551c6005-83d0-48f0-abfe-59c4ac1f0144",
                          "key": "an@vsee.com",
                          "user_id": "201",
                          "type": 10,
                          "created": 1427922949,
                          "modified": 1427922949
                        }
                      ]
                    }
                  }
                }
              }
            }
          }
        },
        "x-auth-type": "user-token"
      }
    },
    "/endpoints/{id}": {
      "get": {
        "summary": "Get endpoint",
        "description": "Retrieve a specific notification endpoint",
        "tags": [
          "Push Notifications"
        ],
        "parameters": [
          {
            "name": "X-ApiToken",
            "in": "header",
            "description": "API token",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "your_api_token"
          },
          {
            "name": "id",
            "in": "path",
            "description": "Endpoint ID",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "551c5f64-a6d8-425d-b89c-581fac1f0144"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "key": {
                          "type": "string"
                        },
                        "user_id": {
                          "type": "string"
                        },
                        "type": {
                          "type": "integer"
                        },
                        "created": {
                          "type": "integer"
                        },
                        "modified": {
                          "type": "integer"
                        }
                      }
                    }
                  }
                },
                "examples": {
                  "Endpoint": {
                    "value": {
                      "data": {
                        "id": "551c5f64-a6d8-425d-b89c-581fac1f0144",
                        "key": "123456",
                        "user_id": "201",
                        "type": 30,
                        "created": 1427922788,
                        "modified": 1427922788
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-auth-type": "user-token"
      },
      "delete": {
        "summary": "Delete endpoint",
        "description": "Delete a notification endpoint",
        "tags": [
          "Push Notifications"
        ],
        "parameters": [
          {
            "name": "X-ApiToken",
            "in": "header",
            "description": "API token",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "your_api_token"
          },
          {
            "name": "id",
            "in": "path",
            "description": "Endpoint ID",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "551c5f64-a6d8-425d-b89c-581fac1f0144"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful deletion",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object"
                    }
                  }
                },
                "examples": {
                  "Deleted": {
                    "value": {
                      "data": {
                        "id": "551c5f64-a6d8-425d-b89c-581fac1f0144"
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-auth-type": "user-token"
      }
    },
    "/notifications": {
      "get": {
        "summary": "List notifications",
        "description": "Retrieve notifications for current user",
        "tags": [
          "Push Notifications"
        ],
        "parameters": [
          {
            "name": "X-ApiToken",
            "in": "header",
            "description": "API token",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "your_api_token"
          },
          {
            "name": "size",
            "in": "query",
            "description": "Fetch size \u2014 how many records to return. Default: 10.",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "example": 10
          },
          {
            "name": "last",
            "in": "query",
            "description": "Unix timestamp in milliseconds. Only fetch notifications before this time. Use the `mtime` field from previous responses for pagination.",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "example": 1460616964000
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "user_id": {
                            "type": "string"
                          },
                          "type": {
                            "type": "string"
                          },
                          "time": {
                            "type": "string"
                          },
                          "mtime": {
                            "type": "integer"
                          },
                          "is_new": {
                            "type": "boolean"
                          },
                          "read": {
                            "type": "boolean"
                          },
                          "title": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                },
                "examples": {
                  "Notifications": {
                    "value": {
                      "data": [
                        {
                          "id": "570f3f04-f1f4-4805-946e-178d50e631f8",
                          "user_id": "201",
                          "type": "foodlog.comment",
                          "time": "1460616964",
                          "mtime": 14606169641000,
                          "is_new": false,
                          "read": false,
                          "title": "Johnathon Lavon commented on a photo",
                          "image": "http://api.vsee.me/files/index/food/photo/1/250x250?auth_code=EXAMPLE_AUTH_CODE"
                        }
                      ]
                    }
                  }
                }
              }
            }
          }
        },
        "x-auth-type": "user-token"
      }
    },
    "/notifications/{id}": {
      "put": {
        "summary": "Mark notification as read",
        "description": "Mark a notification as read",
        "tags": [
          "Push Notifications"
        ],
        "parameters": [
          {
            "name": "X-ApiToken",
            "in": "header",
            "description": "API token",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "your_api_token"
          },
          {
            "name": "id",
            "in": "path",
            "description": "Notification ID",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "570f3f04-f1f4-4805-946e-178d50e631f8"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful update",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "user_id": {
                          "type": "string"
                        },
                        "type": {
                          "type": "string"
                        },
                        "read": {
                          "type": "boolean"
                        },
                        "title": {
                          "type": "string"
                        }
                      }
                    }
                  }
                },
                "examples": {
                  "Marked Read": {
                    "value": {
                      "data": {
                        "id": "570f3f04-f1f4-4805-946e-178d50e631f8",
                        "user_id": "201",
                        "type": "foodlog.comment",
                        "time": 1460616964,
                        "mtime": 14606169641000,
                        "is_new": false,
                        "read": true,
                        "title": "Johnathon Lavon commented on a photo"
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-auth-type": "user-token"
      }
    },
    "/notifications/badge": {
      "get": {
        "summary": "Get badge count",
        "description": "Get the badge number for notifications",
        "tags": [
          "Push Notifications"
        ],
        "parameters": [
          {
            "name": "X-ApiToken",
            "in": "header",
            "description": "API token",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "your_api_token"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "integer"
                    }
                  }
                },
                "examples": {
                  "Badge Count": {
                    "value": {
                      "data": 5
                    }
                  }
                }
              }
            }
          }
        },
        "x-auth-type": "user-token"
      },
      "post": {
        "summary": "Reset badge count",
        "description": "Reset the badge number for notifications",
        "tags": [
          "Push Notifications"
        ],
        "parameters": [
          {
            "name": "X-ApiToken",
            "in": "header",
            "description": "API token",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "your_api_token"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful reset",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "boolean"
                    }
                  }
                },
                "examples": {
                  "Reset": {
                    "value": {
                      "data": true
                    }
                  }
                }
              }
            }
          }
        },
        "x-auth-type": "user-token"
      }
    }
  }
}