API Overview
API Overview
Section titled “API Overview”The SiliconWit.IO API provides programmatic access to your devices and data.
Base URL
Section titled “Base URL”https://api.siliconwit.io/v1Authentication
Section titled “Authentication”All API requests require authentication via API key:
curl -H "Authorization: Bearer YOUR_API_KEY" \ https://api.siliconwit.io/v1/devicesGetting an API Key
Section titled “Getting an API Key”- Go to Dashboard → Settings → API Keys
- Click Create API Key
- Name your key and set permissions
- Copy the key (shown only once)
Key Permissions
Section titled “Key Permissions”| Permission | Access |
|---|---|
read:devices | List and view devices |
write:devices | Create, update, delete devices |
read:data | Query telemetry data |
write:data | Push data via API |
read:alerts | View alerts |
write:alerts | Manage alert rules |
Request Format
Section titled “Request Format”Headers
Section titled “Headers”Authorization: Bearer YOUR_API_KEYContent-Type: application/jsonRequest Body
Section titled “Request Body”JSON format for POST/PUT requests:
{ "name": "New Device", "type": "sensor"}Response Format
Section titled “Response Format”Success Response
Section titled “Success Response”{ "success": true, "data": { "id": "dev_abc123", "name": "New Device" }}Error Response
Section titled “Error Response”{ "success": false, "error": { "code": "INVALID_REQUEST", "message": "Device name is required" }}HTTP Status Codes
Section titled “HTTP Status Codes”| Code | Meaning |
|---|---|
| 200 | Success |
| 201 | Created |
| 400 | Bad Request |
| 401 | Unauthorized |
| 403 | Forbidden |
| 404 | Not Found |
| 429 | Rate Limited |
| 500 | Server Error |
Rate Limits
Section titled “Rate Limits”| Plan | Requests/min |
|---|---|
| Starter | 60 |
| Business | 300 |
| Enterprise | Custom |
Rate limit headers:
X-RateLimit-Limit: 60X-RateLimit-Remaining: 45X-RateLimit-Reset: 1704067260Pagination
Section titled “Pagination”List endpoints support pagination:
GET /v1/devices?page=1&limit=20Response includes pagination info:
{ "data": [...], "pagination": { "page": 1, "limit": 20, "total": 45, "pages": 3 }}Filtering
Section titled “Filtering”Filter results with query parameters:
# Devices by typeGET /v1/devices?type=sensor
# Devices by statusGET /v1/devices?status=online
# Data by time rangeGET /v1/devices/abc123/data?from=2024-01-01&to=2024-01-31Quick Reference
Section titled “Quick Reference”Devices
Section titled “Devices”| Method | Endpoint | Description |
|---|---|---|
| GET | /devices | List all devices |
| POST | /devices | Create device |
| GET | /devices/:id | Get device |
| PUT | /devices/:id | Update device |
| DELETE | /devices/:id | Delete device |
| Method | Endpoint | Description |
|---|---|---|
| GET | /devices/:id/data | Get device data |
| POST | /devices/:id/data | Push data point |
Alerts
Section titled “Alerts”| Method | Endpoint | Description |
|---|---|---|
| GET | /alerts | List alert rules |
| POST | /alerts | Create alert |
| GET | /alerts/history | Get alert history |
SDKs & Libraries
Section titled “SDKs & Libraries”Official libraries:
- JavaScript/Node.js:
npm install @siliconwit/sdk - Python:
pip install siliconwit
Next Steps
Section titled “Next Steps”- Devices API - Device management
- Data API - Query and push data
- Alerts API - Manage alerts