### Start Inker with Docker Compose Source: https://github.com/usetrmnl/inker/blob/main/README.md This command builds and starts the Inker services defined in the docker-compose.yml file in detached mode. ```bash docker compose up -d ``` -------------------------------- ### Auto-provision TRMNL Device Source: https://context7.com/usetrmnl/inker/llms.txt Allows a TRMNL device to auto-provision itself with the Inker system. Requires a GET request to the /api/setup endpoint, including device identification and status headers like HTTP_ID, HTTP_FW_VERSION, battery-voltage, and rssi. Returns an API key and initial setup information. ```bash curl -X GET http://localhost/api/setup \ -H "HTTP_ID: AA:BB:CC:DD:EE:FF" \ -H "HTTP_FW_VERSION: 1.6.9" \ -H "battery-voltage: 3.95" \ -H "rssi: -51" ``` -------------------------------- ### Get Available Setting Keys Source: https://context7.com/usetrmnl/inker/llms.txt Retrieves a list of available setting keys within the application. This is achieved through a GET request to the /settings/keys endpoint and requires authentication. ```bash # Get available setting keys curl -X GET http://localhost/settings/keys \ -H "Authorization: Bearer " ``` -------------------------------- ### Build Inker from Source with Docker Compose Source: https://github.com/usetrmnl/inker/blob/main/README.md This command clones the Inker repository, navigates into the directory, and then builds and starts the services using Docker Compose. The --build flag ensures that the Docker images are built from the source code. ```bash git clone https://github.com/wojo-o/inker.git cd inker docker compose up -d --build ``` -------------------------------- ### Get All Settings Source: https://context7.com/usetrmnl/inker/llms.txt Retrieves all application settings, with sensitive values masked for security. This operation is performed using a GET request to the /settings endpoint and requires authentication. ```bash # Get all settings (sensitive values masked) curl -X GET http://localhost/settings \ -H "Authorization: Bearer " ``` -------------------------------- ### Get All Widget Templates (API) Source: https://context7.com/usetrmnl/inker/llms.txt Retrieves a list of all available built-in widget templates, including their IDs, names, and default configurations. Requires authentication token. ```bash curl -X GET http://localhost/widget-templates \ -H "Authorization: Bearer " ``` -------------------------------- ### Get All Screens (Legacy) Source: https://context7.com/usetrmnl/inker/llms.txt Retrieves a list of all static screens managed by the legacy system. This is performed using a GET request to the /screens endpoint and requires authentication. ```bash # Get all screens curl -X GET http://localhost/screens \ -H "Authorization: Bearer " ``` -------------------------------- ### Docker Deployment Configuration Source: https://context7.com/usetrmnl/inker/llms.txt Provides a Docker Compose configuration for deploying Inker. This setup includes an all-in-one container that bundles PostgreSQL for the database and Redis for caching, simplifying the deployment process. ```yaml version: '3.8' services: inker: image: ghcr.io/usetrmnl/inker:latest ports: - "80:80" environment: DATABASE_URL: postgresql://user:password@db:5432/inker REDIS_URL: redis://redis:6379 depends_on: - db - redis db: image: postgres:15 environment: POSTGRES_USER: user POSTGRES_PASSWORD: password POSTGRES_DB: inker volumes: - postgres_data:/var/lib/postgresql/data redis: image: redis:7 volumes: - redis_data:/data volumes: postgres_data: redis_data: ``` -------------------------------- ### Get Extensions Source: https://context7.com/usetrmnl/inker/llms.txt Retrieves a list of extensions. An optional query parameter `activeOnly=true` can filter for only active extensions. This uses a GET request to /extensions and requires authentication. ```bash # Get all extensions curl -X GET "http://localhost/extensions?activeOnly=true" \ -H "Authorization: Bearer " ``` -------------------------------- ### Get Public Screens (Legacy) Source: https://context7.com/usetrmnl/inker/llms.txt Retrieves a list of public static screens. This operation does not require authentication and uses a GET request to /screens/public. ```bash # Get public screens (no auth required) curl -X GET http://localhost/screens/public ``` -------------------------------- ### Docker Commands for Inker Management Source: https://context7.com/usetrmnl/inker/llms.txt Provides essential Docker commands for managing the Inker service. This includes starting the service in detached mode, viewing live logs, and performing a full reset by stopping, removing volumes, and restarting. ```bash # Start Inker docker compose up -d # View logs docker compose logs -f inker # Reset all data (fresh start) docker compose down -v docker compose up -d ``` -------------------------------- ### Get Single Screen (Legacy) Source: https://context7.com/usetrmnl/inker/llms.txt Retrieves details for a specific static screen identified by its ID. This uses a GET request to /screens/{id} and requires authentication. ```bash # Get single screen curl -X GET http://localhost/screens/1 \ -H "Authorization: Bearer " ``` -------------------------------- ### Get Widget Templates by Category (API) Source: https://context7.com/usetrmnl/inker/llms.txt Retrieves widget templates belonging to a specific category. Requires authentication token. ```bash curl -X GET http://localhost/widget-templates/category/time \ -H "Authorization: Bearer " ``` -------------------------------- ### Get Single Extension Source: https://context7.com/usetrmnl/inker/llms.txt Retrieves details for a specific extension identified by its ID. This is done via a GET request to /extensions/{id} and requires authentication. ```bash # Get single extension curl -X GET http://localhost/extensions/1 \ -H "Authorization: Bearer " ``` -------------------------------- ### Get Widget Template Categories (API) Source: https://context7.com/usetrmnl/inker/llms.txt Retrieves a list of categories for widget templates. Requires authentication token. ```bash curl -X GET http://localhost/widget-templates/categories \ -H "Authorization: Bearer " ``` -------------------------------- ### Get Single Widget Template Details (API) Source: https://context7.com/usetrmnl/inker/llms.txt Retrieves detailed information for a specific widget template by its ID. Requires authentication token. ```bash curl -X GET http://localhost/widget-templates/1 \ -H "Authorization: Bearer " ``` -------------------------------- ### Get All Devices with Pagination Source: https://context7.com/usetrmnl/inker/llms.txt Retrieves a paginated list of all managed e-ink devices. Requires a GET request to the /devices endpoint with administrator authentication and optional query parameters for page number and items per page. Returns device data and pagination information. ```bash curl -X GET "http://localhost/devices?page=1&limit=20" \ -H "Authorization: Bearer " ``` -------------------------------- ### Get Rendered Screen Image for Device Source: https://context7.com/usetrmnl/inker/llms.txt Retrieves a rendered screen image for a specific device design. Requires a GET request to the /api/device-images/design/{id} endpoint, with optional query parameters for mode, battery, and wifi. The output can be saved to a file. ```bash curl -X GET "http://localhost/api/device-images/design/5?mode=device&battery=85&wifi=-45" \ --output screen.png ``` -------------------------------- ### Get Device Logs Source: https://context7.com/usetrmnl/inker/llms.txt Retrieves log entries for a specific e-ink device. Requires a GET request to the /devices/{id}/logs endpoint with administrator authentication. ```bash curl -X GET http://localhost/devices/1/logs \ -H "Authorization: Bearer " ``` -------------------------------- ### Get Single Device by ID Source: https://context7.com/usetrmnl/inker/llms.txt Retrieves details for a specific e-ink device identified by its ID. Requires a GET request to the /devices/{id} endpoint with administrator authentication. ```bash curl -X GET http://localhost/devices/1 \ -H "Authorization: Bearer " ``` -------------------------------- ### Retrieve Display Content for Device Source: https://context7.com/usetrmnl/inker/llms.txt Enables TRMNL devices to poll for display content. Requires a GET request to the /api/display endpoint, authenticated with the device's API key in the HTTP_ID header. Returns image URLs, firmware update information, and refresh rates. ```bash curl -X GET http://localhost/api/display \ -H "HTTP_ID: S_PMVGON8htPIae-zRiL6vhGZmo3n1ftYLKvL_9J1f0" \ -H "battery-voltage: 3.95" \ -H "rssi: -51" ``` -------------------------------- ### Run Frontend Tests Source: https://github.com/usetrmnl/inker/blob/main/README.md This command executes the frontend tests for the Inker project using the 'bun' package manager. It navigates to the 'frontend' directory before running the tests. ```bash cd frontend && bun run test # 19 tests ``` -------------------------------- ### Run Backend Tests Source: https://github.com/usetrmnl/inker/blob/main/README.md This command executes the backend tests for the Inker project using the 'bun' package manager. It navigates to the 'backend' directory before running the tests. ```bash cd backend && bun test # 357 tests ``` -------------------------------- ### Create Playlist (API) Source: https://context7.com/usetrmnl/inker/llms.txt Creates a new playlist for rotating screens on devices. Requires authentication token and JSON content type for playlist details. ```bash curl -X POST http://localhost/playlists \ -H "Authorization: Bearer " \ -H "Content-Type: application/json" \ -d '{ "name": "Morning Rotation", "description": "Screens to display in the morning", "isActive": true }' ``` -------------------------------- ### Create Screen (Legacy) Source: https://context7.com/usetrmnl/inker/llms.txt Creates a new static screen image in the legacy system. This uses a POST request to /screens with a JSON payload including the screen name, image URL, model ID, and public status. Authentication is required. ```bash # Create a screen curl -X POST http://localhost/screens \ -H "Authorization: Bearer " \ -H "Content-Type: application/json" \ -d '{ "name": "Welcome Screen", "imageUrl": "/uploads/screens/welcome.png", "modelId": 1, "isPublic": false }' ``` -------------------------------- ### Create Screen Design with Widgets (API) Source: https://context7.com/usetrmnl/inker/llms.txt Creates a new screen design with specified dimensions, background, and widgets. Requires authentication token and content type header. ```bash curl -X POST http://localhost/screen-designs \ -H "Authorization: Bearer " \ -H "Content-Type: application/json" \ -d '{ "name": "My Dashboard", "description": "A custom dashboard with clock and weather", "width": 800, "height": 480, "background": "#FFFFFF", "widgets": [ { "templateId": 1, "x": 50, "y": 50, "width": 300, "height": 150, "config": {"timezone": "America/New_York", "format": "12h"}, "zIndex": 0 } ] }' ``` -------------------------------- ### Render Screen Design to PNG (API) Source: https://context7.com/usetrmnl/inker/llms.txt Renders a screen design to a PNG image, useful for previews. Requires authentication token. ```bash curl -X GET http://localhost/screen-designs/1/render \ -H "Authorization: Bearer " ``` -------------------------------- ### Get Dashboard Statistics Source: https://context7.com/usetrmnl/inker/llms.txt Retrieves aggregated statistics for the admin dashboard, including device counts, online status, and recent activity. This is done via a GET request to /dashboard/stats and requires authentication. ```bash # Get dashboard statistics curl -X GET http://localhost/dashboard/stats \ -H "Authorization: Bearer " ``` -------------------------------- ### Create Extension Source: https://context7.com/usetrmnl/inker/llms.txt Creates a new extension for webhooks, polling, or custom integrations. This involves a POST request to /extensions with a JSON payload detailing the extension's name, type, configuration, and active status. Authentication is required. ```bash # Create an extension curl -X POST http://localhost/extensions \ -H "Authorization: Bearer " \ -H "Content-Type: application/json" \ -d '{ "name": "Slack Notifications", "description": "Send notifications to Slack", "type": "webhook", "config": { "url": "https://hooks.slack.com/services/xxx", "events": ["device.offline", "screen.updated"] }, "isActive": true }' ``` -------------------------------- ### Run Inker with Docker Source: https://github.com/usetrmnl/inker/blob/main/README.md This command runs the Inker application as a Docker container. It maps port 80, sets up persistent storage for PostgreSQL and Redis, and mounts an uploads directory. The container is set to restart automatically unless stopped. ```bash docker run -d \ --name inker \ --restart unless-stopped \ -p 80:80 \ -v inker_postgres:/var/lib/postgresql/17/main \ -v inker_redis:/data \ -v inker_uploads:/app/uploads \ wojooo/inker:latest ``` -------------------------------- ### Retrieve Playlists (API) Source: https://context7.com/usetrmnl/inker/llms.txt Retrieves a list of playlists, supporting pagination. Requires authentication token. ```bash curl -X GET "http://localhost/playlists?page=1&limit=20" \ -H "Authorization: Bearer " ``` -------------------------------- ### Update Extension Source: https://context7.com/usetrmnl/inker/llms.txt Updates an existing extension, for example, to change its active status. This uses a PATCH request to /extensions/{id} with a JSON payload specifying the fields to update. Authentication is required. ```bash # Update extension curl -X PATCH http://localhost/extensions/1 \ -H "Authorization: Bearer " \ -H "Content-Type: application/json" \ -d '{"isActive": false}' ``` -------------------------------- ### Configure Inker with Environment Variables (Docker Run) Source: https://github.com/usetrmnl/inker/blob/main/README.md This command runs the Inker Docker container with custom environment variables for the admin PIN and timezone. It also includes the necessary volume mounts for persistent data. ```bash docker run -d \ --name inker \ --restart unless-stopped \ -p 80:80 \ -e ADMIN_PIN="1111" \ -e TZ=Europe/Warsaw \ -v inker_postgres:/var/lib/postgresql/17/main \ -v inker_redis:/data \ -v inker_uploads:/app/uploads \ wojooo/inker:latest ``` -------------------------------- ### Capture Screen for Device (API) Source: https://context7.com/usetrmnl/inker/llms.txt Captures a screen design for a device, performing server-side rendering with e-ink processing. Requires authentication token. ```bash curl -X POST http://localhost/screen-designs/1/capture \ -H "Authorization: Bearer " ``` -------------------------------- ### Settings API Source: https://context7.com/usetrmnl/inker/llms.txt Manage application settings, including GitHub token for widget integrations. ```APIDOC ## GET /settings ### Description Retrieves all application settings. Sensitive values are masked. ### Method GET ### Endpoint `/settings` ## GET /settings/keys ### Description Retrieves a list of available setting keys. ### Method GET ### Endpoint `/settings/keys` ## POST /settings/test-github-token ### Description Tests a provided GitHub token for validity before saving. ### Method POST ### Endpoint `/settings/test-github-token` ### Parameters #### Request Body - **token** (string) - Required - The GitHub token to test. ### Request Example ```json { "token": "ghp_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" } ``` ## PUT /settings/{key} ### Description Updates a specific application setting. ### Method PUT ### Endpoint `/settings/{key}` ### Parameters #### Path Parameters - **key** (string) - Required - The key of the setting to update. #### Request Body - **value** (string) - Required - The new value for the setting. ### Request Example ```json { "value": "ghp_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" } ``` ## DELETE /settings/{key} ### Description Deletes a specific application setting. ### Method DELETE ### Endpoint `/settings/{key}` ### Parameters #### Path Parameters - **key** (string) - Required - The key of the setting to delete. ``` -------------------------------- ### Deploy Inker with Docker Compose Source: https://github.com/usetrmnl/inker/blob/main/README.md This Docker Compose configuration defines the Inker service, including its image, container name, restart policy, port mapping, volume mounts for persistent data, and environment variables for timezone and admin PIN. It also defines the necessary volumes. ```yaml # docker-compose.yml services: inker: image: wojooo/inker:latest container_name: inker restart: unless-stopped ports: - "80:80" volumes: - postgres_data:/var/lib/postgresql/17/main - redis_data:/data - uploads_data:/app/uploads environment: TZ: UTC ADMIN_PIN: "1111" # Quotes required — YAML strips leading zeros without them volumes: postgres_data: redis_data: uploads_data: ``` -------------------------------- ### Retrieve Screen Designs (API) Source: https://context7.com/usetrmnl/inker/llms.txt Retrieves a list of screen designs, supporting pagination. Requires authentication token. ```bash curl -X GET "http://localhost/screen-designs?page=1&limit=20" \ -H "Authorization: Bearer " ``` -------------------------------- ### Duplicate Screen Design (API) Source: https://context7.com/usetrmnl/inker/llms.txt Duplicates an existing screen design, creating a copy with a new name. Requires authentication token. ```bash curl -X POST "http://localhost/screen-designs/1/duplicate?name=Dashboard%20Copy" \ -H "Authorization: Bearer " ``` -------------------------------- ### Retrieve Single Playlist with Items (API) Source: https://context7.com/usetrmnl/inker/llms.txt Retrieves a specific playlist by its ID, including its associated items. Requires authentication token. ```bash curl -X GET http://localhost/playlists/1 \ -H "Authorization: Bearer " ``` -------------------------------- ### Create New Device Source: https://context7.com/usetrmnl/inker/llms.txt Adds a new e-ink device to the Inker management system. Requires a POST request to the /devices endpoint with administrator authentication and a JSON payload containing device details like name, MAC address, model ID, and playlist ID. ```bash curl -X POST http://localhost/devices \ -H "Authorization: Bearer " \ -H "Content-Type: application/json" \ -d '{ \ "name": "Living Room Display", \ "macAddress": "AA:BB:CC:DD:EE:FF", \ "modelId": 1, \ "playlistId": 1 \ }' ``` -------------------------------- ### Delete Setting Source: https://context7.com/usetrmnl/inker/llms.txt Deletes a specific application setting, like the GitHub token. This is performed using a DELETE request to /settings/{key} and requires authentication. ```bash # Delete a setting curl -X DELETE http://localhost/settings/github_token \ -H "Authorization: Bearer " ``` -------------------------------- ### Screens API (Legacy) Source: https://context7.com/usetrmnl/inker/llms.txt Manage static screen images. This is a legacy system; use Screen Designs for new screens. ```APIDOC ## POST /screens ### Description Creates a new screen. ### Method POST ### Endpoint `/screens` ### Parameters #### Request Body - **name** (string) - Required - The name of the screen. - **imageUrl** (string) - Required - The URL path to the screen's image. - **modelId** (integer) - Required - The ID of the model associated with the screen. - **isPublic** (boolean) - Optional - Whether the screen is public. ### Request Example ```json { "name": "Welcome Screen", "imageUrl": "/uploads/screens/welcome.png", "modelId": 1, "isPublic": false } ``` ## GET /screens ### Description Retrieves a list of all screens. ### Method GET ### Endpoint `/screens` ## GET /screens/public ### Description Retrieves a list of public screens. No authentication is required. ### Method GET ### Endpoint `/screens/public` ## GET /screens/{id} ### Description Retrieves a single screen by its ID. ### Method GET ### Endpoint `/screens/{id}` ### Parameters #### Path Parameters - **id** (integer) - Required - The ID of the screen to retrieve. ## PATCH /screens/{id} ### Description Updates an existing screen. ### Method PATCH ### Endpoint `/screens/{id}` ### Parameters #### Path Parameters - **id** (integer) - Required - The ID of the screen to update. #### Request Body - **name** (string) - Optional - The new name for the screen. - **imageUrl** (string) - Optional - The new image URL for the screen. - **isPublic** (boolean) - Optional - The new public status for the screen. ### Request Example ```json { "name": "Updated Welcome" } ``` ## DELETE /screens/{id} ### Description Deletes a screen. ### Method DELETE ### Endpoint `/screens/{id}` ### Parameters #### Path Parameters - **id** (integer) - Required - The ID of the screen to delete. ``` -------------------------------- ### Authenticate User with PIN Source: https://context7.com/usetrmnl/inker/llms.txt Handles user login using a PIN to obtain an authentication token. Requires a POST request to the /auth/login endpoint with a JSON payload containing the PIN. Returns a Bearer token upon successful authentication. ```bash curl -X POST http://localhost/auth/login \ -H "Content-Type: application/json" \ -d '{"pin": "1111"}' ``` -------------------------------- ### Retrieve Single Screen Design (API) Source: https://context7.com/usetrmnl/inker/llms.txt Retrieves a specific screen design by its ID. Requires authentication token. ```bash curl -X GET http://localhost/screen-designs/1 \ -H "Authorization: Bearer " ``` -------------------------------- ### Refresh Devices Using Screen Design (API) Source: https://context7.com/usetrmnl/inker/llms.txt Triggers a refresh for all devices currently using a specific screen design. Requires authentication token. ```bash curl -X POST http://localhost/screen-designs/1/refresh-devices \ -H "Authorization: Bearer " ``` -------------------------------- ### Update Setting Source: https://context7.com/usetrmnl/inker/llms.txt Updates a specific application setting, such as the GitHub token. This uses a PUT request to /settings/{key} with the new value in the JSON payload and requires authentication. ```bash # Update a setting curl -X PUT http://localhost/settings/github_token \ -H "Authorization: Bearer " \ -H "Content-Type: application/json" \ -d '{"value": "ghp_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"}' ``` -------------------------------- ### Test GitHub Token Source: https://context7.com/usetrmnl/inker/llms.txt Tests a GitHub token before saving it to ensure its validity. This is done via a POST request to /settings/test-github-token with the token in the JSON payload and requires authentication. ```bash # Test GitHub token before saving curl -X POST http://localhost/settings/test-github-token \ -H "Authorization: Bearer " \ -H "Content-Type: application/json" \ -d '{"token": "ghp_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"}' ``` -------------------------------- ### Upload Browser-Captured Image (API) Source: https://context7.com/usetrmnl/inker/llms.txt Uploads an image captured by a browser for a screen design. Requires authentication token and multipart/form-data for the image file. ```bash curl -X POST http://localhost/screen-designs/1/upload-capture \ -H "Authorization: Bearer " \ -F "image=@screenshot.png" ``` -------------------------------- ### Playlists API Source: https://context7.com/usetrmnl/inker/llms.txt Create and manage playlists to automatically rotate multiple screens on devices. ```APIDOC ## POST /playlists ### Description Create a new playlist. ### Method POST ### Endpoint /playlists ### Parameters #### Request Body - **name** (string) - Required - The name of the playlist. - **description** (string) - Optional - A description for the playlist. - **isActive** (boolean) - Optional - Whether the playlist is currently active. ### Request Example ```json { "name": "Morning Rotation", "description": "Screens to display in the morning", "isActive": true } ``` ### Response #### Success Response (200) - **id** (integer) - The ID of the newly created playlist. - **name** (string) - The name of the playlist. - **description** (string) - The description of the playlist. - **isActive** (boolean) - The active status of the playlist. #### Response Example ```json { "id": 1, "name": "Morning Rotation", "description": "Screens to display in the morning", "isActive": true } ``` ``` ```APIDOC ## GET /playlists ### Description Get all playlists with pagination. ### Method GET ### Endpoint /playlists ### Parameters #### Query Parameters - **page** (integer) - Optional - The page number for pagination. - **limit** (integer) - Optional - The number of items per page. ### Response #### Success Response (200) - **data** (array) - An array of playlist objects. - **pagination** (object) - Pagination details. #### Response Example ```json { "data": [ { "id": 1, "name": "Morning Rotation", "description": "Screens to display in the morning", "isActive": true } ], "pagination": { "currentPage": 1, "totalPages": 5, "totalItems": 50 } } ``` ``` ```APIDOC ## GET /playlists/{id} ### Description Get a single playlist with its items. ### Method GET ### Endpoint /playlists/{id} ### Parameters #### Path Parameters - **id** (integer) - Required - The ID of the playlist to retrieve. ### Response #### Success Response (200) - **id** (integer) - The ID of the playlist. - **name** (string) - The name of the playlist. - **description** (string) - The description of the playlist. - **isActive** (boolean) - The active status of the playlist. - **items** (array) - An array of screen design IDs included in the playlist. #### Response Example ```json { "id": 1, "name": "Morning Rotation", "description": "Screens to display in the morning", "isActive": true, "items": [10, 15, 22] } ``` ``` ```APIDOC ## PATCH /playlists/{id} ### Description Update an existing playlist. ### Method PATCH ### Endpoint /playlists/{id} ### Parameters #### Path Parameters - **id** (integer) - Required - The ID of the playlist to update. #### Request Body - **name** (string) - Optional - The new name for the playlist. - **description** (string) - Optional - The new description for the playlist. - **isActive** (boolean) - Optional - The new active status for the playlist. ### Request Example ```json { "name": "All Day Rotation", "isActive": true } ``` ### Response #### Success Response (200) - **id** (integer) - The ID of the updated playlist. - **name** (string) - The updated name of the playlist. - **description** (string) - The updated description of the playlist. - **isActive** (boolean) - The updated active status of the playlist. #### Response Example ```json { "id": 1, "name": "All Day Rotation", "description": "Screens to display throughout the day", "isActive": true } ``` ``` -------------------------------- ### Add Widget to Screen Design (API) Source: https://context7.com/usetrmnl/inker/llms.txt Adds a new widget to a specified screen design. Requires authentication token and JSON content type for widget configuration. ```bash curl -X POST http://localhost/screen-designs/1/widgets \ -H "Authorization: Bearer " \ -H "Content-Type: application/json" \ -d '{ "templateId": 3, "x": 400, "y": 200, "width": 200, "height": 100, "config": {"text": "Hello World", "fontSize": 24}, "rotation": 0 }' ``` -------------------------------- ### Regenerate Device API Key Source: https://context7.com/usetrmnl/inker/llms.txt Generates a new API key for a specific e-ink device, invalidating the previous one. Requires a POST request to the /devices/{id}/regenerate-key endpoint with administrator authentication. ```bash curl -X POST http://localhost/devices/1/regenerate-key \ -H "Authorization: Bearer " ``` -------------------------------- ### Assign Screen Design to Device (API) Source: https://context7.com/usetrmnl/inker/llms.txt Assigns a screen design to a specific device. Requires authentication token and JSON content type for device ID. ```bash curl -X POST http://localhost/screen-designs/1/assign \ -H "Authorization: Bearer " \ -H "Content-Type: application/json" \ -d '{"deviceId": 1}' ``` -------------------------------- ### Reset Inker Volumes and Restart Source: https://github.com/usetrmnl/inker/blob/main/README.md This command sequence stops and removes all containers, networks, and volumes associated with the Docker Compose project, then restarts the services. This is useful for resetting the application to a clean state, but it will delete all data. ```bash docker compose down -v docker compose up -d ``` -------------------------------- ### Docker Compose Configuration for Inker Source: https://context7.com/usetrmnl/inker/llms.txt Defines the services, ports, volumes, and environment variables for running the Inker application using Docker Compose. It specifies the image to use, container name, restart policy, port mappings, and persistent data volumes. ```yaml services: inker: image: wojooo/inker:latest container_name: inker restart: unless-stopped ports: - "80:80" volumes: - postgres_data:/var/lib/postgresql/17/main - redis_data:/data - uploads_data:/app/uploads environment: TZ: Europe/Warsaw ADMIN_PIN: "1111" volumes: postgres_data: redis_data: uploads_data: ``` -------------------------------- ### Extensions API Source: https://context7.com/usetrmnl/inker/llms.txt Manage extensions for webhooks, polling, and custom integrations. ```APIDOC ## POST /extensions ### Description Creates a new extension. ### Method POST ### Endpoint `/extensions` ### Parameters #### Request Body - **name** (string) - Required - The name of the extension. - **description** (string) - Optional - A description of the extension. - **type** (string) - Required - The type of the extension (e.g., 'webhook', 'polling'). - **config** (object) - Required - Configuration specific to the extension type. - **url** (string) - Required for webhook type - The URL for the webhook. - **events** (array of strings) - Optional for webhook type - Events to trigger the webhook. - **isActive** (boolean) - Optional - Whether the extension is active (defaults to true). ### Request Example ```json { "name": "Slack Notifications", "description": "Send notifications to Slack", "type": "webhook", "config": { "url": "https://hooks.slack.com/services/xxx", "events": ["device.offline", "screen.updated"] }, "isActive": true } ``` ## GET /extensions ### Description Retrieves a list of extensions. Can filter by active status. ### Method GET ### Endpoint `/extensions` ### Parameters #### Query Parameters - **activeOnly** (boolean) - Optional - If true, only returns active extensions. ## GET /extensions/{id} ### Description Retrieves a single extension by its ID. ### Method GET ### Endpoint `/extensions/{id}` ### Parameters #### Path Parameters - **id** (integer) - Required - The ID of the extension to retrieve. ## PATCH /extensions/{id} ### Description Updates an existing extension. ### Method PATCH ### Endpoint `/extensions/{id}` ### Parameters #### Path Parameters - **id** (integer) - Required - The ID of the extension to update. #### Request Body - **isActive** (boolean) - Optional - The new active status for the extension. ### Request Example ```json { "isActive": false } ``` ## POST /extensions/{id}/toggle ### Description Toggles the active status of an extension. ### Method POST ### Endpoint `/extensions/{id}/toggle` ### Parameters #### Path Parameters - **id** (integer) - Required - The ID of the extension to toggle. ## DELETE /extensions/{id} ### Description Deletes an extension. ### Method DELETE ### Endpoint `/extensions/{id}` ### Parameters #### Path Parameters - **id** (integer) - Required - The ID of the extension to delete. ``` -------------------------------- ### Playlist Management API Endpoints (curl) Source: https://context7.com/usetrmnl/inker/llms.txt These endpoints allow for the management of playlist items, including adding, updating, reordering, and removing screens. They also support deleting entire playlists, with an option to force unassignment from devices. ```bash curl -X POST http://localhost/playlists/1/items \ -H "Authorization: Bearer " \ -H "Content-Type: application/json" \ -d '{ "screenId": 5, "order": 0, "duration": 120 }' ``` ```bash curl -X PATCH http://localhost/playlists/1/items/3 \ -H "Authorization: Bearer " \ -H "Content-Type: application/json" \ -d '{ "duration": 180, "order": 2 }' ``` ```bash curl -X POST http://localhost/playlists/1/reorder \ -H "Authorization: Bearer " \ -H "Content-Type: application/json" \ -d '{ "items": [ {"id": 3, "order": 0}, {"id": 5, "order": 1}, {"id": 2, "order": 2} ] }' ``` ```bash curl -X DELETE http://localhost/playlists/1/items/3 \ -H "Authorization: Bearer " ``` ```bash curl -X DELETE "http://localhost/playlists/1?force=true" \ -H "Authorization: Bearer " ``` -------------------------------- ### Update Screen (Legacy) Source: https://context7.com/usetrmnl/inker/llms.txt Updates an existing static screen, such as changing its name. This uses a PATCH request to /screens/{id} with a JSON payload specifying the fields to update. Authentication is required. ```bash # Update screen curl -X PATCH http://localhost/screens/1 \ -H "Authorization: Bearer " \ -H "Content-Type: application/json" \ -d '{"name": "Updated Welcome"}' ```