> ## Documentation Index
> Fetch the complete documentation index at: https://docs.telemetron.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# API Reference

> RESTful API for syncing customer and device data with Telemetron

## Telemetron External API (ext-v1)

Synchronize customer and device ownership data to enable Telemetron to correlate device telemetry with customers for AI-powered support.

<Tip>New to the integration? Start with [API Getting Started](/api-reference/getting-started).</Tip>

## Base URL

```
https://admin.telemetron.ai/api/ext-v1
```

## Authentication

All requests require an API key in the `x-api-key` header:

```bash theme={null}
x-api-key: your_api_key_here
```

**Get your API key**: [Dashboard → Integrations](https://admin.telemetron.ai/dashboard/settings/integrations) → scroll down to find your API key and copy it

<Warning>Never expose API keys in client-side code or commit them to version control.</Warning>

## Endpoints

### Customer Management

* `POST /customer/createOrUpdateCustomer` - Create or update customer records
* `POST /customer/queryCustomer` - Query customer by email
* `GET /customer/getCustomer/{id}` - Get customer by ID

### Device Management

* `POST /device` - Create or update device records

### Device Assignment

* `POST /deviceAssignment/assignDeviceToOwners` - Assign device to one or more customers
* `POST /deviceAssignment/assignDevicesToOwner` - Assign multiple devices to one customer
* `POST /deviceAssignment/unassignDeviceFromOwner` - Remove device assignment
* `POST /deviceAssignment/unassignDevicesFromOwner` - Remove multiple device assignments from one customer

### Ticket Management

* `POST /ticket/createTicket` - Create a new support ticket

<Tip>Keep mappings synchronized. Update Telemetron immediately when customers register devices or transfer ownership.</Tip>

## Response Format

All responses are JSON. Success responses include `success: true`, error responses include `error` field.

**Success:**

```json theme={null}
{
  "success": true,
  "message": "Operation completed",
  "data": { }
}
```

**Error:**

```json theme={null}
{
  "error": "Error description"
}
```

## HTTP Status Codes

| Code | Meaning                                  |
| ---- | ---------------------------------------- |
| 200  | Success                                  |
| 400  | Bad request (invalid/missing parameters) |
| 401  | Unauthorized (invalid/missing API key)   |
| 404  | Resource not found                       |
| 409  | Conflict (duplicate resource)            |
| 500  | Server error                             |

## How Device-Customer Mapping Works

1. **Device sends telemetry** → Telemetron receives device data
2. **Mapping lookup** → Uses your synced mappings to identify the customer
3. **AI diagnosis** → Analyzes telemetry in customer context
4. **Intelligent support** → Provides proactive support or alerts your team

**Bottom line**: Keep mappings current so telemetry reaches the right customers.
