Rename a field
Allows renaming a field and showing or hiding it in the subscribers section. Changing field type is not allowed.
Endpoint
Section titled “Endpoint”HTTP method: PATCH
https://api.sender.net/v2/fields/{id}
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
id | string required | Field ID |
title | string | The new field title |
show | boolean | True or false. It will display as an active filter field in the subscribers dashboard |
Request Examples
Section titled “Request Examples”const url = new URL("https://api.sender.net/v2/fields/{id}");
let headers = { "Authorization": "Bearer [your-token]", "Content-Type": "application/json", "Accept": "application/json",};
let bodyContent = { "title": "Changing title", "show": true};
fetch(url, { method: "PATCH", headers, body: JSON.stringify(bodyContent)}).then(response => response.json()).then(data => console.log(data)).catch(error => console.error('Error:', error));$client = new \GuzzleHttp\Client();
$json = [ "title" => "Changing title", "show" => true];
$response = $client->patch( 'https://api.sender.net/v2/fields/{id}', [ 'headers' => [ 'Authorization' => 'Bearer [your-token]', 'Content-Type' => 'application/json', 'Accept' => 'application/json', ], 'json' => $json ]);
$body = $response->getBody()->getContents();$data = json_decode($body, true);print_r($data);import requestsimport json
url = "https://api.sender.net/v2/fields/{id}"
headers = { "Authorization": "Bearer [your-token]", "Content-Type": "application/json", "Accept": "application/json",}
payload = { "title": "Changing title", "show": true}
response = requests.request('PATCH', url, headers=headers, json=payload)
print(response.json())curl -X PATCH \"https://api.sender.net/v2/fields/{id}" \-H "Authorization: Bearer [your-token]" \-H "Content-Type: application/json" \-H "Accept: application/json" \-d '{"title":"Changing title","show":true}'Response
Section titled “Response”{ "success": true, "message": "Field successfully updated"}