---
title: "Create a new MOH for User from Upload (JSON + Base64 File)"
method: POST
path: "/domains/{domain}/users/{user}/moh#2"
tags: ["Media/Music on Hold/User"]
---

# Create a new MOH for User from Upload (JSON + Base64 File)

`POST /domains/{domain}/users/{user}/moh#2`

> Note: # and anything after is NOT needed, its just to allow multiple examples for the same path/method.

## Path parameters

- `domain` string, required — This is the main organization name. This is used to link resource to its group/tenant/organization/enterprise. Then using in path for GET you can set to "~" to use the domain name linked to your token/key instead of the domain name itself when reading for your own domain.
- `user` string, required — This is the main user extension for the user account. ~ can be used to mean "my account" which will extract the user from the token/key used for authentication.

## Request body

- object
  - `synchronous` 'yes' | 'no', required — When synchronous is requested with "yes" the response will be a 200 on success and will contain a valid JSON representiation of the new resource. If no or left off request a 202 "Accepted" will be given in a success case and this can be considered a success. Synchronous responses will be a little slower as the API will process the geo replication request and wait till the local copy has been written and can be read back berfore sending a response.
  - `index` integer — The index of the file, Example "2" for greeting 2. In create (POST) requests index cab be omitted and the API will select a new index automatically.
  - `script` string, required — This is a simple explanation of what the audio is and can include what is said in the audio file for explanation.
  - `convert` 'yes' | 'no' — Setting yes will allow the API to attempt to convert the file from accepted formats into the correct format for media playback
  - `encoding` string — Used when providing base64 encoded data to give the content tupe of the file.
  - `base64_file` string — This is a base64 encoded string formated without line breaks or spaces.

## Response `202`

- SuccessResponse
  - `code` integer, required
  - `message` string, required

## Other responses

- `400`
- `401`
- `404`

---

[API](https://skmtc.net/ns-api/apis/netsapiens-api-v2.md) · [All operations](https://skmtc.net/ns-api/apis/netsapiens-api-v2/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/ns-api/netsapiens-api-v2/versions/d37f65b5b886/schema)
