(Un)blocking users
You can block or unblock users from using Yunite on your server using this endpoint.
POST
Block or unblock a Discord or Epic user
https://yunite.xyz/api/v3/guild/{guildId}/registration/blocks
- Request
- Response
Path Parameters
Request Body
Name | Value type | Description |
---|---|---|
guildId | Guild ID Snowflake | The ID of the guild you want to access |
- Schema
- Example
{ "type": "object", "properties": { "op": { "type": "string", "value": "one of ['BLOCK', 'UNBLOCK']" }, "userType": { "type": "string", "value": "one of ['DISCORD', 'EPIC']" }, "userId": { "type": "string", "value": "DisordID / EpicID, depending on given type" }, "reason": { "type": "string", "value": "add a reason for blocking the user; required if blocking, ignored if unblocking" }, "blockLinkedUser": { "type": "boolean", "value": "set to true if the linked user should be block as well if present; set to false otherwise" } } }
{ "op": "BLOCK", "userType": "DISCORD", "userId": "12345654321123432", "reason": "Griefing games", "blockLinkedUser": true }
- Schema
- Example
{ "type": "object", "properties": { "status": { "type": "string", "value": "one of ['SUCCESS', 'ALREADY_BLOCKED,', 'NOT_BLOCKED', 'NOT_FOUND' ]" }, "message": { "type": "string", "value": "a message explaining the status value" }, "unlinkedFrom": { "type": "object", "optional": true, "properties": { "epicID": { "type": "string?", "value": "filled in if blocked Discord account was linked to an Epic user; absent if this request blocks an Epic account" }, "epicName": { "type": "string?", "value": "filled in if blocked Discord account was linked to an Epic user; absent if this request blocks an Epic account" }, "id": { "type": "string?", "value": "filled in if blocked Epic account was linked to a Discord user; absent if this request block a Discord account" }, "name": { "type": "string?", "value": "filled in if blocked Epic account was linked to a Discord user; absent if this request block a Discord account" }, "avatar": { "type": "string?", "value": "filled in if blocked Epic account was linked to a Discord user; absent if this request block a Discord account" } } } } }
{ "status": "SUCCESS", "message": "User blocked successfully.", "unlinkedFrom": { "epicID": "a1c2d3e4f5a1c2d3e4f5a1c2d3e4f5a1", "epicName": "xXGrieferXx" } }
Check Block Status
You can check the block status of multiple users in a single batch request.
POST
Check block status of multiple users
https://yunite.xyz/api/v3/guild/{guildId}/registration/block-status
- Request
- Response
Path Parameters
Request Body
Name | Value type | Description |
---|---|---|
guildId | Guild ID Snowflake | The ID of the guild you want to access |
- Schema
- Example
{ "type": "object", "properties": { "type": { "type": "string", "value": "one of ['DISCORD', 'EPIC']" }, "userIds": { "type": "array", "itemSchema": { "type": "string", "value": "Array of Discord IDs or Epic IDs, depending on given type (max 100)" } } } }
{ "type": "DISCORD", "userIds": [ "111111111", "222222222", "333333333" ] }
- Schema
- Example
{ "type": "object", "properties": { "blocked": { "type": "array", "itemSchema": { "type": "object", "properties": { "userId": { "type": "string", "value": "The ID of the blocked user" }, "blockedBy": { "type": "string", "value": "The ID of the moderator/system that issued the block" }, "reason": { "type": "string", "value": "The reason provided for the block" }, "userType": { "type": "string", "value": "The type of user (DISCORD or EPIC)" } } } }, "notBlocked": { "type": "array", "itemSchema": { "type": "string", "value": "User IDs that exist in the system but are not blocked" } }, "notFound": { "type": "array", "itemSchema": { "type": "string", "value": "User IDs that were not found in the system" } } } }
{ "blocked": [ { "userId": "123456789", "blockedBy": "987654321", "reason": "API Block: Violation of terms", "userType": "DISCORD" } ], "notBlocked": [ "234567890", "345678901" ], "notFound": [ "456789012" ] }