{
  "openapi": "3.1.0",
  "x-mcp": {
    "enabled": true
  },
  "info": {
    "title": "Dialect Alerts V2 API",
    "description": "Notification infrastructure for real-time alert delivery through multiple channels including in-app notifications, email, push notifications, and Telegram.",
    "version": "2.2.0-beta"
  },
  "servers": [
    {
      "url": "https://alerts-api.dial.to",
      "description": "Dialect Production"
    },
    {
      "url": "https://alerts.dialectapi.to",
      "description": "Dialect Production"
    }
  ],
  "paths": {
    "/v2/{appId}/send": {
      "post": {
        "operationId": "sendAlert",
        "summary": "Send Alert",
        "description": "Send alert to one subscriber, multiple subscribers, or all with rich content support including images, actions, and custom data",
        "tags": [
          "Send Alerts"
        ],
        "parameters": [
          {
            "name": "appId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "description": "Application ID",
              "example": "255d6163-7e25-43e9-a188-c2f8d0980a4a"
            }
          }
        ],
        "responses": {
          "202": {
            "description": "Message sent successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Request validation error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          }
        },
        "security": [
          {
            "application": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "channels": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "enum": [
                        "PUSH",
                        "IN_APP",
                        "EMAIL",
                        "TELEGRAM"
                      ]
                    },
                    "minItems": 1
                  },
                  "message": {
                    "type": "object",
                    "properties": {
                      "title": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 60,
                        "description": "Alert title",
                        "example": "Alert Title"
                      },
                      "body": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 500,
                        "description": "Alert body",
                        "example": "Alert body"
                      },
                      "image": {
                        "type": "string",
                        "format": "uri",
                        "minLength": 1,
                        "maxLength": 300,
                        "description": "Public URL of the image to be displayed in the alert. Only jpg, png, and webp formats are supported.",
                        "example": "https://dialect-file-storage.s3.us-west-2.amazonaws.com/avatars/dialect-logo.png"
                      },
                      "actions": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "type": {
                              "type": "string",
                              "const": "link"
                            },
                            "label": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 30
                            },
                            "url": {
                              "type": "string",
                              "format": "uri",
                              "minLength": 1,
                              "maxLength": 300
                            }
                          },
                          "required": [
                            "type",
                            "label",
                            "url"
                          ]
                        },
                        "maxItems": 3,
                        "description": "Alert actions",
                        "example": [
                          {
                            "type": "link",
                            "label": "Open Link",
                            "url": "https://dialect.to"
                          }
                        ]
                      }
                    },
                    "required": [
                      "title",
                      "body"
                    ]
                  },
                  "topicId": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "format": "uuid",
                    "description": "Optional topic ID to categorize the alert. Must be created in advance and belong to the authenticated app. If absent, the alert is uncategorized. If invalid or unauthorized, the request will fail."
                  },
                  "data": {
                    "type": "object",
                    "propertyNames": {
                      "type": "string",
                      "pattern": "^[a-zA-Z0-9_-]+$",
                      "minLength": 1,
                      "maxLength": 64
                    },
                    "additionalProperties": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 500
                    },
                    "description": "Additional data to be sent with the alert. For push notifications, this data will be available in the notification payload and can be used by the app to handle the notification. Common use cases include deep linking, custom actions, or passing context to the app.",
                    "example": {
                      "type": "transaction",
                      "transactionId": "123",
                      "amount": "100"
                    }
                  },
                  "push": {
                    "type": "object",
                    "properties": {
                      "showNotification": {
                        "type": "boolean",
                        "default": true,
                        "description": "Whether to show the notification. When false, the notification will be delivered silently without showing any UI notification."
                      },
                      "playNotificationSound": {
                        "type": "boolean",
                        "default": true,
                        "description": "Whether to play notification sound. When false, the notification will be delivered without sound on iOS and best-effort on Android."
                      }
                    },
                    "description": "Push notification specific configuration.",
                    "default": {}
                  },
                  "recipient": {
                    "anyOf": [
                      {
                        "type": "object",
                        "properties": {
                          "type": {
                            "type": "string",
                            "const": "subscriber"
                          },
                          "walletAddress": {
                            "type": "string",
                            "description": "User wallet address",
                            "example": "6CxnSjtasq5Tzwb4b93AhLofXtiDvMpQ2vTkWdSZqTH7"
                          }
                        },
                        "required": [
                          "type",
                          "walletAddress"
                        ],
                        "example": {
                          "type": "subscriber",
                          "walletAddress": "6CxnSjtasq5Tzwb4b93AhLofXtiDvMpQ2vTkWdSZqTH7"
                        }
                      },
                      {
                        "type": "object",
                        "properties": {
                          "type": {
                            "type": "string",
                            "const": "subscribers"
                          },
                          "walletAddresses": {
                            "type": "array",
                            "items": {
                              "type": "string",
                              "description": "User wallet address",
                              "example": "6CxnSjtasq5Tzwb4b93AhLofXtiDvMpQ2vTkWdSZqTH7"
                            },
                            "minItems": 1,
                            "maxItems": 10000
                          }
                        },
                        "required": [
                          "type",
                          "walletAddresses"
                        ],
                        "example": {
                          "type": "subscribers",
                          "walletAddresses": [
                            "6CxnSjtasq5Tzwb4b93AhLofXtiDvMpQ2vTkWdSZqTH7",
                            "7CxnSjtasq5Tzwb4b93AhLofXtiDvMpQ2vTkWdSZqTH8"
                          ]
                        }
                      },
                      {
                        "type": "object",
                        "properties": {
                          "type": {
                            "type": "string",
                            "const": "all-subscribers"
                          }
                        },
                        "required": [
                          "type"
                        ],
                        "example": {
                          "type": "all-subscribers"
                        }
                      }
                    ]
                  }
                },
                "required": [
                  "channels",
                  "message",
                  "recipient"
                ]
              }
            }
          }
        }
      }
    },
    "/v2/{appId}/send-batch": {
      "post": {
        "operationId": "sendBatchAlerts",
        "summary": "Send Batch Alerts",
        "description": "Send multiple alerts in a single request for improved performance with up to 500 alerts per batch",
        "tags": [
          "Send Alerts"
        ],
        "parameters": [
          {
            "name": "appId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "description": "Application ID",
              "example": "255d6163-7e25-43e9-a188-c2f8d0980a4a"
            }
          }
        ],
        "responses": {
          "202": {
            "description": "Batch messages sent successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Request validation error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          }
        },
        "security": [
          {
            "application": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "alerts": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "channels": {
                          "type": "array",
                          "items": {
                            "type": "string",
                            "enum": [
                              "PUSH",
                              "IN_APP",
                              "EMAIL",
                              "TELEGRAM"
                            ]
                          },
                          "minItems": 1
                        },
                        "message": {
                          "type": "object",
                          "properties": {
                            "title": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 60,
                              "description": "Alert title",
                              "example": "Alert Title"
                            },
                            "body": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 500,
                              "description": "Alert body",
                              "example": "Alert body"
                            },
                            "image": {
                              "type": "string",
                              "format": "uri",
                              "minLength": 1,
                              "maxLength": 300,
                              "description": "Public URL of the image to be displayed in the alert. Only jpg, png, and webp formats are supported.",
                              "example": "https://dialect-file-storage.s3.us-west-2.amazonaws.com/avatars/dialect-logo.png"
                            },
                            "actions": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "type": {
                                    "type": "string",
                                    "const": "link"
                                  },
                                  "label": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 30
                                  },
                                  "url": {
                                    "type": "string",
                                    "format": "uri",
                                    "minLength": 1,
                                    "maxLength": 300
                                  }
                                },
                                "required": [
                                  "type",
                                  "label",
                                  "url"
                                ]
                              },
                              "maxItems": 3,
                              "description": "Alert actions",
                              "example": [
                                {
                                  "type": "link",
                                  "label": "Open Link",
                                  "url": "https://dialect.to"
                                }
                              ]
                            }
                          },
                          "required": [
                            "title",
                            "body"
                          ]
                        },
                        "topicId": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "format": "uuid",
                          "description": "Optional topic ID to categorize the alert. Must be created in advance and belong to the authenticated app. If absent, the alert is uncategorized. If invalid or unauthorized, the request will fail."
                        },
                        "data": {
                          "type": "object",
                          "propertyNames": {
                            "type": "string",
                            "pattern": "^[a-zA-Z0-9_-]+$",
                            "minLength": 1,
                            "maxLength": 64
                          },
                          "additionalProperties": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 500
                          },
                          "description": "Additional data to be sent with the alert. For push notifications, this data will be available in the notification payload and can be used by the app to handle the notification. Common use cases include deep linking, custom actions, or passing context to the app.",
                          "example": {
                            "type": "transaction",
                            "transactionId": "123",
                            "amount": "100"
                          }
                        },
                        "push": {
                          "type": "object",
                          "properties": {
                            "showNotification": {
                              "type": "boolean",
                              "default": true,
                              "description": "Whether to show the notification. When false, the notification will be delivered silently without showing any UI notification."
                            },
                            "playNotificationSound": {
                              "type": "boolean",
                              "default": true,
                              "description": "Whether to play notification sound. When false, the notification will be delivered without sound on iOS and best-effort on Android."
                            }
                          },
                          "description": "Push notification specific configuration.",
                          "default": {}
                        },
                        "recipient": {
                          "type": "object",
                          "properties": {
                            "type": {
                              "type": "string",
                              "const": "subscriber"
                            },
                            "walletAddress": {
                              "type": "string",
                              "description": "User wallet address",
                              "example": "6CxnSjtasq5Tzwb4b93AhLofXtiDvMpQ2vTkWdSZqTH7"
                            }
                          },
                          "required": [
                            "type",
                            "walletAddress"
                          ],
                          "example": {
                            "type": "subscriber",
                            "walletAddress": "6CxnSjtasq5Tzwb4b93AhLofXtiDvMpQ2vTkWdSZqTH7"
                          }
                        }
                      },
                      "required": [
                        "channels",
                        "message",
                        "recipient"
                      ]
                    },
                    "minItems": 1,
                    "maxItems": 500
                  }
                },
                "required": [
                  "alerts"
                ]
              }
            }
          }
        }
      }
    },
    "/v2/{appId}/subscribers": {
      "get": {
        "operationId": "getAppSubscribers",
        "summary": "Get App Subscribers",
        "description": "Retrieve paginated list of all subscribers for application management with filtering and pagination support",
        "tags": [
          "Send Alerts"
        ],
        "parameters": [
          {
            "name": "appId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "description": "Application ID",
              "example": "255d6163-7e25-43e9-a188-c2f8d0980a4a"
            }
          },
          {
            "name": "offset",
            "in": "query",
            "schema": {
              "type": "number",
              "minimum": 0,
              "default": 0,
              "description": "Pagination offset",
              "example": 10
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "number",
              "minimum": 1,
              "maximum": 1000,
              "default": 100,
              "description": "Pagination limit",
              "example": 100
            }
          },
          {
            "name": "walletAddress",
            "in": "query",
            "schema": {
              "oneOf": [
                {
                  "type": "string",
                  "description": "Single wallet address to filter by",
                  "example": "6CxnSjtasq5Tzwb4b93AhLofXtiDvMpQ2vTkWdSZqTH7"
                },
                {
                  "type": "array",
                  "items": {
                    "type": "string"
                  },
                  "description": "Multiple wallet addresses to filter by"
                }
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "List of subscribers",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "subscribers": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "walletAddress": {
                            "type": "string",
                            "description": "User wallet address",
                            "example": "6CxnSjtasq5Tzwb4b93AhLofXtiDvMpQ2vTkWdSZqTH7"
                          }
                        },
                        "required": [
                          "walletAddress"
                        ]
                      }
                    },
                    "offset": {
                      "type": "number",
                      "description": "Current pagination offset",
                      "example": 0
                    },
                    "limit": {
                      "type": "number",
                      "description": "Current pagination limit",
                      "example": 100
                    },
                    "count": {
                      "type": "number",
                      "description": "Total count of subscribers",
                      "example": 150
                    }
                  },
                  "required": [
                    "subscribers",
                    "offset",
                    "limit",
                    "count"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Request validation error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          }
        },
        "security": [
          {
            "application": []
          }
        ]
      }
    },
    "/v2/{appId}/topics": {
      "get": {
        "operationId": "getAppTopics",
        "summary": "Get App Topics",
        "description": "Retrieve all available alert topics for a specific application with detailed topic information including names, descriptions, and slugs for topic-based alert categorization",
        "tags": [
          "Send Alerts"
        ],
        "parameters": [
          {
            "name": "appId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "description": "Application ID",
              "example": "255d6163-7e25-43e9-a188-c2f8d0980a4a"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "List of topics",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "items": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "format": "uuid",
                            "description": "Unique identifier for the topic",
                            "example": "123e4567-e89b-12d3-a456-426614174000"
                          },
                          "name": {
                            "type": "string",
                            "description": "Name of the topic",
                            "example": "Price Alerts"
                          },
                          "description": {
                            "type": "string",
                            "description": "Description of the topic",
                            "example": "Receive alerts when prices drop below a certain threshold"
                          },
                          "slug": {
                            "type": "string",
                            "description": "Human-readable slug of the topic",
                            "example": "price-alerts"
                          }
                        },
                        "required": [
                          "id",
                          "name",
                          "slug"
                        ]
                      },
                      "description": "List of alert topics for the app"
                    }
                  },
                  "required": [
                    "items"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          }
        },
        "security": [
          {
            "application": []
          }
        ]
      }
    },
    "/v2/subscribe": {
      "post": {
        "operationId": "subscribeToAlerts",
        "summary": "Subscribe to Alerts",
        "description": "Subscribe to alerts from applications across multiple channels with support for app-specific and bulk subscriptions",
        "tags": [
          "Integrate an Inbox"
        ],
        "parameters": [
          {
            "name": "X-Dialect-Client-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Client Key used to uniquely identify the client",
              "example": "dk_gyh2eqzfkc4mhp5eiahnndkz"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "appId": {
                    "anyOf": [
                      {
                        "type": "string",
                        "format": "uuid",
                        "description": "Application ID",
                        "example": "255d6163-7e25-43e9-a188-c2f8d0980a4a"
                      },
                      {
                        "type": "array",
                        "items": {
                          "type": "string",
                          "format": "uuid",
                          "description": "Application ID",
                          "example": "255d6163-7e25-43e9-a188-c2f8d0980a4a"
                        }
                      }
                    ],
                    "description": "App ID or an array of App IDs. If empty or omitted, targets all apps available (owned or whitelisted) for the client.",
                    "example": "123e4567-e89b-12d3-a456-426614174000"
                  },
                  "channel": {
                    "anyOf": [
                      {
                        "type": "string",
                        "enum": [
                          "IN_APP",
                          "EMAIL",
                          "TELEGRAM"
                        ]
                      },
                      {
                        "type": "array",
                        "items": {
                          "type": "string",
                          "enum": [
                            "IN_APP",
                            "EMAIL",
                            "TELEGRAM"
                          ]
                        }
                      }
                    ],
                    "description": "Channel or an array of channels (IN_APP, TELEGRAM, EMAIL). If empty or omitted, targets all channels available for the subscriber",
                    "example": "IN_APP"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Subscription successful",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Request validation error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "422": {
            "description": "Constraint validation error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            }
          }
        },
        "security": [
          {
            "subscriber": []
          }
        ]
      }
    },
    "/v2/unsubscribe": {
      "post": {
        "operationId": "unsubscribeFromAlerts",
        "summary": "Unsubscribe from Alerts",
        "description": "Remove subscription to alerts from specified applications and channels with bulk unsubscription support",
        "tags": [
          "Integrate an Inbox"
        ],
        "parameters": [
          {
            "name": "X-Dialect-Client-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Client Key used to uniquely identify the client",
              "example": "dk_gyh2eqzfkc4mhp5eiahnndkz"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "appId": {
                    "anyOf": [
                      {
                        "type": "string",
                        "format": "uuid",
                        "description": "Application ID",
                        "example": "255d6163-7e25-43e9-a188-c2f8d0980a4a"
                      },
                      {
                        "type": "array",
                        "items": {
                          "type": "string",
                          "format": "uuid",
                          "description": "Application ID",
                          "example": "255d6163-7e25-43e9-a188-c2f8d0980a4a"
                        }
                      }
                    ],
                    "description": "App ID or an array of App IDs. If empty or omitted, targets all apps available (owned or whitelisted) for the client.",
                    "example": "123e4567-e89b-12d3-a456-426614174000"
                  },
                  "channel": {
                    "anyOf": [
                      {
                        "type": "string",
                        "enum": [
                          "IN_APP",
                          "EMAIL",
                          "TELEGRAM"
                        ]
                      },
                      {
                        "type": "array",
                        "items": {
                          "type": "string",
                          "enum": [
                            "IN_APP",
                            "EMAIL",
                            "TELEGRAM"
                          ]
                        }
                      }
                    ],
                    "description": "Channel or an array of channels (IN_APP, TELEGRAM, EMAIL). If empty or omitted, targets all channels available for the subscriber",
                    "example": "IN_APP"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Unsubscription successful",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Request validation error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "422": {
            "description": "Constraint validation error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            }
          }
        },
        "security": [
          {
            "subscriber": []
          }
        ]
      }
    },
    "/v2/auth": {
      "get": {
        "operationId": "getAuthenticatedUser",
        "summary": "Get Authenticated User",
        "description": "Get authenticated subscriber's wallet address for identity verification and session validation",
        "tags": [
          "Integrate an Inbox"
        ],
        "parameters": [
          {
            "name": "X-Dialect-Client-Key",
            "in": "header",
            "schema": {
              "type": "string",
              "description": "Client Key used to uniquely identify the client",
              "example": "dk_gyh2eqzfkc4mhp5eiahnndkz"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "User authentication details",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "walletAddress": {
                      "type": "string",
                      "description": "User wallet address",
                      "example": "6CxnSjtasq5Tzwb4b93AhLofXtiDvMpQ2vTkWdSZqTH7"
                    }
                  },
                  "required": [
                    "walletAddress"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          }
        },
        "security": [
          {
            "subscriber": []
          }
        ]
      }
    },
    "/v2/auth/solana/prepare": {
      "post": {
        "operationId": "prepareSolanaAuth",
        "summary": "Prepare Solana Authentication",
        "description": "Generate challenge message for Solana wallet-based authentication with nonce and timestamp",
        "tags": [
          "Integrate an Inbox"
        ],
        "parameters": [
          {
            "name": "X-Dialect-Client-Key",
            "in": "header",
            "schema": {
              "type": "string",
              "description": "Client Key used to uniquely identify the client",
              "example": "dk_gyh2eqzfkc4mhp5eiahnndkz"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "walletAddress": {
                    "type": "string",
                    "description": "User wallet address",
                    "example": "6CxnSjtasq5Tzwb4b93AhLofXtiDvMpQ2vTkWdSZqTH7"
                  }
                },
                "required": [
                  "walletAddress"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Challenge message generated",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Message to be signed by the user",
                      "example": "Sign this message to authenticate. Nonce: 1638471298347"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Request validation error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/v2/auth/solana/verify": {
      "post": {
        "operationId": "verifySolanaAuth",
        "summary": "Verify Solana Authentication",
        "description": "Complete Solana wallet authentication by verifying signed message and receive JWT token for session access",
        "tags": [
          "Integrate an Inbox"
        ],
        "parameters": [
          {
            "name": "X-Dialect-Client-Key",
            "in": "header",
            "schema": {
              "type": "string",
              "description": "Client Key used to uniquely identify the client",
              "example": "dk_gyh2eqzfkc4mhp5eiahnndkz"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "message": {
                    "type": "string",
                    "description": "Message signed by the user, provided by /prepare endpoint",
                    "example": "Sign this message to authenticate. Nonce: 1638471298347"
                  },
                  "signature": {
                    "type": "string",
                    "description": "Base58-encoded signature of the message",
                    "example": "2VYoXjcwKE..."
                  }
                },
                "required": [
                  "message",
                  "signature"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Authentication successful, JWT token returned",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "token": {
                      "type": "string",
                      "minLength": 1
                    },
                    "subscriber": {
                      "type": "object",
                      "properties": {
                        "walletAddress": {
                          "type": "string",
                          "description": "User wallet address",
                          "example": "6CxnSjtasq5Tzwb4b93AhLofXtiDvMpQ2vTkWdSZqTH7"
                        }
                      },
                      "required": [
                        "walletAddress"
                      ]
                    }
                  },
                  "required": [
                    "token",
                    "subscriber"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Request validation error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          }
        }
      }
    },
    "/v2/auth/solana-tx/prepare": {
      "post": {
        "operationId": "prepareSolanaTxAuth",
        "summary": "Prepare Solana Transaction Authentication",
        "description": "Generate transaction for Solana wallet-based authentication using transaction signing",
        "tags": [
          "Integrate an Inbox"
        ],
        "parameters": [
          {
            "name": "X-Dialect-Client-Key",
            "in": "header",
            "schema": {
              "type": "string",
              "description": "Client Key used to uniquely identify the client",
              "example": "dk_gyh2eqzfkc4mhp5eiahnndkz"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "walletAddress": {
                    "type": "string",
                    "description": "User wallet address",
                    "example": "6CxnSjtasq5Tzwb4b93AhLofXtiDvMpQ2vTkWdSZqTH7"
                  }
                },
                "required": [
                  "walletAddress"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Transaction generated for signing",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "transaction": {
                      "type": "string",
                      "description": "Base64-encoded transaction to be signed by the user"
                    }
                  },
                  "required": [
                    "transaction"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Request validation error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/v2/auth/solana-tx/verify": {
      "post": {
        "operationId": "verifySolanaTxAuth",
        "summary": "Verify Solana Transaction Authentication",
        "description": "Complete Solana wallet authentication by verifying signed transaction and receive JWT token",
        "tags": [
          "Integrate an Inbox"
        ],
        "parameters": [
          {
            "name": "X-Dialect-Client-Key",
            "in": "header",
            "schema": {
              "type": "string",
              "description": "Client Key used to uniquely identify the client",
              "example": "dk_gyh2eqzfkc4mhp5eiahnndkz"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "transaction": {
                    "type": "string",
                    "description": "Signed base64-encoded transaction signed by the user"
                  }
                },
                "required": [
                  "transaction"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Authentication successful, JWT token returned",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "token": {
                      "type": "string",
                      "minLength": 1
                    },
                    "subscriber": {
                      "type": "object",
                      "properties": {
                        "walletAddress": {
                          "type": "string",
                          "description": "User wallet address",
                          "example": "6CxnSjtasq5Tzwb4b93AhLofXtiDvMpQ2vTkWdSZqTH7"
                        }
                      },
                      "required": [
                        "walletAddress"
                      ]
                    }
                  },
                  "required": [
                    "token",
                    "subscriber"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Request validation error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          }
        }
      }
    },
    "/v2/history": {
      "get": {
        "operationId": "getNotificationHistory",
        "summary": "Get Notification History",
        "description": "Retrieve user's alert history with pagination, filtering by app, and detailed notification metadata",
        "tags": [
          "Integrate an Inbox"
        ],
        "parameters": [
          {
            "name": "appId",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "uuid",
              "description": "Application ID",
              "example": "255d6163-7e25-43e9-a188-c2f8d0980a4a"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "number",
              "minimum": 1,
              "maximum": 20,
              "default": 10,
              "description": "Pagination limit",
              "example": 10
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string",
              "contentEncoding": "base64",
              "description": "Pagination cursor"
            }
          },
          {
            "name": "X-Dialect-Client-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Client Key used to uniquely identify the client",
              "example": "dk_gyh2eqzfkc4mhp5eiahnndkz"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Notification history retrieved with detailed alert data",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "alerts": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "description": "Id uniquely identifying alerts"
                          },
                          "timestamp": {
                            "type": "string",
                            "description": "ISO Timestamp",
                            "example": "2024-02-20T15:30:00.000Z"
                          },
                          "title": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 100
                          },
                          "body": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 500
                          },
                          "image": {
                            "type": "string",
                            "format": "uri",
                            "description": "Image URL",
                            "example": "https://www.dialect.to/favicon.ico"
                          },
                          "actions": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "type": {
                                  "type": "string",
                                  "const": "link"
                                },
                                "label": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 50
                                },
                                "url": {
                                  "type": "string",
                                  "format": "uri",
                                  "minLength": 1
                                },
                                "context": {
                                  "type": "object",
                                  "properties": {
                                    "type": {
                                      "type": "string",
                                      "const": "position"
                                    },
                                    "apiUrl": {
                                      "type": "string",
                                      "format": "uri"
                                    },
                                    "action": {
                                      "type": "string",
                                      "minLength": 1
                                    }
                                  },
                                  "required": [
                                    "type",
                                    "apiUrl"
                                  ]
                                }
                              },
                              "required": [
                                "type",
                                "label",
                                "url"
                              ]
                            }
                          },
                          "topic": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "format": "uuid",
                                "minLength": 1,
                                "description": "Topic ID",
                                "example": "123e4567-e89b-12d3-a456-426614174000"
                              },
                              "name": {
                                "type": "string",
                                "minLength": 1,
                                "description": "Topic name",
                                "example": "Product Announcements"
                              },
                              "slug": {
                                "type": "string",
                                "minLength": 1,
                                "description": "Topic slug",
                                "example": "product-announcements"
                              }
                            },
                            "required": [
                              "id",
                              "name",
                              "slug"
                            ]
                          },
                          "app": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "format": "uuid",
                                "description": "Application ID",
                                "example": "255d6163-7e25-43e9-a188-c2f8d0980a4a"
                              },
                              "name": {
                                "type": "string",
                                "minLength": 1,
                                "description": "Application name",
                                "example": "Dialect"
                              },
                              "icon": {
                                "type": "string",
                                "format": "uri",
                                "description": "Icon URL",
                                "example": "https://dialect-file-storage.s3.us-west-2.amazonaws.com/avatars/dialect-logo.png"
                              }
                            },
                            "required": [
                              "id",
                              "name"
                            ]
                          },
                          "data": {
                            "type": "object",
                            "propertyNames": {
                              "type": "string",
                              "pattern": "^[a-zA-Z0-9_-]+$",
                              "minLength": 1,
                              "maxLength": 64
                            },
                            "additionalProperties": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 500
                            },
                            "description": "Additional data to be sent with the alert. For push notifications, this data will be available in the notification payload and can be used by the app to handle the notification. Common use cases include deep linking, custom actions, or passing context to the app.",
                            "example": {
                              "type": "transaction",
                              "transactionId": "123",
                              "amount": "100"
                            }
                          }
                        },
                        "required": [
                          "id",
                          "timestamp",
                          "title",
                          "body"
                        ]
                      }
                    },
                    "summary": {
                      "type": "object",
                      "properties": {
                        "unreadCount": {
                          "type": "number",
                          "description": "Total number of unread alerts",
                          "example": 5
                        },
                        "lastRead": {
                          "type": "object",
                          "properties": {
                            "timestamp": {
                              "type": "string",
                              "format": "date-time",
                              "description": "ISO Timestamp",
                              "example": "2024-02-20T15:30:00.000Z"
                            }
                          },
                          "required": [
                            "timestamp"
                          ]
                        }
                      },
                      "required": [
                        "unreadCount"
                      ]
                    },
                    "limit": {
                      "type": "number",
                      "minimum": 1,
                      "maximum": 20,
                      "default": 10,
                      "description": "Pagination limit",
                      "example": 10
                    },
                    "cursor": {
                      "type": "string",
                      "contentEncoding": "base64",
                      "description": "Pagination cursor"
                    }
                  },
                  "required": [
                    "alerts",
                    "summary",
                    "limit"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Request validation error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "422": {
            "description": "Constraint validation error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            }
          }
        },
        "security": [
          {
            "subscriber": []
          }
        ]
      }
    },
    "/v2/history/summary": {
      "get": {
        "operationId": "getNotificationSummary",
        "summary": "Get Notification Summary",
        "description": "Get quick summary of user's notification status including unread count and last read timestamp for efficient inbox management",
        "tags": [
          "Integrate an Inbox"
        ],
        "parameters": [
          {
            "name": "appId",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "uuid",
              "description": "Application ID",
              "example": "255d6163-7e25-43e9-a188-c2f8d0980a4a"
            }
          },
          {
            "name": "X-Dialect-Client-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Client Key used to uniquely identify the client",
              "example": "dk_gyh2eqzfkc4mhp5eiahnndkz"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Notification summary with unread count and last read status",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "unreadCount": {
                      "type": "number",
                      "description": "Total number of unread alerts",
                      "example": 5
                    },
                    "lastRead": {
                      "type": "object",
                      "properties": {
                        "timestamp": {
                          "type": "string",
                          "format": "date-time",
                          "description": "ISO Timestamp",
                          "example": "2024-02-20T15:30:00.000Z"
                        }
                      },
                      "required": [
                        "timestamp"
                      ]
                    }
                  },
                  "required": [
                    "unreadCount"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Request validation error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden"
          },
          "422": {
            "description": "Constraint validation error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            }
          }
        },
        "security": [
          {
            "subscriber": []
          }
        ]
      }
    },
    "/v2/history/read": {
      "post": {
        "operationId": "markNotificationsRead",
        "summary": "Mark Notifications as Read",
        "description": "Mark alerts as read for the authenticated user to update their notification status",
        "tags": [
          "Integrate an Inbox"
        ],
        "parameters": [
          {
            "name": "X-Dialect-Client-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Client Key used to uniquely identify the client",
              "example": "dk_gyh2eqzfkc4mhp5eiahnndkz"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "appId": {
                    "type": "string",
                    "format": "uuid",
                    "description": "Application ID",
                    "example": "255d6163-7e25-43e9-a188-c2f8d0980a4a"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Notifications marked as read successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Request validation error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden"
          },
          "422": {
            "description": "Constraint validation error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            }
          }
        },
        "security": [
          {
            "subscriber": []
          }
        ]
      }
    },
    "/v2/history/clear": {
      "post": {
        "operationId": "clearNotificationHistory",
        "summary": "Clear Notification History",
        "description": "Clear all read alerts for the given user and specified apps. This is a global action that applies across all clients",
        "tags": [
          "Integrate an Inbox"
        ],
        "parameters": [
          {
            "name": "X-Dialect-Client-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Client Key used to uniquely identify the client",
              "example": "dk_gyh2eqzfkc4mhp5eiahnndkz"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "appId": {
                    "anyOf": [
                      {
                        "type": "string",
                        "format": "uuid",
                        "description": "Application ID",
                        "example": "255d6163-7e25-43e9-a188-c2f8d0980a4a"
                      },
                      {
                        "type": "array",
                        "items": {
                          "type": "string",
                          "format": "uuid",
                          "description": "Application ID",
                          "example": "255d6163-7e25-43e9-a188-c2f8d0980a4a"
                        }
                      }
                    ],
                    "description": "App ID or an array of App IDs. If empty or omitted, targets all apps available (owned or whitelisted) for the client.",
                    "example": "123e4567-e89b-12d3-a456-426614174000"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Alert history cleared successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Request validation error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden"
          },
          "422": {
            "description": "Constraint validation error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            }
          }
        },
        "security": [
          {
            "subscriber": []
          }
        ]
      }
    },
    "/v2/push/subscribe": {
      "post": {
        "operationId": "subscribeToPushNotifications",
        "summary": "Subscribe to Push Notifications",
        "description": "Register device for push notifications using Firebase Cloud Messaging (FCM) with support for app-specific or global subscriptions",
        "tags": [
          "Integrate an Inbox"
        ],
        "parameters": [
          {
            "name": "X-Dialect-Client-Key",
            "in": "header",
            "schema": {
              "type": "string",
              "description": "Client Key used to uniquely identify the client",
              "example": "dk_gyh2eqzfkc4mhp5eiahnndkz"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "appId": {
                    "type": "string",
                    "format": "uuid",
                    "description": "Application ID",
                    "example": "255d6163-7e25-43e9-a188-c2f8d0980a4a"
                  },
                  "deviceId": {
                    "type": "string"
                  },
                  "fcmToken": {
                    "type": "string",
                    "minLength": 1
                  }
                },
                "required": [
                  "fcmToken"
                ]
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Push subscription accepted",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Request validation error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "422": {
            "description": "Constraint validation error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            }
          }
        },
        "security": [
          {
            "subscriber": []
          }
        ]
      }
    },
    "/v2/push/unsubscribe": {
      "post": {
        "operationId": "unsubscribeFromPushNotifications",
        "summary": "Unsubscribe from Push Notifications",
        "description": "Remove device from push notification delivery with support for app-specific or global unsubscription",
        "tags": [
          "Integrate an Inbox"
        ],
        "parameters": [
          {
            "name": "X-Dialect-Client-Key",
            "in": "header",
            "schema": {
              "type": "string",
              "description": "Client Key used to uniquely identify the client",
              "example": "dk_gyh2eqzfkc4mhp5eiahnndkz"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "appId": {
                    "type": "string",
                    "format": "uuid",
                    "description": "Application ID",
                    "example": "255d6163-7e25-43e9-a188-c2f8d0980a4a"
                  },
                  "deviceId": {
                    "type": "string"
                  },
                  "fcmToken": {
                    "type": "string",
                    "minLength": 1
                  }
                },
                "required": [
                  "fcmToken"
                ]
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Push unsubscription accepted",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Request validation error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "422": {
            "description": "Constraint validation error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            }
          }
        },
        "security": [
          {
            "subscriber": []
          }
        ]
      }
    },
    "/v2/topics": {
      "get": {
        "operationId": "getAlertTopics",
        "summary": "Get Alert Topics",
        "description": "Retrieve available alert topics organized by application with subscription status for granular notification control",
        "tags": [
          "Integrate an Inbox"
        ],
        "parameters": [
          {
            "name": "appId",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "uuid",
              "description": "Application ID",
              "example": "255d6163-7e25-43e9-a188-c2f8d0980a4a"
            }
          },
          {
            "name": "X-Dialect-Client-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Client Key used to uniquely identify the client",
              "example": "dk_gyh2eqzfkc4mhp5eiahnndkz"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Alert topics retrieved with subscription status",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "byApp": {
                      "type": "object",
                      "propertyNames": {
                        "type": "string",
                        "format": "uuid",
                        "description": "App ID"
                      },
                      "additionalProperties": {
                        "type": "object",
                        "properties": {
                          "items": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "format": "uuid",
                                  "description": "Unique identifier for the topic",
                                  "example": "123e4567-e89b-12d3-a456-426614174000"
                                },
                                "name": {
                                  "type": "string",
                                  "description": "Name of the topic",
                                  "example": "Price Alerts"
                                },
                                "description": {
                                  "type": "string",
                                  "description": "Description of the topic",
                                  "example": "Receive alerts when prices drop below a certain threshold"
                                },
                                "slug": {
                                  "type": "string",
                                  "description": "Human-readable slug of the topic",
                                  "example": "price-alerts"
                                },
                                "subscribed": {
                                  "type": "boolean",
                                  "description": "Whether the subscriber has enabled notifications for this topic",
                                  "example": true
                                }
                              },
                              "required": [
                                "id",
                                "name",
                                "slug",
                                "subscribed"
                              ]
                            }
                          }
                        },
                        "required": [
                          "items"
                        ]
                      }
                    }
                  },
                  "required": [
                    "byApp"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Request validation error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          }
        },
        "security": [
          {
            "subscriber": []
          }
        ]
      }
    },
    "/v2/topics/subscribe": {
      "post": {
        "operationId": "subscribeToTopic",
        "summary": "Subscribe to Alert Topic",
        "description": "Enable receiving alerts for a specific topic to provide granular notification control and better user experience",
        "tags": [
          "Integrate an Inbox"
        ],
        "parameters": [
          {
            "name": "X-Dialect-Client-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Client Key used to uniquely identify the client",
              "example": "dk_gyh2eqzfkc4mhp5eiahnndkz"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "topicId": {
                    "type": "string",
                    "format": "uuid",
                    "description": "List of topic IDs to be updated",
                    "example": "123e4567-e89b-12d3-a456-426614174000"
                  }
                },
                "required": [
                  "topicId"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Topic preference updated successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Request validation error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden. Client not authorized to edit topics of non-whitelisted apps",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "422": {
            "description": "Topic not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        },
        "security": [
          {
            "subscriber": []
          }
        ]
      }
    },
    "/v2/topics/unsubscribe": {
      "post": {
        "operationId": "unsubscribeFromTopic",
        "summary": "Unsubscribe from Alert Topic",
        "description": "Disable receiving alerts for a specific topic to provide granular notification control",
        "tags": [
          "Integrate an Inbox"
        ],
        "parameters": [
          {
            "name": "X-Dialect-Client-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Client Key used to uniquely identify the client",
              "example": "dk_gyh2eqzfkc4mhp5eiahnndkz"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "topicId": {
                    "type": "string",
                    "format": "uuid",
                    "description": "List of topic IDs to be updated",
                    "example": "123e4567-e89b-12d3-a456-426614174000"
                  }
                },
                "required": [
                  "topicId"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Topic preference updated successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Request validation error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden. Client not authorized to edit topics of non-whitelisted apps",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "422": {
            "description": "Topic not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        },
        "security": [
          {
            "subscriber": []
          }
        ]
      }
    },
    "/v2/apps": {
      "get": {
        "operationId": "getAvailableApps",
        "summary": "Get Available Apps",
        "description": "Get all applications available to the authenticated user with subscription status, topics, and channel availability",
        "tags": [
          "Integrate an Inbox"
        ],
        "parameters": [
          {
            "name": "X-Dialect-Client-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Client Key used to uniquely identify the client",
              "example": "dk_gyh2eqzfkc4mhp5eiahnndkz"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Available apps with detailed subscription and topic information",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "apps": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "format": "uuid"
                          },
                          "name": {
                            "type": "string"
                          },
                          "description": {
                            "type": "string"
                          },
                          "icon": {
                            "type": "string",
                            "format": "uri"
                          },
                          "subscribed": {
                            "type": "boolean",
                            "description": "Whether the subscriber has enabled notifications for at least one channel of this app",
                            "example": true
                          },
                          "topics": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "format": "uuid",
                                  "description": "Unique identifier for the topic",
                                  "example": "123e4567-e89b-12d3-a456-426614174000"
                                },
                                "name": {
                                  "type": "string",
                                  "description": "Name of the topic",
                                  "example": "Price Alerts"
                                },
                                "description": {
                                  "type": "string",
                                  "description": "Description of the topic",
                                  "example": "Receive alerts when prices drop below a certain threshold"
                                },
                                "slug": {
                                  "type": "string",
                                  "description": "Human-readable slug of the topic",
                                  "example": "price-alerts"
                                },
                                "subscribed": {
                                  "type": "boolean",
                                  "description": "Whether the subscriber has enabled notifications for this topic",
                                  "example": true
                                }
                              },
                              "required": [
                                "id",
                                "name",
                                "slug",
                                "subscribed"
                              ]
                            },
                            "description": "Subscriber's topics this app."
                          },
                          "channels": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "channel": {
                                  "type": "string",
                                  "enum": [
                                    "IN_APP",
                                    "EMAIL",
                                    "TELEGRAM"
                                  ]
                                },
                                "subscribed": {
                                  "type": "boolean"
                                }
                              },
                              "required": [
                                "channel",
                                "subscribed"
                              ]
                            },
                            "description": "List of channels that the app supports for notifications."
                          }
                        },
                        "required": [
                          "id",
                          "name",
                          "subscribed",
                          "topics",
                          "channels"
                        ]
                      }
                    }
                  },
                  "required": [
                    "apps"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          }
        },
        "security": [
          {
            "subscriber": []
          }
        ]
      }
    },
    "/v2/channels": {
      "get": {
        "operationId": "getChannels",
        "summary": "Get Channels",
        "description": "Get user's channels and channel subscriptions",
        "tags": [
          "Manage Channels"
        ],
        "parameters": [
          {
            "name": "X-Dialect-Client-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Client Key used to uniquely identify the client",
              "example": "dk_gyh2eqzfkc4mhp5eiahnndkz"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "User channels retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "EMAIL": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "type": {
                          "type": "string",
                          "enum": [
                            "EMAIL",
                            "TELEGRAM"
                          ]
                        },
                        "value": {
                          "type": "string"
                        },
                        "verified": {
                          "type": "boolean"
                        },
                        "subscribed": {
                          "type": "boolean"
                        },
                        "subscribedApps": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "format": "uuid",
                                "description": "Application ID",
                                "example": "255d6163-7e25-43e9-a188-c2f8d0980a4a"
                              },
                              "name": {
                                "type": "string",
                                "minLength": 1,
                                "description": "Application name",
                                "example": "Dialect"
                              },
                              "icon": {
                                "type": "string",
                                "format": "uri",
                                "description": "Icon URL",
                                "example": "https://dialect-file-storage.s3.us-west-2.amazonaws.com/avatars/dialect-logo.png"
                              }
                            },
                            "required": [
                              "id",
                              "name"
                            ]
                          }
                        }
                      },
                      "required": [
                        "id",
                        "type",
                        "value",
                        "verified",
                        "subscribed"
                      ]
                    },
                    "TELEGRAM": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "type": {
                          "type": "string",
                          "enum": [
                            "EMAIL",
                            "TELEGRAM"
                          ]
                        },
                        "value": {
                          "type": "string"
                        },
                        "verified": {
                          "type": "boolean"
                        },
                        "subscribed": {
                          "type": "boolean"
                        },
                        "subscribedApps": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "format": "uuid",
                                "description": "Application ID",
                                "example": "255d6163-7e25-43e9-a188-c2f8d0980a4a"
                              },
                              "name": {
                                "type": "string",
                                "minLength": 1,
                                "description": "Application name",
                                "example": "Dialect"
                              },
                              "icon": {
                                "type": "string",
                                "format": "uri",
                                "description": "Icon URL",
                                "example": "https://dialect-file-storage.s3.us-west-2.amazonaws.com/avatars/dialect-logo.png"
                              }
                            },
                            "required": [
                              "id",
                              "name"
                            ]
                          }
                        }
                      },
                      "required": [
                        "id",
                        "type",
                        "value",
                        "verified",
                        "subscribed"
                      ]
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          }
        },
        "security": [
          {
            "subscriber": []
          }
        ]
      }
    },
    "/v2/channel/email/prepare": {
      "post": {
        "operationId": "prepareEmailChannel",
        "summary": "Prepare Email Channel",
        "description": "Prepare email channel for a subscriber",
        "tags": [
          "Manage Channels"
        ],
        "parameters": [
          {
            "name": "X-Dialect-Client-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Client Key used to uniquely identify the client",
              "example": "dk_gyh2eqzfkc4mhp5eiahnndkz"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "email": {
                    "type": "string",
                    "format": "email",
                    "description": "Email address to add",
                    "example": "user@example.com"
                  }
                },
                "required": [
                  "email"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Unverified email channel created successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "type": {
                      "type": "string",
                      "enum": [
                        "EMAIL",
                        "TELEGRAM"
                      ]
                    },
                    "value": {
                      "type": "string"
                    },
                    "verified": {
                      "type": "boolean"
                    },
                    "subscribed": {
                      "type": "boolean"
                    },
                    "subscribedApps": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "format": "uuid",
                            "description": "Application ID",
                            "example": "255d6163-7e25-43e9-a188-c2f8d0980a4a"
                          },
                          "name": {
                            "type": "string",
                            "minLength": 1,
                            "description": "Application name",
                            "example": "Dialect"
                          },
                          "icon": {
                            "type": "string",
                            "format": "uri",
                            "description": "Icon URL",
                            "example": "https://dialect-file-storage.s3.us-west-2.amazonaws.com/avatars/dialect-logo.png"
                          }
                        },
                        "required": [
                          "id",
                          "name"
                        ]
                      }
                    }
                  },
                  "required": [
                    "id",
                    "type",
                    "value",
                    "verified",
                    "subscribed"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Request validation error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "409": {
            "description": "Channel already exists",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            }
          }
        },
        "security": [
          {
            "subscriber": []
          }
        ]
      }
    },
    "/v2/channel/email/verify": {
      "post": {
        "operationId": "verifyEmailChannel",
        "summary": "Verify Email Channel",
        "description": "Verify email channel for a subscriber",
        "tags": [
          "Manage Channels"
        ],
        "parameters": [
          {
            "name": "X-Dialect-Client-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Client Key used to uniquely identify the client",
              "example": "dk_gyh2eqzfkc4mhp5eiahnndkz"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "code": {
                    "type": "string",
                    "description": "Verification code sent to email",
                    "example": "123456"
                  }
                },
                "required": [
                  "code"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Email channel verified successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "type": {
                      "type": "string",
                      "enum": [
                        "EMAIL",
                        "TELEGRAM"
                      ]
                    },
                    "value": {
                      "type": "string"
                    },
                    "verified": {
                      "type": "boolean"
                    },
                    "subscribed": {
                      "type": "boolean"
                    },
                    "subscribedApps": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "format": "uuid",
                            "description": "Application ID",
                            "example": "255d6163-7e25-43e9-a188-c2f8d0980a4a"
                          },
                          "name": {
                            "type": "string",
                            "minLength": 1,
                            "description": "Application name",
                            "example": "Dialect"
                          },
                          "icon": {
                            "type": "string",
                            "format": "uri",
                            "description": "Icon URL",
                            "example": "https://dialect-file-storage.s3.us-west-2.amazonaws.com/avatars/dialect-logo.png"
                          }
                        },
                        "required": [
                          "id",
                          "name"
                        ]
                      }
                    }
                  },
                  "required": [
                    "id",
                    "type",
                    "value",
                    "verified",
                    "subscribed"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Request validation error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "422": {
            "description": "Verification error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            }
          }
        },
        "security": [
          {
            "subscriber": []
          }
        ]
      }
    },
    "/v2/channel/email/resend": {
      "post": {
        "operationId": "resendEmailVerification",
        "summary": "Resend Email Verification",
        "description": "Resend email verification for a subscriber",
        "tags": [
          "Manage Channels"
        ],
        "parameters": [
          {
            "name": "X-Dialect-Client-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Client Key used to uniquely identify the client",
              "example": "dk_gyh2eqzfkc4mhp5eiahnndkz"
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Email verification resent successfully"
          },
          "400": {
            "description": "Request validation error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "409": {
            "description": "Address already verified or does not exist yet",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            }
          },
          "422": {
            "description": "Verification error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            }
          }
        },
        "security": [
          {
            "subscriber": []
          }
        ]
      }
    },
    "/v2/channel/email/delete": {
      "post": {
        "operationId": "deleteEmailChannel",
        "summary": "Delete Email Channel",
        "description": "Delete email channel for a subscriber",
        "tags": [
          "Manage Channels"
        ],
        "parameters": [
          {
            "name": "X-Dialect-Client-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Client Key used to uniquely identify the client",
              "example": "dk_gyh2eqzfkc4mhp5eiahnndkz"
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Email channel deleted successfully"
          },
          "400": {
            "description": "Request validation error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          }
        },
        "security": [
          {
            "subscriber": []
          }
        ]
      }
    },
    "/v2/channel/telegram/prepare": {
      "post": {
        "operationId": "prepareTelegramChannel",
        "summary": "Prepare Telegram Channel",
        "description": "Prepare telegram channel for a subscriber",
        "tags": [
          "Manage Channels"
        ],
        "parameters": [
          {
            "name": "X-Dialect-Client-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Client Key used to uniquely identify the client",
              "example": "dk_gyh2eqzfkc4mhp5eiahnndkz"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Telegram channel prepared successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "type": {
                      "type": "string",
                      "enum": [
                        "EMAIL",
                        "TELEGRAM"
                      ]
                    },
                    "value": {
                      "type": "string"
                    },
                    "verified": {
                      "type": "boolean"
                    },
                    "subscribed": {
                      "type": "boolean"
                    },
                    "subscribedApps": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "format": "uuid",
                            "description": "Application ID",
                            "example": "255d6163-7e25-43e9-a188-c2f8d0980a4a"
                          },
                          "name": {
                            "type": "string",
                            "minLength": 1,
                            "description": "Application name",
                            "example": "Dialect"
                          },
                          "icon": {
                            "type": "string",
                            "format": "uri",
                            "description": "Icon URL",
                            "example": "https://dialect-file-storage.s3.us-west-2.amazonaws.com/avatars/dialect-logo.png"
                          }
                        },
                        "required": [
                          "id",
                          "name"
                        ]
                      }
                    },
                    "verification": {
                      "type": "object",
                      "properties": {
                        "link": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "link"
                      ]
                    }
                  },
                  "required": [
                    "id",
                    "type",
                    "value",
                    "verified",
                    "subscribed",
                    "verification"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Request validation error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          }
        },
        "security": [
          {
            "subscriber": []
          }
        ]
      }
    },
    "/v2/channel/telegram/delete": {
      "post": {
        "operationId": "deleteTelegramChannel",
        "summary": "Delete Telegram Channel",
        "description": "Delete telegram channel for a subscriber",
        "tags": [
          "Manage Channels"
        ],
        "parameters": [
          {
            "name": "X-Dialect-Client-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Client Key used to uniquely identify the client",
              "example": "dk_gyh2eqzfkc4mhp5eiahnndkz"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Telegram channel deleted successfully"
          },
          "400": {
            "description": "Request validation error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          }
        },
        "security": [
          {
            "subscriber": []
          }
        ]
      }
    }
  },
  "components": {
    "securitySchemes": {
      "application": {
        "type": "apiKey",
        "description": "API key to authorize app-level requests",
        "name": "x-dialect-api-key",
        "in": "header"
      },
      "subscriber": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "description": "Bearer token authentication for subscriber calls"
      }
    }
  }
}