Skip to main content

List Catalog Templates

Lists catalog templates (service catalog items) available for ticket creation. Returns template definitions with associated metadata, categories, and configuration details. Supports filtering, sorting, and pagination.


Endpoint

Method: POST URL: {{base_url}}/api/v2/ticketing/ticket/list?type=template&module=ticketing


Authentication

This endpoint uses Bearer Token authentication via a JWT (JSON Web Token). The token must be included in the Authorization header.


Headers

HeaderTypeDescriptionRequired
AuthorizationstringBearer token for authenticationYes
Content-TypestringMust be application/jsonYes
x-tenantidstringTenant UUID identifierYes
realmnamestringAuthentication realm nameYes
issupportrequeststringFilter for support request templates. Values: true, falseNo

Query Parameters

ParameterTypeDescriptionRequired
typestringRecord type. Must be template for catalog templatesYes
modulestringModule context. Use ticketing for service catalogYes

Request Body Schema

FieldTypeDescriptionRequired
searchstringSearch term to filter templates by name or descriptionNo
topintegerNumber of records to return (page size). Default: 30No
offsetintegerNumber of records to skip for pagination. Default: 0No
sortstringField to sort by. Default: updatedAtNo
searchOrderstringSort direction for search. Values: ASC, DESCNo
sortOrderarrayAdditional sort configurationsNo
filterobjectComplex filter conditionsNo
filter.opstringLogical operator: AND, ORNo
filter.operandarrayArray of filter conditionsNo

Filter Operand Structure

Each filter operand supports:

FieldTypeDescription
fieldstringField name to filter on
opstringComparison operator: eq, ne, contains, in, notIn, gt, lt, gte, lte
valueanyValue to compare against

Request Body Example

{
"search": "",
"top": 30,
"offset": 0,
"sort": "updatedAt",
"searchOrder": "DESC",
"sortOrder": [],
"filter": {
"op": "AND",
"operand": []
}
}

Example cURL

List All Active Templates

curl -X POST 'https://your-domain.com/api/v2/ticketing/ticket/list?type=template&module=ticketing' \
-H 'accept: application/json' \
-H 'authorization: Bearer YOUR_ACCESS_TOKEN' \
-H 'content-type: application/json' \
-H 'x-tenantid: YOUR_TENANT_ID' \
-H 'realmname: YOUR_REALM' \
-H 'issupportrequest: false' \
--data-raw '{
"search": "",
"top": 30,
"offset": 0,
"sort": "updatedAt",
"searchOrder": "DESC",
"sortOrder": [],
"filter": {
"op": "AND",
"operand": []
}
}'

Search Templates by Name

curl -X POST 'https://your-domain.com/api/v2/ticketing/ticket/list?type=template&module=ticketing' \
-H 'accept: application/json' \
-H 'authorization: Bearer YOUR_ACCESS_TOKEN' \
-H 'content-type: application/json' \
-H 'x-tenantid: YOUR_TENANT_ID' \
-H 'realmname: YOUR_REALM' \
--data-raw '{
"search": "laptop",
"top": 20,
"offset": 0,
"sort": "name",
"searchOrder": "ASC"
}'

Filter by Category

curl -X POST 'https://your-domain.com/api/v2/ticketing/ticket/list?type=template&module=ticketing' \
-H 'accept: application/json' \
-H 'authorization: Bearer YOUR_ACCESS_TOKEN' \
-H 'content-type: application/json' \
-H 'x-tenantid: YOUR_TENANT_ID' \
-H 'realmname: YOUR_REALM' \
--data-raw '{
"search": "",
"top": 30,
"offset": 0,
"sort": "displayOrder",
"searchOrder": "ASC",
"filter": {
"op": "AND",
"operand": [
{
"field": "category.id",
"op": "eq",
"value": "cat_hardware"
},
{
"field": "isPublished",
"op": "eq",
"value": true
}
]
}
}'

List Support Request Templates Only

curl -X POST 'https://your-domain.com/api/v2/ticketing/ticket/list?type=template&module=ticketing' \
-H 'accept: application/json' \
-H 'authorization: Bearer YOUR_ACCESS_TOKEN' \
-H 'content-type: application/json' \
-H 'x-tenantid: YOUR_TENANT_ID' \
-H 'realmname: YOUR_REALM' \
-H 'issupportrequest: true' \
--data-raw '{
"search": "",
"top": 30,
"offset": 0,
"sort": "updatedAt",
"searchOrder": "DESC"
}'

Paginated Request (Page 2)

curl -X POST 'https://your-domain.com/api/v2/ticketing/ticket/list?type=template&module=ticketing' \
-H 'accept: application/json' \
-H 'authorization: Bearer YOUR_ACCESS_TOKEN' \
-H 'content-type: application/json' \
-H 'x-tenantid: YOUR_TENANT_ID' \
-H 'realmname: YOUR_REALM' \
--data-raw '{
"search": "",
"top": 30,
"offset": 30,
"sort": "updatedAt",
"searchOrder": "DESC"
}'

Success Response Example

Status Code: 200 OK

{
"success": true,
"data": {
"count": 15,
"rows": [
{
"id": "tpl_01HQRST456",
"uuid": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"name": "New Laptop Request",
"description": "Request for a new laptop or workstation",
"category": {
"id": "cat_hardware",
"name": "Hardware",
"icon": "laptop"
},
"subcategory": {
"id": "subcat_laptops",
"name": "Laptops & Workstations"
},
"priority": {
"id": "pri_medium",
"name": "Medium",
"value": 3
},
"status": "active",
"isPublished": true,
"isSupportRequest": false,
"estimatedTime": "3-5 business days",
"approvalRequired": true,
"approvalWorkflow": {
"id": "wf_manager_approval",
"name": "Manager Approval"
},
"formFields": [
{
"id": "field_laptop_type",
"name": "Laptop Type",
"type": "DROPDOWN",
"required": true,
"options": ["Standard", "Developer", "Executive"]
},
{
"id": "field_justification",
"name": "Business Justification",
"type": "TEXTAREA",
"required": true
}
],
"metaFields": {
"costCenter": "IT-HARDWARE",
"budgetCategory": "CAPEX"
},
"icon": "laptop",
"color": "#4A90D9",
"displayOrder": 1,
"tags": ["hardware", "laptop", "equipment"],
"availableForTeams": ["it", "engineering", "global"],
"createdAt": "2024-08-15T10:30:00.000Z",
"updatedAt": "2024-12-10T14:22:00.000Z",
"createdBy": {
"id": "usr_admin01",
"name": "System Admin"
},
"updatedBy": {
"id": "usr_catalog_mgr",
"name": "Catalog Manager"
}
},
{
"id": "tpl_01HQRST789",
"uuid": "b2c3d4e5-f6a7-8901-bcde-f23456789012",
"name": "Software Installation Request",
"description": "Request installation of approved software",
"category": {
"id": "cat_software",
"name": "Software",
"icon": "package"
},
"subcategory": {
"id": "subcat_install",
"name": "Installation"
},
"priority": {
"id": "pri_low",
"name": "Low",
"value": 4
},
"status": "active",
"isPublished": true,
"isSupportRequest": false,
"estimatedTime": "1-2 business days",
"approvalRequired": false,
"formFields": [
{
"id": "field_software_name",
"name": "Software Name",
"type": "LOOKUP",
"required": true,
"lookupSource": "approved_software_catalog"
},
{
"id": "field_license_type",
"name": "License Type",
"type": "DROPDOWN",
"required": true,
"options": ["Single User", "Team", "Enterprise"]
}
],
"icon": "download",
"color": "#27AE60",
"displayOrder": 2,
"tags": ["software", "installation"],
"availableForTeams": ["*"],
"createdAt": "2024-09-01T09:00:00.000Z",
"updatedAt": "2024-12-08T11:15:00.000Z"
}
]
},
"message": "Templates retrieved successfully"
}

Response Fields

FieldTypeDescription
successbooleanIndicates if the request was successful
data.countintegerTotal number of templates matching criteria
data.rowsarrayArray of template objects
data.rows[].idstringUnique template identifier
data.rows[].uuidstringUUID of the template
data.rows[].namestringDisplay name of the template
data.rows[].descriptionstringDetailed description of the service
data.rows[].categoryobjectPrimary category classification
data.rows[].subcategoryobjectSecondary category classification
data.rows[].priorityobjectDefault priority for tickets created from template
data.rows[].statusstringTemplate status: active, inactive, draft
data.rows[].isPublishedbooleanWhether template is visible in catalog
data.rows[].isSupportRequestbooleanWhether this is a support request template
data.rows[].estimatedTimestringExpected fulfillment time
data.rows[].approvalRequiredbooleanWhether approval workflow is needed
data.rows[].approvalWorkflowobjectAssociated approval workflow details
data.rows[].formFieldsarrayCustom form field definitions
data.rows[].metaFieldsobjectAdditional metadata configuration
data.rows[].iconstringIcon identifier for display
data.rows[].colorstringColor code for visual styling
data.rows[].displayOrderintegerSort order in catalog display
data.rows[].tagsarraySearchable tags
data.rows[].availableForTeamsarrayTeam restrictions (* for all teams)
data.rows[].createdAtstringISO 8601 creation timestamp
data.rows[].updatedAtstringISO 8601 last update timestamp
data.rows[].createdByobjectUser who created the template
data.rows[].updatedByobjectUser who last modified the template

Form Field Types

TypeDescription
TEXTSingle-line text input
TEXTAREAMulti-line text input
DROPDOWNSingle-select dropdown
MULTISELECTMulti-select dropdown
CHECKBOXBoolean checkbox
RADIORadio button group
DATEDate picker
DATETIMEDate and time picker
NUMBERNumeric input
FILEFile attachment
USERUser picker
LOOKUPDynamic lookup from external source

Error Responses

400 Bad Request

{
"success": false,
"error": {
"code": "INVALID_REQUEST",
"message": "Invalid filter operand structure"
}
}

401 Unauthorized

{
"success": false,
"error": {
"code": "UNAUTHORIZED",
"message": "Invalid or expired access token"
}
}

403 Forbidden

{
"success": false,
"error": {
"code": "FORBIDDEN",
"message": "Insufficient permissions to access catalog templates"
}
}

422 Unprocessable Entity

{
"success": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "Invalid sort field specified",
"details": {
"field": "sort",
"value": "invalidField",
"allowedValues": ["name", "updatedAt", "createdAt", "displayOrder", "category"]
}
}
}

500 Internal Server Error

{
"success": false,
"error": {
"code": "INTERNAL_ERROR",
"message": "An unexpected error occurred while retrieving templates"
}
}

Notes

  1. Template vs Ticket Distinction: This endpoint uses type=template to fetch catalog template definitions, not actual tickets. For listing tickets, use type=ticket.

  2. Module Context: The module=ticketing parameter ensures templates are retrieved from the service catalog context. Other modules may have different template types.

  3. Support Request Header: The issupportrequest header filters between standard service catalog templates and support request templates. When false or omitted, returns standard catalog items.

  4. Team Availability: Templates can be restricted to specific teams via availableForTeams. A value of ["*"] indicates the template is available to all teams.

  5. Published Status: Only templates with isPublished: true appear in end-user catalogs. Draft and unpublished templates are visible only to administrators.

  6. Form Fields Configuration: The formFields array defines the custom form rendered when users create tickets from this template. Field configurations include validation rules, default values, and conditional visibility.

  7. Approval Workflows: Templates with approvalRequired: true will trigger the associated approval workflow when tickets are created.

  8. Pagination: Use top and offset for pagination. The count field in response indicates total matching records for calculating pages.

  9. Sort Options: Common sort fields include:

    • name: Alphabetical by template name
    • updatedAt: Most recently modified
    • createdAt: Creation date
    • displayOrder: Custom catalog order
    • category: By category grouping
  10. Role Requirements: Requires ticket_user, ticket_agent, or higher role to view published templates. Draft templates require ticket_admin or catalog_admin role.

  11. Multi-Tenancy: Templates are tenant-specific. The x-tenantid header ensures proper data isolation.

  12. Caching: Template lists may be cached. Changes to templates may take a few minutes to reflect in API responses.