{
    "title": "List tickets request v1",
    "description": "Returns a list of tickets.",
    "$schema": "http://json-schema.org/draft-04/schema#",
    "id": "http://localdev/schemas/support/list_tickets_request_v1.json",
    "type": "object",
    "properties": {
        "closed": {
            "description": "Whether or not closed tickets should be returned. Defaults to true.",
            "type": "boolean"
        },
        "pagination": {
            "description": "Used to limit the amount of tickets returned.",
            "type": "object",
            "properties": {
                "per_page": {
                    "description": "Amount of tickets per page (request).",
                    "type": "integer",
                    "maximum": 100,
                    "minimum": 1
                },
                "page": {
                    "description": "The requested page-index, starts at 1.",
                    "type": "integer",
                    "minimum": 1
                }
            },
            "required": [
                "per_page",
                "page"
            ]
        },
        "filter": {
            "description": "Filter tickets.",
            "type": "object",
            "properties": {
                "search": {
                    "description": "Filter tickets by search string.",
                    "type": "string"
                }
            },
            "required": [
                "search"
            ]
        },
        "sort": {
            "description": "Sort tickets. Can only sort by one key at a time. By default all tickets are sorted in descending order of last update time.",
            "type": "object",
            "properties": {
                "updated_at": {
                    "description": "Enum options:<pre class=\"empty-params-pre\">ASC|DESC</pre>. Sort by date of last update.",
                    "type": "string",
                    "enum": [
                        "ASC",
                        "DESC"
                    ]
                },
                "created_at": {
                    "description": "Enum options:<pre class=\"empty-params-pre\">ASC|DESC</pre>. Sort by date of creation.",
                    "type": "string",
                    "enum": [
                        "ASC",
                        "DESC"
                    ]
                },
                "id": {
                    "description": "Enum options:<pre class=\"empty-params-pre\">ASC|DESC</pre>. Sort by ticket number.",
                    "type": "string",
                    "enum": [
                        "ASC",
                        "DESC"
                    ]
                },
                "requester": {
                    "description": "Enum options:<pre class=\"empty-params-pre\">ASC|DESC</pre>. Sort by ticket creator.",
                    "type": "string",
                    "enum": [
                        "ASC",
                        "DESC"
                    ]
                },
                "status": {
                    "description": "Enum options:<pre class=\"empty-params-pre\">ASC|DESC</pre>. Sort by ticket status.",
                    "type": "string",
                    "enum": [
                        "ASC",
                        "DESC"
                    ]
                },
                "subject": {
                    "description": "Enum options:<pre class=\"empty-params-pre\">ASC|DESC</pre>. Sort by ticket subject.",
                    "type": "string",
                    "enum": [
                        "ASC",
                        "DESC"
                    ]
                }
            },
            "maxProperties": 1,
            "additionalProperties": false
        }
    },
    "additionalProperties": false,
    "required": [
        "pagination"
    ]
}