QHR Developers

Update a request type

PATCH/ticket_types/{id}
Needs a read & write tokenConfigure request categories and types, see all requests, approve as HR, change priority and due date ticket/manageRequires feature ticketNot available in Claudeticket_types.update

Changes the fields you send. form_fields, when sent, replaces the whole form, so send every field (read them with ticket_types.show). A new ticket_category_id moves the type to the end of that category. enabled: false stops offering it in ticket_catalog.list.

What changes for requests: only requests submitted from now on. A request copies the form, approval flow, department and target days when it is submitted, so requests already raised keep theirs.

Prerequisites: the type's id from ticket_types.list; ids as in ticket_types.create.

Side effects: recorded in the audit log. No one is notified.

Not offered to Claude: it changes what every employee can ask for and who approves and handles it.

Not available in Claude yet.

Before you call this

You will need ids that come from these operations:

Parameters

NameInTypeDescriptionExample
idRequiredpathintegerRequest type id, from ticket_types.list.12
Accept-LanguageheaderstringLanguage of messages and translated labels. English when omitted.
Allowed values: ar, en
ar

Request body

application/json

FieldTypeDescription
ticket_typeRequiredobjectThe type's fields. On update, only the fields you send change; form_fields, when sent, replaces the whole form.
ticket_type.ticket_category_idintegerCategory, from ticket_categories.list; required. Moving a type to another category puts it last there.
ticket_type.name_enstringName in English, required, unique in the category.
ticket_type.name_arstringName in Arabic, required, unique in the category.
ticket_type.description_enstringDescription in English.
ticket_type.description_arstringDescription in Arabic.
ticket_type.department_idintegerDepartment that handles the work, required; id from employees.meta_data (departments).
ticket_type.approval_flowstringWho approves a request before the department works on it: none (goes straight to the department), manager (the requester's direct manager), hr (HR) or manager_and_hr (the manager, then HR).
Allowed values: none, manager, hr, manager_and_hr
ticket_type.default_prioritystringPriority a new request gets: low, medium, high or highest. HR can change it per request later.
Allowed values: low, medium, high, highest
ticket_type.target_daysintegerDays the department has to finish, counted from approval; sets the request's due date.
min 1
ticket_type.enabledbooleanOffer it in the request catalog. True when omitted on create.
ticket_type.form_fieldsarray<object>The whole form, in order; at most 30 fields. Unknown keys are dropped.
ticket_type.form_fields[].keyRequiredstringField key, unique in the form: letters, digits, - and _, up to 40.
ticket_type.form_fields[].typeRequiredstringField type: short_text, long_text, number, date, date_range, select, multi_select, checkbox, file (PDF, JPG or PNG) or employee (a colleague, picked with ticket_catalog.employees).
Allowed values: short_text, long_text, number, date, date_range, select, multi_select, checkbox, file, employee
ticket_type.form_fields[].label_enRequiredstringLabel in English.
ticket_type.form_fields[].label_arRequiredstringLabel in Arabic.
ticket_type.form_fields[].help_enstringHelp text in English.
ticket_type.form_fields[].help_arstringHelp text in Arabic.
ticket_type.form_fields[].requiredbooleanThe employee must answer it.
ticket_type.form_fields[].widthRequiredintegerWidth on a 12-column grid: 12 (full), 6 (half) or 4 (third).
Allowed values: 12, 6, 4
ticket_type.form_fields[].optionsarray<object>The choices, for select and multi_select only (at least one, keys unique).
ticket_type.form_fields[].options[].keyRequiredstringOption key; the value the answer carries.
ticket_type.form_fields[].options[].label_enRequiredstringOption label in English.
ticket_type.form_fields[].options[].label_arRequiredstringOption label in Arabic.
ticket_type.form_fields[].validationobjectRules checked on the answer: min / max for number, max_length for text, file_types and max_size_mb for file. A rule on another field type is refused.
ticket_type.form_fields[].validation.minnumberSmallest number allowed.
ticket_type.form_fields[].validation.maxnumberLargest number allowed, not below min.
ticket_type.form_fields[].validation.max_lengthintegerMost characters allowed.
ticket_type.form_fields[].validation.max_size_mbnumberLargest file, in MB, at most 10.
ticket_type.form_fields[].validation.file_typesarray<string>File types accepted: pdf, jpg, png.

Response

200 The request type.

FieldTypeDescription
idintegerRequest type id.
ticket_category_idintegerIts category.
name_enstringName in English, unique in the category.
name_arstringName in Arabic, unique in the category.
namestringName in the requested language.
description_enstringDescription in English.
description_arstringDescription in Arabic.
descriptionstringDescription in the requested language; null when blank.
departmentobjectThe department that handles requests of this type.
department.idintegerDepartment id.
department.name_enstringName in English.
department.name_arstringName in Arabic.
department.namestringName in the requested language.
department.active_employee_countintegerEmployed people in the department, who can take its requests.
approval_flowstringWho approves a request before the department works on it: none (goes straight to the department), manager (the requester's direct manager), hr (HR) or manager_and_hr (the manager, then HR).
Allowed values: none, manager, hr, manager_and_hr
default_prioritystringPriority a new request gets: low, medium, high or highest. HR can change it per request later.
Allowed values: low, medium, high, highest
target_daysintegerDays the department has to finish, counted from approval; sets the request's due date.
min 1
positionintegerDisplay order inside the category, from 0.
enabledbooleanOffered in the request catalog.
form_fieldsarray<object>The form employees fill in, in order (at most 30 fields).
form_fields[].keyRequiredstringField key, unique in the form: letters, digits, - and _, up to 40.
form_fields[].typeRequiredstringField type: short_text, long_text, number, date, date_range, select, multi_select, checkbox, file (PDF, JPG or PNG) or employee (a colleague, picked with ticket_catalog.employees).
Allowed values: short_text, long_text, number, date, date_range, select, multi_select, checkbox, file, employee
form_fields[].label_enRequiredstringLabel in English.
form_fields[].label_arRequiredstringLabel in Arabic.
form_fields[].help_enstringHelp text in English.
form_fields[].help_arstringHelp text in Arabic.
form_fields[].requiredbooleanThe employee must answer it.
form_fields[].widthRequiredintegerWidth on a 12-column grid: 12 (full), 6 (half) or 4 (third).
Allowed values: 12, 6, 4
form_fields[].optionsarray<object>The choices, for select and multi_select only (at least one, keys unique).
form_fields[].options[].keyRequiredstringOption key; the value the answer carries.
form_fields[].options[].label_enRequiredstringOption label in English.
form_fields[].options[].label_arRequiredstringOption label in Arabic.
form_fields[].validationobjectRules checked on the answer: min / max for number, max_length for text, file_types and max_size_mb for file. A rule on another field type is refused.
form_fields[].validation.minnumberSmallest number allowed.
form_fields[].validation.maxnumberLargest number allowed, not below min.
form_fields[].validation.max_lengthintegerMost characters allowed.
form_fields[].validation.max_size_mbnumberLargest file, in MB, at most 10.
form_fields[].validation.file_typesarray<string>File types accepted: pdf, jpg, png.
tickets_countintegerRequests ever raised with this type.
deletablebooleanTrue while no request uses it; a used type can only be disabled.

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.
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.
404not_foundThe record does not exist, or you cannot see it.Check the id. List the records first to get a valid one.
422validation_failedSome fields are not valid. errors names them; form problems are under errors.form_fields, keyed by the field's index in the form ("2"), with list-wide ones under errors.form_fields.base.Fix the fields named in errors, 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 →