curl --request PATCH \
--url https://api.routera.io/companies/{companyId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"fields": {
"company_name": "Acme Corp"
}
}
'import requests
url = "https://api.routera.io/companies/{companyId}"
payload = { "fields": { "company_name": "Acme Corp" } }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({fields: {company_name: 'Acme Corp'}})
};
fetch('https://api.routera.io/companies/{companyId}', 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://api.routera.io/companies/{companyId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'fields' => [
'company_name' => 'Acme Corp'
]
]),
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://api.routera.io/companies/{companyId}"
payload := strings.NewReader("{\n \"fields\": {\n \"company_name\": \"Acme Corp\"\n }\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.routera.io/companies/{companyId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"fields\": {\n \"company_name\": \"Acme Corp\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.routera.io/companies/{companyId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"fields\": {\n \"company_name\": \"Acme Corp\"\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"external_id": "<string>",
"company_name": "<string>",
"description": "<string>",
"industry": "<string>",
"company_owner": "jane@example.com",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"archived": true,
"archived_by": "<string>"
}{
"message": "<string>",
"error": true,
"field": "<string>"
}{
"message": "<string>",
"error": true,
"field": "<string>"
}{
"message": "<string>",
"error": true,
"field": "<string>"
}{
"message": "<string>",
"error": true,
"field": "<string>"
}{
"message": "<string>",
"error": true,
"field": "<string>"
}Update company
PATCH /companies/ — update fields on an active object
curl --request PATCH \
--url https://api.routera.io/companies/{companyId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"fields": {
"company_name": "Acme Corp"
}
}
'import requests
url = "https://api.routera.io/companies/{companyId}"
payload = { "fields": { "company_name": "Acme Corp" } }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({fields: {company_name: 'Acme Corp'}})
};
fetch('https://api.routera.io/companies/{companyId}', 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://api.routera.io/companies/{companyId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'fields' => [
'company_name' => 'Acme Corp'
]
]),
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://api.routera.io/companies/{companyId}"
payload := strings.NewReader("{\n \"fields\": {\n \"company_name\": \"Acme Corp\"\n }\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.routera.io/companies/{companyId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"fields\": {\n \"company_name\": \"Acme Corp\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.routera.io/companies/{companyId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"fields\": {\n \"company_name\": \"Acme Corp\"\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"external_id": "<string>",
"company_name": "<string>",
"description": "<string>",
"industry": "<string>",
"company_owner": "jane@example.com",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"archived": true,
"archived_by": "<string>"
}{
"message": "<string>",
"error": true,
"field": "<string>"
}{
"message": "<string>",
"error": true,
"field": "<string>"
}{
"message": "<string>",
"error": true,
"field": "<string>"
}{
"message": "<string>",
"error": true,
"field": "<string>"
}{
"message": "<string>",
"error": true,
"field": "<string>"
}Endpoint
PATCH https://api.routera.io/companies/{id}
/companies/{companyId}Authentication: Bearer JWT Path parameter:
companyId — object ID
Query parameters
?properties=phone). Names already in the default set are not duplicated. Invalid or disallowed property names return 400.Request body
The body is a JSON object with a singlefields property. Each key inside fields is a field internal_name (the same names returned in GET responses, not nested under fields in the response).
Only include keys you want to change. Omitted fields keep their current values.
{
"fields": {
"company_name": "Acme Corp"
}
}
| Key | Description |
|---|---|
fields | Required. Map of internal_name → value for this object type. |
fields.external_id | Optional. External identifier for sync with outside systems. |
fields.
Default response fields
200 returns the updated object using the default property set:| Property | Description |
|---|---|
id | Internal object ID |
company_name | Custom or system field (flat on the object) |
description | Custom or system field (flat on the object) |
industry | Custom or system field (flat on the object) |
company_owner | Assigned owner email |
external_id | External identifier (nullable) |
archived | false when active; ISO timestamp when archived |
created_at and updated_at are always included in every response (ISO 8601 UTC), even when not listed above. When an object is archived, archived_by is also included automatically.Errors
| Status | When |
|---|---|
400 | Missing companyId, invalid properties, invalid JSON, validation failure, or forbidden system field |
401 | Missing account context |
404 | Object not found |
409 | Object is archived — cannot update |
409 | Duplicate active record (unique key collision) |
{ "message": "Cannot update an archived object", "error": true }
Authorizations
Bearer JWT with valid account context.
Path Parameters
Object identifier
Query Parameters
Comma-separated additional property names to include alongside defaults (e.g. phone). Invalid or disallowed names return 400.
Body
Write payload for POST create and PATCH update. Keys inside fields match field internal names returned in GET responses.
Field values keyed by internal_name. Custom account fields use the same key names.
Hide child attributes
Hide child attributes
Optional external identifier for sync with outside systems
"ext-001"
Value for company_name (field internal_name)
"Acme Corp"
Value for description (field internal_name)
"Example company"
Value for industry (field internal_name)
"Technology"
Response
Updated
Assigned owner email
"jane@example.com"
false when active, or ISO timestamp when archived
Was this page helpful?
