Skip to main content

Legal Entities

Overview

Legal Entities endpoints manage legal entities, related links, and contacts.

Endpoint Summary

MethodRoutePurpose
GET/v1/data/legal-entitiesList legal entities
POST/v1/data/legal-entitiesCreate legal entity
GET/v1/data/legal-entities/{legalEntityId}Get legal entity by ID
PUT/v1/data/legal-entities/{legalEntityId}Update legal entity
DELETE/v1/data/legal-entities/{legalEntityId}Delete legal entity
GET/v1/data/legal-entities/{legalEntityId}/linksList links
POST/v1/data/legal-entities/{legalEntityId}/linksCreate links
DELETE/v1/data/legal-entities/{legalEntityId}/linksDelete links
GET/v1/data/legal-entities/{legalEntityId}/contactsList contacts
POST/v1/data/legal-entities/{legalEntityId}/contactsCreate contact
PUT/v1/data/legal-entities/{legalEntityId}/contacts/{contactId}Update contact
DELETE/v1/data/legal-entities/{legalEntityId}/contacts/{contactId}Delete contact

GET /v1/data/legal-entities

Return legal entities for the authenticated context.

Headers

HeaderRequiredValue
AuthorizationYesBearer {{ACCESS_TOKEN}}
AcceptYesapplication/json

Query Parameters

ParameterTypeRequiredDescription
search_textstringNoSearch by name/text.
owner_idstringNoOwner UUID (resolved from auth context if omitted).

Example Request

curl -X GET "{{BASE_URL}}/v1/data/legal-entities" \
-H "Authorization: Bearer {{ACCESS_TOKEN}}" \
-H "Accept: application/json"

Success Response (200)

{
"success": true,
"result": [
{
"id": "df6f8c4b-b35f-4f2a-9f96-968bd61b3e81",
"owner_id": "8e6b6409-b03a-4f4d-a0b0-05481cc2cf28",
"name": "XPath Germany GmbH",
"country_code": "DE",
"region": "Berlin",
"city": "Berlin",
"address": "Friedrichstrasse 100",
"tax_number": "DE123456789",
"zip_code": "10117",
"segments": [
{
"id": "7f2d6e6d-a4ad-4b58-abfe-bd8b918ebec2",
"name": "EMEA"
}
]
}
]
}

POST /v1/data/legal-entities

Create a legal entity.

Headers

HeaderRequiredValue
AuthorizationYesBearer {{ACCESS_TOKEN}}
Content-TypeYesapplication/json
AcceptYesapplication/json

Request Body Fields

FieldTypeRequiredDescription
namestringYesLegal entity name.
country_codestringYesCountry ISO code (max 3 chars).
regionstringNoRegion/state.
citystringNoCity.
addressstringNoAddress line.
tax_numberstringNoTax number.
zip_codestringNoPostal code.
segmentsarray<object>NoLinked segment IDs.
segments[].idstringNoSegment UUID.

Example Request

curl -X POST "{{BASE_URL}}/v1/data/legal-entities" \
-H "Authorization: Bearer {{ACCESS_TOKEN}}" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{
"name": "XPath Germany GmbH",
"country_code": "DE",
"region": "Berlin",
"city": "Berlin",
"address": "Friedrichstrasse 100",
"tax_number": "DE123456789",
"zip_code": "10117",
"segments": [{"id": "7f2d6e6d-a4ad-4b58-abfe-bd8b918ebec2"}]
}'

Success Response (201)

{
"success": true,
"result": {
"id": "df6f8c4b-b35f-4f2a-9f96-968bd61b3e81",
"owner_id": "8e6b6409-b03a-4f4d-a0b0-05481cc2cf28",
"name": "XPath Germany GmbH",
"country_code": "DE",
"region": "Berlin",
"city": "Berlin",
"address": "Friedrichstrasse 100",
"tax_number": "DE123456789",
"zip_code": "10117",
"segments": [
{
"id": "7f2d6e6d-a4ad-4b58-abfe-bd8b918ebec2",
"name": "EMEA"
}
]
},
"message": "Legal entity created successfully."
}

GET /v1/data/legal-entities/{legalEntityId}

Return one legal entity by ID.

Headers

HeaderRequiredValue
AuthorizationYesBearer {{ACCESS_TOKEN}}
AcceptYesapplication/json

Path Parameters

ParameterTypeRequiredDescription
legalEntityIdstringYesLegal entity UUID.

Example Request

curl -X GET "{{BASE_URL}}/v1/data/legal-entities/{{LEGAL_ENTITY_ID}}" \
-H "Authorization: Bearer {{ACCESS_TOKEN}}" \
-H "Accept: application/json"

Success Response (200)

{
"success": true,
"result": {
"id": "df6f8c4b-b35f-4f2a-9f96-968bd61b3e81",
"owner_id": "8e6b6409-b03a-4f4d-a0b0-05481cc2cf28",
"name": "XPath Germany GmbH",
"country_code": "DE",
"region": "Berlin",
"city": "Berlin",
"address": "Friedrichstrasse 100",
"tax_number": "DE123456789",
"zip_code": "10117",
"segments": [
{
"id": "7f2d6e6d-a4ad-4b58-abfe-bd8b918ebec2",
"name": "EMEA"
}
]
}
}

PUT /v1/data/legal-entities/{legalEntityId}

Update a legal entity.

Headers

HeaderRequiredValue
AuthorizationYesBearer {{ACCESS_TOKEN}}
Content-TypeYesapplication/json
AcceptYesapplication/json

Path Parameters

ParameterTypeRequiredDescription
legalEntityIdstringYesLegal entity UUID.

Request Body Fields

FieldTypeRequiredDescription
namestringYesLegal entity name.
country_codestringYesCountry ISO code.
regionstringNoRegion/state.
citystringNoCity.
addressstringNoAddress line.
tax_numberstringNoTax number.
zip_codestringNoPostal code.
segmentsarray<object>NoLinked segment IDs.
segments[].idstringNoSegment UUID.

Example Request

curl -X PUT "{{BASE_URL}}/v1/data/legal-entities/{{LEGAL_ENTITY_ID}}" \
-H "Authorization: Bearer {{ACCESS_TOKEN}}" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{
"name": "XPath Germany GmbH",
"country_code": "DE",
"city": "Munich",
"address": "Leopoldstrasse 12"
}'

Success Response (200)

{
"success": true,
"result": {
"id": "df6f8c4b-b35f-4f2a-9f96-968bd61b3e81",
"owner_id": "8e6b6409-b03a-4f4d-a0b0-05481cc2cf28",
"name": "XPath Germany GmbH",
"country_code": "DE",
"region": "Bavaria",
"city": "Munich",
"address": "Leopoldstrasse 12",
"tax_number": "DE123456789",
"zip_code": "80802",
"segments": []
},
"message": "Legal entity updated successfully."
}

DELETE /v1/data/legal-entities/{legalEntityId}

Delete a legal entity.

Headers

HeaderRequiredValue
AuthorizationYesBearer {{ACCESS_TOKEN}}
AcceptYesapplication/json

Path Parameters

ParameterTypeRequiredDescription
legalEntityIdstringYesLegal entity UUID.

Example Request

curl -X DELETE "{{BASE_URL}}/v1/data/legal-entities/{{LEGAL_ENTITY_ID}}" \
-H "Authorization: Bearer {{ACCESS_TOKEN}}" \
-H "Accept: application/json"

Success Response (200)

{
"success": true,
"result": null,
"message": "Legal entity deleted successfully."
}

Return resource links for one legal entity.

Headers

HeaderRequiredValue
AuthorizationYesBearer {{ACCESS_TOKEN}}
AcceptYesapplication/json

Path Parameters

ParameterTypeRequiredDescription
legalEntityIdstringYesLegal entity UUID.

Query Parameters

ParameterTypeRequiredDescription
resource_typestringYesLinked resource type (for example user).

Example Request

curl -X GET "{{BASE_URL}}/v1/data/legal-entities/{{LEGAL_ENTITY_ID}}/links?resource_type=user" \
-H "Authorization: Bearer {{ACCESS_TOKEN}}" \
-H "Accept: application/json"

Success Response (200)

{
"success": true,
"result": [
{
"legal_entity_id": "df6f8c4b-b35f-4f2a-9f96-968bd61b3e81",
"resource_id": 501,
"resource_type": "user",
"resource": {
"id": 501,
"name": "Jane Doe",
"email": "[email protected]"
}
}
]
}

POST /v1/data/legal-entities/{legalEntityId}/links

Create links from legal entity to resources.

Headers

HeaderRequiredValue
AuthorizationYesBearer {{ACCESS_TOKEN}}
Content-TypeYesapplication/json
AcceptYesapplication/json

Path Parameters

ParameterTypeRequiredDescription
legalEntityIdstringYesLegal entity UUID.

Request Body Fields

FieldTypeRequiredDescription
resource_typestringYesLinked resource type.
resource_idsarrayYesLinked resource IDs.
resource_ids[]string|numberYesOne resource identifier.

Example Request

curl -X POST "{{BASE_URL}}/v1/data/legal-entities/{{LEGAL_ENTITY_ID}}/links" \
-H "Authorization: Bearer {{ACCESS_TOKEN}}" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{
"resource_type": "user",
"resource_ids": [501, 502]
}'

Success Response (201)

{
"success": true,
"result": [
{
"legal_entity_id": "df6f8c4b-b35f-4f2a-9f96-968bd61b3e81",
"resource_id": 501,
"resource_type": "user",
"resource": {
"id": 501,
"name": "Jane Doe",
"email": "[email protected]"
}
},
{
"legal_entity_id": "df6f8c4b-b35f-4f2a-9f96-968bd61b3e81",
"resource_id": 502,
"resource_type": "user",
"resource": {
"id": 502,
"name": "John Doe",
"email": "[email protected]"
}
}
]
}

Delete links for one legal entity.

Headers

HeaderRequiredValue
AuthorizationYesBearer {{ACCESS_TOKEN}}
Content-TypeYesapplication/json
AcceptYesapplication/json

Path Parameters

ParameterTypeRequiredDescription
legalEntityIdstringYesLegal entity UUID.

Request Body Fields

FieldTypeRequiredDescription
resource_typestringYesLinked resource type.
resource_idsarrayYesLinked resource IDs to remove.
resource_ids[]string|numberYesOne resource identifier.

Example Request

curl -X DELETE "{{BASE_URL}}/v1/data/legal-entities/{{LEGAL_ENTITY_ID}}/links" \
-H "Authorization: Bearer {{ACCESS_TOKEN}}" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{
"resource_type": "user",
"resource_ids": [501]
}'

Success Response (204)

{
"success": true,
"result": []
}

GET /v1/data/legal-entities/{legalEntityId}/contacts

Return paginated contacts for one legal entity.

Headers

HeaderRequiredValue
AuthorizationYesBearer {{ACCESS_TOKEN}}
AcceptYesapplication/json

Path Parameters

ParameterTypeRequiredDescription
legalEntityIdstringYesLegal entity UUID.

Query Parameters

ParameterTypeRequiredDescription
pagenumberNoPage number.
per_pagenumberNoItems per page.

Example Request

curl -X GET "{{BASE_URL}}/v1/data/legal-entities/{{LEGAL_ENTITY_ID}}/contacts" \
-H "Authorization: Bearer {{ACCESS_TOKEN}}" \
-H "Accept: application/json"

Success Response (200)

{
"success": true,
"result": {
"currentPage": 1,
"perPage": 20,
"lastPage": 1,
"total": 1,
"items": [
{
"id": 991,
"label": "Primary",
"name": "John Manager",
"email": "[email protected]",
"phone_prefix": "+49",
"phone_number": "155001122",
"is_primary": true,
"is_emergency": false,
"address": {
"usage": "office",
"country_code": "DE",
"state": "Berlin",
"city": "Berlin",
"address": "Friedrichstrasse 100",
"post_code": "10117"
},
"company_position": "HR Lead",
"legal_entity_id": "df6f8c4b-b35f-4f2a-9f96-968bd61b3e81",
"legal_entity": {
"id": "df6f8c4b-b35f-4f2a-9f96-968bd61b3e81",
"label": "XPath Germany GmbH"
}
}
],
"filters": []
}
}

POST /v1/data/legal-entities/{legalEntityId}/contacts

Create a contact for one legal entity.

Headers

HeaderRequiredValue
AuthorizationYesBearer {{ACCESS_TOKEN}}
Content-TypeYesapplication/json
AcceptYesapplication/json

Path Parameters

ParameterTypeRequiredDescription
legalEntityIdstringYesLegal entity UUID.

Request Body Fields

FieldTypeRequiredDescription
namestringYesContact name.
emailstringConditionalRequired if phone_number is missing.
phone_numberstringConditionalRequired if email is missing.
phone_prefixstringNoPhone prefix.
is_primarybooleanYesPrimary contact flag.
is_emergencybooleanYesEmergency contact flag.
labelstringNoLabel value.
company_positionstringNoCompany position.
user_idnumberNoLinked user ID.
addressobjectNoAddress object.
address.usagestringNoAddress usage.
address.country_codestringConditionalRequired when address is sent.
address.statestringConditionalRequired when address is sent.
address.citystringConditionalRequired when address is sent.
address.addressstringConditionalRequired when address is sent.
address.post_codestringConditionalRequired when address is sent.

Example Request

curl -X POST "{{BASE_URL}}/v1/data/legal-entities/{{LEGAL_ENTITY_ID}}/contacts" \
-H "Authorization: Bearer {{ACCESS_TOKEN}}" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{
"name": "John Manager",
"email": "[email protected]",
"phone_prefix": "+49",
"phone_number": "155001122",
"is_primary": true,
"is_emergency": false,
"company_position": "HR Lead",
"address": {
"usage": "office",
"country_code": "DE",
"state": "Berlin",
"city": "Berlin",
"address": "Friedrichstrasse 100",
"post_code": "10117"
}
}'

Success Response (200)

{
"success": true,
"result": {
"contact": {
"id": 991,
"label": "Primary",
"name": "John Manager",
"email": "[email protected]",
"phone_prefix": "+49",
"phone_number": "155001122",
"is_primary": true,
"is_emergency": false,
"address": {
"usage": "office",
"country_code": "DE",
"state": "Berlin",
"city": "Berlin",
"address": "Friedrichstrasse 100",
"post_code": "10117"
},
"company_position": "HR Lead",
"legal_entity_id": "df6f8c4b-b35f-4f2a-9f96-968bd61b3e81",
"legal_entity": {
"id": "df6f8c4b-b35f-4f2a-9f96-968bd61b3e81",
"label": "XPath Germany GmbH"
}
}
}
}

PUT /v1/data/legal-entities/{legalEntityId}/contacts/{contactId}

Update a legal entity contact.

Headers

HeaderRequiredValue
AuthorizationYesBearer {{ACCESS_TOKEN}}
Content-TypeYesapplication/json
AcceptYesapplication/json

Path Parameters

ParameterTypeRequiredDescription
legalEntityIdstringYesLegal entity UUID.
contactIdnumberYesContact identifier.

Request Body Fields

Same fields as POST /contacts.

Example Request

curl -X PUT "{{BASE_URL}}/v1/data/legal-entities/{{LEGAL_ENTITY_ID}}/contacts/{{CONTACT_ID}}" \
-H "Authorization: Bearer {{ACCESS_TOKEN}}" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{
"name": "John Manager",
"email": "[email protected]",
"phone_prefix": "+49",
"phone_number": "155001122",
"is_primary": true,
"is_emergency": true
}'

Success Response (200)

{
"success": true,
"result": {
"contact": {
"id": 991,
"label": "Primary",
"name": "John Manager",
"email": "[email protected]",
"phone_prefix": "+49",
"phone_number": "155001122",
"is_primary": true,
"is_emergency": true,
"address": null,
"company_position": "HR Lead",
"legal_entity_id": "df6f8c4b-b35f-4f2a-9f96-968bd61b3e81",
"legal_entity": {
"id": "df6f8c4b-b35f-4f2a-9f96-968bd61b3e81",
"label": "XPath Germany GmbH"
}
}
}
}

DELETE /v1/data/legal-entities/{legalEntityId}/contacts/{contactId}

Delete a contact.

Headers

HeaderRequiredValue
AuthorizationYesBearer {{ACCESS_TOKEN}}
AcceptYesapplication/json

Path Parameters

ParameterTypeRequiredDescription
legalEntityIdstringYesLegal entity UUID.
contactIdnumberYesContact identifier.

Example Request

curl -X DELETE "{{BASE_URL}}/v1/data/legal-entities/{{LEGAL_ENTITY_ID}}/contacts/{{CONTACT_ID}}" \
-H "Authorization: Bearer {{ACCESS_TOKEN}}" \
-H "Accept: application/json"

Success Response (200)

{
"success": true,
"result": {
"contact": 991
}
}