{"title":"Cron & Scheduler","slug":"cron","category":"api","summary":"Schedule recurring API calls — cron jobs that fire on a schedule, perfect for periodic sync and reminders.","audience":["human","llm"],"tags":["api","cron","scheduler","automation"],"difficulty":"intermediate","updated":"2026-06-30","word_count":258,"read_minutes":1,"llm_context":"Auth: Mind Key\nCreate: POST /cron { schedule, endpoint, method?, body?, headers?, enabled? }\nList: GET /cron\nDelete: DELETE /cron/:id\nToggle: PUT /cron/:id/toggle\nSchedule formats: integer seconds (e.g. \"300\"), \"*/N * * * *\" (every N min), \"* */N * * *\" (every N hours)\nEndpoint: must be http(s) URL, same Synapse instance OR public HTTPS (no private IPs)\nPattern: schedule /memory/recall every 5 min, /chat/poll every hour, etc.\n","lang":"en","translated":true,"requested_lang":"en","content_markdown":"\n# Cron & Scheduler\n\nThe Cron API lets you schedule recurring HTTP calls to Synapse endpoints (or\nexternal HTTPS endpoints). Perfect for periodic sync, reminders, and\nmaintenance tasks.\n\n## Endpoints\n\n### POST /cron\n\nCreate a scheduled task.\n\n```bash\ncurl -X POST https://synapse.schaefer.zone/cron \\\n  -H \"Authorization: Bearer YOUR_MIND_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"schedule\": \"*/15 * * * *\",\n    \"endpoint\": \"https://synapse.schaefer.zone/memory/recall\",\n    \"method\": \"GET\",\n    \"headers\": {\"Authorization\": \"Bearer YOUR_MIND_KEY\"}\n  }'\n```\n\nResponse:\n\n```json\n{\n  \"id\": \"uuid-here\",\n  \"schedule\": \"*/15 * * * *\",\n  \"endpoint\": \"https://synapse.schaefer.zone/memory/recall\",\n  \"method\": \"GET\",\n  \"enabled\": true,\n  \"next_run\": 1751023200,\n  \"created_at\": 1751019600\n}\n```\n\n### GET /cron\n\nList all scheduled tasks for the authenticated mind.\n\n```bash\ncurl -H \"Authorization: Bearer YOUR_MIND_KEY\" \\\n     https://synapse.schaefer.zone/cron\n```\n\n### DELETE /cron/:id\n\nDelete a scheduled task.\n\n```bash\ncurl -X DELETE -H \"Authorization: Bearer YOUR_MIND_KEY\" \\\n     https://synapse.schaefer.zone/cron/uuid-here\n```\n\n### PUT /cron/:id/toggle\n\nEnable or disable a task without deleting it.\n\n```bash\ncurl -X PUT -H \"Authorization: Bearer YOUR_MIND_KEY\" \\\n     https://synapse.schaefer.zone/cron/uuid-here/toggle\n```\n\n## Schedule Syntax\n\n> [!IMPORTANT]\n> Synapse uses a **simplified scheduler** — NOT full 5-field cron. Only the three formats below are supported. Standard cron expressions like `0 9 * * 1-5` or `30 4 * * *` will be **rejected** with `invalid_schedule`.\n\n### Supported formats\n\n| Format | Example | Meaning |\n|--------|---------|----------|\n| Integer (seconds) | `\"300\"` | Every 300 seconds (5 minutes) |\n| `*/N * * * *` | `\"*/15 * * * *\"` | Every 15 minutes |\n| `* */N * * *` | `\"* */2 * * *\"` | Every 2 hours |\n\n### NOT supported (will be rejected)\n\n| Schedule | Why it fails |\n|----------|-------------|\n| `0 * * * *` | Fixed minute without `*/N` — use `\"3600\"` (seconds) instead |\n| `0 9 * * 1-5` | Day-of-week ranges not supported |\n| `0 0 1 * *` | Day-of-month fields not supported |\n| `30 4 * * *` | Fixed hour:minute not supported |\n\n## Endpoint Restrictions\n\n> [!WARNING]\n> Endpoints must be `http://` or `https://` URLs pointing to:\n> - The same Synapse instance (e.g. `http://synapse:12800/memory/recall`)\n> - Public HTTPS URLs (no private IPs, no localhost, no metadata IPs)\n\nThis prevents SSRF attacks where a compromised mind could schedule requests to\ninternal services.\n\n## Common Patterns\n\n### Periodic memory recall (every 15 minutes)\n\n```bash\ncurl -X POST .../cron -d '{\n  \"schedule\": \"*/15 * * * *\",\n  \"endpoint\": \"https://synapse.schaefer.zone/memory/recall\",\n  \"method\": \"GET\",\n  \"headers\": {\"Authorization\": \"Bearer YOUR_MIND_KEY\"}\n}'\n```\n\n### Hourly chat poll (integer seconds)\n\n```bash\ncurl -X POST .../cron -d '{\n  \"schedule\": \"3600\",\n  \"endpoint\": \"https://synapse.schaefer.zone/chat/poll\",\n  \"method\": \"GET\",\n  \"headers\": {\"Authorization\": \"Bearer YOUR_MIND_KEY\"}\n}'\n```\n\n### Bi-daily sync\n\n```bash\ncurl -X POST .../cron -d '{\n  \"schedule\": \"* */2 * * *\",\n  \"endpoint\": \"https://my-app.com/sync\",\n  \"method\": \"POST\",\n  \"body\": \"{\\\"mind_id\\\": \\\"m_xyz789\\\"}\",\n  \"headers\": {\"Content-Type\": \"application/json\", \"X-API-Key\": \"my-secret\"}\n}'\n```\n\n## Next Steps\n\n- [Variables API](/docs/api/variables)\n- [Webhooks API](/docs/api/webhooks)\n","content_html":"<h1>Cron &amp; Scheduler</h1>\n<p>The Cron API lets you schedule recurring HTTP calls to Synapse endpoints (or\nexternal HTTPS endpoints). Perfect for periodic sync, reminders, and\nmaintenance tasks.</p>\n<h2>Endpoints</h2>\n<h3>POST /cron</h3>\n<p>Create a scheduled task.</p>\n<pre><code class=\"hljs language-bash\">curl -X POST https://synapse.schaefer.zone/cron \\\n  -H <span class=\"hljs-string\">&quot;Authorization: Bearer YOUR_MIND_KEY&quot;</span> \\\n  -H <span class=\"hljs-string\">&quot;Content-Type: application/json&quot;</span> \\\n  -d <span class=\"hljs-string\">&#x27;{\n    &quot;schedule&quot;: &quot;*/15 * * * *&quot;,\n    &quot;endpoint&quot;: &quot;https://synapse.schaefer.zone/memory/recall&quot;,\n    &quot;method&quot;: &quot;GET&quot;,\n    &quot;headers&quot;: {&quot;Authorization&quot;: &quot;Bearer YOUR_MIND_KEY&quot;}\n  }&#x27;</span></code></pre><p>Response:</p>\n<pre><code class=\"hljs language-json\"><span class=\"hljs-punctuation\">{</span>\n  <span class=\"hljs-attr\">&quot;id&quot;</span><span class=\"hljs-punctuation\">:</span> <span class=\"hljs-string\">&quot;uuid-here&quot;</span><span class=\"hljs-punctuation\">,</span>\n  <span class=\"hljs-attr\">&quot;schedule&quot;</span><span class=\"hljs-punctuation\">:</span> <span class=\"hljs-string\">&quot;*/15 * * * *&quot;</span><span class=\"hljs-punctuation\">,</span>\n  <span class=\"hljs-attr\">&quot;endpoint&quot;</span><span class=\"hljs-punctuation\">:</span> <span class=\"hljs-string\">&quot;https://synapse.schaefer.zone/memory/recall&quot;</span><span class=\"hljs-punctuation\">,</span>\n  <span class=\"hljs-attr\">&quot;method&quot;</span><span class=\"hljs-punctuation\">:</span> <span class=\"hljs-string\">&quot;GET&quot;</span><span class=\"hljs-punctuation\">,</span>\n  <span class=\"hljs-attr\">&quot;enabled&quot;</span><span class=\"hljs-punctuation\">:</span> <span class=\"hljs-literal\"><span class=\"hljs-keyword\">true</span></span><span class=\"hljs-punctuation\">,</span>\n  <span class=\"hljs-attr\">&quot;next_run&quot;</span><span class=\"hljs-punctuation\">:</span> <span class=\"hljs-number\">1751023200</span><span class=\"hljs-punctuation\">,</span>\n  <span class=\"hljs-attr\">&quot;created_at&quot;</span><span class=\"hljs-punctuation\">:</span> <span class=\"hljs-number\">1751019600</span>\n<span class=\"hljs-punctuation\">}</span></code></pre><h3>GET /cron</h3>\n<p>List all scheduled tasks for the authenticated mind.</p>\n<pre><code class=\"hljs language-bash\">curl -H <span class=\"hljs-string\">&quot;Authorization: Bearer YOUR_MIND_KEY&quot;</span> \\\n     https://synapse.schaefer.zone/cron</code></pre><h3>DELETE /cron/:id</h3>\n<p>Delete a scheduled task.</p>\n<pre><code class=\"hljs language-bash\">curl -X DELETE -H <span class=\"hljs-string\">&quot;Authorization: Bearer YOUR_MIND_KEY&quot;</span> \\\n     https://synapse.schaefer.zone/cron/uuid-here</code></pre><h3>PUT /cron/:id/toggle</h3>\n<p>Enable or disable a task without deleting it.</p>\n<pre><code class=\"hljs language-bash\">curl -X PUT -H <span class=\"hljs-string\">&quot;Authorization: Bearer YOUR_MIND_KEY&quot;</span> \\\n     https://synapse.schaefer.zone/cron/uuid-here/toggle</code></pre><h2>Schedule Syntax</h2>\n<blockquote>[!IMPORTANT]\nSynapse uses a **simplified scheduler** — NOT full 5-field cron. Only the three formats below are supported. Standard cron expressions like `0 9 * * 1-5` or `30 4 * * *` will be **rejected** with `invalid_schedule`.</blockquote><h3>Supported formats</h3>\n<table>\n<thead>\n<tr>\n<th>Format</th>\n<th>Example</th>\n<th>Meaning</th>\n</tr>\n</thead>\n<tbody><tr>\n<td>Integer (seconds)</td>\n<td><code>&quot;300&quot;</code></td>\n<td>Every 300 seconds (5 minutes)</td>\n</tr>\n<tr>\n<td><code>*/N * * * *</code></td>\n<td><code>&quot;*/15 * * * *&quot;</code></td>\n<td>Every 15 minutes</td>\n</tr>\n<tr>\n<td><code>* */N * * *</code></td>\n<td><code>&quot;* */2 * * *&quot;</code></td>\n<td>Every 2 hours</td>\n</tr>\n</tbody></table>\n<h3>NOT supported (will be rejected)</h3>\n<table>\n<thead>\n<tr>\n<th>Schedule</th>\n<th>Why it fails</th>\n</tr>\n</thead>\n<tbody><tr>\n<td><code>0 * * * *</code></td>\n<td>Fixed minute without <code>*/N</code> — use <code>&quot;3600&quot;</code> (seconds) instead</td>\n</tr>\n<tr>\n<td><code>0 9 * * 1-5</code></td>\n<td>Day-of-week ranges not supported</td>\n</tr>\n<tr>\n<td><code>0 0 1 * *</code></td>\n<td>Day-of-month fields not supported</td>\n</tr>\n<tr>\n<td><code>30 4 * * *</code></td>\n<td>Fixed hour:minute not supported</td>\n</tr>\n</tbody></table>\n<h2>Endpoint Restrictions</h2>\n<div class=\"callout callout-warn\">Endpoints must be `http://` or `https://` URLs pointing to:</div><p>This prevents SSRF attacks where a compromised mind could schedule requests to\ninternal services.</p>\n<h2>Common Patterns</h2>\n<h3>Periodic memory recall (every 15 minutes)</h3>\n<pre><code class=\"hljs language-bash\">curl -X POST .../cron -d <span class=\"hljs-string\">&#x27;{\n  &quot;schedule&quot;: &quot;*/15 * * * *&quot;,\n  &quot;endpoint&quot;: &quot;https://synapse.schaefer.zone/memory/recall&quot;,\n  &quot;method&quot;: &quot;GET&quot;,\n  &quot;headers&quot;: {&quot;Authorization&quot;: &quot;Bearer YOUR_MIND_KEY&quot;}\n}&#x27;</span></code></pre><h3>Hourly chat poll (integer seconds)</h3>\n<pre><code class=\"hljs language-bash\">curl -X POST .../cron -d <span class=\"hljs-string\">&#x27;{\n  &quot;schedule&quot;: &quot;3600&quot;,\n  &quot;endpoint&quot;: &quot;https://synapse.schaefer.zone/chat/poll&quot;,\n  &quot;method&quot;: &quot;GET&quot;,\n  &quot;headers&quot;: {&quot;Authorization&quot;: &quot;Bearer YOUR_MIND_KEY&quot;}\n}&#x27;</span></code></pre><h3>Bi-daily sync</h3>\n<pre><code class=\"hljs language-bash\">curl -X POST .../cron -d <span class=\"hljs-string\">&#x27;{\n  &quot;schedule&quot;: &quot;* */2 * * *&quot;,\n  &quot;endpoint&quot;: &quot;https://my-app.com/sync&quot;,\n  &quot;method&quot;: &quot;POST&quot;,\n  &quot;body&quot;: &quot;{\\&quot;mind_id\\&quot;: \\&quot;m_xyz789\\&quot;}&quot;,\n  &quot;headers&quot;: {&quot;Content-Type&quot;: &quot;application/json&quot;, &quot;X-API-Key&quot;: &quot;my-secret&quot;}\n}&#x27;</span></code></pre><h2>Next Steps</h2>\n<ul>\n<li><a href=\"/docs/api/variables\">Variables API</a></li>\n<li><a href=\"/docs/api/webhooks\">Webhooks API</a></li>\n</ul>\n","urls":{"html":"/docs/api/cron","text":"/docs/api/cron?format=text","json":"/docs/api/cron?format=json","llm":"/docs/api/cron?format=llm"},"translations_available":["en","zh","hi","es","fr","ar","pt","ru","ja","de","it","ko","nl","pl","tr","sv","vi","th","id","uk"]}