Skip to content

Resource WorkerResource

CrucifiedPain edited this page Jun 26, 2026 · 8 revisions

WorkerResource (client.worker)

Endpoints: • worker.getWorkers • worker.getTotalWorkersCount

.get_total_count()

Get the total number of workers employed by a user across all their companies.

Signature

await client.worker.get_total_count(user_id: 'str') -> 'int'

Parameters

Name Type Default
user_id str *Required*

.get_workers()

Get workers, optionally filtered by company or user. At least one of company_id or user_id should be provided.

Signature

await client.worker.get_workers(*, company_id: 'str | None' = None, user_id: 'str | None' = None) -> 'list[Worker]'

Parameters

Name Type Default
company_id str | None None
user_id str | None None

Return Models

Worker

Field Type Required Description
_id string \| null
__v integer \| null
userId string \| null
companyId string \| null
salary number \| null
startedAt string \| null

.invalidate_cache()

Clear the SWR cache for all resources.

Signature

await client.worker.invalidate_cache() -> 'None'

Clone this wiki locally