QHR Developers

Hand an asset to an employee

POST/custodies
Needs a read & write tokenAssign, transfer, return and settle custody custody/manage_custodyRequires feature custodyNot available in Claudecustodies.create

Records that an asset from the catalogue was handed to an employee: the item, its serial, its value (the item's default value when omitted) and the date, with the signed handover form. The custody starts as held, gets the next reference (CUS-0042), and keeps the category and item names as they are today.

When to use: when HR gives an employee a laptop, phone, car or key. To move an asset someone already holds, use custodies.transfer.

Prerequisites: employee_id from custodies.employee_options (active, no termination package); custody_item_id from custody_categories.list (an available item). Items with serial_required need a serial nobody else holds. Needs "Manage custody", and a token owner linked to an employee record.

Side effects: the assignment, with the handover PDF and the acting HR employee, starts the custody's history; recorded in the audit log. No one is notified, and nothing is deducted from salary.

Not offered to Claude: it uploads a signed PDF (multipart), which a chat cannot provide.

Not available in Claude: file uploads are API-only.

Before you call this

You will need ids that come from these operations:

Parameters

NameInTypeDescriptionExample
Accept-LanguageheaderstringLanguage of messages and translated labels. English when omitted.
Allowed values: ar, en
ar

Request body

multipart/form-data

FieldTypeDescription
employee_idRequiredintegerWho receives it (id from custodies.employee_options).
custody_item_idRequiredintegerThe item (id from custody_categories.list).
serialstringSerial number of the unit; required when the item has serial_required.
valuestringValue of this unit; the item's default_value when omitted.
assigned_onRequiredstring (date)Handover date, not in the future.
documentRequiredfileThe signed handover form, a PDF of at most 10 MB.

Response

201 The new custody record.

FieldTypeDescription
recordRequiredobjectOne custody record in full.
record.idintegerCustody id.
record.referencestringCustody reference, e.g. CUS-0042.
record.employeeobjectThe employee holding the asset.
record.employee.idintegerEmployee id.
record.employee.full_namestringFull name.
record.employee.employee_nostringEmployee number.
record.employee.departmentobjectThe holder's department.
record.employee.department.idintegerDepartment id.
record.employee.department.namestringDepartment name.
record.categoryobjectCategory as it was named when handed over.
record.category.idintegerCategory id.
record.category.namestringCategory name.
record.category.iconstringCategory icon key.
record.itemobjectItem as it was named when handed over.
record.item.idintegerItem id.
record.item.namestringItem name.
record.serialstringSerial number of the unit handed over.
record.valuestringValue of the asset, 2 decimals.
record.currencystringCurrency of the money fields (the holder's pay currency).
record.assigned_onstring (date)Date it was first handed over.
record.held_sincestring (date)Date the current holder received it.
record.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
record.installments_paidintegerSalary deductions already paid; 0 when none.
record.installments_countintegerNumber of salary deductions scheduled; null when the employee pays nothing.
record.returned_onstring (date)Return date; null while held.
record.conditionstringCondition at return: intact, damaged or lost; null until returned.
Allowed values: intact, damaged, lost, null
record.compensation_amountstringCost of the damage or loss; null for an intact return.
record.borne_bystringWho pays that cost: company or employee.
Allowed values: company, employee, null
record.labor_law_capbooleanTrue when the deductions were limited to five days' wage a month (labour law).
record.amount_repaidstringAlready recovered from salary; null unless the employee pays.
record.outstandingstringStill to recover; null unless the employee pays.
record.settlementobjectHow the balance was closed (cash, or a termination package); null until settled.
record.settlement.amountstringAmount settled.
record.settlement.datestring (date)Settlement date.
record.settlement.sourcestringcash or termination_package.
record.settlement.reasonstringHR's reason, for a cash settlement.
record.settlement.termination_packageobjectThe termination package that settled it.
record.settlement.termination_package.idintegerId.
record.settlement.termination_package.referencestringReference.
record.installmentsarray<object>The salary-deduction schedule, oldest first; empty unless the employee pays.
record.installments[].idintegerInstallment id.
record.installments[].sequenceintegerPosition in the schedule, from 1.
record.installments[].due_onstring (date)First day of the month whose payroll deducts it.
record.installments[].amountstringAmount.
record.installments[].currencystringCurrency.
record.installments[].statusstringpaid once the payslip carrying it was paid, due until then.
Allowed values: paid, due
record.installments[].payrollobjectThe payroll run that deducted it.
record.installments[].payroll.idintegerId.
record.installments[].payroll.referencestringReference.
record.timelinearray<object>What happened to the asset, newest first.
record.timeline[].kindstringassigned, transferred, auto_transferred (moved to HR when a leaver's package was paid), returned, installment_deducted, settled or package_settled.
record.timeline[].occurred_onstring (date)Date.
record.timeline[].actorobjectWho did it; null for a system action.
record.timeline[].actor.idintegerEmployee id.
record.timeline[].actor.full_namestringFull name.
record.timeline[].from_employeeobjectPrevious holder, for a transfer.
record.timeline[].from_employee.idintegerEmployee id.
record.timeline[].from_employee.full_namestringFull name.
record.timeline[].to_employeeobjectNew holder, for an assignment or transfer.
record.timeline[].to_employee.idintegerEmployee id.
record.timeline[].to_employee.full_namestringFull name.
record.timeline[].amountstringMoney involved, when any.
record.timeline[].notestringSettlement reason.
record.timeline[].conditionstringCondition, for a return.
record.timeline[].termination_packageobjectRelated termination package.
record.timeline[].termination_package.idintegerId.
record.timeline[].termination_package.referencestringReference.
record.timeline[].payrollobjectPayroll run, for a deduction.
record.timeline[].payroll.idintegerId.
record.timeline[].payroll.referencestringReference.
record.timeline[].installmentobjectWhich installment, for a deduction.
record.timeline[].installment.sequenceintegerInstallment number.
record.timeline[].installment.countintegerInstallments in total.
record.timeline[].documentobjectThe signed handover PDF.
record.timeline[].document.urlstringTemporary download link.
record.timeline[].document.filenamestringFile name.
record.can_returnbooleanTrue when the caller may take it back now.
record.can_transferbooleanTrue when the caller may move it to another employee now.
record.can_settlebooleanTrue when the caller may settle the balance in cash now.
record.settlement_blockerobjectWhy the balance cannot be settled in cash, while deducting: claimed_by_package, nothing_outstanding or installment_in_flight.
record.settlement_blocker.codestringReason code.
record.settlement_blocker.messagestringExplanation.
record.accounting_connectedbooleanTrue when the company is connected to Qoyod accounting (a cash settlement is then booked there by hand).
record.employee_termination_packageobjectThe holder's open termination package, which blocks moving the asset.
record.employee_termination_package.idintegerId.
record.employee_termination_package.referencestringReference.

Errors

HTTPCodeMeaningHow to fix
400bad_requestA parameter is missing or malformed.Check the parameters against this operation's documentation.
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.
403token_read_onlyThis token can only read; the operation makes changes.Use a token created with "Allow changes".
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.
422employee_not_assignableThe employee is not active, is serving notice, or has a termination package.Choose someone from custodies.employee_options.
422item_unavailableThe item does not exist or is switched off.Choose an available item from custody_categories.list (for_assign=true).
422serial_requiredThe item needs a serial number.Send serial.
422serial_takenAnother employee holds this serial; custody_id and reference name that custody.Check the serial, or take that custody back first with custodies.return.
422date_in_futureThe date is after today in the company time zone.Send today or an earlier date.
422document_requiredThe signed handover form is missing.Attach it as document, a PDF.
422document_invalidThe handover form is not a PDF, or is over 10 MB.Attach a PDF of at most 10 MB.
422employee_requiredThe token owner is a user with no employee record; the operation records who acted, so it needs one.Use a token created by a user linked to an employee record.
422validation_failedSome fields are missing or not valid.Fix the fields named in error (and errors when present), then send again.
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 →