List custody records
GET
/custodiesRead token is enoughView every employee's custody, its details and stats
custody/view_othersRequires feature custodyAvailable in Claudecustodies.listReturns 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
| Name | In | Type | Description | Example |
|---|---|---|---|---|
page | query | integer | Page number, starting at 1. min 1 | 1 |
per_page | query | integer | Records per page. Each list states its maximum. min 1 | 20 |
q[status_eq] | query | string | Only this status. held when no status is sent.Allowed values: held, returned, deducting, deducted | deducting |
q[search_cont] | query | string | Holder's name or employee number, the custody reference or the serial contains. | Ahmed |
q[custody_category_id_eq] | query | integer | Only this category (id from custody_categories.list). | 2 |
q[custody_item_id_eq] | query | integer | Only this item (id from custody_categories.list). | 7 |
q[employee_department_id_eq] | query | integer | Only holders in this department (id from employees.meta_data). | 4 |
q[employee_location_id_eq] | query | integer | Only holders at this work location (id from employees.meta_data). | 3 |
q[s] | query | string | Sort, <field> asc|desc on reference, assigned_on, value or created_at. Newest first when omitted. | value desc |
Accept-Language | header | string | Language of messages and translated labels. English when omitted. Allowed values: ar, en | ar |
Response
200 A page of custody records.
| Field | Type | Description |
|---|---|---|
recordsRequired | array<object> | The custody on this page. |
records[].id | integer | Custody id. |
records[].reference | string | Custody reference, e.g. CUS-0042. |
records[].employee | object | The employee holding the asset. |
records[].employee.id | integer | Employee id. |
records[].employee.full_name | string | Full name. |
records[].employee.employee_no | string | Employee number. |
records[].employee.department | object | The holder's department. |
records[].employee.department.id | integer | Department id. |
records[].employee.department.name | string | Department name. |
records[].category | object | Category as it was named when handed over. |
records[].category.id | integer | Category id. |
records[].category.name | string | Category name. |
records[].category.icon | string | Category icon key. |
records[].item | object | Item as it was named when handed over. |
records[].item.id | integer | Item id. |
records[].item.name | string | Item name. |
records[].serial | string | Serial number of the unit handed over. |
records[].value | string | Value of the asset, 2 decimals. |
records[].currency | string | Currency of the money fields (the holder's pay currency). |
records[].assigned_on | string (date) | Date it was first handed over. |
records[].held_since | string (date) | Date the current holder received it. |
records[].status | string | held (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_paid | integer | Salary deductions already paid; 0 when none. |
records[].installments_count | integer | Number of salary deductions scheduled; null when the employee pays nothing. |
records[].returned_on | string (date) | Return date; null while held. |
records[].condition | string | Condition at return: intact, damaged or lost; null until returned.Allowed values: intact, damaged, lost, null |
paginationRequired | object | |
pagination.current_pageRequired | integer | This page's number. |
pagination.per_pageRequired | integer | Records per page. |
pagination.total_entriesRequired | integer | Records across all pages. |
pagination.pagesRequired | integer | Number of pages. |
Errors
| HTTP | Code | Meaning | How to fix |
|---|---|---|---|
| 401 | token_missing | No Authorization: Bearer … header, or it is malformed. | Send Authorization: Bearer qhr_… with the full token. |
| 401 | token_invalid | The 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. |
| 401 | token_expired | The token is past its expiry date. | Create a new token. |
| 401 | token_revoked | The 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. |
| 401 | tenant_inactive | The company account is suspended. | Contact QHR support. |
| 403 | forbidden | The token owner's role lacks the permission this operation needs. | Ask an admin to grant the permission shown on this operation (x-permission). |
| 403 | employee_inactive | The token owner's employee record is not active. | HR must reactivate the employee record. |
| 403 | tenant_access_revoked | The 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. |
entitlement_blocked · 429 rate_limited · 500 internal_error