> For the complete documentation index, see [llms.txt](https://docs.papelship.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.papelship.com/qpapel-web-api-reference/discord-integrations.md).

# Discord Integrations

Guild linkage, anti-cheat event channel streaming, and role-based bot permissions.

## List Discord Integrations

> Retrieve connected Discord server integrations, log stream channels, and role permission mappings.

```json
{"openapi":"3.0.3","info":{"title":"qPapel Protection Web API","version":"1.0.0"},"tags":[{"name":"Discord Integrations","description":"Guild linkage, anti-cheat event channel streaming, and role-based bot permissions."}],"servers":[{"url":"https://papelship.com/api/qpapel/v1","description":"Production Server"}],"security":[{"BearerAuth":[]},{"ApiKeyHeader":[]},{"ApiKeyHeaderLegacy":[]}],"components":{"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"API_KEY","description":"Standard HTTP Bearer token authentication header (e.g. `Authorization: Bearer pk_live_...`)."},"ApiKeyHeader":{"type":"apiKey","in":"header","name":"x-api-key","description":"Custom header API key authentication parameter (`x-api-key: pk_live_...`)."},"ApiKeyHeaderLegacy":{"type":"apiKey","in":"header","name":"api-key","description":"Legacy custom header API key fallback parameter (`api-key: pk_live_...`)."}},"schemas":{"DiscordIntegration":{"type":"object","properties":{"id":{"type":"integer"},"guild_id":{"type":"string"},"guild_name":{"type":"string"},"is_active":{"type":"integer"},"log_channel_id":{"type":"string","nullable":true},"log_dm_enabled":{"type":"integer"},"owner_username":{"type":"string","nullable":true},"products":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":"string"}}}},"permissions":{"type":"array","items":{"$ref":"#/components/schemas/DiscordPermission"}}}},"DiscordPermission":{"type":"object","properties":{"id":{"type":"integer"},"subject_type":{"type":"string","enum":["ROLE","USER"]},"subject_id":{"type":"string"},"product_id":{"type":"integer","nullable":true},"can_create_key":{"type":"integer"},"can_delete_key":{"type":"integer"},"can_ban_key":{"type":"integer"},"can_freeze_key":{"type":"integer"},"can_reset_hwid":{"type":"integer"}}},"StandardErrorResponse":{"type":"object","properties":{"success":{"type":"boolean"},"error":{"type":"string"}}}},"responses":{"UnauthorizedError":{"description":"Authentication failed. Missing or invalid developer API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StandardErrorResponse"}}}}}},"paths":{"/discord-integrations":{"get":{"tags":["Discord Integrations"],"summary":"List Discord Integrations","description":"Retrieve connected Discord server integrations, log stream channels, and role permission mappings.","operationId":"listDiscordIntegrations","parameters":[{"name":"includeProducts","in":"query","description":"Expand linked products in response.","schema":{"type":"boolean","default":false}},{"name":"includePermissions","in":"query","description":"Expand role and user permission assignments in response.","schema":{"type":"boolean","default":false}}],"responses":{"200":{"description":"List of Discord integrations.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"integrations":{"type":"array","items":{"$ref":"#/components/schemas/DiscordIntegration"}}}}}}},"401":{"$ref":"#/components/responses/UnauthorizedError"}}}}}}
```

## Register Discord Guild Integration

> Connect a new Discord server guild to the developer protection workspace.

```json
{"openapi":"3.0.3","info":{"title":"qPapel Protection Web API","version":"1.0.0"},"tags":[{"name":"Discord Integrations","description":"Guild linkage, anti-cheat event channel streaming, and role-based bot permissions."}],"servers":[{"url":"https://papelship.com/api/qpapel/v1","description":"Production Server"}],"security":[{"BearerAuth":[]},{"ApiKeyHeader":[]},{"ApiKeyHeaderLegacy":[]}],"components":{"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"API_KEY","description":"Standard HTTP Bearer token authentication header (e.g. `Authorization: Bearer pk_live_...`)."},"ApiKeyHeader":{"type":"apiKey","in":"header","name":"x-api-key","description":"Custom header API key authentication parameter (`x-api-key: pk_live_...`)."},"ApiKeyHeaderLegacy":{"type":"apiKey","in":"header","name":"api-key","description":"Legacy custom header API key fallback parameter (`api-key: pk_live_...`)."}},"schemas":{"DiscordIntegration":{"type":"object","properties":{"id":{"type":"integer"},"guild_id":{"type":"string"},"guild_name":{"type":"string"},"is_active":{"type":"integer"},"log_channel_id":{"type":"string","nullable":true},"log_dm_enabled":{"type":"integer"},"owner_username":{"type":"string","nullable":true},"products":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":"string"}}}},"permissions":{"type":"array","items":{"$ref":"#/components/schemas/DiscordPermission"}}}},"DiscordPermission":{"type":"object","properties":{"id":{"type":"integer"},"subject_type":{"type":"string","enum":["ROLE","USER"]},"subject_id":{"type":"string"},"product_id":{"type":"integer","nullable":true},"can_create_key":{"type":"integer"},"can_delete_key":{"type":"integer"},"can_ban_key":{"type":"integer"},"can_freeze_key":{"type":"integer"},"can_reset_hwid":{"type":"integer"}}},"StandardErrorResponse":{"type":"object","properties":{"success":{"type":"boolean"},"error":{"type":"string"}}}},"responses":{"BadRequestError":{"description":"Invalid request body or query parameter structure.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StandardErrorResponse"}}}},"UnauthorizedError":{"description":"Authentication failed. Missing or invalid developer API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StandardErrorResponse"}}}}}},"paths":{"/discord-integrations":{"post":{"tags":["Discord Integrations"],"summary":"Register Discord Guild Integration","description":"Connect a new Discord server guild to the developer protection workspace.","operationId":"createDiscordIntegration","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["guild_id"],"properties":{"guild_id":{"type":"string","description":"Discord Snowflake Guild ID."},"guild_name":{"type":"string","description":"Guild title."},"log_channel_id":{"type":"string","description":"Discord Text Channel Snowflake ID for anti-cheat and security logs."},"log_dm_enabled":{"type":"boolean","description":"Allow automated direct notification messages to users.","default":false}}}}}},"responses":{"200":{"description":"Integration registered.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"integration":{"$ref":"#/components/schemas/DiscordIntegration"}}}}}},"400":{"$ref":"#/components/responses/BadRequestError"},"401":{"$ref":"#/components/responses/UnauthorizedError"}}}}}}
```

## Get Discord Integration Details

> Retrieve complete configuration, attached products, and role permissions for a Discord guild connection.

```json
{"openapi":"3.0.3","info":{"title":"qPapel Protection Web API","version":"1.0.0"},"tags":[{"name":"Discord Integrations","description":"Guild linkage, anti-cheat event channel streaming, and role-based bot permissions."}],"servers":[{"url":"https://papelship.com/api/qpapel/v1","description":"Production Server"}],"security":[{"BearerAuth":[]},{"ApiKeyHeader":[]},{"ApiKeyHeaderLegacy":[]}],"components":{"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"API_KEY","description":"Standard HTTP Bearer token authentication header (e.g. `Authorization: Bearer pk_live_...`)."},"ApiKeyHeader":{"type":"apiKey","in":"header","name":"x-api-key","description":"Custom header API key authentication parameter (`x-api-key: pk_live_...`)."},"ApiKeyHeaderLegacy":{"type":"apiKey","in":"header","name":"api-key","description":"Legacy custom header API key fallback parameter (`api-key: pk_live_...`)."}},"schemas":{"DiscordIntegration":{"type":"object","properties":{"id":{"type":"integer"},"guild_id":{"type":"string"},"guild_name":{"type":"string"},"is_active":{"type":"integer"},"log_channel_id":{"type":"string","nullable":true},"log_dm_enabled":{"type":"integer"},"owner_username":{"type":"string","nullable":true},"products":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":"string"}}}},"permissions":{"type":"array","items":{"$ref":"#/components/schemas/DiscordPermission"}}}},"DiscordPermission":{"type":"object","properties":{"id":{"type":"integer"},"subject_type":{"type":"string","enum":["ROLE","USER"]},"subject_id":{"type":"string"},"product_id":{"type":"integer","nullable":true},"can_create_key":{"type":"integer"},"can_delete_key":{"type":"integer"},"can_ban_key":{"type":"integer"},"can_freeze_key":{"type":"integer"},"can_reset_hwid":{"type":"integer"}}},"StandardErrorResponse":{"type":"object","properties":{"success":{"type":"boolean"},"error":{"type":"string"}}}},"responses":{"UnauthorizedError":{"description":"Authentication failed. Missing or invalid developer API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StandardErrorResponse"}}}},"NotFoundError":{"description":"The requested resource was not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StandardErrorResponse"}}}}}},"paths":{"/discord-integrations/{id}":{"get":{"tags":["Discord Integrations"],"summary":"Get Discord Integration Details","description":"Retrieve complete configuration, attached products, and role permissions for a Discord guild connection.","operationId":"getDiscordIntegrationById","parameters":[{"name":"id","in":"path","required":true,"description":"Unique database ID of the integration.","schema":{"type":"integer"}}],"responses":{"200":{"description":"Detailed integration record.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"integration":{"$ref":"#/components/schemas/DiscordIntegration"}}}}}},"401":{"$ref":"#/components/responses/UnauthorizedError"},"404":{"$ref":"#/components/responses/NotFoundError"}}}}}}
```

## Update Discord Integration

> Modify channel routing, active state, or DM delivery settings.

```json
{"openapi":"3.0.3","info":{"title":"qPapel Protection Web API","version":"1.0.0"},"tags":[{"name":"Discord Integrations","description":"Guild linkage, anti-cheat event channel streaming, and role-based bot permissions."}],"servers":[{"url":"https://papelship.com/api/qpapel/v1","description":"Production Server"}],"security":[{"BearerAuth":[]},{"ApiKeyHeader":[]},{"ApiKeyHeaderLegacy":[]}],"components":{"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"API_KEY","description":"Standard HTTP Bearer token authentication header (e.g. `Authorization: Bearer pk_live_...`)."},"ApiKeyHeader":{"type":"apiKey","in":"header","name":"x-api-key","description":"Custom header API key authentication parameter (`x-api-key: pk_live_...`)."},"ApiKeyHeaderLegacy":{"type":"apiKey","in":"header","name":"api-key","description":"Legacy custom header API key fallback parameter (`api-key: pk_live_...`)."}},"schemas":{"StandardSuccessResponse":{"type":"object","properties":{"success":{"type":"boolean"},"message":{"type":"string"}}},"StandardErrorResponse":{"type":"object","properties":{"success":{"type":"boolean"},"error":{"type":"string"}}}},"responses":{"BadRequestError":{"description":"Invalid request body or query parameter structure.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StandardErrorResponse"}}}},"UnauthorizedError":{"description":"Authentication failed. Missing or invalid developer API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StandardErrorResponse"}}}}}},"paths":{"/discord-integrations/{id}":{"put":{"tags":["Discord Integrations"],"summary":"Update Discord Integration","description":"Modify channel routing, active state, or DM delivery settings.","operationId":"updateDiscordIntegration","parameters":[{"name":"id","in":"path","required":true,"description":"Unique database ID of the integration.","schema":{"type":"integer"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"guild_name":{"type":"string"},"is_active":{"type":"boolean"},"log_channel_id":{"type":"string"},"log_dm_enabled":{"type":"boolean"}}}}}},"responses":{"200":{"description":"Integration updated.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StandardSuccessResponse"}}}},"400":{"$ref":"#/components/responses/BadRequestError"},"401":{"$ref":"#/components/responses/UnauthorizedError"}}}}}}
```

## Delete Discord Integration

> Disconnect Discord guild and cascade delete mapped permissions.

```json
{"openapi":"3.0.3","info":{"title":"qPapel Protection Web API","version":"1.0.0"},"tags":[{"name":"Discord Integrations","description":"Guild linkage, anti-cheat event channel streaming, and role-based bot permissions."}],"servers":[{"url":"https://papelship.com/api/qpapel/v1","description":"Production Server"}],"security":[{"BearerAuth":[]},{"ApiKeyHeader":[]},{"ApiKeyHeaderLegacy":[]}],"components":{"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"API_KEY","description":"Standard HTTP Bearer token authentication header (e.g. `Authorization: Bearer pk_live_...`)."},"ApiKeyHeader":{"type":"apiKey","in":"header","name":"x-api-key","description":"Custom header API key authentication parameter (`x-api-key: pk_live_...`)."},"ApiKeyHeaderLegacy":{"type":"apiKey","in":"header","name":"api-key","description":"Legacy custom header API key fallback parameter (`api-key: pk_live_...`)."}},"schemas":{"StandardSuccessResponse":{"type":"object","properties":{"success":{"type":"boolean"},"message":{"type":"string"}}},"StandardErrorResponse":{"type":"object","properties":{"success":{"type":"boolean"},"error":{"type":"string"}}}},"responses":{"UnauthorizedError":{"description":"Authentication failed. Missing or invalid developer API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StandardErrorResponse"}}}},"NotFoundError":{"description":"The requested resource was not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StandardErrorResponse"}}}}}},"paths":{"/discord-integrations/{id}":{"delete":{"tags":["Discord Integrations"],"summary":"Delete Discord Integration","description":"Disconnect Discord guild and cascade delete mapped permissions.","operationId":"deleteDiscordIntegration","parameters":[{"name":"id","in":"path","required":true,"description":"Unique database ID of the integration.","schema":{"type":"integer"}}],"responses":{"200":{"description":"Integration removed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StandardSuccessResponse"}}}},"401":{"$ref":"#/components/responses/UnauthorizedError"},"404":{"$ref":"#/components/responses/NotFoundError"}}}}}}
```

## Send Test Log Webhook

> Dispatch a test verification event message to the designated Discord logging channel.

```json
{"openapi":"3.0.3","info":{"title":"qPapel Protection Web API","version":"1.0.0"},"tags":[{"name":"Discord Integrations","description":"Guild linkage, anti-cheat event channel streaming, and role-based bot permissions."}],"servers":[{"url":"https://papelship.com/api/qpapel/v1","description":"Production Server"}],"security":[{"BearerAuth":[]},{"ApiKeyHeader":[]},{"ApiKeyHeaderLegacy":[]}],"components":{"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"API_KEY","description":"Standard HTTP Bearer token authentication header (e.g. `Authorization: Bearer pk_live_...`)."},"ApiKeyHeader":{"type":"apiKey","in":"header","name":"x-api-key","description":"Custom header API key authentication parameter (`x-api-key: pk_live_...`)."},"ApiKeyHeaderLegacy":{"type":"apiKey","in":"header","name":"api-key","description":"Legacy custom header API key fallback parameter (`api-key: pk_live_...`)."}},"schemas":{"StandardSuccessResponse":{"type":"object","properties":{"success":{"type":"boolean"},"message":{"type":"string"}}},"StandardErrorResponse":{"type":"object","properties":{"success":{"type":"boolean"},"error":{"type":"string"}}}},"responses":{"UnauthorizedError":{"description":"Authentication failed. Missing or invalid developer API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StandardErrorResponse"}}}}}},"paths":{"/discord-integrations/{id}/test-log":{"post":{"tags":["Discord Integrations"],"summary":"Send Test Log Webhook","description":"Dispatch a test verification event message to the designated Discord logging channel.","operationId":"testDiscordLogging","parameters":[{"name":"id","in":"path","required":true,"description":"Unique database ID of the integration.","schema":{"type":"integer"}}],"responses":{"200":{"description":"Test log sent.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StandardSuccessResponse"}}}},"401":{"$ref":"#/components/responses/UnauthorizedError"}}}}}}
```

## List Discord Role/User Permissions

> Retrieve role and user command permission entries for a connected Discord guild.

```json
{"openapi":"3.0.3","info":{"title":"qPapel Protection Web API","version":"1.0.0"},"tags":[{"name":"Discord Integrations","description":"Guild linkage, anti-cheat event channel streaming, and role-based bot permissions."}],"servers":[{"url":"https://papelship.com/api/qpapel/v1","description":"Production Server"}],"security":[{"BearerAuth":[]},{"ApiKeyHeader":[]},{"ApiKeyHeaderLegacy":[]}],"components":{"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"API_KEY","description":"Standard HTTP Bearer token authentication header (e.g. `Authorization: Bearer pk_live_...`)."},"ApiKeyHeader":{"type":"apiKey","in":"header","name":"x-api-key","description":"Custom header API key authentication parameter (`x-api-key: pk_live_...`)."},"ApiKeyHeaderLegacy":{"type":"apiKey","in":"header","name":"api-key","description":"Legacy custom header API key fallback parameter (`api-key: pk_live_...`)."}},"schemas":{"DiscordPermission":{"type":"object","properties":{"id":{"type":"integer"},"subject_type":{"type":"string","enum":["ROLE","USER"]},"subject_id":{"type":"string"},"product_id":{"type":"integer","nullable":true},"can_create_key":{"type":"integer"},"can_delete_key":{"type":"integer"},"can_ban_key":{"type":"integer"},"can_freeze_key":{"type":"integer"},"can_reset_hwid":{"type":"integer"}}},"StandardErrorResponse":{"type":"object","properties":{"success":{"type":"boolean"},"error":{"type":"string"}}}},"responses":{"UnauthorizedError":{"description":"Authentication failed. Missing or invalid developer API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StandardErrorResponse"}}}}}},"paths":{"/discord-integrations/{id}/permissions":{"get":{"tags":["Discord Integrations"],"summary":"List Discord Role/User Permissions","description":"Retrieve role and user command permission entries for a connected Discord guild.","operationId":"listDiscordPermissions","parameters":[{"name":"id","in":"path","required":true,"description":"Unique database ID of the integration.","schema":{"type":"integer"}}],"responses":{"200":{"description":"List of permissions.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"permissions":{"type":"array","items":{"$ref":"#/components/schemas/DiscordPermission"}}}}}}},"401":{"$ref":"#/components/responses/UnauthorizedError"}}}}}}
```

## Create or Update Discord Permission

> Assign bot management permissions to a Discord role or user Snowflake.

```json
{"openapi":"3.0.3","info":{"title":"qPapel Protection Web API","version":"1.0.0"},"tags":[{"name":"Discord Integrations","description":"Guild linkage, anti-cheat event channel streaming, and role-based bot permissions."}],"servers":[{"url":"https://papelship.com/api/qpapel/v1","description":"Production Server"}],"security":[{"BearerAuth":[]},{"ApiKeyHeader":[]},{"ApiKeyHeaderLegacy":[]}],"components":{"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"API_KEY","description":"Standard HTTP Bearer token authentication header (e.g. `Authorization: Bearer pk_live_...`)."},"ApiKeyHeader":{"type":"apiKey","in":"header","name":"x-api-key","description":"Custom header API key authentication parameter (`x-api-key: pk_live_...`)."},"ApiKeyHeaderLegacy":{"type":"apiKey","in":"header","name":"api-key","description":"Legacy custom header API key fallback parameter (`api-key: pk_live_...`)."}},"schemas":{"DiscordPermission":{"type":"object","properties":{"id":{"type":"integer"},"subject_type":{"type":"string","enum":["ROLE","USER"]},"subject_id":{"type":"string"},"product_id":{"type":"integer","nullable":true},"can_create_key":{"type":"integer"},"can_delete_key":{"type":"integer"},"can_ban_key":{"type":"integer"},"can_freeze_key":{"type":"integer"},"can_reset_hwid":{"type":"integer"}}},"StandardErrorResponse":{"type":"object","properties":{"success":{"type":"boolean"},"error":{"type":"string"}}}},"responses":{"BadRequestError":{"description":"Invalid request body or query parameter structure.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StandardErrorResponse"}}}},"UnauthorizedError":{"description":"Authentication failed. Missing or invalid developer API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StandardErrorResponse"}}}}}},"paths":{"/discord-integrations/{id}/permissions":{"post":{"tags":["Discord Integrations"],"summary":"Create or Update Discord Permission","description":"Assign bot management permissions to a Discord role or user Snowflake.","operationId":"upsertDiscordPermission","parameters":[{"name":"id","in":"path","required":true,"description":"Unique database ID of the integration.","schema":{"type":"integer"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["subject_type","subject_id"],"properties":{"subject_type":{"type":"string","enum":["ROLE","USER"]},"subject_id":{"type":"string","description":"Discord Snowflake ID."},"product_id":{"type":"integer","nullable":true,"description":"Restrict capability to product ID (null for global scope)."},"can_create_key":{"type":"boolean","default":false},"can_delete_key":{"type":"boolean","default":false},"can_ban_key":{"type":"boolean","default":false},"can_freeze_key":{"type":"boolean","default":false},"can_reset_hwid":{"type":"boolean","default":false}}}}}},"responses":{"200":{"description":"Permission saved.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"permission":{"$ref":"#/components/schemas/DiscordPermission"}}}}}},"400":{"$ref":"#/components/responses/BadRequestError"},"401":{"$ref":"#/components/responses/UnauthorizedError"}}}}}}
```

## Delete Discord Permission

> Revoke a specific role or user permission entry.

```json
{"openapi":"3.0.3","info":{"title":"qPapel Protection Web API","version":"1.0.0"},"tags":[{"name":"Discord Integrations","description":"Guild linkage, anti-cheat event channel streaming, and role-based bot permissions."}],"servers":[{"url":"https://papelship.com/api/qpapel/v1","description":"Production Server"}],"security":[{"BearerAuth":[]},{"ApiKeyHeader":[]},{"ApiKeyHeaderLegacy":[]}],"components":{"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"API_KEY","description":"Standard HTTP Bearer token authentication header (e.g. `Authorization: Bearer pk_live_...`)."},"ApiKeyHeader":{"type":"apiKey","in":"header","name":"x-api-key","description":"Custom header API key authentication parameter (`x-api-key: pk_live_...`)."},"ApiKeyHeaderLegacy":{"type":"apiKey","in":"header","name":"api-key","description":"Legacy custom header API key fallback parameter (`api-key: pk_live_...`)."}},"schemas":{"StandardSuccessResponse":{"type":"object","properties":{"success":{"type":"boolean"},"message":{"type":"string"}}},"StandardErrorResponse":{"type":"object","properties":{"success":{"type":"boolean"},"error":{"type":"string"}}}},"responses":{"UnauthorizedError":{"description":"Authentication failed. Missing or invalid developer API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StandardErrorResponse"}}}},"NotFoundError":{"description":"The requested resource was not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StandardErrorResponse"}}}}}},"paths":{"/discord-integrations/{id}/permissions/{permissionId}":{"delete":{"tags":["Discord Integrations"],"summary":"Delete Discord Permission","description":"Revoke a specific role or user permission entry.","operationId":"deleteDiscordPermission","parameters":[{"name":"id","in":"path","required":true,"description":"Unique database ID of the integration.","schema":{"type":"integer"}},{"name":"permissionId","in":"path","required":true,"description":"Unique ID of the permission record.","schema":{"type":"integer"}}],"responses":{"200":{"description":"Permission revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StandardSuccessResponse"}}}},"401":{"$ref":"#/components/responses/UnauthorizedError"},"404":{"$ref":"#/components/responses/NotFoundError"}}}}}}
```

## List Products Mapped to Discord

> Retrieve products linked to the specified Discord integration.

```json
{"openapi":"3.0.3","info":{"title":"qPapel Protection Web API","version":"1.0.0"},"tags":[{"name":"Discord Integrations","description":"Guild linkage, anti-cheat event channel streaming, and role-based bot permissions."}],"servers":[{"url":"https://papelship.com/api/qpapel/v1","description":"Production Server"}],"security":[{"BearerAuth":[]},{"ApiKeyHeader":[]},{"ApiKeyHeaderLegacy":[]}],"components":{"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"API_KEY","description":"Standard HTTP Bearer token authentication header (e.g. `Authorization: Bearer pk_live_...`)."},"ApiKeyHeader":{"type":"apiKey","in":"header","name":"x-api-key","description":"Custom header API key authentication parameter (`x-api-key: pk_live_...`)."},"ApiKeyHeaderLegacy":{"type":"apiKey","in":"header","name":"api-key","description":"Legacy custom header API key fallback parameter (`api-key: pk_live_...`)."}},"responses":{"UnauthorizedError":{"description":"Authentication failed. Missing or invalid developer API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StandardErrorResponse"}}}}},"schemas":{"StandardErrorResponse":{"type":"object","properties":{"success":{"type":"boolean"},"error":{"type":"string"}}}}},"paths":{"/discord-integrations/{id}/products":{"get":{"tags":["Discord Integrations"],"summary":"List Products Mapped to Discord","description":"Retrieve products linked to the specified Discord integration.","operationId":"listDiscordProducts","parameters":[{"name":"id","in":"path","required":true,"description":"Unique database ID of the integration.","schema":{"type":"integer"}}],"responses":{"200":{"description":"List of mapped products.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"products":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":"string"},"cheat_value":{"type":"string"}}}}}}}}},"401":{"$ref":"#/components/responses/UnauthorizedError"}}}}}}
```

## Map Product to Discord Integration

> Associate a product catalog entry with this Discord integration.

```json
{"openapi":"3.0.3","info":{"title":"qPapel Protection Web API","version":"1.0.0"},"tags":[{"name":"Discord Integrations","description":"Guild linkage, anti-cheat event channel streaming, and role-based bot permissions."}],"servers":[{"url":"https://papelship.com/api/qpapel/v1","description":"Production Server"}],"security":[{"BearerAuth":[]},{"ApiKeyHeader":[]},{"ApiKeyHeaderLegacy":[]}],"components":{"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"API_KEY","description":"Standard HTTP Bearer token authentication header (e.g. `Authorization: Bearer pk_live_...`)."},"ApiKeyHeader":{"type":"apiKey","in":"header","name":"x-api-key","description":"Custom header API key authentication parameter (`x-api-key: pk_live_...`)."},"ApiKeyHeaderLegacy":{"type":"apiKey","in":"header","name":"api-key","description":"Legacy custom header API key fallback parameter (`api-key: pk_live_...`)."}},"responses":{"BadRequestError":{"description":"Invalid request body or query parameter structure.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StandardErrorResponse"}}}},"UnauthorizedError":{"description":"Authentication failed. Missing or invalid developer API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StandardErrorResponse"}}}}},"schemas":{"StandardErrorResponse":{"type":"object","properties":{"success":{"type":"boolean"},"error":{"type":"string"}}}}},"paths":{"/discord-integrations/{id}/products":{"post":{"tags":["Discord Integrations"],"summary":"Map Product to Discord Integration","description":"Associate a product catalog entry with this Discord integration.","operationId":"addDiscordProduct","parameters":[{"name":"id","in":"path","required":true,"description":"Unique database ID of the integration.","schema":{"type":"integer"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["product_id"],"properties":{"product_id":{"type":"integer","description":"Numeric database ID of the product."}}}}}},"responses":{"200":{"description":"Product mapped.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"product":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":"string"}}}}}}}},"400":{"$ref":"#/components/responses/BadRequestError"},"401":{"$ref":"#/components/responses/UnauthorizedError"}}}}}}
```
