{ "openapi": "3.0.1", "info": { "title": "Messaging Service", "description": "This page contains reference documentation for the Open Cloud v1 Messaging Service API, which can broadcast messages across all servers in your experience.\n\nThe v2 API has its own version of the [Publish Message](/cloud/reference/Universe#Cloud_PublishUniverseMessage) method. For information on using the v2 method, see the [Messaging usage guide](/cloud/guides/usage-messaging.md).", "version": "v1", "x-roblox-extensions-version": "1.0.0" }, "servers": [ { "url": "https://apis.roblox.com/messaging-service/" } ], "paths": { "/v1/universes/{universeId}/topics/{topic}": { "post": { "tags": ["CrossServerMessaging"], "operationId": "CrossServerMessaging_Publish", "x-roblox-cloud-api-operation-name": "Publish a Message", "x-roblox-stability": "BETA", "x-roblox-recommended-alternatives": [ { "url": "https://apis.roblox.com/cloud/v2/universes/{universe_id}:publishMessage", "httpMethod": "POST", "documentationUrl": "https://create.roblox.com/docs/cloud/reference/features/universes#Cloud_PublishUniverseMessage" } ], "summary": "Publish a cross-server message to a universe", "description": "Publish a message to a pre-defined topic of an experience, with the size of the message up to 1,024 characters (1 KB). Requires the **Publish** permission for API keys and the **universe-messaging-service:publish** scope for OAuth 2.0 apps. See [Cross-server messaging](/cloud-services/cross-server-messaging.md#subscribe-users-to-receive-messages) for defining and subscribing users to a topic.", "parameters": [ { "name": "universeId", "in": "path", "required": true, "description": "The identifier of the experience in which you want to send your messages to. You can [copy your experience's Universe ID](/cloud/guides/usage-messaging.md#publishing-messages-to-live-servers) on **Creator Dashboard**.", "schema": { "type": "integer", "format": "int64" } }, { "name": "topic", "in": "path", "required": true, "description": "The topic that you want to publish your message to, with up to 80 characters.", "schema": { "type": "string", "nullable": true } } ], "requestBody": { "content": { "application/json-patch+json": { "schema": { "$ref": "#/components/schemas/PublishRequest" } }, "application/json": { "schema": { "$ref": "#/components/schemas/PublishRequest" } }, "text/json": { "schema": { "$ref": "#/components/schemas/PublishRequest" } }, "application/*+json": { "schema": { "$ref": "#/components/schemas/PublishRequest" } } } }, "responses": { "200": { "description": "Returns an empty response body." }, "400": { "description": "Invalid request." }, "401": { "description": "The API key is not valid for this operation / You don't have the authorization." }, "403": { "description": "Publishing is not allowed on this experience." }, "500": { "description": "Server internal error / Unknown error." } }, "security": [ { "roblox-api-key": ["universe-messaging-service:publish"] }, { "roblox-oauth2": ["universe-messaging-service:publish"] } ], "x-roblox-scopes": [{ "name": "universe-messaging-service:publish" }], "x-roblox-cloud-api-operation": true } } }, "components": { "schemas": { "PublishRequest": { "type": "object", "description": "The request body object with the message string that you want to publish to the live server.", "properties": { "message": { "type": "string", "nullable": true, "description": "The message content that you want to publish to the live server." } }, "additionalProperties": false } }, "securitySchemes": { "roblox-api-key": { "type": "apiKey", "description": "A configurable key that allows granular access to Roblox resources. See https://create.roblox.com/docs/cloud/auth/api-keys for more information.", "in": "header", "name": "x-api-key" }, "roblox-oauth2": { "type": "oauth2", "description": "Build or authorize apps to access Roblox resources. See https://create.roblox.com/docs/cloud/auth/oauth2-overview for more information.", "flows": { "authorizationCode": { "authorizationUrl": "https://apis.roblox.com/oauth/v1/authorize", "tokenUrl": "https://apis.roblox.com/oauth/v1/token", "refreshUrl": "https://apis.roblox.com/oauth/v1/token", "scopes": { "universe-messaging-service:publish": "This grants the ability to publish messages on behalf of users." } } } } } } }