Add a Kodi instance
const url = 'https://example.com/api/v1/kodi/instances';const options = { method: 'POST', headers: { cookie: 'encore_session=<encore_session>', 'Content-Type': 'application/json' }, body: '{"broadcast":"example","language":"example","mac":"example","name":"example","password":"example","shutdown":"inherit","timezone":"example","url":"example","username":"example","websocket_url":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://example.com/api/v1/kodi/instances \ --header 'Content-Type: application/json' \ --cookie encore_session=<encore_session> \ --data '{ "broadcast": "example", "language": "example", "mac": "example", "name": "example", "password": "example", "shutdown": "inherit", "timezone": "example", "url": "example", "username": "example", "websocket_url": "example" }'Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”object
Title-matching rules, e.g. en or de
Write-only; empty removes it
The Kodi host’s IANA time zone; empty learns it from Kodi’s clock
HTTP JSON-RPC endpoint, e.g. http://192.168.1.20:8080/jsonrpc
E.g. ws://192.168.1.20:9090/jsonrpc; empty disables live updates
Responses
Section titled “Responses”Created
object
Title-matching rules for this library
object
object
The item’s poster or thumbnail, fetched from Kodi through encore; empty when Kodi has none
What “shut down” does; inherit follows Settings › Features
object
The Kodi host’s IANA time zone; empty when learnt from Kodi’s clock
HTTP JSON-RPC endpoint, without credentials
Empty when live updates are disabled
Example
{ "shutdown": "inherit", "status": { "state": "connected" }}default
Section titled “default”Error
object
A human-readable explanation specific to this occurrence of the problem.
Optional list of individual error details
object
Where the error occurred, e.g. ‘body.items[3].tags’ or ‘path.thing-id’
Error message text
The value at the given location
A URI reference that identifies the specific occurrence of the problem.
HTTP status code
A short, human-readable summary of the problem type. This value should not change between occurrences of the error.
A URI reference to human-readable documentation for the error.
Example
{ "detail": "Property foo is required but is missing.", "instance": "https://example.com/error-log/abc123", "status": 400, "title": "Bad Request", "type": "about:blank"}