> ## Documentation Index
> Fetch the complete documentation index at: https://developer.rocket.chat/llms.txt
> Use this file to discover all available pages before exploring further.

# Create Custom Sound

> Upload a new custom sound to the workspace.

- The request must be sent as `multipart/form-data` and contain the audio file in the `sound` field and the display name in the `name` field.

- The file size must not exceed `5 MB` (5242880 bytes), and the file MIME type must be one of `audio/mpeg`, `audio/mp3`, `audio/wav`, or `audio/x-wav`.

This endpoint replaces the deprecated DDP methods `insertOrUpdateSound` and `uploadCustomSound`, which will be removed in `9.0.0`.

Permission required: `manage-sounds`

### Changelog
| Version | Description |
| ------- | ----------- |
| 8.5.0   | Added       |

## OpenAPI

````json POST /api/v1/custom-sounds.create
{
  "openapi": "3.0.0",
  "info": {
    "version": "1.0.0",
    "title": "Content Management"
  },
  "servers": [
    {
      "url": "https://apiexplorer.support.rocket.chat"
    }
  ],
  "tags": [
    {
      "name": "Assets"
    },
    {
      "name": "Custom Emoji"
    },
    {
      "name": "Custom Sounds"
    },
    {
      "name": "Custom User Status"
    }
  ],
  "paths": {
    "/api/v1/custom-sounds.create": {
      "post": {
        "tags": [
          "Custom Sounds"
        ],
        "summary": "Create Custom Sound",
        "description": "Upload a new custom sound to the workspace.\n\n- The request must be sent as `multipart/form-data` and contain the audio file in the `sound` field and the display name in the `name` field.\n\n- The file size must not exceed `5 MB` (5242880 bytes), and the file MIME type must be one of `audio/mpeg`, `audio/mp3`, `audio/wav`, or `audio/x-wav`.\n\nThis endpoint replaces the deprecated DDP methods `insertOrUpdateSound` and `uploadCustomSound`, which will be removed in `9.0.0`.\n\nPermission required: `manage-sounds`\n\n### Changelog\n| Version | Description |\n| ------- | ----------- |\n| 8.5.0   | Added       |",
        "operationId": "post-api-v1-custom-sounds.create",
        "parameters": [
          {
            "$ref": "#/components/parameters/Auth-Token"
          },
          {
            "$ref": "#/components/parameters/UserId"
          }
        ],
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "sound": {
                    "type": "string",
                    "format": "binary",
                    "description": "The audio file to upload. Allowed MIME types are `audio/mpeg`, `audio/mp3`, `audio/wav`, and `audio/x-wav`. Maximum size is `5 MB` (5242880 bytes)."
                  },
                  "name": {
                    "type": "string",
                    "description": "The display name of the custom sound. Must be at least one character long and must not contain colons, whitespace, or the characters `,`, `>`, `<`, `&`, `\"`, `'`, `/`, `\\`, `(`, or `)`.",
                    "example": "doremi"
                  }
                },
                "required": [
                  "sound",
                  "name"
                ]
              },
              "examples": {
                "Example": {
                  "value": {
                    "name": "doremi"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "sound": {
                      "type": "object",
                      "properties": {
                        "_id": {
                          "type": "string"
                        }
                      }
                    },
                    "success": {
                      "type": "boolean"
                    }
                  }
                },
                "examples": {
                  "Success Example": {
                    "value": {
                      "sound": {
                        "_id": "65462caea2f73c7460e18f83"
                      },
                      "success": "true"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "error": {
                      "type": "string"
                    },
                    "errorType": {
                      "type": "string"
                    }
                  }
                },
                "examples": {
                  "MIME type not allowed": {
                    "value": {
                      "success": "false",
                      "error": "MIME type not allowed"
                    }
                  },
                  "File too large": {
                    "value": {
                      "success": "false",
                      "error": "[error-file-too-large]"
                    }
                  },
                  "Name already in use": {
                    "value": {
                      "success": "false",
                      "error": "The custom sound name is already in use [Custom_Sound_Error_Name_Already_In_Use]"
                    }
                  },
                  "Invalid name": {
                    "value": {
                      "success": "false",
                      "error": "<script> is not a valid name"
                    }
                  },
                  "Missing required field": {
                    "value": {
                      "success": "false",
                      "error": "must have required property 'name' [invalid-params]",
                      "errorType": "invalid-params"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/authorizationError"
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "error": {
                      "type": "string"
                    },
                    "errorType": {
                      "type": "string"
                    }
                  }
                },
                "examples": {
                  "Permission Error": {
                    "value": {
                      "success": "false",
                      "error": "User does not have the permissions required for this action [error-unauthorized]",
                      "errorType": "error-unauthorized"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "parameters": {
      "Auth-Token": {
        "name": "X-Auth-Token",
        "in": "header",
        "description": "The `authToken` of the authenticated user.",
        "required": "true",
        "schema": {
          "type": "string"
        },
        "example": "RScctEHSmLGZGywfIhWyRpyofhKOiMoUIpimhvheU3f"
      },
      "UserId": {
        "name": "X-User-Id",
        "in": "header",
        "description": "The `userId` of the authenticated user.",
        "required": "true",
        "schema": {
          "type": "string"
        },
        "example": "rbAXPnMktTFbNpwtJ"
      }
    },
    "responses": {
      "authorizationError": {
        "description": "Unauthorized",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "status": {
                  "type": "string"
                },
                "message": {
                  "type": "string"
                }
              }
            },
            "examples": {
              "Authorization Error": {
                "value": {
                  "status": "error",
                  "message": "You must be logged in to do this."
                }
              }
            }
          }
        }
      }
    }
  }
}
````

