API Documentation

Valethon REST API

Build powerful integrations with the Valethon platform

API Version 1.0 | January 2026

Authentication

The Valethon API uses API keys for authentication. You can generate API keys from Settings → API Keys in your Valethon admin panel.

API Key Authentication

Include your API key in the Authorization header:

Authorization: Bearer vk_live_xxxxxxxxxxxxxxxxxxxx

Security Note: Keep your API keys secure. Never expose them in client-side code or public repositories.

Key Types

Rate Limiting

API requests are rate limited to ensure fair usage. Current limits are:

Rate limit information is returned in response headers:

X-RateLimit-Limit: 1000
X-RateLimit-Remaining: 999
X-RateLimit-Reset: 1704067200

Tickets

Manage support tickets programmatically.

GET /api/v1/tickets

List all tickets with optional filtering and pagination.

Query Parameters

Parameter Type Description
status string Filter by status: open, in_progress, closed
customer_id integer Filter by customer ID
assigned_to integer Filter by assigned technician ID
page integer Page number (default: 1)
per_page integer Results per page (default: 50, max: 100)

Example Response

{
  "data": [
    {
      "id": 1234,
      "ticket_number": "TKT-001234",
      "subject": "Network connectivity issue",
      "status": "open",
      "priority": "high",
      "customer_id": 56,
      "customer_name": "Acme Corp",
      "assigned_to": 12,
      "created_at": "2026-01-15T10:30:00Z",
      "updated_at": "2026-01-15T14:22:00Z"
    }
  ],
  "meta": {
    "current_page": 1,
    "total_pages": 10,
    "total_count": 487
  }
}
POST /api/v1/tickets

Create a new ticket.

Request Body

Parameter Type Description
subject required string Ticket subject line
description required string Detailed description of the issue
customer_id required integer Customer ID
priority string low, medium, high, critical (default: medium)
assigned_to integer Technician ID to assign
GET /api/v1/tickets/{id}

Retrieve a specific ticket by ID.

PUT /api/v1/tickets/{id}

Update an existing ticket.

Customers

Manage customer/company records.

GET /api/v1/customers

List all customers.

POST /api/v1/customers

Create a new customer.

Request Body

Parameter Type Description
name required string Company name
email string Primary contact email
phone string Primary phone number
address object Address object with street, city, state, zip, country

Assets

Manage hardware and software assets.

GET /api/v1/assets

List all assets with optional filtering.

Query Parameters

Parameter Type Description
customer_id integer Filter by customer
site_id integer Filter by site
type string Filter by asset type
POST /api/v1/assets

Create a new asset.

Contacts

Manage contact records associated with customers.

GET /api/v1/contacts

List contacts, optionally filtered by customer.

POST /api/v1/contacts

Create a new contact.

Sites

Manage physical locations/sites for customers.

GET /api/v1/sites

List all sites.

POST /api/v1/sites

Create a new site.

Contracts

Manage service contracts and SLAs.

GET /api/v1/contracts

List all contracts.

POST /api/v1/contracts

Create a new contract.

Webhooks

Webhooks allow you to receive real-time notifications when events occur in Valethon. Configure webhooks from Settings → Webhooks in your admin panel.

Available Events

Webhook Payload

{
  "event": "ticket.created",
  "timestamp": "2026-01-15T10:30:00Z",
  "data": {
    "id": 1234,
    "ticket_number": "TKT-001234",
    "subject": "Network connectivity issue",
    ...
  }
}

Security: Validate webhook signatures using the X-Valethon-Signature header to ensure requests are authentic.

Error Handling

The API uses conventional HTTP response codes to indicate success or failure.

HTTP Status Codes

Code Description
200 Success
201 Created - Resource successfully created
400 Bad Request - Invalid parameters
401 Unauthorized - Invalid or missing API key
403 Forbidden - Insufficient permissions
404 Not Found - Resource doesn't exist
429 Too Many Requests - Rate limit exceeded
500 Internal Server Error

Error Response Format

{
  "error": {
    "code": "invalid_parameter",
    "message": "The 'email' field must be a valid email address",
    "field": "email"
  }
}