# Transfer (/api/events/tickets/transfer)



## Event Type [#event-type]

```ts
"ticket.transfer"
```

## Description [#description]

This event is triggered when a ticket is transferred from one panel to another, potentially moving it to a different category as well.

## Payload Structure [#payload-structure]

<TypeTable
  type="{
  ticketId: {
    description: 'Unique identifier for the ticket',
    type: 'string',
  },
  panelId: {
    description: 'ID of the new panel',
    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',
  },
  oldPanelId: {
    description: 'Previous panel ID',
    type: 'string',
  },
  newPanelId: {
    description: 'New panel ID',
    type: 'string',
  },
}"
/>

## Example Payload [#example-payload]

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

## Example Usage [#example-usage]

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

  if (type === 'ticket.transfer') {
    console.log(`Ticket transferred:`);
    console.log(`  From panel: ${payload.oldPanelId}`);
    console.log(`  To panel: ${payload.newPanelId}`);
    
    // Reassign ticket to appropriate team
    await reassignTicket({
      ticketId: payload.ticketId,
      oldPanel: payload.oldPanelId,
      newPanel: payload.newPanelId,
    });
    
    // Notify the new team
    await notifyPanelTeam(payload.newPanelId, payload.ticketId);
  }

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

## Use Cases [#use-cases]

* Route tickets to specialized teams
* Track ticket escalations between departments
* Update ticket ownership in external systems
* Monitor inter-team workload distribution
* Automate team notifications on transfers
