QHR Developers

Reorder the request types of a category

PATCH/ticket_types/reorder
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.reorder

Saves the order of one category's request types, in the catalog and in settings. ids must list every type of that category exactly once, in the new order; the answer is the category's types in that order.

When to use: after HR moves types around inside a category. To move a type to another category use ticket_types.update with a new ticket_category_id.

Prerequisites: ticket_category_id from ticket_categories.list; the ids from ticket_types.list.

Side effects: each move is recorded in the audit log.

Not offered to Claude: a company-wide layout choice made by HR in QHR.

Not available in Claude yet.

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

application/json

FieldTypeDescription
ticket_category_idRequiredintegerThe category whose types are reordered.
idsRequiredarray<integer>Every type id of the category, once, in the new order.

Response

200 The category's types, in the new order.

FieldTypeDescription
recordsRequiredarray<object>The request types.
records[].idintegerRequest type id.
records[].ticket_category_idintegerIts category.
records[].name_enstringName in English, unique in the category.
records[].name_arstringName in Arabic, unique in the category.
records[].namestringName in the requested language.
records[].description_enstringDescription in English.
records[].description_arstringDescription in Arabic.
records[].descriptionstringDescription in the requested language; null when blank.
records[].departmentobjectThe department that handles requests of this type.
records[].department.idintegerDepartment id.
records[].department.name_enstringName in English.
records[].department.name_arstringName in Arabic.
records[].department.namestringName in the requested language.
records[].department.active_employee_countintegerEmployed people in the department, who can take its requests.
records[].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
records[].default_prioritystringPriority a new request gets: low, medium, high or highest. HR can change it per request later.
Allowed values: low, medium, high, highest
records[].target_daysintegerDays the department has to finish, counted from approval; sets the request's due date.
min 1
records[].positionintegerDisplay order inside the category, from 0.
records[].enabledbooleanOffered in the request catalog.
records[].form_fieldsarray<object>The form employees fill in, in order (at most 30 fields).
records[].form_fields[].keyRequiredstringField key, unique in the form: letters, digits, - and _, up to 40.
records[].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
records[].form_fields[].label_enRequiredstringLabel in English.
records[].form_fields[].label_arRequiredstringLabel in Arabic.
records[].form_fields[].help_enstringHelp text in English.
records[].form_fields[].help_arstringHelp text in Arabic.
records[].form_fields[].requiredbooleanThe employee must answer it.
records[].form_fields[].widthRequiredintegerWidth on a 12-column grid: 12 (full), 6 (half) or 4 (third).
Allowed values: 12, 6, 4
records[].form_fields[].optionsarray<object>The choices, for select and multi_select only (at least one, keys unique).
records[].form_fields[].options[].keyRequiredstringOption key; the value the answer carries.
records[].form_fields[].options[].label_enRequiredstringOption label in English.
records[].form_fields[].options[].label_arRequiredstringOption label in Arabic.
records[].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.
records[].form_fields[].validation.minnumberSmallest number allowed.
records[].form_fields[].validation.maxnumberLargest number allowed, not below min.
records[].form_fields[].validation.max_lengthintegerMost characters allowed.
records[].form_fields[].validation.max_size_mbnumberLargest file, in MB, at most 10.
records[].form_fields[].validation.file_typesarray<string>File types accepted: pdf, jpg, png.
records[].tickets_countintegerRequests ever raised with this type.
records[].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_failedids does not list every request type of the category exactly once.Read ticket_types.list for the category and send every id once, in the new order.
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 →