Skip to main content
PATCH
/
v1
/
organization
Update organization
curl --request PATCH \
  --url https://api.trycomp.ai/v1/organization \
  --header 'Content-Type: application/json' \
  --header 'X-API-Key: <api-key>' \
  --data '
{
  "name": "New Acme Corporation",
  "slug": "new-acme-corp",
  "logo": "https://example.com/logo.png",
  "metadata": "{\"theme\": \"dark\", \"preferences\": {}}",
  "website": "https://acme-corp.com",
  "onboardingCompleted": true,
  "hasAccess": true,
  "fleetDmLabelId": 123,
  "isFleetSetupCompleted": false,
  "primaryColor": "#3B82F6"
}
'
const options = {
method: 'PATCH',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'New Acme Corporation',
slug: 'new-acme-corp',
logo: 'https://example.com/logo.png',
metadata: '{"theme": "dark", "preferences": {}}',
website: 'https://acme-corp.com',
onboardingCompleted: true,
hasAccess: true,
fleetDmLabelId: 123,
isFleetSetupCompleted: false,
primaryColor: '#3B82F6'
})
};

fetch('https://api.trycomp.ai/v1/organization', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
import requests

url = "https://api.trycomp.ai/v1/organization"

payload = {
"name": "New Acme Corporation",
"slug": "new-acme-corp",
"logo": "https://example.com/logo.png",
"metadata": "{\"theme\": \"dark\", \"preferences\": {}}",
"website": "https://acme-corp.com",
"onboardingCompleted": True,
"hasAccess": True,
"fleetDmLabelId": 123,
"isFleetSetupCompleted": False,
"primaryColor": "#3B82F6"
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}

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

print(response.text)
{
  "id": "org_abc123def456",
  "name": "New Acme Corporation",
  "slug": "new-acme-corp",
  "logo": "https://example.com/logo.png",
  "metadata": "{\"theme\": \"dark\", \"preferences\": {}}",
  "website": "https://acme-corp.com",
  "onboardingCompleted": true,
  "hasAccess": true,
  "fleetDmLabelId": 123,
  "isFleetSetupCompleted": false,
  "primaryColor": "#3B82F6",
  "createdAt": "2023-11-07T05:31:56Z"
}
{
"message": "Invalid slug format"
}
{
"message": "Invalid or expired API key"
}
{
"message": "Organization with ID org_abc123def456 not found"
}

Authorizations

X-API-Key
string
header
required

API key for authentication

Body

application/json

Organization update data

name
string

Organization name

Example:

"New Acme Corporation"

slug
string

Organization slug

Example:

"new-acme-corp"

Organization logo URL

Example:

"https://example.com/logo.png"

metadata
string

Additional metadata in JSON format

Example:

"{\"theme\": \"dark\", \"preferences\": {}}"

website
string

Organization website URL

Example:

"https://acme-corp.com"

onboardingCompleted
boolean

Whether onboarding is completed

Example:

true

hasAccess
boolean

Whether organization has access to the platform

Example:

true

fleetDmLabelId
integer

FleetDM label ID for device management

Example:

123

isFleetSetupCompleted
boolean

Whether FleetDM setup is completed

Example:

false

primaryColor
string

Organization primary color in hex format

Example:

"#3B82F6"

Response

Organization updated successfully

id
string

The organization ID

Example:

"org_abc123def456"

name
string

Organization name

Example:

"New Acme Corporation"

slug
string

Organization slug

Example:

"new-acme-corp"

logo
string | null

Organization logo URL

Example:

"https://example.com/logo.png"

metadata
string | null

Additional metadata in JSON format

Example:

"{\"theme\": \"dark\", \"preferences\": {}}"

website
string | null

Organization website URL

Example:

"https://acme-corp.com"

onboardingCompleted
boolean

Whether onboarding is completed

Example:

true

hasAccess
boolean

Whether organization has access to the platform

Example:

true

fleetDmLabelId
integer | null

FleetDM label ID for device management

Example:

123

isFleetSetupCompleted
boolean

Whether FleetDM setup is completed

Example:

false

primaryColor
string | null

Organization primary color in hex format

Example:

"#3B82F6"

createdAt
string<date-time>

When the organization was created

authType
enum<string>

How the request was authenticated

Available options:
api-key,
session