{"openapi":"3.0.0","info":{"title":"Messaging API","description":"\n# Feature Overview\nThe Messaging API is responsible for messaging interactions related to email, Push Protocol\nor XMTP.\n\n## Authenticated endpoint overview\nThis API uses signed messages to validate a given wallet is authorized to submit the request. \nAuthentication headers must be provided using the approach described below.\n\n### How to authenticate\n- Determine the message that must be signed through the message generator endpoint\n - Request GET /api/user/{domain}/signature?device=true&expiry={timestamp}\n - Replace '{domain}' with desired domain\n - Replace '{expiry}' with desired Unix epoch timestamp\n - Response contains the message that must be signed\n - Message is a unique hash value\n - Represents combination of provided request parameters\n - Includes an expiration timestamp\n- User must sign the message returned by the message generator API\n - For example, the Metamask wallet could be used to sign the message\n - Generated signature is used in header of subsequent GET or POST request\n- Construct a request to the desired endpoint that requires user authentication\n - Must include headers\n - x-auth-domain - Must equal the {domain} in context\n - x-auth-expiration - Must equal the {expiry} timestamp in the signed message\n - x-auth-signature - Must be set to the value of the user generated signature\n","version":"1.0.0"},"servers":[{"url":"https://api.unstoppabledomains.com/messaging","description":"Production"}],"paths":{"/push/group":{"post":{"summary":"Creates a new Push Protocol token gated group","description":"Creates a new Push Protocol token gated group if it does not yet exists. The group is associated with an Unstoppable Domains badge.","tags":["Communities"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SerializedPushGroupCreatePost"}}}},"responses":{"200":{"description":"Group created successfully"},"404":{"description":"Badge not found"}}}},"/push/group/join":{"post":{"summary":"Request to join a Push Protocol token gated community","description":"Request to join a token gated community for a given wallet address. The request is granted if the token gating requirements are satisfied.","tags":["Communities"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SerializedPushGroupJoinPost"}}}},"responses":{"200":{"description":"Group joined successfully"},"403":{"description":"Wallet not authorized to join group"},"404":{"description":"Group not found"}}}},"/push/group/leave":{"post":{"summary":"Request to leave a Push Protocol token gated community","description":"Request to leave a token gated community for a given wallet address.","tags":["Communities"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SerializedPushGroupJoinPost"}}}},"responses":{"200":{"description":"Group was left successfully"},"404":{"description":"Group not found"}}}},"/push/notification/badge":{"post":{"summary":"Send a message to holders of a badge","description":"Allows an authorized user to send a message to all holders of a badge that have opted-in to partner notifications","tags":["Partner notifications"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SerializedBadgeNotificationPost"}}}},"parameters":[{"in":"header","name":"x-auth-domain","schema":{"type":"string"},"required":true,"description":"The domain to authorize. Should match the domain specified in the body","example":"mydomain.tld"},{"in":"header","name":"x-auth-expires","schema":{"type":"string"},"required":true,"description":"The expiration time of the signature","example":1765522015090},{"in":"header","name":"x-auth-signature","schema":{"type":"string"},"required":true,"description":"The signature generating using domain owner private key","example":"b62348775da58077591e2d20506371e8d94a5a83031f34b9ac85845d3463e73b0f0a500875830785c093515806e354cda6c217acab0fce5245d662eff4105f5e1c"}],"responses":{"200":{"description":"Notification successful"},"403":{"description":"Notification not authorized"},"404":{"description":"Domain not found"}}}},"/status":{"get":{"summary":"status probe","description":"This route can be used to determine if the application service is alive","tags":["Status"],"responses":{"200":{"description":"application is alive","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"object","description":"break down of application component status","properties":{"http":{"type":"boolean","description":"If http server is available."},"db":{"type":"boolean","description":"If DB is available"},"redis":{"type":"boolean","description":"If redis is available"}}}}}}}}}}},"/xmtp/spam/{address}":{"get":{"summary":"Determine if an address is marked as source of spam","description":"The provided address is cross referenced against algorithms to suggest whether it has generated spam messages","tags":["Chat"],"responses":{"200":{"description":"Registration successful","content":{"application/json":{"schema":{"type":"object","properties":{"isSpam":{"type":"boolean","description":"Address spam value"}}}}}}}}},"/xmtp/topics/accept":{"post":{"summary":"Accept an XMTP chat request","description":"New XMTP chats are not show in the Unstoppable Messaging inbox by default. After a topic is accepted by the user, it is shown in the default view.","tags":["Chat"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SerializedRegistrationPost"}}}},"responses":{"200":{"description":"Accept successful"},"403":{"description":"Accept not authorized"},"404":{"description":"Not found"}}}},"/xmtp/topics/block":{"post":{"summary":"Block an XMTP conversation","description":"Block the specified XMTP topics and report as spam","tags":["Chat"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SerializedRegistrationPost"}}}},"responses":{"200":{"description":"Accept successful"},"403":{"description":"Accept not authorized"},"404":{"description":"Not found"}}}},"/xmtp/topics/register":{"post":{"summary":"Register an XMTP topic for mobile push notifications","description":"Handles registration of XMTP topics to associate with mobile device tokens to receive push notifications","tags":["Chat"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SerializedRegistrationPost"}}}},"responses":{"200":{"description":"Registration successful"},"403":{"description":"Notification not authorized"},"404":{"description":"Not found"}}}}},"components":{"schemas":{"SerializedTopicPost":{"type":"object","properties":{"accept":{"type":"boolean","description":"Indicates whether user has accepted the chat request","example":true},"block":{"type":"boolean","description":"Indicates whether user is reporting this topic as spam","example":true},"topic":{"type":"string","description":"Topic ID to be registered","example":"topic-123"},"peerAddress":{"type":"string","description":"Peer wallet address associated with this conversation"},"signature":{"type":"string","description":"Topic ID signed with the XMTP account private key","example":""}}},"SerializedRegistrationPost":{"type":"object","properties":{"ownerAddress":{"type":"string","description":"Domain owner public wallet address","example":123},"signedPublicKey":{"type":"string","description":"XMTP account public key","example":456},"registrations":{"type":"array","items":{"$ref":"#/components/schemas/SerializedTopicPost"}}}},"SerializedBadgeNotificationPost":{"type":"object","properties":{"badgeCode":{"type":"string","description":"The badge identifier","example":"badge1"},"subject":{"type":"string","description":"Notification subject","example":"My new subject"},"message":{"type":"string","description":"Notification message body","example":"This is the message content"},"ctaUrl":{"type":"string","description":"Optional link the user can click for more information","example":"https://unstoppabledomains.com"},"imageUrl":{"type":"string","description":"Optional link to an image","example":"https://unstoppabledomains.com/logo.png"},"sender":{"type":"object","properties":{"domain":{"type":"string","description":"The domain name of the notification sender","example":"matt.x"}}}}},"SerializedPushGroupCreatePost":{"type":"object","properties":{"badgeCode":{"type":"string","description":"Badge code associated with the token gated group","example":123}}},"SerializedPushGroupJoinPost":{"type":"object","properties":{"address":{"type":"string","description":"Wallet address to join the token gated group","example":291},"badgeCode":{"type":"string","description":"Badge code associated with the token gated group","example":123},"signature":{"type":"string","description":"Signature of the badge code created with user's Push Protocol private key","example":291}}}}},"tags":[]}