# Move (/api/events/tickets/move)



## Event Type [#event-type]

```ts
"ticket.move"
```

## Description [#description]

This event is triggered when a ticket is moved to a different Discord category using the move command.

## Payload Structure [#payload-structure]

<TypeTable
  type="{
  ticketId: {
    description: 'Unique identifier for the ticket',
    type: 'string',
  },
  panelId: {
    description: 'ID of the panel the ticket belongs to',
    type: 'string',
  },
  channel: {
    description: 'Discord channel information',
    type: '{ id: string; name: string; }',
  },
  creatorId: {
    description: 'Discord user ID of who created the ticket',
    type: 'string',
  },
  openDate: {
    description: 'ISO 8601 timestamp when the ticket was created',
    type: 'string',
  },
  oldCategoryId: {
    description: 'Previous Discord category ID',
    type: 'string',
  },
  newCategoryId: {
    description: 'New Discord category ID',
    type: 'string',
  },
}"
/>

## Example Payload [#example-payload]

```json
{
  "type": "ticket.move",
  "payload": {
    "ticketId": "TKT-1234",
    "panelId": "support-panel",
    "channel": {
      "id": "1140972530400776294",
      "name": "ticket-0001"
    },
    "creatorId": "713115896805064856",
    "openDate": "2024-01-18T15:30:00.000Z",
    "oldCategoryId": "1140123456789012345",
    "newCategoryId": "1140987654321098765"
  }
}
```

## Example Usage [#example-usage]

```ts
app.post('/webhook', (req, res) => {
  const { type, payload } = req.body;

  if (type === 'ticket.move') {
    console.log(`Ticket ${payload.ticketId} moved`);
    console.log(`From category: ${payload.oldCategoryId}`);
    console.log(`To category: ${payload.newCategoryId}`);
    
    // Track category changes
    await trackCategoryMove({
      ticketId: payload.ticketId,
      oldCategory: payload.oldCategoryId,
      newCategory: payload.newCategoryId,
    });
  }

  res.status(200).send('OK');
});
```

## Use Cases [#use-cases]

* Monitor ticket organization and categorization
* Track workflow stages via category changes
* Update external systems with new ticket locations
* Analyze ticket routing patterns
