> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.callix.dev.br/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.callix.dev.br/_mcp/server.

# Update company

PATCH https://sua-conta.callix.com.br/api/v1/companies/{id}
Content-Type: application/vnd.api+json

Atualiza uma empresa. `type: "company"`, com id. Atributos: name, `legal_code` (CNPJ), `legal_name` (razão social), `integration_code`.

Reference: https://docs.callix.dev.br/api-reference/companies/patch-companies-id

## Authentication

- `Authorization` header (bearer token, required) — Token de API da conta do tenant.

## Request

### Path parameters

- `id` (string, required) — Identificador do recurso.

### Body (application/vnd.api+json)

This endpoint expects an object.

- `data` (CompaniesIdPatchRequestBodyContentApplicationVndApiJsonSchemaData, required)

## Response

### 200

Empresa atualizada.

- `data` (CompanyResource, optional)

## Types

### CompaniesIdPatchRequestBodyContentApplicationVndApiJsonSchemaData

- `type` (enum, required)
  - Allowed values: `companies`
- `id` (string, required)
- `attributes` (CompanyAttributes, required)

### CompanyResource

- `type` (string, optional)
- `id` (string, optional)
- `attributes` (CompanyAttributes, optional)

### CompanyAttributes

- `name` (string, optional) — Nome
- `legal_code` (string, optional) — CNPJ
- `legal_name` (string, optional) — Razão social
- `integration_code` (string, optional) — Código de integração

## Examples

**Request**

```json
{
  "data": {
    "type": "companies",
    "id": "1",
    "attributes": {
      "name": "Empresa Callix",
      "legal_code": "88376746000145",
      "legal_name": "Razão teste Callix",
      "integration_code": "17102023"
    }
  }
}
```

**Response**

```json
{
  "data": {
    "type": "companies",
    "id": "1",
    "attributes": {
      "name": "Callix",
      "legal_code": "05371986000120",
      "legal_name": "Callix",
      "integration_code": "codigo"
    }
  }
}
```

**SDK Code**

```python Companies_patch_companies_id_example
import requests

url = "https://sua-conta.callix.com.br/api/v1/companies/id"

payload = "{\n  \"data\": {\n    \"type\": \"companies\",\n    \"id\": \"1\",\n    \"attributes\": {\n      \"name\": \"Empresa Callix\",\n      \"legal_code\": \"88376746000145\",\n      \"legal_name\": \"Razão teste Callix\",\n      \"integration_code\": \"17102023\"\n    }\n  }\n}"
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/vnd.api+json"
}

response = requests.patch(url, data=payload, headers=headers)

print(response.json())
```

```javascript Companies_patch_companies_id_example
const url = 'https://sua-conta.callix.com.br/api/v1/companies/id';
const options = {
  method: 'PATCH',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/vnd.api+json'},
  body: '{\n  "data": {\n    "type": "companies",\n    "id": "1",\n    "attributes": {\n      "name": "Empresa Callix",\n      "legal_code": "88376746000145",\n      "legal_name": "Razão teste Callix",\n      "integration_code": "17102023"\n    }\n  }\n}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Companies_patch_companies_id_example
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://sua-conta.callix.com.br/api/v1/companies/id"

	payload := strings.NewReader("{\n  \"data\": {\n    \"type\": \"companies\",\n    \"id\": \"1\",\n    \"attributes\": {\n      \"name\": \"Empresa Callix\",\n      \"legal_code\": \"88376746000145\",\n      \"legal_name\": \"Razão teste Callix\",\n      \"integration_code\": \"17102023\"\n    }\n  }\n}")

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

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/vnd.api+json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Companies_patch_companies_id_example
require 'uri'
require 'net/http'

url = URI("https://sua-conta.callix.com.br/api/v1/companies/id")

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/vnd.api+json'
request.body = "{\n  \"data\": {\n    \"type\": \"companies\",\n    \"id\": \"1\",\n    \"attributes\": {\n      \"name\": \"Empresa Callix\",\n      \"legal_code\": \"88376746000145\",\n      \"legal_name\": \"Razão teste Callix\",\n      \"integration_code\": \"17102023\"\n    }\n  }\n}"

response = http.request(request)
puts response.read_body
```

```java Companies_patch_companies_id_example
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.patch("https://sua-conta.callix.com.br/api/v1/companies/id")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/vnd.api+json")
  .body("{\n  \"data\": {\n    \"type\": \"companies\",\n    \"id\": \"1\",\n    \"attributes\": {\n      \"name\": \"Empresa Callix\",\n      \"legal_code\": \"88376746000145\",\n      \"legal_name\": \"Razão teste Callix\",\n      \"integration_code\": \"17102023\"\n    }\n  }\n}")
  .asString();
```

```php Companies_patch_companies_id_example
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('PATCH', 'https://sua-conta.callix.com.br/api/v1/companies/id', [
  'body' => '{
  "data": {
    "type": "companies",
    "id": "1",
    "attributes": {
      "name": "Empresa Callix",
      "legal_code": "88376746000145",
      "legal_name": "Razão teste Callix",
      "integration_code": "17102023"
    }
  }
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/vnd.api+json',
  ],
]);

echo $response->getBody();
```

```csharp Companies_patch_companies_id_example
using RestSharp;

var client = new RestClient("https://sua-conta.callix.com.br/api/v1/companies/id");
var request = new RestRequest(Method.PATCH);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/vnd.api+json");
request.AddParameter("application/vnd.api+json", "{\n  \"data\": {\n    \"type\": \"companies\",\n    \"id\": \"1\",\n    \"attributes\": {\n      \"name\": \"Empresa Callix\",\n      \"legal_code\": \"88376746000145\",\n      \"legal_name\": \"Razão teste Callix\",\n      \"integration_code\": \"17102023\"\n    }\n  }\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Companies_patch_companies_id_example
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/vnd.api+json"
]

let postData = NSData(data: "{
  "data": {
    "type": "companies",
    "id": "1",
    "attributes": {
      "name": "Empresa Callix",
      "legal_code": "88376746000145",
      "legal_name": "Razão teste Callix",
      "integration_code": "17102023"
    }
  }
}".data(using: String.Encoding.utf8)!)

let request = NSMutableURLRequest(url: NSURL(string: "https://sua-conta.callix.com.br/api/v1/companies/id")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PATCH"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```