Zoho CRM Inventory Templates

OpenAPI definition for managing Inventory Templates APIs. Published by Zoho in its first-party OpenAPI 3.1.0 repository github.com/zoho/crm-oas; 1 operation(s).

OpenAPI Specification

zoho-crm-inventory-templates-openapi.json Raw ↑
{
  "openapi": "3.1.0",
  "info": {
    "title": "Inventory Templates",
    "description": "OpenAPI definition for managing Inventory Templates APIs.",
    "version": "8.0"
  },
  "servers": [
    {
      "url": "https://zohoapis.{dc}/crm/{version}",
      "description": "API Server URL",
      "variables": {
        "dc": {
          "enum": [
            "com",
            "eu",
            "in",
            "cn",
            "au"
          ],
          "default": "com",
          "description": "API Server URL TLD"
        },
        "version": {
          "default": "v8",
          "description": "API Version"
        }
      }
    }
  ],
  "paths": {
    "/settings/inventory_templates": {
      "get": {
        "operationId": "getTemplates",
        "summary": "Retrieve inventory templates list",
        "description": "Retrieve a paginated list of inventory templates with support for sorting, filtering, and category selection. Use page/per_page for pagination (default: 20 per page, max: 200). Supports sorting by any field and filtering via JSON-stringified filter expressions.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Module"
          },
          {
            "name": "sort_by",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 50
            },
            "description": "Field name to sort by (e.g., modified_time, name)"
          },
          {
            "name": "sort_order",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ]
            },
            "description": "Sort order; default is desc"
          },
          {
            "name": "category",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "normal",
                "draft"
              ]
            },
            "description": "Filter by template category. Values: normal (active templates), draft (saved drafts)"
          },
          {
            "name": "filters",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 2000
            },
            "description": "JSON-stringified filter expression. See operation description for supported comparators and group_operator.\n"
          },
          {
            "name": "per_page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 20,
              "minimum": 1,
              "maximum": 100
            },
            "description": "Number of items per page (default = 20, max = 100)"
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 1,
              "minimum": 1
            },
            "description": "Page number, starting at 1"
          }
        ],
        "security": [
          {
            "iam-oauth2-schema": [
              "ZohoCRM.templates.inventory.READ"
            ]
          }
        ],
        "responses": {
          "200": {
            "description": "OK — list of inventory templates with pagination metadata",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InventoryTemplatesSuccessResponse"
                }
              }
            }
          },
          "204": {
            "description": "No Content — no templates match the criteria"
          },
          "400": {
            "description": "Bad Request — invalid parameters, missing mandatory fields, or invalid module",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InventoryTemplatesErrorResponse"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "examples": {
      "ModifiedTimeGreaterThan": {
        "summary": "Filter templates modified after a date",
        "value": {
          "group_operator": "AND",
          "group": [
            {
              "comparator": "greater_than",
              "field": {
                "api_name": "modified_time"
              },
              "value": "2025-07-15T13:20:29.896+05:30"
            }
          ]
        }
      },
      "InventoryTemplatesListExample": {
        "summary": "Example list response",
        "value": {
          "inventory_templates": [
            {
              "id": "tmpl_123",
              "name": "Abc12",
              "created_time": "2025-11-27T06:00:00Z",
              "modified_time": "2025-11-27T07:00:00Z",
              "last_usage_time": null,
              "category": "normal",
              "folder": {
                "id": "f1",
                "name": "Default"
              },
              "module": {
                "api_name": "Quotes",
                "id": "m1"
              },
              "created_by": {
                "id": "u1",
                "name": "Alice"
              },
              "modified_by": {
                "id": "u2",
                "name": "Bob"
              },
              "editor_mode": "plain_text",
              "favorite": false
            }
          ],
          "info": {
            "per_page": 20,
            "page": 1,
            "count": 1,
            "more_records": true
          }
        }
      }
    },
    "schemas": {
      "ModuleRef": {
        "type": "object",
        "description": "Reference to a CRM module (api_name and id).",
        "additionalProperties": false,
        "properties": {
          "api_name": {
            "type": "string",
            "description": "API name of the module",
            "maxLength": 50
          },
          "id": {
            "type": "string",
            "description": "ID of the module",
            "maxLength": 50
          }
        },
        "required": [
          "api_name",
          "id"
        ]
      },
      "FolderRef": {
        "type": "object",
        "description": "Folder reference with id and name.",
        "additionalProperties": false,
        "properties": {
          "name": {
            "type": "string",
            "description": "Name of the folder",
            "maxLength": 255
          },
          "id": {
            "type": "string",
            "description": "ID of the folder",
            "maxLength": 50
          }
        },
        "required": [
          "name",
          "id"
        ]
      },
      "UserRef": {
        "type": "object",
        "description": "User reference with id and display name.",
        "additionalProperties": false,
        "properties": {
          "name": {
            "type": "string",
            "description": "Display name of the user",
            "maxLength": 255
          },
          "id": {
            "type": "string",
            "description": "ID of the user",
            "maxLength": 50
          }
        },
        "required": [
          "name",
          "id"
        ]
      },
      "InventoryTemplatesSuccessResponse": {
        "type": "object",
        "description": "Successful response containing inventory_templates array and pagination info.",
        "additionalProperties": false,
        "properties": {
          "inventory_templates": {
            "type": "array",
            "description": "List of inventory templates",
            "items": {
              "$ref": "#/components/schemas/InventoryTemplateItem"
            },
            "maxItems": 100
          },
          "info": {
            "description": "Pagination information",
            "$ref": "#/components/schemas/InfoBlock"
          }
        },
        "required": [
          "inventory_templates",
          "info"
        ]
      },
      "InfoBlock": {
        "type": "object",
        "description": "Pagination metadata for list responses (per_page, page, count, more_records).",
        "additionalProperties": false,
        "properties": {
          "per_page": {
            "type": "integer",
            "format": "int32",
            "description": "Items per page (requested or default)"
          },
          "page": {
            "type": "integer",
            "format": "int32",
            "description": "Current page number"
          },
          "count": {
            "type": "integer",
            "format": "int32",
            "description": "Number of items returned in `inventory_templates` for this response"
          },
          "more_records": {
            "type": "boolean",
            "description": "True if there are more pages available after this one"
          }
        },
        "required": [
          "per_page",
          "page",
          "count",
          "more_records"
        ]
      },
      "InventoryTemplateItem": {
        "type": "object",
        "description": "Inventory template summary object returned in lists.",
        "additionalProperties": false,
        "properties": {
          "created_time": {
            "type": "string",
            "format": "date-time",
            "description": "Template creation timestamp"
          },
          "modified_time": {
            "type": "string",
            "format": "date-time",
            "description": "Template last modification timestamp"
          },
          "last_usage_time": {
            "description": "Last time the template was used",
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "description": "Last usage timestamp"
              },
              {
                "type": "null",
                "description": "Null if never used"
              }
            ]
          },
          "category": {
            "type": "string",
            "description": "Template category: normal or draft",
            "enum": [
              "normal",
              "draft"
            ]
          },
          "folder": {
            "description": "Folder containing this template",
            "$ref": "#/components/schemas/FolderRef"
          },
          "module": {
            "description": "Module this template belongs to",
            "$ref": "#/components/schemas/ModuleRef"
          },
          "created_by": {
            "description": "User who created the template",
            "$ref": "#/components/schemas/UserRef"
          },
          "modified_by": {
            "description": "User who last modified the template",
            "$ref": "#/components/schemas/UserRef"
          },
          "name": {
            "type": "string",
            "description": "Template name (5-75 characters, alphanumeric)",
            "pattern": "^[A-Za-z0-9]{5}$",
            "maxLength": 75
          },
          "id": {
            "type": "string",
            "description": "Unique template identifier",
            "maxLength": 50
          },
          "editor_mode": {
            "type": "string",
            "description": "Template editor mode",
            "enum": [
              "plain_text",
              "rich_text",
              "gallery"
            ]
          },
          "favorite": {
            "type": "boolean",
            "description": "Whether the template is marked as favorite"
          }
        },
        "required": [
          "created_time",
          "modified_time",
          "last_usage_time",
          "category",
          "folder",
          "module",
          "created_by",
          "modified_by",
          "name",
          "id",
          "editor_mode",
          "favorite"
        ]
      },
      "ErrorItemInvalidRequest": {
        "description": "Error item for invalid request shape or parse errors.",
        "additionalProperties": false,
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "description": "Error status level",
            "enum": [
              "error"
            ]
          },
          "code": {
            "type": "string",
            "description": "Error code for invalid request",
            "enum": [
              "INVALID_REQUEST",
              "JSON_PARSE_ERROR",
              "INVALID_MODULE"
            ]
          },
          "message": {
            "type": "string",
            "description": "Error message describing the issue",
            "maxLength": 1000
          },
          "details": {
            "type": "object",
            "description": "Error details",
            "additionalProperties": false
          }
        },
        "required": [
          "status",
          "code",
          "message",
          "details"
        ]
      },
      "InventoryTemplatesErrorResponse": {
        "description": "Error response schema for inventory templates operations.",
        "items": {
          "type": "object",
          "additionalProperties": false,
          "description": "Error item",
          "oneOf": [
            {
              "$ref": "#/components/schemas/ErrorItemMandatoryNotFound"
            },
            {
              "$ref": "#/components/schemas/ErrorItemInvalidData"
            },
            {
              "$ref": "#/components/schemas/ErrorItemPatternNotMatched"
            },
            {
              "$ref": "#/components/schemas/ErrorItemInvalidRequest"
            }
          ]
        }
      },
      "ErrorItemMandatoryNotFound": {
        "description": "Error item for missing mandatory field",
        "allOf": [
          {
            "$ref": "#/components/schemas/ErrorItemBase"
          },
          {
            "description": "Specialized properties for MANDATORY_NOT_FOUND error",
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "code": {
                "description": "Error code",
                "type": "string",
                "enum": [
                  "MANDATORY_NOT_FOUND"
                ]
              },
              "details": {
                "oneOf": [
                  {
                    "type": "object",
                    "description": "Additional details",
                    "additionalProperties": true
                  },
                  {
                    "type": "object",
                    "description": "Details with parent API name",
                    "additionalProperties": false,
                    "properties": {
                      "parent_api_name": {
                        "description": "Parent API name",
                        "type": "string",
                        "maxLength": 128
                      }
                    },
                    "required": [
                      "parent_api_name"
                    ]
                  }
                ]
              }
            }
          }
        ]
      },
      "ErrorItemInvalidData": {
        "description": "Error item for invalid data/module",
        "allOf": [
          {
            "$ref": "#/components/schemas/ErrorItemBase"
          },
          {
            "description": "Specialized properties for INVALID_DATA/INVALID_MODULE error",
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "code": {
                "description": "Error code",
                "type": "string",
                "enum": [
                  "INVALID_DATA",
                  "INVALID_MODULE"
                ]
              },
              "details": {
                "description": "Additional details",
                "type": "object",
                "additionalProperties": true
              }
            }
          }
        ]
      },
      "ErrorItemBase": {
        "description": "Base structure for error items",
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "code": {
            "description": "Error code identifier",
            "type": "string",
            "maxLength": 128
          },
          "message": {
            "description": "Human-readable error message",
            "type": "string",
            "maxLength": 1024
          },
          "status": {
            "description": "Error severity",
            "type": "string",
            "enum": [
              "error",
              "warning",
              "info"
            ]
          },
          "details": {
            "description": "Additional error details",
            "type": "object",
            "additionalProperties": true
          }
        },
        "required": [
          "code",
          "message",
          "status",
          "details"
        ]
      },
      "ErrorItemPatternNotMatched": {
        "description": "Error item when a value fails to match a required pattern",
        "allOf": [
          {
            "$ref": "#/components/schemas/ErrorItemBase"
          },
          {
            "description": "Specialized properties for PATTERN_NOT_MATCHED error",
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "code": {
                "description": "Error code",
                "type": "string",
                "enum": [
                  "PATTERN_NOT_MATCHED"
                ]
              },
              "details": {
                "oneOf": [
                  {
                    "type": "object",
                    "description": "Details with api name",
                    "additionalProperties": false,
                    "properties": {
                      "api_name": {
                        "description": "API name that failed pattern",
                        "type": "string",
                        "maxLength": 128
                      }
                    },
                    "required": [
                      "api_name"
                    ]
                  },
                  {
                    "type": "object",
                    "description": "Additional details",
                    "additionalProperties": true
                  }
                ]
              }
            }
          }
        ]
      }
    },
    "parameters": {
      "Module": {
        "description": "Module API name.",
        "name": "module",
        "in": "query",
        "required": false,
        "schema": {
          "type": "string",
          "maxLength": 128
        }
      }
    },
    "securitySchemes": {
      "iam-oauth2-schema": {
        "type": "oauth2",
        "flows": {
          "authorizationCode": {
            "authorizationUrl": "https://accounts.zoho.com/oauth/v2/auth",
            "tokenUrl": "https://accounts.zoho.com/oauth/v2/token",
            "refreshUrl": "https://accounts.zoho.com/oauth/v2/token",
            "scopes": {
              "ZohoCRM.templates.inventory.CREATE": "Create inventory templates.",
              "ZohoCRM.templates.inventory.READ": "Read inventory templates.",
              "ZohoCRM.templates.inventory.UPDATE": "Update inventory templates.",
              "ZohoCRM.templates.inventory.DELETE": "Delete inventory templates."
            }
          }
        }
      }
    }
  }
}