Skip to main content
PUT
/
core
/
companies
/
{company_id}
Update Company
curl --request PUT \
  --url https://api.rootfi.dev/v3/core/companies/{company_id} \
  --header 'Content-Type: application/json' \
  --header 'api_key: <api-key>' \
  --data '
{
  "name": "<string>",
  "partner_id": "<string>",
  "sync_config": [
    {
      "enabled": true,
      "interval": 1,
      "scope_access": {
        "READ": true,
        "CREATE": true,
        "UPDATE": true,
        "DELETE": true
      },
      "sync_from": "2023-11-07T05:31:56Z",
      "custom_fields": [
        "<string>"
      ]
    }
  ]
}
'
import requests

url = "https://api.rootfi.dev/v3/core/companies/{company_id}"

payload = {
"name": "<string>",
"partner_id": "<string>",
"sync_config": [
{
"enabled": True,
"interval": 1,
"scope_access": {
"READ": True,
"CREATE": True,
"UPDATE": True,
"DELETE": True
},
"sync_from": "2023-11-07T05:31:56Z",
"custom_fields": ["<string>"]
}
]
}
headers = {
"api_key": "<api-key>",
"Content-Type": "application/json"
}

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

print(response.text)
const options = {
method: 'PUT',
headers: {api_key: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
partner_id: '<string>',
sync_config: [
{
enabled: true,
interval: 1,
scope_access: {READ: true, CREATE: true, UPDATE: true, DELETE: true},
sync_from: '2023-11-07T05:31:56Z',
custom_fields: ['<string>']
}
]
})
};

fetch('https://api.rootfi.dev/v3/core/companies/{company_id}', 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.rootfi.dev/v3/core/companies/{company_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'partner_id' => '<string>',
'sync_config' => [
[
'enabled' => true,
'interval' => 1,
'scope_access' => [
'READ' => true,
'CREATE' => true,
'UPDATE' => true,
'DELETE' => true
],
'sync_from' => '2023-11-07T05:31:56Z',
'custom_fields' => [
'<string>'
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"api_key: <api-key>"
],
]);

$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.rootfi.dev/v3/core/companies/{company_id}"

payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"partner_id\": \"<string>\",\n \"sync_config\": [\n {\n \"enabled\": true,\n \"interval\": 1,\n \"scope_access\": {\n \"READ\": true,\n \"CREATE\": true,\n \"UPDATE\": true,\n \"DELETE\": true\n },\n \"sync_from\": \"2023-11-07T05:31:56Z\",\n \"custom_fields\": [\n \"<string>\"\n ]\n }\n ]\n}")

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

req.Header.Add("api_key", "<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))

}
HttpResponse<String> response = Unirest.put("https://api.rootfi.dev/v3/core/companies/{company_id}")
.header("api_key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"partner_id\": \"<string>\",\n \"sync_config\": [\n {\n \"enabled\": true,\n \"interval\": 1,\n \"scope_access\": {\n \"READ\": true,\n \"CREATE\": true,\n \"UPDATE\": true,\n \"DELETE\": true\n },\n \"sync_from\": \"2023-11-07T05:31:56Z\",\n \"custom_fields\": [\n \"<string>\"\n ]\n }\n ]\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.rootfi.dev/v3/core/companies/{company_id}")

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

request = Net::HTTP::Put.new(url)
request["api_key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"partner_id\": \"<string>\",\n \"sync_config\": [\n {\n \"enabled\": true,\n \"interval\": 1,\n \"scope_access\": {\n \"READ\": true,\n \"CREATE\": true,\n \"UPDATE\": true,\n \"DELETE\": true\n },\n \"sync_from\": \"2023-11-07T05:31:56Z\",\n \"custom_fields\": [\n \"<string>\"\n ]\n }\n ]\n}"

response = http.request(request)
puts response.read_body
{
  "data": [
    {
      "rootfi_id": 123,
      "rootfi_created_at": "2023-11-07T05:31:56Z",
      "rootfi_updated_at": "2023-11-07T05:31:56Z",
      "name": "Rootfi",
      "partner_id": "<string>",
      "invite_link": {
        "rootfi_id": 123,
        "rootfi_created_at": "2023-11-07T05:31:56Z",
        "rootfi_updated_at": "2023-11-07T05:31:56Z",
        "invite_link_id": "1",
        "integrations": [],
        "integration_categories": []
      },
      "connections": [
        {
          "rootfi_id": 123,
          "rootfi_created_at": "2023-11-07T05:31:56Z",
          "rootfi_updated_at": "2023-11-07T05:31:56Z",
          "rate_limits": {
            "counters": {},
            "lastReset": {},
            "maxLimits": {}
          },
          "zoho_sub_calls_enabled": false,
          "sync_resume_at": "2023-11-07T05:31:56Z",
          "last_synced": "2023-11-07T05:31:56Z",
          "tally_last_active_at": "2023-11-07T05:31:56Z",
          "sync_config": {
            "enabled": true,
            "interval": 1,
            "scope_access": {
              "READ": true,
              "CREATE": true,
              "UPDATE": true,
              "DELETE": true
            },
            "sync_from": "2023-11-07T05:31:56Z",
            "custom_fields": [
              "<string>"
            ]
          }
        }
      ],
      "activity_log": [
        {
          "rootfi_id": 123,
          "rootfi_created_at": "2023-11-07T05:31:56Z",
          "rootfi_updated_at": "2023-11-07T05:31:56Z"
        }
      ]
    }
  ],
  "next": "<string>"
}
{
"error": {
"message": "<string>",
"code": "<string>",
"field": "<string>"
}
}
{
"error": {
"message": "<string>",
"code": "<string>",
"field": "<string>"
}
}
{
"error": {
"message": "<string>",
"code": "<string>",
"field": "<string>"
}
}
{
"error": {
"message": "<string>",
"code": "<string>",
"field": "<string>"
}
}

Authorizations

api_key
string
header
required

Path Parameters

company_id
integer
required

The ID of the company to update

Body

application/json

The body of the company to update

The data of the company endpoint

name
string | null

Name of the company

partner_id
string | null

Unique identifier in your system.

sync_config
SyncConfigData · object[] | null

The sync configuration of the connection

Response

The data of the company endpoint

data
coreCompanyData · object[]
required

The data of the company endpoint

next
string | null

The next page of objects to retrieve