patch/users/@me/guilds/@me/settings

Update DM notification settings

Updates the user's notification settings for direct messages and group DMs. Controls how DM notifications are handled.

update_dm_notification_settings

Request body

application/json

json
{
  "type": "object",
  "properties": {
    "message_notifications": {
      "$ref": "#/components/schemas/UserNotificationSettings",
      "description": "Default guild notification level"
    },
    "muted": {
      "type": "boolean",
      "description": "Guild muted"
    },
    "mute_config": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "end_time": {
              "oneOf": [
                {
                  "type": "string",
                  "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(?:\\.\\d+)?(?:Z|[+-]\\d{2}:?\\d{2})?$"
                },
                {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 8640000000000000,
                  "format": "int53"
                },
                {
                  "type": "null"
                }
              ],
              "description": "When the mute expires"
            },
            "selected_time_window": {
              "type": "integer",
              "format": "int53",
              "description": "Selected mute duration"
            }
          },
          "required": [
            "selected_time_window"
          ]
        },
        {
          "type": "null"
        }
      ],
      "description": "Guild mute configuration"
    },
    "mobile_push": {
      "type": "boolean",
      "description": "Mobile push notifications enabled"
    },
    "suppress_everyone": {
      "type": "boolean",
      "description": "Suppress @everyone mentions"
    },
    "suppress_roles": {
      "type": "boolean",
      "description": "Suppress role mentions"
    },
    "hide_muted_channels": {
      "type": "boolean",
      "description": "Hide muted channels"
    },
    "channel_overrides": {
      "anyOf": [
        {
          "type": "object",
          "additionalProperties": {
            "type": "object",
            "properties": {
              "collapsed": {
                "type": "boolean",
                "description": "Channel category collapsed"
              },
              "message_notifications": {
                "$ref": "#/components/schemas/UserNotificationSettings",
                "description": "Channel notification level"
              },
              "muted": {
                "type": "boolean",
                "description": "Channel muted"
              },
              "mute_config": {
                "anyOf": [
                  {
                    "type": "object",
                    "properties": {
                      "end_time": {
                        "oneOf": [
                          {
                            "type": "string",
                            "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(?:\\.\\d+)?(?:Z|[+-]\\d{2}:?\\d{2})?$"
                          },
                          {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 8640000000000000,
                            "format": "int53"
                          },
                          {
                            "type": "null"
                          }
                        ],
                        "description": "When the mute expires"
                      },
                      "selected_time_window": {
                        "type": "integer",
                        "format": "int53",
                        "description": "Selected mute duration"
                      }
                    },
                    "required": [
                      "selected_time_window"
                    ]
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "Channel mute configuration"
              },
              "unread_badges": {
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/UserNotificationSettings",
                    "description": "Unread badges level override for this channel"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "Unread badges level override for this channel (null = inherit)"
              }
            },
            "required": [
              "collapsed",
              "message_notifications",
              "muted"
            ]
          },
          "patternProperties": {
            "^(0|[1-9][0-9]*)$": {
              "type": "object",
              "properties": {
                "collapsed": {
                  "type": "boolean",
                  "description": "Channel category collapsed"
                },
                "message_notifications": {
                  "$ref": "#/components/schemas/UserNotificationSettings",
                  "description": "Channel notification level"
                },
                "muted": {
                  "type": "boolean",
                  "description": "Channel muted"
                },
                "mute_config": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "end_time": {
                          "oneOf": [
                            {
                              "type": "string",
                              "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(?:\\.\\d+)?(?:Z|[+-]\\d{2}:?\\d{2})?$"
                            },
                            {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 8640000000000000,
                              "format": "int53"
                            },
                            {
                              "type": "null"
                            }
                          ],
                          "description": "When the mute expires"
                        },
                        "selected_time_window": {
                          "type": "integer",
                          "format": "int53",
                          "description": "Selected mute duration"
                        }
                      },
                      "required": [
                        "selected_time_window"
                      ]
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "description": "Channel mute configuration"
                },
                "unread_badges": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/UserNotificationSettings",
                      "description": "Unread badges level override for this channel"
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "description": "Unread badges level override for this channel (null = inherit)"
                }
              },
              "required": [
                "collapsed",
                "message_notifications",
                "muted"
              ]
            }
          },
          "x-keyType": "snowflake"
        },
        {
          "type": "null"
        }
      ],
      "description": "Per-channel overrides"
    },
    "unread_badges": {
      "anyOf": [
        {
          "$ref": "#/components/schemas/UserNotificationSettings",
          "description": "Default unread badges level for the guild"
        },
        {
          "type": "null"
        }
      ],
      "description": "Default unread badges level for the guild (null = follows message_notifications)"
    }
  }
}

Responses

200

Success

json
{
  "type": "object",
  "properties": {
    "guild_id": {
      "anyOf": [
        {
          "$ref": "#/components/schemas/SnowflakeType"
        },
        {
          "type": "null"
        }
      ],
      "description": "The ID of the guild these settings apply to"
    },
    "message_notifications": {
      "$ref": "#/components/schemas/UserNotificationSettings",
      "description": "The default notification level for the guild"
    },
    "muted": {
      "type": "boolean",
      "description": "Whether the guild is muted"
    },
    "mute_config": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "end_time": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "ISO8601 timestamp of when the mute expires"
            },
            "selected_time_window": {
              "type": "integer",
              "minimum": 0,
              "maximum": 2147483647,
              "format": "int32",
              "description": "The selected mute duration in seconds"
            }
          },
          "required": [
            "end_time",
            "selected_time_window"
          ]
        },
        {
          "type": "null"
        }
      ],
      "description": "The mute configuration for the guild"
    },
    "mobile_push": {
      "type": "boolean",
      "description": "Whether mobile push notifications are enabled"
    },
    "suppress_everyone": {
      "type": "boolean",
      "description": "Whether @everyone mentions are suppressed"
    },
    "suppress_roles": {
      "type": "boolean",
      "description": "Whether role mentions are suppressed"
    },
    "hide_muted_channels": {
      "type": "boolean",
      "description": "Whether muted channels are hidden in the sidebar"
    },
    "channel_overrides": {
      "anyOf": [
        {
          "type": "object",
          "additionalProperties": {
            "type": "object",
            "properties": {
              "collapsed": {
                "type": "boolean",
                "description": "Whether the channel category is collapsed in the sidebar"
              },
              "message_notifications": {
                "$ref": "#/components/schemas/UserNotificationSettings",
                "description": "The notification level override for this channel"
              },
              "muted": {
                "type": "boolean",
                "description": "Whether notifications are muted for this channel"
              },
              "mute_config": {
                "anyOf": [
                  {
                    "type": "object",
                    "properties": {
                      "end_time": {
                        "anyOf": [
                          {
                            "type": "string"
                          },
                          {
                            "type": "null"
                          }
                        ],
                        "description": "ISO8601 timestamp of when the mute expires"
                      },
                      "selected_time_window": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 2147483647,
                        "format": "int32",
                        "description": "The selected mute duration in seconds"
                      }
                    },
                    "required": [
                      "end_time",
                      "selected_time_window"
                    ]
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "The mute configuration for this channel"
              },
              "unread_badges": {
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/UserNotificationSettings",
                    "description": "Unread badges level override for this channel"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "Unread badges level override for this channel (null = inherit)"
              }
            },
            "required": [
              "collapsed",
              "message_notifications",
              "muted",
              "mute_config"
            ]
          },
          "patternProperties": {
            "^(0|[1-9][0-9]*)$": {
              "type": "object",
              "properties": {
                "collapsed": {
                  "type": "boolean",
                  "description": "Whether the channel category is collapsed in the sidebar"
                },
                "message_notifications": {
                  "$ref": "#/components/schemas/UserNotificationSettings",
                  "description": "The notification level override for this channel"
                },
                "muted": {
                  "type": "boolean",
                  "description": "Whether notifications are muted for this channel"
                },
                "mute_config": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "end_time": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ],
                          "description": "ISO8601 timestamp of when the mute expires"
                        },
                        "selected_time_window": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 2147483647,
                          "format": "int32",
                          "description": "The selected mute duration in seconds"
                        }
                      },
                      "required": [
                        "end_time",
                        "selected_time_window"
                      ]
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "description": "The mute configuration for this channel"
                },
                "unread_badges": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/UserNotificationSettings",
                      "description": "Unread badges level override for this channel"
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "description": "Unread badges level override for this channel (null = inherit)"
                }
              },
              "required": [
                "collapsed",
                "message_notifications",
                "muted",
                "mute_config"
              ]
            }
          },
          "x-keyType": "snowflake"
        },
        {
          "type": "null"
        }
      ],
      "description": "Per-channel notification overrides"
    },
    "unread_badges": {
      "anyOf": [
        {
          "$ref": "#/components/schemas/UserNotificationSettings",
          "description": "Default unread badges level for the guild"
        },
        {
          "type": "null"
        }
      ],
      "description": "Default unread badges level for the guild (null = follows message_notifications)"
    },
    "version": {
      "type": "integer",
      "minimum": 0,
      "maximum": 2147483647,
      "format": "int32",
      "description": "The version number of these settings for sync"
    }
  },
  "required": [
    "guild_id",
    "message_notifications",
    "muted",
    "mute_config",
    "mobile_push",
    "suppress_everyone",
    "suppress_roles",
    "hide_muted_channels",
    "channel_overrides",
    "version"
  ]
}
400

Bad Request - The request was malformed or contained invalid data

json
{
  "type": "object",
  "properties": {
    "code": {
      "$ref": "#/components/schemas/APIErrorCode"
    },
    "message": {
      "type": "string",
      "description": "Human-readable error message"
    },
    "errors": {
      "type": "array",
      "description": "Field-specific validation errors",
      "items": {
        "$ref": "#/components/schemas/ValidationErrorItem"
      }
    }
  },
  "required": [
    "code",
    "message"
  ]
}
401

Unauthorized - Authentication is required or the token is invalid

json
{
  "type": "object",
  "properties": {
    "code": {
      "$ref": "#/components/schemas/APIErrorCode"
    },
    "message": {
      "type": "string",
      "description": "Human-readable error message"
    },
    "errors": {
      "type": "array",
      "description": "Field-specific validation errors",
      "items": {
        "$ref": "#/components/schemas/ValidationErrorItem"
      }
    }
  },
  "required": [
    "code",
    "message"
  ]
}
403

Forbidden - You do not have permission to perform this action

json
{
  "type": "object",
  "properties": {
    "code": {
      "$ref": "#/components/schemas/APIErrorCode"
    },
    "message": {
      "type": "string",
      "description": "Human-readable error message"
    },
    "errors": {
      "type": "array",
      "description": "Field-specific validation errors",
      "items": {
        "$ref": "#/components/schemas/ValidationErrorItem"
      }
    }
  },
  "required": [
    "code",
    "message"
  ]
}
429

Too Many Requests - You are being rate limited

json
{
  "type": "object",
  "properties": {
    "code": {
      "type": "string",
      "enum": [
        "RATE_LIMITED"
      ]
    },
    "message": {
      "type": "string"
    },
    "retry_after": {
      "type": "number",
      "description": "Seconds to wait before retrying"
    },
    "global": {
      "type": "boolean",
      "description": "Whether this is a global rate limit"
    }
  },
  "required": [
    "code",
    "message",
    "retry_after"
  ]
}
500

Internal Server Error - An unexpected error occurred

json
{
  "type": "object",
  "properties": {
    "code": {
      "$ref": "#/components/schemas/APIErrorCode"
    },
    "message": {
      "type": "string",
      "description": "Human-readable error message"
    },
    "errors": {
      "type": "array",
      "description": "Field-specific validation errors",
      "items": {
        "$ref": "#/components/schemas/ValidationErrorItem"
      }
    }
  },
  "required": [
    "code",
    "message"
  ]
}