Skip to main content
Gateway opcodes indicate the type of payload being sent or received. Clients send and receive different opcodes depending on their role in the connection lifecycle.

Opcode reference

OpcodeNameDescriptionClient Action
0DISPATCHDispatches an event to the clientReceive
1HEARTBEATFired periodically to keep the connection aliveSend/Receive
2IDENTIFYStarts a new session during the initial handshakeSend
3PRESENCE_UPDATEUpdates the client presenceSend
4VOICE_STATE_UPDATEJoins, moves, or disconnects from a voice channelSend
5VOICE_SERVER_PINGPings the voice serverSend
6RESUMEResumes a previous session after a disconnectSend
7RECONNECTIndicates the client should reconnect to the gatewayReceive
8REQUEST_GUILD_MEMBERSRequests members for a guildSend
9INVALID_SESSIONSession has been invalidated; client should reconnect and identifyReceive
10HELLOSent immediately after connecting; contains heartbeat intervalReceive
11HEARTBEAT_ACKAcknowledgement of a heartbeatReceive
12GATEWAY_ERRORIndicates an error occurred while processing a gateway messageReceive
14LAZY_REQUESTRequests lazy-loaded guild dataSend