Get a Discord guild member
Fetch a single guild member by Discord user id.
Does not require the privileged Server Members Intent, so this works even where the full member listing returns 403.
API key authentication - use your Zernio API key as a Bearer token
In: header
Path Parameters
Discord user snowflake.
Query Parameters
Response Body
application/json
application/json
application/json
import Zernio from '@zernio/node';const zernio = new Zernio({ apiKey: process.env.ZERNIO_API_KEY });const { data } = await zernio.discord.getDiscordGuildMember({ path: { guildId: 'guild_abc123', userId: 'user_abc123', }, query: { accountId: 'account_abc123', },});console.log(data);{
"data": {
"user": {
"id": "string",
"username": "string",
"discriminator": "string",
"avatar": "string",
"global_name": "string"
},
"nick": "string",
"roles": [
"string"
],
"joined_at": "2019-08-24T14:15:22Z",
"premium_since": "2019-08-24T14:15:22Z"
}
}{
"error": "string",
"type": "invalid_request_error",
"code": "string",
"param": "string",
"platform": "string",
"platformError": {},
"details": {}
}{
"error": "Unauthorized"
}Search Discord guild members GET
Search guild members whose username or nickname **starts with** the query (Discord matches prefixes only, not substrings). Does not require the privileged Server Members Intent, so this works even where the full member listing returns 403.
Assign a role to a guild member PUT
Assign one role to one member. Idempotent on Discord's side — re-running on a member who already has the role is a 204 no-op. Path shape mirrors Discord's own API (`PUT /guilds/{guild}/members/{user}/roles/{role}`) for zero-translation mental mapping. Bot needs MANAGE_ROLES permission in the guild AND its highest role must be above the target role (Discord hierarchy rule). The `@everyone` role (where roleId == guildId) cannot be assigned.