API Reference

Tickets API

Create and manage support tickets via the API

The Tickets API allows you to create, retrieve, update, and list support tickets programmatically.

Endpoints

MethodEndpointDescription
GET/api/v1/ticketsList tickets
POST/api/v1/ticketsCreate a ticket
GET/api/v1/tickets/:idGet a ticket
PATCH/api/v1/tickets/:idUpdate a ticket
GET/api/v1/tickets/:id/messagesList messages
POST/api/v1/tickets/:id/messagesAdd a message

List Tickets

Retrieve a paginated list of tickets.

GET /api/v1/tickets

Query Parameters

ParameterTypeDescription
pageintegerPage number (default: 1)
per_pageintegerItems per page (max: 100, default: 20)
statusstringFilter by status: open, pending, solved, closed
workspace_idstringFilter by workspace

Example Request

curl "https://app.keva.support/api/v1/tickets?status=open&per_page=10" \
  -H "Authorization: Bearer keva_live_your_api_key"

Example Response

{
  "data": [
    {
      "id": "tkt_abc123",
      "subject": "Cannot access my account",
      "status": "open",
      "priority": "high",
      "customerEmail": "customer@example.com",
      "customerName": "John Doe",
      "source": "email",
      "assignedTo": null,
      "resolutionType": null,
      "tags": ["login", "urgent"],
      "createdAt": "2024-01-15T10:30:00Z",
      "updatedAt": "2024-01-15T10:30:00Z"
    }
  ],
  "pagination": {
    "page": 1,
    "perPage": 10,
    "total": 45
  }
}

Create Ticket

Create a new support ticket.

POST /api/v1/tickets

Request Body

FieldTypeRequiredDescription
subjectstringYesTicket subject line
customerEmailstringYesCustomer's email address
customerNamestringNoCustomer's name
bodystringYesInitial message content
sourcestringNoSource identifier (default: api)

Example Request

curl https://app.keva.support/api/v1/tickets \
  -H "Authorization: Bearer keva_live_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "subject": "Order not delivered",
    "customerEmail": "customer@example.com",
    "customerName": "Jane Smith",
    "body": "My order #12345 was supposed to arrive yesterday but I havent received it yet."
  }'

Example Response

{
  "data": {
    "id": "tkt_xyz789",
    "subject": "Order not delivered",
    "status": "open",
    "priority": "medium",
    "customerEmail": "customer@example.com",
    "customerName": "Jane Smith",
    "source": "api",
    "createdAt": "2024-01-15T14:22:00Z"
  }
}

Get Ticket

Retrieve a single ticket by ID.

GET /api/v1/tickets/:id

Example Request

curl https://app.keva.support/api/v1/tickets/tkt_abc123 \
  -H "Authorization: Bearer keva_live_your_api_key"

Update Ticket

Update ticket properties.

PATCH /api/v1/tickets/:id

Request Body

FieldTypeDescription
statusstringopen, pending, solved, closed
prioritystringlow, medium, high, urgent
assignedTostringUser ID to assign

Example Request

curl -X PATCH https://app.keva.support/api/v1/tickets/tkt_abc123 \
  -H "Authorization: Bearer keva_live_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{"status": "pending", "priority": "high"}'

List Messages

Get all messages for a ticket.

GET /api/v1/tickets/:id/messages

Example Response

{
  "data": [
    {
      "id": "msg_001",
      "ticketId": "tkt_abc123",
      "direction": "inbound",
      "senderEmail": "customer@example.com",
      "senderName": "John Doe",
      "body": "I need help with my order",
      "createdAt": "2024-01-15T10:30:00Z"
    },
    {
      "id": "msg_002",
      "ticketId": "tkt_abc123",
      "direction": "outbound",
      "senderEmail": "support@company.com",
      "body": "Happy to help! Let me look into this.",
      "createdAt": "2024-01-15T10:31:00Z"
    }
  ]
}

Add Message

Add a message to an existing ticket.

POST /api/v1/tickets/:id/messages

Request Body

FieldTypeRequiredDescription
bodystringYesMessage content
senderEmailstringYesSender's email
senderNamestringNoSender's name
directionstringNoinbound or outbound (default: inbound)
bodyHtmlstringNoHTML version of message

Example Request

curl -X POST https://app.keva.support/api/v1/tickets/tkt_abc123/messages \
  -H "Authorization: Bearer keva_live_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "body": "Any update on this?",
    "senderEmail": "customer@example.com",
    "direction": "inbound"
  }'