Create a scoped connection
Open API & Gateway from app navigation. Choose a server you manage and one non-age-restricted text channel. Select only the necessary read, write or Gateway scopes. Reading permission exposes the chosen channel history to your software. Save the displayed secret on your server; it is shown once and expires in 90 days.
HTTP and live events
The full endpoint and WebSocket protocol reference is on Developers → HTTP API & Gateway v1. Gateway tickets are single-use and expire in thirty seconds. Send heartbeats every thirty seconds; connections expire after five minutes. Refresh HTTP history on reconnection because events are not replayed.
If access stops
Check scope, credential expiry, server membership, current management and channel permissions, read-only mode and rate-limit responses. Removing permission or suspending the credential owner revokes access. Respect Retry-After and use bounded reconnect backoff. Never paste a bearer secret or connection ticket into a report.
Revoke a secret
Use Revoke in API & Gateway Studio. The old credential stops working and its Gateway connections close. Create a replacement if needed. The integration cannot read DMs, operate staff tools or impersonate a member.