Update a specific setting by key.
PUT/v2/projects/{project_id}/settings/{key} Path Parameters
The unique identifier of the project.
The setting key to update.
Request Body
The new value for the setting.
curl -X PUT "https://api.botsubscription.com/v2/projects/YOUR_PROJECT_ID/settings/default_language" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"value": "es"
}'
const project_id = 'YOUR_PROJECT_ID';
const key = 'default_language';
const response = await fetch(`https://api.botsubscription.com/v2/projects/${project_id}/settings/${key}`, {
method: 'PUT',
headers: {
'Authorization': 'Bearer YOUR_TOKEN',
'Content-Type': 'application/json'
},
body: JSON.stringify({
value: 'es'
})
});
// 204 No Content on success
import requests
project_id = 'YOUR_PROJECT_ID'
key = 'default_language'
response = requests.put(
f'https://api.botsubscription.com/v2/projects/{project_id}/settings/{key}',
headers={
'Authorization': 'Bearer YOUR_TOKEN',
'Content-Type': 'application/json'
},
json={
'value': 'es'
}
)
# 204 No Content on success
$project_id = 'YOUR_PROJECT_ID';
$key = 'default_language';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://api.botsubscription.com/v2/projects/{$project_id}/settings/{$key}");
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PUT');
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Authorization: Bearer YOUR_TOKEN',
'Content-Type: application/json'
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode([
'value' => 'es'
]));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
// 204 No Content on success
Setting updatedapplication/json
No response body is returned on successful update.
Invalid valueapplication/json
{
"ok": false,
"request_id": "11111111-1111-1111-1111-111111111111",
"method": "PUT",
"path": "/v2/projects/YOUR_PROJECT_ID/settings/default_language",
"code": 400,
"error": {
"error_code": "BAD_REQUEST",
"message": "Invalid value for setting"
}
}
Last updated: