Data import (JSON)
Data import is Ryot’s own, general-purpose import format. One JSON document can add entities (things you track), relationships between them and events (things that happened to them), for any app installed on your server. It is built into Ryot, so it works without a plugin’s importer. Use it to bring data from a service Ryot has no importer for, or to feed Ryot from your own scripts.
You can send a document in two ways:
- Upload it once from Settings → Import data.
- Send it to a webhook from a script, as often as you like.
This page is a technical reference. For movie and show history, the simpler Media history format may be enough.
The document
Section titled “The document”A document is a JSON object with three arrays. All three are required; use [] for any you do not
need. A document can be up to 32 MiB.
{ "entities": [], "relationships": [], "events": [] }Every record in the document has a key: a name you choose, used to refer to that record from
other records. Keys must be unique across the whole document. If two records share a key, the
whole document fails.
Records must use schemas that already exist on your server, with property names and values that match those schemas. A data import never adds schemas or changes settings.
Schema owners
Section titled “Schema owners”Entity schemas, relationship schemas and providers are named by an owner and a slug:
{ "owner": { "kind": "plugin", "pluginId": "PLUGIN_ID" }, "slug": "movie" }- For schemas that come with an app (plugin), the owner is
{ "kind": "plugin", "pluginId": "…" }. Plugin IDs are different on every server. Find yours in Settings → Plugins: open the plugin and look under Technical details for Plugin ID. - For schemas built into Ryot itself, the owner is
{ "kind": "kernel" }.
Entities
Section titled “Entities”Each entity has a key, an entitySchema and one of three kind values:
kind |
Other fields | What it does |
|---|---|---|
custom |
name, properties |
Creates a new entity that belongs to you. |
existing |
entityId |
Points to an entity you can already see in Ryot. Nothing is created. |
provider |
provider, identifierType, value |
Looks the entity up with a metadata provider. If the lookup fails, the record fails; no custom entity is made instead. |
provider is an owner and slug, like a schema. The identifier types each provider accepts depend on
the provider. For example, the Media app’s movie.tmdb provider accepts "identifierType": "imdb"
with an IMDb ID such as tt0133093 as the value.
Relationships
Section titled “Relationships”Each relationship has a key, a relationshipSchema, sourceEntityKey, targetEntityKey and
properties. The two entity keys refer to entities in the same document.
Some relationship schemas are keyed, which lets one entity have several relationships of that type.
For those, add an identityKey naming this particular relationship. Leave it out for other
relationship schemas.
Events
Section titled “Events”Each event has a key, an eventSchemaSlug, an entityKey (the entity it happened to),
occurredAt and properties. It can also have a sessionEntityKey. Event schemas are found
through the entity’s schema, so they have no owner of their own.
occurredAt must be a UTC timestamp, such as 2026-01-15T12:00:00Z.
References inside properties
Section titled “References inside properties”When a schema marks a property as a reference to an entity or a relationship, put the key of that record from your document in the property. This works inside nested objects and arrays too. Ryot swaps each key for the real ID when it saves the record.
Files and images
Section titled “Files and images”A data import cannot upload files. Image and file properties can point only to files Ryot already stores.
Example
Section titled “Example”This example uses one record of each kind. Everything starting with example, the IDs and the
property names are placeholders: replace them with schemas and fields from your server.
{ "entities": [ { "kind": "custom", "key": "film", "name": "Example film", "entitySchema": { "owner": { "kind": "plugin", "pluginId": "PLUGIN_ID" }, "slug": "example-film" }, "properties": { "note": "An illustrative property" } }, { "kind": "existing", "key": "person", "entityId": "EXISTING_ENTITY_ID", "entitySchema": { "owner": { "kind": "plugin", "pluginId": "PLUGIN_ID" }, "slug": "example-person" } }, { "kind": "provider", "key": "session", "entitySchema": { "owner": { "kind": "plugin", "pluginId": "PLUGIN_ID" }, "slug": "example-session" }, "provider": { "owner": { "kind": "plugin", "pluginId": "PLUGIN_ID" }, "slug": "example-provider" }, "identifierType": "example-id", "value": "provider-value" } ], "relationships": [ { "key": "credit", "relationshipSchema": { "owner": { "kind": "plugin", "pluginId": "PLUGIN_ID" }, "slug": "example-credit" }, "sourceEntityKey": "film", "targetEntityKey": "person", "properties": { "role": "writer" } } ], "events": [ { "key": "activity", "eventSchemaSlug": "example-activity", "entityKey": "film", "sessionEntityKey": "session", "occurredAt": "2026-01-15T12:00:00Z", "properties": { "details": { "relatedEntity": "person", "creditRelationship": "credit" } } } ]}For this to work, the example-activity event schema would need to mark details.relatedEntity as
an entity reference and details.creditRelationship as a relationship reference.
Upload a file
Section titled “Upload a file”- Save your document as a
.jsonfile. - In Ryot, open Settings → Import data, select Start an import and choose Data import.
- Upload the file under JSON file.
- Optional: fill in Submission key (see Retries and submission keys).
- Select Continue, then Start import.
Uploading the same file again without a submission key starts a new import, which can add the same records twice.
Send a webhook
Section titled “Send a webhook”- In Ryot, open Settings → Integrations, select Connect a service and choose Data webhook. Finish the steps to create it.
- Open the new integration from the list and copy its Webhook URL. Keep it private: anyone with the URL can add data to your account.
- Send your document as the request body with
Content-Type: application/jsonand anIdempotency-Keyheader. Both are required.
WEBHOOK_URL='paste the URL copied from the integration'curl --fail \ -H 'Content-Type: application/json' \ -H 'Idempotency-Key: data-import-2026-01-15-01' \ --data-binary @data.json \ "$WEBHOOK_URL"Each request starts an import, which you can follow under the integration’s Recent runs or in Settings → Import data.
Retries and submission keys
Section titled “Retries and submission keys”The Idempotency-Key header (or the Submission key field when uploading) makes retries safe:
- Sending the same document with the same key returns the original import instead of starting a new one. This holds even after that import finished, failed or was cancelled.
- Sending a different document with a used key is rejected with HTTP
409. - A key stays used even if you delete its import report.
Use a new key for each new document, and reuse a key only to retry the same document.
How records are saved
Section titled “How records are saved”- Records only ever add data. Nothing in your library is changed or deleted.
- Records are saved one at a time, in an order that puts each record after the records it refers to. If one record fails, records already saved stay saved, and records that do not depend on it still go ahead.
- A record that refers to a key not in the document fails with “Unknown reference”.
- Records that refer to each other in a loop cannot be created and fail.
- Each failed record is listed with its reason in the import report.