Create a request type
/ticket_typesticket/manageRequires feature ticketNot available in Claudeticket_types.createAdds a kind of request to a category, placed last in it, and offers it in ticket_catalog.list while it and its category are enabled.
What the type decides for every request raised with it: - form_fields — the questions the employee answers in tickets.create, with their rules (required, length, number range, file types and size, choices). - approval_flow — who approves before work starts: none (straight to the department), manager (the requester's direct manager; HR when there is no manager), hr, or manager_and_hr (manager, then HR). The approvers are notified when a request reaches them. - department_id — the department whose members see the request in department_tickets.list, take it and work on it; they are notified when a request opens in their queue. - default_priority and target_days — the starting priority and the due date (approval day plus the target days).
A request copies these at submission, so later changes to the type never affect it.
Prerequisites: ticket_category_id from ticket_categories.list; department_id from employees.meta_data (departments).
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; HR sets this up in QHR.
Not available in Claude yet.
Before you call this
You will need ids that come from these operations:
Parameters
| Name | In | Type | Description | Example |
|---|---|---|---|---|
Accept-Language | header | string | Language of messages and translated labels. English when omitted. Allowed values: ar, en | ar |
Request body
application/json
| Field | Type | Description |
|---|---|---|
ticket_typeRequired | object | The type's fields. On update, only the fields you send change; form_fields, when sent, replaces the whole form. |
ticket_type.ticket_category_id | integer | Category, from ticket_categories.list; required. Moving a type to another category puts it last there. |
ticket_type.name_en | string | Name in English, required, unique in the category. |
ticket_type.name_ar | string | Name in Arabic, required, unique in the category. |
ticket_type.description_en | string | Description in English. |
ticket_type.description_ar | string | Description in Arabic. |
ticket_type.department_id | integer | Department that handles the work, required; id from employees.meta_data (departments). |
ticket_type.approval_flow | string | Who 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_priority | string | Priority 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_days | integer | Days the department has to finish, counted from approval; sets the request's due date. min 1 |
ticket_type.enabled | boolean | Offer it in the request catalog. True when omitted on create. |
ticket_type.form_fields | array<object> | The whole form, in order; at most 30 fields. Unknown keys are dropped. |
ticket_type.form_fields[].keyRequired | string | Field key, unique in the form: letters, digits, - and _, up to 40. |
ticket_type.form_fields[].typeRequired | string | Field 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_enRequired | string | Label in English. |
ticket_type.form_fields[].label_arRequired | string | Label in Arabic. |
ticket_type.form_fields[].help_en | string | Help text in English. |
ticket_type.form_fields[].help_ar | string | Help text in Arabic. |
ticket_type.form_fields[].required | boolean | The employee must answer it. |
ticket_type.form_fields[].widthRequired | integer | Width on a 12-column grid: 12 (full), 6 (half) or 4 (third). Allowed values: 12, 6, 4 |
ticket_type.form_fields[].options | array<object> | The choices, for select and multi_select only (at least one, keys unique). |
ticket_type.form_fields[].options[].keyRequired | string | Option key; the value the answer carries. |
ticket_type.form_fields[].options[].label_enRequired | string | Option label in English. |
ticket_type.form_fields[].options[].label_arRequired | string | Option label in Arabic. |
ticket_type.form_fields[].validation | object | Rules 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.min | number | Smallest number allowed. |
ticket_type.form_fields[].validation.max | number | Largest number allowed, not below min. |
ticket_type.form_fields[].validation.max_length | integer | Most characters allowed. |
ticket_type.form_fields[].validation.max_size_mb | number | Largest file, in MB, at most 10. |
ticket_type.form_fields[].validation.file_types | array<string> | File types accepted: pdf, jpg, png. |
Response
201 The new request type.
| Field | Type | Description |
|---|---|---|
id | integer | Request type id. |
ticket_category_id | integer | Its category. |
name_en | string | Name in English, unique in the category. |
name_ar | string | Name in Arabic, unique in the category. |
name | string | Name in the requested language. |
description_en | string | Description in English. |
description_ar | string | Description in Arabic. |
description | string | Description in the requested language; null when blank. |
department | object | The department that handles requests of this type. |
department.id | integer | Department id. |
department.name_en | string | Name in English. |
department.name_ar | string | Name in Arabic. |
department.name | string | Name in the requested language. |
department.active_employee_count | integer | Employed people in the department, who can take its requests. |
approval_flow | string | Who 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_priority | string | Priority a new request gets: low, medium, high or highest. HR can change it per request later.Allowed values: low, medium, high, highest |
target_days | integer | Days the department has to finish, counted from approval; sets the request's due date. min 1 |
position | integer | Display order inside the category, from 0. |
enabled | boolean | Offered in the request catalog. |
form_fields | array<object> | The form employees fill in, in order (at most 30 fields). |
form_fields[].keyRequired | string | Field key, unique in the form: letters, digits, - and _, up to 40. |
form_fields[].typeRequired | string | Field 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_enRequired | string | Label in English. |
form_fields[].label_arRequired | string | Label in Arabic. |
form_fields[].help_en | string | Help text in English. |
form_fields[].help_ar | string | Help text in Arabic. |
form_fields[].required | boolean | The employee must answer it. |
form_fields[].widthRequired | integer | Width on a 12-column grid: 12 (full), 6 (half) or 4 (third). Allowed values: 12, 6, 4 |
form_fields[].options | array<object> | The choices, for select and multi_select only (at least one, keys unique). |
form_fields[].options[].keyRequired | string | Option key; the value the answer carries. |
form_fields[].options[].label_enRequired | string | Option label in English. |
form_fields[].options[].label_arRequired | string | Option label in Arabic. |
form_fields[].validation | object | Rules 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.min | number | Smallest number allowed. |
form_fields[].validation.max | number | Largest number allowed, not below min. |
form_fields[].validation.max_length | integer | Most characters allowed. |
form_fields[].validation.max_size_mb | number | Largest file, in MB, at most 10. |
form_fields[].validation.file_types | array<string> | File types accepted: pdf, jpg, png. |
tickets_count | integer | Requests ever raised with this type. |
deletable | boolean | True while no request uses it; a used type can only be disabled. |
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 | token_read_only | This token can only read; the operation makes changes. | Use a token created with "Allow changes". |
| 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. |
| 422 | validation_failed | Some 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. |
entitlement_blocked · 429 rate_limited · 500 internal_error