Skip to content

Get a company's context

GET
/relations/companies/{id}/context
Code sample: Shell / cURL
curl --request GET \
--url https://example.com/api/v1/relations/companies/example/context \
--header 'Authorization: Bearer <token>'

One read of where a company stands: active projects, current orders, the team assigned to it, open tickets and the latest task activity. A section the caller may not see is null. Team members only; a client account is refused.

id
required

Resource identifier (CUID2).

string
>= 1 characters

Resource identifier (CUID2).

The company’s context.

Media typeapplication/json
object
data
required
object
activeProjects
required

Null when the caller may not see this section.

Any of:
object
items
required
Array<object>
object
id
required
string
name
required
string
openTasks
required
integer
>= -9007199254740991 <= 9007199254740991
path
required

Location of the record, relative to the workspace’s /app/ base.

string
total
required
integer
>= -9007199254740991 <= 9007199254740991
company
required
object
id
required
string
isActive
required
boolean
name
required
string
path
required

Location of the record, relative to the workspace’s /app/ base.

string
status
required
string | null
currentOrders
required

Null when the caller may not see this section.

Any of:
object
items
required
Array<object>
object
code
required
string | null
endsAt
required
Any of:
string format: date-time
/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z))$/
id
required
string
name
required
string
path
required

Location of the record, relative to the workspace’s /app/ base.

string
startsAt
required
Any of:
string format: date-time
/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z))$/
status
required
string
total
required
integer
>= -9007199254740991 <= 9007199254740991
openTickets
required

Null when the caller may not see this section.

Any of:
object
items
required
Array<object>
object
id
required
string
path
required

Location of the record, relative to the workspace’s /app/ base.

string
reference
required
string
status
required
string | null
subject
required
string
updatedAt
required
string format: date-time
/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z))$/
total
required
integer
>= -9007199254740991 <= 9007199254740991
recentActivity
required
Array<object>
object
action
required
string
actor
required
string
at
required
string format: date-time
/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z))$/
field
required
string | null
task
required
object
id
required
string
label
required
string
path
required

Location of the record, relative to the workspace’s /app/ base.

string
team
required
Array<object>
object
access
required

How the member reaches the company: manager, direct, or team .

string
memberId
required
string
name
required
string

Example generated

{
"data": {
"activeProjects": {
"items": [
{
"id": "example",
"name": "example",
"openTasks": 1,
"path": "example"
}
],
"total": 1
},
"company": {
"id": "example",
"isActive": true,
"name": "example",
"path": "example",
"status": "example"
},
"currentOrders": {
"items": [
{
"code": "example",
"endsAt": "2026-04-15T12:00:00Z",
"id": "example",
"name": "example",
"path": "example",
"startsAt": "2026-04-15T12:00:00Z",
"status": "example"
}
],
"total": 1
},
"openTickets": {
"items": [
{
"id": "example",
"path": "example",
"reference": "example",
"status": "example",
"subject": "example",
"updatedAt": "2026-04-15T12:00:00Z"
}
],
"total": 1
},
"recentActivity": [
{
"action": "example",
"actor": "example",
"at": "2026-04-15T12:00:00Z",
"field": "example",
"task": {
"id": "example",
"label": "example",
"path": "example"
}
}
],
"team": [
{
"access": "example",
"memberId": "example",
"name": "example"
}
]
}
}

Unauthorized.

Media typeapplication/json

Standard error envelope.

object
error
required
object
code
required

Stable machine-readable error code.

string
message
required

Human-readable error message.

string
status
required

HTTP status code, mirrored in the body.

integer
>= -9007199254740991 <= 9007199254740991

Example

{
"error": {
"code": "UNAUTHORIZED"
}
}

Forbidden.

Media typeapplication/json

Standard error envelope.

object
error
required
object
code
required

Stable machine-readable error code.

string
message
required

Human-readable error message.

string
status
required

HTTP status code, mirrored in the body.

integer
>= -9007199254740991 <= 9007199254740991

Example

{
"error": {
"code": "UNAUTHORIZED"
}
}

Not found.

Media typeapplication/json

Standard error envelope.

object
error
required
object
code
required

Stable machine-readable error code.

string
message
required

Human-readable error message.

string
status
required

HTTP status code, mirrored in the body.

integer
>= -9007199254740991 <= 9007199254740991

Example

{
"error": {
"code": "UNAUTHORIZED"
}
}

Rate limit exceeded. Wait for Retry-After before retrying.

Media typeapplication/json

Standard error envelope.

object
error
required
object
code
required

Stable machine-readable error code.

string
message
required

Human-readable error message.

string
status
required

HTTP status code, mirrored in the body.

integer
>= -9007199254740991 <= 9007199254740991

Example

{
"error": {
"code": "UNAUTHORIZED"
}
}
RateLimit-Limit
string
/^\d+$/

Maximum requests in the current quota window.

RateLimit-Policy
string

Quota policy in requests and window seconds, for example 60;w=60.

RateLimit-Remaining
string
/^\d+$/

Requests left in this quota window (zero when blocked).

RateLimit-Reset
string
/^\d+$/

Seconds until the current quota window resets, when available from the rate-limit store.

Retry-After
string
/^\d+$/

Seconds until another request may be attempted.