QHR Developers

List custody records

GET/custodies
Read token is enoughView every employee's custody, its details and stats custody/view_othersRequires feature custodyAvailable in Claudecustodies.list

Returns the company's custody records — which employee holds which asset, its serial and value — newest first. With no status filter only assets held right now are listed; send q[status_eq] for returned ones, ones being deducted from salary, or fully recovered ones.

When to use: to answer "who has which laptop?", "what does Ahmed hold?" or "what is still being deducted?", and to find a custody id for the other custody operations. For totals only, custodies.stat_cards is lighter.

Prerequisites: none. Category and item ids for the filters come from custody_categories.list.

Side effects: none. Up to 50 per page.

Before you call this

You will need ids that come from these operations:

Parameters

NameInTypeDescriptionExample
pagequeryintegerPage number, starting at 1.
min 1
1
per_pagequeryintegerRecords per page. Each list states its maximum.
min 1
20
q[status_eq]querystringOnly this status. held when no status is sent.
Allowed values: held, returned, deducting, deducted
deducting
q[search_cont]querystringHolder's name or employee number, the custody reference or the serial contains.Ahmed
q[custody_category_id_eq]queryintegerOnly this category (id from custody_categories.list).2
q[custody_item_id_eq]queryintegerOnly this item (id from custody_categories.list).7
q[employee_department_id_eq]queryintegerOnly holders in this department (id from employees.meta_data).4
q[employee_location_id_eq]queryintegerOnly holders at this work location (id from employees.meta_data).3
q[s]querystringSort, <field> asc|desc on reference, assigned_on, value or created_at. Newest first when omitted.value desc
Accept-LanguageheaderstringLanguage of messages and translated labels. English when omitted.
Allowed values: ar, en
ar

Response

200 A page of custody records.

FieldTypeDescription
recordsRequiredarray<object>The custody on this page.
records[].idintegerCustody id.
records[].referencestringCustody reference, e.g. CUS-0042.
records[].employeeobjectThe employee holding the asset.
records[].employee.idintegerEmployee id.
records[].employee.full_namestringFull name.
records[].employee.employee_nostringEmployee number.
records[].employee.departmentobjectThe holder's department.
records[].employee.department.idintegerDepartment id.
records[].employee.department.namestringDepartment name.
records[].categoryobjectCategory as it was named when handed over.
records[].category.idintegerCategory id.
records[].category.namestringCategory name.
records[].category.iconstringCategory icon key.
records[].itemobjectItem as it was named when handed over.
records[].item.idintegerItem id.
records[].item.namestringItem name.
records[].serialstringSerial number of the unit handed over.
records[].valuestringValue of the asset, 2 decimals.
records[].currencystringCurrency of the money fields (the holder's pay currency).
records[].assigned_onstring (date)Date it was first handed over.
records[].held_sincestring (date)Date the current holder received it.
records[].statusstringheld (with the employee), returned (back with the company), deducting (returned damaged or lost, the employee repaying it from salary) or deducted (fully recovered or settled).
Allowed values: held, returned, deducting, deducted
records[].installments_paidintegerSalary deductions already paid; 0 when none.
records[].installments_countintegerNumber of salary deductions scheduled; null when the employee pays nothing.
records[].returned_onstring (date)Return date; null while held.
records[].conditionstringCondition at return: intact, damaged or lost; null until returned.
Allowed values: intact, damaged, lost, null
paginationRequiredobject
pagination.current_pageRequiredintegerThis page's number.
pagination.per_pageRequiredintegerRecords per page.
pagination.total_entriesRequiredintegerRecords across all pages.
pagination.pagesRequiredintegerNumber of pages.

Errors

HTTPCodeMeaningHow to fix
401token_missingNo Authorization: Bearer … header, or it is malformed.Send Authorization: Bearer qhr_… with the full token.
401token_invalidThe token is unknown or wrong, or its owner's account is locked.Check the token was copied in full, or create a new one in QHR › Settings › API & Integrations.
401token_expiredThe token is past its expiry date.Create a new token.
401token_revokedThe token was revoked by its owner or an admin, or the owner was removed from the company (which revokes all their tokens).Create a new token, or ask your admin. If the owner was removed, they must be re-invited to the company first.
401tenant_inactiveThe company account is suspended.Contact QHR support.
403forbiddenThe token owner's role lacks the permission this operation needs.Ask an admin to grant the permission shown on this operation (x-permission).
403employee_inactiveThe token owner's employee record is not active.HR must reactivate the employee record.
403tenant_access_revokedThe token's owner is no longer an active member of this company. Rare: removing a member normally revokes their tokens, which answers 401 token_revoked instead.The owner must be re-invited to the company, then create a new token. If the owner is still a member, contact QHR support.
This endpoint can also return the errors that can happen on any endpoint →402 / 412 / 425 entitlement_blocked · 429 rate_limited · 500 internal_error

See the full error catalogue →