Edit
curl --request POST \
--url https://test.api.cxconnect.ai/language/edit \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"document": {
"value": "<string>",
"mime_type": "<string>",
"language": "<string>",
"meta": {}
},
"edits": [],
"tone_level": 5,
"temperature": 0.5,
"meta": {
"foo": "bar"
}
}
'import requests
url = "https://test.api.cxconnect.ai/language/edit"
payload = {
"document": {
"value": "<string>",
"mime_type": "<string>",
"language": "<string>",
"meta": {}
},
"edits": [],
"tone_level": 5,
"temperature": 0.5,
"meta": { "foo": "bar" }
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
document: {value: '<string>', mime_type: '<string>', language: '<string>', meta: {}},
edits: [],
tone_level: 5,
temperature: 0.5,
meta: {foo: 'bar'}
})
};
fetch('https://test.api.cxconnect.ai/language/edit', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://test.api.cxconnect.ai/language/edit",
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([
'document' => [
'value' => '<string>',
'mime_type' => '<string>',
'language' => '<string>',
'meta' => [
]
],
'edits' => [
],
'tone_level' => 5,
'temperature' => 0.5,
'meta' => [
'foo' => 'bar'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://test.api.cxconnect.ai/language/edit"
payload := strings.NewReader("{\n \"document\": {\n \"value\": \"<string>\",\n \"mime_type\": \"<string>\",\n \"language\": \"<string>\",\n \"meta\": {}\n },\n \"edits\": [],\n \"tone_level\": 5,\n \"temperature\": 0.5,\n \"meta\": {\n \"foo\": \"bar\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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))
}HttpResponse<String> response = Unirest.post("https://test.api.cxconnect.ai/language/edit")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"document\": {\n \"value\": \"<string>\",\n \"mime_type\": \"<string>\",\n \"language\": \"<string>\",\n \"meta\": {}\n },\n \"edits\": [],\n \"tone_level\": 5,\n \"temperature\": 0.5,\n \"meta\": {\n \"foo\": \"bar\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://test.api.cxconnect.ai/language/edit")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"document\": {\n \"value\": \"<string>\",\n \"mime_type\": \"<string>\",\n \"language\": \"<string>\",\n \"meta\": {}\n },\n \"edits\": [],\n \"tone_level\": 5,\n \"temperature\": 0.5,\n \"meta\": {\n \"foo\": \"bar\"\n }\n}"
response = http.request(request)
puts response.read_body{
"document": {
"value": "<string>",
"mime_type": "<string>",
"language": "<string>",
"meta": {}
},
"original": {
"value": "<string>",
"mime_type": "<string>",
"language": "<string>",
"meta": {}
},
"meta": {
"foo": "bar"
}
}language
Edit
The edit endpoint uses generative AI to apply requested edits to a document
POST
/
language
/
edit
Edit
curl --request POST \
--url https://test.api.cxconnect.ai/language/edit \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"document": {
"value": "<string>",
"mime_type": "<string>",
"language": "<string>",
"meta": {}
},
"edits": [],
"tone_level": 5,
"temperature": 0.5,
"meta": {
"foo": "bar"
}
}
'import requests
url = "https://test.api.cxconnect.ai/language/edit"
payload = {
"document": {
"value": "<string>",
"mime_type": "<string>",
"language": "<string>",
"meta": {}
},
"edits": [],
"tone_level": 5,
"temperature": 0.5,
"meta": { "foo": "bar" }
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
document: {value: '<string>', mime_type: '<string>', language: '<string>', meta: {}},
edits: [],
tone_level: 5,
temperature: 0.5,
meta: {foo: 'bar'}
})
};
fetch('https://test.api.cxconnect.ai/language/edit', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://test.api.cxconnect.ai/language/edit",
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([
'document' => [
'value' => '<string>',
'mime_type' => '<string>',
'language' => '<string>',
'meta' => [
]
],
'edits' => [
],
'tone_level' => 5,
'temperature' => 0.5,
'meta' => [
'foo' => 'bar'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://test.api.cxconnect.ai/language/edit"
payload := strings.NewReader("{\n \"document\": {\n \"value\": \"<string>\",\n \"mime_type\": \"<string>\",\n \"language\": \"<string>\",\n \"meta\": {}\n },\n \"edits\": [],\n \"tone_level\": 5,\n \"temperature\": 0.5,\n \"meta\": {\n \"foo\": \"bar\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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))
}HttpResponse<String> response = Unirest.post("https://test.api.cxconnect.ai/language/edit")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"document\": {\n \"value\": \"<string>\",\n \"mime_type\": \"<string>\",\n \"language\": \"<string>\",\n \"meta\": {}\n },\n \"edits\": [],\n \"tone_level\": 5,\n \"temperature\": 0.5,\n \"meta\": {\n \"foo\": \"bar\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://test.api.cxconnect.ai/language/edit")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"document\": {\n \"value\": \"<string>\",\n \"mime_type\": \"<string>\",\n \"language\": \"<string>\",\n \"meta\": {}\n },\n \"edits\": [],\n \"tone_level\": 5,\n \"temperature\": 0.5,\n \"meta\": {\n \"foo\": \"bar\"\n }\n}"
response = http.request(request)
puts response.read_body{
"document": {
"value": "<string>",
"mime_type": "<string>",
"language": "<string>",
"meta": {}
},
"original": {
"value": "<string>",
"mime_type": "<string>",
"language": "<string>",
"meta": {}
},
"meta": {
"foo": "bar"
}
}Authorizations
OAuth2BearerAuth
The access token received from the authorization server in the OAuth 2.0 flow.
Scopes
API level access to permit operations
Allow read level access to stored configs and settings
Allow write level access to store configs and settings
Body
application/json
Show child attributes
Show child attributes
Available options:
grammar, syntax, simplify, clarify Available options:
default, expand, shorten Available options:
none, academic, admiring, amused, angry, annoyed, approving, aware, confident, confused, curious, disappointed, disapproving, eager, embarrassed, excited, fearful, friendly, funny, grateful, joyful, loving, mournful, neutral, optimistic, professional, relieved, remorseful, repulsed, sad, worried, surprised, sympathetic Required range:
1 <= x <= 10Required range:
0 <= x <= 1Show child attributes
Show child attributes
Example:
{ "foo": "bar" }
Was this page helpful?