## Create phrase replacement config

### JavaScript

```json
{
  "phraseReplacements": [
    {
      "phrase": "سیونگز اکاؤنٹ",
      "replacement": "savings account"
    },
    {
      "phrase": "Isabion",
      "replacement": "ایزابیان"
    },
    {
      "phrase": "Meezan bank",
      "replacement": "میزان بینک"
    }
  ]
}
```

### cURL

```bash
curl --request POST \
  --url https://api.upliftai.org/v1/synthesis/phrase-replacement-config \
  --header 'Authorization: <api-key>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "phraseReplacements": [
    {
      "phrase": "<string>",
      "replacement": "<string>"
    }
  ]
}
'
```

### Python

```python
import requests

url = "https://api.upliftai.org/v1/synthesis/phrase-replacement-config"

payload = { "phraseReplacements": [
        {
            "phrase": "<string>",
            "replacement": "<string>"
        }
    ] }
headers = {
    "Authorization": "<api-key>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
```

### PHP

```php
$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => "https://api.upliftai.org/v1/synthesis/phrase-replacement-config",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => json_encode([
    'phraseReplacements' => [
        [
                'phrase' => '<string>',
                'replacement' => '<string>'
        ]
    ]
  ]),
  CURLOPT_HTTPHEADER => [
    "Authorization: <api-key>",
    "Content-Type: application/json"
  ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
```

### Go

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

url := "https://api.upliftai.org/v1/synthesis/phrase-replacement-config"

payload := strings.NewReader("{\n  \"phraseReplacements\": [\n    {\n      \"phrase\": \"<string>\",\n      \"replacement\": \"<string>\"\n    }\n  ]\n}")

req, _ := http.NewRequest("POST", url, payload)

req.Header.Add("Authorization", "<api-key>")
	req.Header.Add("Content-Type", "application/json")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))
}
```

### Java

```java
HttpResponse<String> response = Unirest.post("https://api.upliftai.org/v1/synthesis/phrase-replacement-config")
  .header("Authorization", "<api-key>")
  .header("Content-Type", "application/json")
  .body("{\n  \"phraseReplacements\": [\n    {\n      \"phrase\": \"<string>\",\n      \"replacement\": \"<string>\"\n    }\n  ]\n}")
  .asString();
```

### Ruby

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.upliftai.org/v1/synthesis/phrase-replacement-config")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"phraseReplacements\": [\n    {\n      \"phrase\": \"<string>\",\n      \"replacement\": \"<string>\"\n    }\n  ]\n}"

response = http.request(request)
puts response.read_body
```

### Response Examples

#### Success Response (201)
```json
{
  "configId": "<string>",
  "phraseReplacements": [
    {
      "phrase": "<string>",
      "replacement": "<string>"
    }
  ]
}
```

#### Error Response (400)
```json
{
  "message": "<string>"
}
```

#### Rate Limit Exceeded (429)
```json
{
  "message": "Rate limit exceeded, please try again later"
}
```

### Authorizations
- **Authorization**: string, header, required, API key with format "Bearer sk_api_..."

### Body
- **phraseReplacements**: object[], required, Array of phrase replacement rules, Maximum array length: `1000`.
