← Back to guidesGUIDE · TICKETING

Create a ticket with the REST API

Ticketing12 minIntermediate

Creating a ticket in Alga PSA is straightforward once you have the right IDs. The key point is that tickets reference existing boards, board-scoped statuses, priorities, and clients, so the usual workflow is lookup first, then create.

Endpoints used in this flow

GET/api/v1/boardsFind a board ID.
GET/api/v1/tickets/statuses?board_id={boardId}Find a valid status for that board.
GET/api/v1/tickets/prioritiesFind a priority ID.
GET/api/v1/clientsFind a client ID.
POST/api/v1/ticketsCreate the ticket.

Required fields for POST /api/v1/tickets

titlestringRequired
Ticket title, 1 to 255 characters.
board_iduuidRequired
Board to place the ticket on.
client_iduuidRequired
Client associated with the ticket.
status_iduuidRequired
A valid ticket status for the selected board.
priority_iduuidRequired
Ticket priority.
assigned_touuidOptional
Optional assignee user ID.
category_iduuidOptional
Optional category for the board.
tagsstring[]Optional
Optional string tags.

Step 1: find a board and a board status

Ticket statuses are board-scoped, so you cannot safely hard-code a status without knowing which board you are using.

curl
curl -X GET "https://algapsa.com/api/v1/boards" \
  -H "X-API-Key: $ALGA_API_KEY"

curl -X GET "https://algapsa.com/api/v1/tickets/statuses?board_id=$BOARD_ID" \
  -H "X-API-Key: $ALGA_API_KEY"

Step 2: find a priority and a client

curl
curl -X GET "https://algapsa.com/api/v1/tickets/priorities" \
  -H "X-API-Key: $ALGA_API_KEY"

curl -X GET "https://algapsa.com/api/v1/clients?page=1&limit=25" \
  -H "X-API-Key: $ALGA_API_KEY"

Step 3: create the ticket

curl
curl -X POST "https://algapsa.com/api/v1/tickets" \
  -H "Content-Type: application/json" \
  -H "X-API-Key: $ALGA_API_KEY" \
  -d '{
    "title": "VPN disconnects every 15 minutes",
    "board_id": "$BOARD_ID",
    "client_id": "$CLIENT_ID",
    "status_id": "$STATUS_ID",
    "priority_id": "$PRIORITY_ID",
    "tags": ["network", "vpn"]
  }'
TypeScript
type CreateTicketPayload = {
  title: string;
  board_id: string;
  client_id: string;
  status_id: string;
  priority_id: string;
  assigned_to?: string;
  category_id?: string;
  tags?: string[];
};

async function createTicket(payload: CreateTicketPayload) {
  const response = await fetch('https://algapsa.com/api/v1/tickets', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
      'X-API-Key': process.env.ALGA_API_KEY!,
    },
    body: JSON.stringify(payload),
  });

  const result = await response.json();
  if (!response.ok) {
    throw new Error(result.error?.message ?? 'Ticket creation failed');
  }
  return result.data;
}

Practical advice

  • Look up board and status IDs dynamically instead of copying them between tenants or environments.
  • If you also need assignees or categories, fetch those IDs before building your create form.
  • Store only the IDs your integration needs. Avoid assuming names are unique forever.