The documentation here is for an unreleased version of Recyclarr.
Visit the documentation site for the Current Version instead.API and Sync Jobs
The recyclarr CLI and other programs control the server through its HTTP API. Through it
they start syncs, follow the jobs those syncs run as, and read the server diagnostics.
API Reference
Each server describes its own API on the same address and port as the API itself, so the description always matches the version you run:
/scalaris an interactive reference page where you can browse operations and try requests./openapi/v1.jsonis the OpenAPI document, for tools that generate clients or import an API.
Both paths are open without the API key. Requests you send from the /scalar page go to /api, so
enter the key there before you try them. This site also has the reference under HTTP API.
Sync Jobs
Every sync runs as a job, whether the schedule, the CLI, or the API started it. The server runs one job at a time, oldest first. Other jobs wait in a queue. A job that runs longer than the sync time limit stops so that the next job can start.
Each job has one of these statuses:
| Status | Meaning |
|---|---|
pending | Waiting in the queue |
running | Syncing now |
succeeded | The sync finished without errors |
partial | The sync finished, but some changes failed |
failed | The sync failed |
interrupted | The server stopped while the job was pending or running |
skipped | A scheduled sync was not started because another job was already active |
A persistent server keeps the 50 most recent finished jobs and their results, including across
restarts. When the server starts, it marks jobs that were active at shutdown as interrupted. It
does not run them again.
Server Diagnostics
Server diagnostics are problems the server has right now that you need to fix, such as a deprecated setting or an instance it had to leave out of syncs. The server logs each problem when it finds it, and also keeps it in a list until the problem is gone. You see this list in three places:
- Notifications: Every sync notification has a Server section with the current diagnostics. While the list is not empty, the server sends a notification after every sync, even when the sync itself had nothing to report.
recyclarr sync: The sync command lists them under Sync Diagnostics after the results, and in the log output when you use--log. They do not change the exit code. If the server cannot return the list, the command shows its results without it.- HTTP API:
GET /api/v1/diagnosticsreturns the list.
| Code | Severity | Cause | Goes away when |
|---|---|---|---|
environmentVariableRemoved | warning | A Recyclarr 8 Docker variable such as CRON_SCHEDULE is still set | You remove the variable and restart the server |
settingDeprecated | warning | settings.yml uses a deprecated setting | You remove the setting and restart the server |
configPropertyDeprecated | warning | A configuration file uses a deprecated property | The server loads your configuration without it |
instanceLeftOut | error | An instance has errors and no earlier working version, so syncs leave it out | You fix or remove the instance |
instanceChangeRejected | error | The latest change to an instance has errors, so syncs use its last working settings | You fix the change, or undo it |
configFileUnreadable | error | A YAML configuration file cannot be read, so its instances keep their last working settings | You fix the file |
guideUpdateRejected | warning | New data from a resource provider made an instance invalid, so the server went back to that provider's last data that worked | A later update from that provider leaves every instance valid |
resourceProviderUpdateFailed | warning | A resource provider could not be downloaded, so syncs use its cached copy | The next download of that provider succeeds |
The server reads settings.yml and environment variables only when it starts, so those problems
last until a restart. It checks your instances at startup, after you edit your
YAML files, and on each change to an API instance.
The API returns errors first. Each diagnostic has an id that stays the same while the problem
lasts, a code from the table above, a severity, a message, and a data object. The
API reference lists the data fields for each code. Reading the list changes nothing, and
the list is empty when the server has no problems:
{
"diagnostics": [
{
"id": "environmentVariableRemoved:CRON_SCHEDULE",
"code": "environmentVariableRemoved",
"severity": "warning",
"message": "CRON_SCHEDULE is no longer used; set `server.schedule.cron` in settings.yml instead. See https://recyclarr.dev/guide/upgrade-guide/v9.0/#cron-schedule",
"data": { "variable": "CRON_SCHEDULE" }
}
]
}
The server keeps the list in memory and builds it again after a restart. Problems found at startup appear right away. A guide data update that was held back appears again the next time the server updates that provider, up to one hour after the restart.