{"id":"cron.create","module":"scheduling","namespace":"cron","action":"create","method":"POST","path":"/v1/cron/create","idempotent":true,"available":true,"vendors":[],"vendors_ready":[],"vendors_pending":[],"key_status":"live","default_vendor":null,"self_hosted":true,"minimum_tier":"standard","supported_message_classes":null,"regions":["western","china"],"dynamic_params":{},"models_tracked":false,"sdk_hint":"Regular parameters + types are stable — read them from the typed SDK signature / API reference for this capability. discovery only carries the runtime-dynamic values above (available, vendors, dynamic_params).","params":{"title":"CronCreateRequest","description":"Request shape for cron.create. A job is EITHER recurring (provide cron_expr) OR a one-shot (provide run_at, an absolute time — fires once via max_runs=1; supersedes the retired scheduling.task.schedule). Exposes the full module schedule() surface (task / overlap_policy / on_failure_webhook / timezone / retry / timeout). See REVIEW Scheduling §3.A and docs/Infrai_SDK_Scheduling.md §1.","type":"object","required":["task"],"oneOf":[{"required":["cron_expr"]},{"required":["run_at"]}],"additionalProperties":false,"properties":{"cron_expr":{"type":"string","description":"Standard 5/6-field cron expression (recurring schedule). Mutually exclusive with run_at."},"run_at":{"type":"string","format":"date-time","description":"Absolute UTC time for a ONE-SHOT job that fires exactly once (max_runs=1). Mutually exclusive with cron_expr."},"task":{"type":"string","format":"uri","description":"Delivery target URL the cron fires against (http_url task type)."},"name":{"type":["string","null"],"description":"Human-readable name for this resource"},"timezone":{"type":"string","default":"UTC","description":"IANA tz name."},"retry":{"type":"integer","minimum":0,"maximum":10,"default":3,"description":"Retry configuration for failed executions"},"timeout_seconds":{"type":"integer","minimum":1,"maximum":900,"default":300,"description":"Maximum execution time in seconds"},"overlap_policy":{"enum":["allow","skip","queue"],"default":"skip","description":"Policy for handling overlapping runs (skip, queue, cancel)"},"max_runs":{"type":["integer","null"],"minimum":1,"description":"Maximum number of runs to retain"},"payload":{"type":["object","null"],"description":"Payload data for the message or request body"},"headers":{"type":["object","null"],"description":"Custom HTTP headers to include in requests or responses"},"on_failure_webhook":{"type":["string","null"],"format":"uri","description":"Webhook URL to call on execution failure"},"secret":{"type":["string","null"],"description":"HMAC signing secret for the fired request; never returned (only secret_fingerprint)."},"idempotency_key":{"type":["string","null"],"description":"Client-provided idempotency key; prevents duplicate execution on retry"}}},"response":{"title":"CronJob","type":"object","required":["job_id","cron_expr","task_type","enabled","status"],"additionalProperties":false,"properties":{"job_id":{"type":"string","pattern":"^cron_[A-Za-z0-9]{20,}$","description":"Unique identifier for this async job"},"name":{"type":["string","null"],"description":"Human-readable name for this resource"},"account_id":{"type":"string","description":"Account identifier that owns this resource"},"cron_expr":{"type":"string","description":"Standard 5/6-field cron expression."},"task_type":{"enum":["http_url","function_ref"],"description":"Type of task (http, serverless)"},"task_url":{"type":["string","null"],"format":"uri","description":"URL to call when the cron job triggers"},"task_function_name":{"type":["string","null"],"description":"Serverless function name to invoke"},"timezone":{"type":"string","default":"UTC","description":"IANA timezone for the cron schedule"},"retry":{"type":"integer","minimum":0,"maximum":10,"default":3,"description":"Retry configuration for failed executions"},"timeout_seconds":{"type":"integer","minimum":1,"maximum":900,"default":300,"description":"Standard/Pro hard max 900s (15 min). Enterprise contract may override per-tier."},"overlap_policy":{"enum":["allow","skip","queue"],"default":"skip","description":"Policy for handling overlapping runs (skip, queue, cancel)"},"max_runs":{"type":["integer","null"],"minimum":1,"description":"Maximum number of runs to retain"},"payload":{"type":["object","null"],"description":"Payload data for the message or request body"},"headers":{"type":["object","null"],"description":"Custom HTTP headers to include in requests or responses"},"on_failure_webhook":{"type":["string","null"],"format":"uri","description":"Webhook URL to call on execution failure"},"enabled":{"type":"boolean","default":true,"description":"Whether this feature or configuration is enabled"},"status":{"enum":["active","disabled","exhausted","deleted"],"description":"Current status of this resource"},"next_run_at":{"type":["string","null"],"format":"date-time","description":"ISO 8601 timestamp of the next scheduled run"},"last_run_at":{"type":["string","null"],"format":"date-time","description":"ISO 8601 timestamp of the last cron run"},"last_run_status":{"enum":["succeeded","failed","skipped",null],"description":"Status of the last cron run"}}},"errors":["ACCOUNT_AUTORECHARGE_LIMIT","ACCOUNT_FROZEN","AUTH_RATE_LIMIT","AUTH_REFRESH_TOO_FREQUENT","CRON_EXPR_INVALID","CRON_JOB_NOT_FOUND","CRON_MAX_RUNS_REACHED","CRON_MISSED_SCHEDULE","CRON_OVERLAP_SKIPPED","CRON_RUN_FAILED","CRON_RUN_TIMEOUT","CRON_TASK_5XX","CRON_TASK_URL_UNREACHABLE","CRON_TIMEOUT","CRON_TIMEZONE_INVALID","DEDUPLICATION_ID_MISSING","IDEMPOTENCY_KEY_CONFLICT","INSUFFICIENT_CREDIT","INTERNAL_ERROR","INVALID_ARGUMENT","KEY_REVOKED","MAINTENANCE","MESSAGE_GROUP_ID_MISSING","NETWORK_ERROR","QUEUE_ALREADY_EXISTS","QUEUE_DELAY_INVALID","QUEUE_FIFO_CONFLICT","QUEUE_HEADERS_TOO_LARGE","QUEUE_MESSAGE_NOT_FOUND","QUEUE_MESSAGE_NOT_IN_FLIGHT","QUEUE_MESSAGE_TOO_LARGE","QUEUE_NOT_FOUND","RATE_LIMIT_ACCOUNT","RATE_LIMIT_USER","RATE_LIMIT_VENDOR","SCOPE_INSUFFICIENT","UNAUTHORIZED","VENDOR_AUTH_ERROR","VENDOR_DOWN","VENDOR_TIMEOUT","WALLET_EXPIRED","WEBHOOK_DELIVERY_NOT_FOUND","WEBHOOK_ENDPOINT_NOT_FOUND","WEBHOOK_PAYLOAD_TOO_LARGE","WEBHOOK_TARGET_4XX","WEBHOOK_TARGET_5XX","WEBHOOK_TARGET_TIMEOUT","WEBHOOK_TIMESTAMP_EXPIRED","WEBHOOK_URL_INVALID","WEBHOOK_VERIFY_FAILED"],"examples":{"curl":"curl -X POST https://api.infrai.cc/v1/cron/create \\\n  -H \"Authorization: Bearer $INFRAI_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"cron_expr\": \"0 9 * * 1\", \"task\": \"https://api.acme.com/weekly\"}'","python":"# Zero-install REST call — no SDK required (short-term the API is REST-only).\nimport os, requests\n\nresp = requests.post(\n    \"https://api.infrai.cc/v1/cron/create\",\n    headers={\n        \"Authorization\": f\"Bearer {os.environ['INFRAI_API_KEY']}\",\n    },\n    json={'cron_expr': '0 9 * * 1', 'task': 'https://api.acme.com/weekly'},\n)\nresp.raise_for_status()\nprint(resp.json())","javascript":"// Zero-install REST call — no SDK required (short-term the API is REST-only).\nconst resp = await fetch(\n  \"https://api.infrai.cc/v1/cron/create\",\n  {\n    method: \"POST\",\n    headers: {\n      \"Authorization\": `Bearer ${process.env.INFRAI_API_KEY}`,\n      \"Content-Type\": \"application/json\",\n    },\n    body: JSON.stringify({\"cron_expr\": \"0 9 * * 1\", \"task\": \"https://api.acme.com/weekly\"}),\n  },\n);\nconsole.log(await resp.json());","typescript":"// Zero-install REST call — no SDK required (short-term the API is REST-only).\nconst resp = await fetch(\n  \"https://api.infrai.cc/v1/cron/create\",\n  {\n    method: \"POST\",\n    headers: {\n      \"Authorization\": `Bearer ${process.env.INFRAI_API_KEY}`,\n      \"Content-Type\": \"application/json\",\n    },\n    body: JSON.stringify({\"cron_expr\": \"0 9 * * 1\", \"task\": \"https://api.acme.com/weekly\"}),\n  },\n);\nif (!resp.ok) throw new Error(`infrai ${resp.status}`);\nconst data: unknown = await resp.json();\nconsole.log(data);","go":"// Zero-install REST call — no SDK required (short-term the API is REST-only).\npackage main\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"os\"\n)\n\nfunc main() {\n\tbody := []byte(`{\"cron_expr\": \"0 9 * * 1\", \"task\": \"https://api.acme.com/weekly\"}`)\n\treq, _ := http.NewRequest(\"POST\", \"https://api.infrai.cc/v1/cron/create\", bytes.NewReader(body))\n\treq.Header.Set(\"Authorization\", \"Bearer \"+os.Getenv(\"INFRAI_API_KEY\"))\n\treq.Header.Set(\"Content-Type\", \"application/json\")\n\tresp, err := http.DefaultClient.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer resp.Body.Close()\n\tfmt.Println(resp.Status)\n}","java":"// Zero-install REST call — no SDK required (short-term the API is REST-only).\nimport java.net.URI;\nimport java.net.http.*;\n\nHttpRequest req = HttpRequest.newBuilder()\n    .uri(URI.create(\"https://api.infrai.cc/v1/cron/create\"))\n    .header(\"Authorization\", \"Bearer \" + System.getenv(\"INFRAI_API_KEY\"))\n    .header(\"Content-Type\", \"application/json\")\n    .method(\"POST\", HttpRequest.BodyPublishers.ofString(\"{\\\"cron_expr\\\": \\\"0 9 * * 1\\\", \\\"task\\\": \\\"https://api.acme.com/weekly\\\"}\"))\n    .build();\nHttpResponse<String> resp = HttpClient.newHttpClient()\n    .send(req, HttpResponse.BodyHandlers.ofString());\nSystem.out.println(resp.body());","csharp":"// Zero-install REST call — no SDK required (short-term the API is REST-only).\nusing System;\nusing System.Net.Http;\n\nvar client = new HttpClient();\nvar req = new HttpRequestMessage(new HttpMethod(\"POST\"), \"https://api.infrai.cc/v1/cron/create\");\nvar key = Environment.GetEnvironmentVariable(\"INFRAI_API_KEY\");\nreq.Headers.Add(\"Authorization\", \"Bearer \" + key);\nreq.Content = new StringContent(\"{\\\"cron_expr\\\": \\\"0 9 * * 1\\\", \\\"task\\\": \\\"https://api.acme.com/weekly\\\"}\", System.Text.Encoding.UTF8, \"application/json\");\nvar resp = await client.SendAsync(req);\nConsole.WriteLine(await resp.Content.ReadAsStringAsync());","php":"<?php\n// Zero-install REST call — no SDK required (short-term the API is REST-only).\n$ch = curl_init(\"https://api.infrai.cc/v1/cron/create\");\ncurl_setopt($ch, CURLOPT_CUSTOMREQUEST, \"POST\");\ncurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\ncurl_setopt($ch, CURLOPT_HTTPHEADER, [\n    \"Authorization: Bearer \" . getenv(\"INFRAI_API_KEY\"),\n    \"Content-Type: application/json\",\n]);\ncurl_setopt($ch, CURLOPT_POSTFIELDS, \"{\\\"cron_expr\\\": \\\"0 9 * * 1\\\", \\\"task\\\": \\\"https://api.acme.com/weekly\\\"}\");\n$response = curl_exec($ch);\ncurl_close($ch);\necho $response;","ruby":"# Zero-install REST call — no SDK required (short-term the API is REST-only).\nrequire \"net/http\"\nrequire \"uri\"\n\nuri = URI(\"https://api.infrai.cc/v1/cron/create\")\nhttp = Net::HTTP.new(uri.host, uri.port)\nhttp.use_ssl = true\nreq = Net::HTTP::Post.new(uri)\nreq[\"Authorization\"] = \"Bearer #{ENV['INFRAI_API_KEY']}\"\nreq[\"Content-Type\"] = \"application/json\"\nreq.body = '{\"cron_expr\": \"0 9 * * 1\", \"task\": \"https://api.acme.com/weekly\"}'\nres = http.request(req)\nputs res.body","rust":"// Zero-install REST call — no SDK required (short-term the API is REST-only). (uses the reqwest + tokio crates)\nuse std::env;\n\n#[tokio::main]\nasync fn main() -> Result<(), Box<dyn std::error::Error>> {\n    let resp = reqwest::Client::new()\n        .post(\"https://api.infrai.cc/v1/cron/create\")\n        .header(\"Authorization\", format!(\"Bearer {}\", env::var(\"INFRAI_API_KEY\")?))\n        .header(\"Content-Type\", \"application/json\")\n        .body(r#\"{\"cron_expr\": \"0 9 * * 1\", \"task\": \"https://api.acme.com/weekly\"}\"#)\n        .send()\n        .await?;\n    println!(\"{}\", resp.text().await?);\n    Ok(())\n}","request":{"cron_expr":"0 9 * * 1","task":"https://api.acme.com/weekly"}},"billing":{"is_billable":false,"free":true,"billing_class":"self_dev_market","unit":"per_call","note":"free (rate-limited); does NOT consume the new-account trial"}}