---
updatedAt: 2026-06-03T15:32:12.000Z
agentTools:
  projectIndex: https://docs.glassix.com/llms.txt
---

# Set State

This endpoint resets the state of a ticket.
**Tickets may have 4 states:**
1.  Closed
2.  Open
3.  Pending
4.  Snoozed

# OpenAPI definition

```json
{
  "openapi": "3.0.0",
  "info": {
    "version": "1.2",
    "title": "Glassix",
    "description": "Glassix REST API",
    "contact": {}
  },
  "servers": [
    {
      "description": "Production server",
      "url": "https://{workspace}.glassix.com/api/v1.2"
    }
  ],
  "security": [
    {
      "Bearer": []
    }
  ],
  "paths": {
    "/tickets/setstate/{ticketId}": {
      "put": {
        "operationId": "PUT_tickets-setstate-ticketId",
        "summary": "Set State",
        "tags": [
          "Tickets"
        ],
        "security": [
          {
            "Bearer": []
          }
        ],
        "description": "This endpoint resets the state of a ticket.\n**Tickets may have 4 states:**\n1.  Closed\n2.  Open\n3.  Pending\n4.  Snoozed",
        "parameters": [
          {
            "name": "ticketId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "Unique identifier for a ticket."
          },
          {
            "name": "nextState",
            "in": "query",
            "description": "New state to be applied to ticket.",
            "required": true,
            "schema": {
              "type": "string",
              "default": "Open",
              "enum": [
                "Open",
                "Closed",
                "Pending",
                "Snoozed"
              ],
              "example": "Open"
            }
          },
          {
            "name": "getTicket",
            "in": "query",
            "description": "Switch to determine whether ticket is returned in the response body.",
            "required": false,
            "schema": {
              "type": "boolean",
              "default": false
            }
          },
          {
            "name": "sendTicketStateChangedMessage",
            "in": "query",
            "description": "Switch to determine whether a message is sent to the client indicating the ticket's state has changed.",
            "required": false,
            "schema": {
              "type": "boolean",
              "default": true
            }
          },
          {
            "name": "enableWebhook",
            "in": "query",
            "description": "Switch to determine whether webhook is triggered. If set to `False`, no event will be sent on this change.",
            "required": false,
            "schema": {
              "type": "boolean",
              "default": true
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success – ticket status updated",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                },
                "examples": {
                  "ticket state changed": {
                    "value": {
                      "message": "Ticket #123456789 state was changed to: Closed"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                },
                "examples": {
                  "ticket state closed": {
                    "value": {
                      "message": "Ticket #123456789 state is already Closed"
                    }
                  },
                  "ticket doesn't exist": {
                    "value": {
                      "message": "The ticket: 123456789 doesn't exist doesn't belong to this department"
                    }
                  },
                  "summery is empty": {
                    "value": {
                      "message": "The 'summary' property must not be null or empty"
                    }
                  },
                  "summery invalid": {
                    "value": {
                      "message": "The 'summary' property must contain at least one word."
                    }
                  }
                }
              }
            }
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "tags": {
                    "type": "array",
                    "x-stoplight": {
                      "id": "3xn243q7i9hvy"
                    },
                    "description": "Tags to replace on the ticket.\nRequired when there is a minimum tag requirement, and the ticket has no tags.",
                    "items": {
                      "x-stoplight": {
                        "id": "vj6y2s77661xf"
                      },
                      "type": "string"
                    }
                  },
                  "summary": {
                    "type": "string",
                    "x-stoplight": {
                      "id": "f6ro260541xox"
                    },
                    "description": "Summary to add to the ticket.\nRequired when summery is a requirement, and the ticket doesn't have a summery."
                  },
                  "awakeOnDateTimeUTC": {
                    "type": "string",
                    "x-stoplight": {
                      "id": "ftb9ihkh91edb"
                    },
                    "format": "date-time",
                    "example": "2011-10-05T14:48:00.000Z",
                    "description": "The UTC datetime when the ticket will return to 'Open' status. Only required when setting the `Snoozed` state."
                  }
                }
              },
              "examples": {
                "Example 1": {
                  "value": {
                    "tags": [
                      "Vacation"
                    ],
                    "summery": "The customer is loking for a Vacation in Tuscuny"
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "Bearer": {
        "type": "oauth2",
        "description": "",
        "flows": {
          "authorizationCode": {
            "authorizationUrl": "",
            "tokenUrl": "",
            "refreshUrl": "",
            "scopes": {}
          }
        }
      }
    }
  }
}
```