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/UserNotificationSettingsInput",
      "description": "Default guild notification level"
    },
    "muted": {
      "type": "boolean",
      "description": "Guild muted"
    },
    "mute_config": {
      "description": "Guild mute configuration",
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "end_time": {
              "description": "When the mute expires",
              "anyOf": [
                {
                  "anyOf": [
                    {
                      "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
                    }
                  ]
                },
                {
                  "type": "null"
                }
              ]
            },
            "selected_time_window": {
              "type": "integer",
              "minimum": -9007199254740991,
              "maximum": 9007199254740991,
              "description": "Selected mute duration"
            }
          },
          "required": [
            "selected_time_window"
          ]
        },
        {
          "type": "null"
        }
      ]
    },
    "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",
          "propertyNames": {
            "$ref": "#/components/schemas/SnowflakeStringType"
          },
          "additionalProperties": {
            "type": "object",
            "properties": {
              "collapsed": {
                "type": "boolean",
                "description": "Channel category collapsed"
              },
              "message_notifications": {
                "$ref": "#/components/schemas/UserNotificationSettingsInput",
                "description": "Channel notification level"
              },
              "muted": {
                "type": "boolean",
                "description": "Channel muted"
              },
              "mute_config": {
                "description": "Channel mute configuration",
                "anyOf": [
                  {
                    "type": "object",
                    "properties": {
                      "end_time": {
                        "description": "When the mute expires",
                        "anyOf": [
                          {
                            "anyOf": [
                              {
                                "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
                              }
                            ]
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "selected_time_window": {
                        "type": "integer",
                        "minimum": -9007199254740991,
                        "maximum": 9007199254740991,
                        "description": "Selected mute duration"
                      }
                    },
                    "required": [
                      "selected_time_window"
                    ]
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "unread_badges": {
                "description": "Unread badges level override for this channel (null = inherit)",
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/UserNotificationSettingsInput",
                    "description": "Unread badges level override for this channel"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "flags": {
                "description": "Channel override flags (NEW_FORUM_THREADS_OFF 1<<13, NEW_FORUM_THREADS_ON 1<<14)",
                "$ref": "#/components/schemas/Int32Type"
              }
            },
            "required": [
              "collapsed",
              "message_notifications",
              "muted"
            ]
          }
        },
        {
          "type": "null"
        }
      ],
      "description": "Per-channel overrides"
    },
    "unread_badges": {
      "description": "Default unread badges level for the guild (null = follows message_notifications)",
      "anyOf": [
        {
          "$ref": "#/components/schemas/UserNotificationSettingsInput",
          "description": "Default unread badges level for the guild"
        },
        {
          "type": "null"
        }
      ]
    }
  }
}

Responses

200

Success

json
{
  "type": "object",
  "properties": {
    "guild_id": {
      "anyOf": [
        {
          "$ref": "#/components/schemas/SnowflakeStringType"
        },
        {
          "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": {
              "description": "ISO8601 timestamp of when the mute expires",
              "type": [
                "string",
                "null"
              ]
            },
            "selected_time_window": {
              "description": "The selected mute duration in seconds",
              "$ref": "#/components/schemas/Int32Type"
            }
          },
          "required": [
            "end_time",
            "selected_time_window"
          ],
          "additionalProperties": false
        },
        {
          "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",
          "propertyNames": {
            "$ref": "#/components/schemas/SnowflakeStringType"
          },
          "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": {
                        "description": "ISO8601 timestamp of when the mute expires",
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "selected_time_window": {
                        "description": "The selected mute duration in seconds",
                        "$ref": "#/components/schemas/Int32Type"
                      }
                    },
                    "required": [
                      "end_time",
                      "selected_time_window"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "The mute configuration for this channel"
              },
              "unread_badges": {
                "description": "Unread badges level override for this channel (null = inherit)",
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/UserNotificationSettings",
                    "description": "Unread badges level override for this channel"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "flags": {
                "description": "Channel override flags (NEW_FORUM_THREADS_OFF 1<<13, NEW_FORUM_THREADS_ON 1<<14)",
                "$ref": "#/components/schemas/Int32Type"
              }
            },
            "required": [
              "collapsed",
              "message_notifications",
              "muted",
              "mute_config"
            ],
            "additionalProperties": false
          }
        },
        {
          "type": "null"
        }
      ],
      "description": "Per-channel notification overrides"
    },
    "unread_badges": {
      "description": "Default unread badges level for the guild (null = follows message_notifications)",
      "anyOf": [
        {
          "$ref": "#/components/schemas/UserNotificationSettings",
          "description": "Default unread badges level for the guild"
        },
        {
          "type": "null"
        }
      ]
    },
    "version": {
      "description": "The version number of these settings for sync",
      "$ref": "#/components/schemas/Int32Type"
    }
  },
  "required": [
    "guild_id",
    "message_notifications",
    "muted",
    "mute_config",
    "mobile_push",
    "suppress_everyone",
    "suppress_roles",
    "hide_muted_channels",
    "channel_overrides",
    "version"
  ],
  "additionalProperties": false
}
400

Bad Request - The request was malformed or contained invalid data

json
{
  "type": "object",
  "properties": {
    "code": {
      "type": "string",
      "description": "Machine-readable error code"
    },
    "message": {
      "type": "string",
      "description": "Human-readable error message"
    },
    "errors": {
      "description": "Field-specific validation errors",
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "path": {
            "type": "string",
            "description": "Field path that failed validation"
          },
          "code": {
            "description": "Machine-readable validation error code",
            "type": "string"
          },
          "message": {
            "type": "string",
            "description": "Human-readable validation error message"
          }
        },
        "required": [
          "path",
          "message"
        ],
        "additionalProperties": false
      }
    }
  },
  "required": [
    "code",
    "message"
  ],
  "additionalProperties": {}
}
401

Unauthorized - Authentication is required or the token is invalid

json
{
  "type": "object",
  "properties": {
    "code": {
      "type": "string",
      "description": "Machine-readable error code"
    },
    "message": {
      "type": "string",
      "description": "Human-readable error message"
    },
    "errors": {
      "description": "Field-specific validation errors",
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "path": {
            "type": "string",
            "description": "Field path that failed validation"
          },
          "code": {
            "description": "Machine-readable validation error code",
            "type": "string"
          },
          "message": {
            "type": "string",
            "description": "Human-readable validation error message"
          }
        },
        "required": [
          "path",
          "message"
        ],
        "additionalProperties": false
      }
    }
  },
  "required": [
    "code",
    "message"
  ],
  "additionalProperties": {}
}
403

Forbidden - You do not have permission to perform this action

json
{
  "type": "object",
  "properties": {
    "code": {
      "type": "string",
      "description": "Machine-readable error code"
    },
    "message": {
      "type": "string",
      "description": "Human-readable error message"
    },
    "errors": {
      "description": "Field-specific validation errors",
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "path": {
            "type": "string",
            "description": "Field path that failed validation"
          },
          "code": {
            "description": "Machine-readable validation error code",
            "type": "string"
          },
          "message": {
            "type": "string",
            "description": "Human-readable validation error message"
          }
        },
        "required": [
          "path",
          "message"
        ],
        "additionalProperties": false
      }
    }
  },
  "required": [
    "code",
    "message"
  ],
  "additionalProperties": {}
}
429

Too Many Requests - You are being rate limited

json
{
  "type": "object",
  "properties": {
    "code": {
      "type": "string",
      "description": "Machine-readable error code"
    },
    "message": {
      "type": "string",
      "description": "Human-readable error message"
    },
    "errors": {
      "description": "Field-specific validation errors",
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "path": {
            "type": "string",
            "description": "Field path that failed validation"
          },
          "code": {
            "description": "Machine-readable validation error code",
            "type": "string"
          },
          "message": {
            "type": "string",
            "description": "Human-readable validation error message"
          }
        },
        "required": [
          "path",
          "message"
        ],
        "additionalProperties": false
      }
    },
    "retry_after": {
      "type": "number",
      "description": "Seconds to wait before retrying"
    },
    "global": {
      "type": "boolean",
      "description": "Whether this is a global rate limit"
    }
  },
  "required": [
    "code",
    "message"
  ],
  "additionalProperties": {}
}
500

Internal Server Error - An unexpected error occurred

json
{
  "type": "object",
  "properties": {
    "code": {
      "type": "string",
      "description": "Machine-readable error code"
    },
    "message": {
      "type": "string",
      "description": "Human-readable error message"
    },
    "errors": {
      "description": "Field-specific validation errors",
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "path": {
            "type": "string",
            "description": "Field path that failed validation"
          },
          "code": {
            "description": "Machine-readable validation error code",
            "type": "string"
          },
          "message": {
            "type": "string",
            "description": "Human-readable validation error message"
          }
        },
        "required": [
          "path",
          "message"
        ],
        "additionalProperties": false
      }
    }
  },
  "required": [
    "code",
    "message"
  ],
  "additionalProperties": {}
}