{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/spoofy-social/json-schema/spoofy-social-automation-create-schema.json",
  "title": "AutomationCreate",
  "description": "What to automate. Every run is an ordinary order of `service`, charged from your balance when it goes, at the price on sale then: a price that moves while it runs moves the plan, its budget too, by the difference (a rise is emailed to you; it keeps running). Fields by kind — **spread**: service, link, quantity (the total), over (\"3d\") or over_minutes, or runs + interval_minutes; pace even | steady | front (S-curves) | launch (about half in the first run, each one after smaller); natural (±15 % on time and size, default on). **scheduled**: service, link, quantity, start_at. **recurring**: service, link, quantity (each run), every (\"6h\", \"1d\", \"1w\"), at (\"14:00\" in `timezone`), and times, until or budget; natural (±15 % on each run's time, default on). **split**: service, link, quantity (beyond one order's max). **campaign**: steps [{service, link, quantity, offset_minutes, over_minutes, runs, pace}] — or `template` (a kit id or a saved template) with `links`. **keep_above**: service, link, target, days, budget (public Telegram channels and groups, YouTube videos); when the count is under the target it places a new order. **feed**: feed (a public Telegram channel, a YouTube channel, a CoinMarketCap Community profile, a Pinterest profile or board, a Bluesky account, a Reddit user or subreddit, any RSS / Atom feed, or an X account while X’s own API is on here), service, quantity per post — or quantity_min and quantity_max, a random whole number in that range for each post —, spread_minutes and parts (each post's order in parts at random times over 30 minutes to 6 hours) and their pace (even, or launch: the first part about half), delay_min_minutes and delay_max_minutes (a random start after the post), posts (your next N posts: it completes once they have had their orders), max_per_day, days, budget (needed without posts; with them, posts × the most one post can cost unless you give less) — and PATCH /api/v1/automations/{id} changes them later; where no feed is read, an On new posts service (order fields username, min, max, posts, delay) is the provider’s own watch. **per_link** (a new post each run): service, quantity each run, runs, every and at (when the posts come, optional), days (how long it takes links; default half as long again as the runs take at that pace, else 90) — no link and no budget: each run's link comes later through POST /api/v1/automations/{id}/links, and runs you never send a link for are never charged.",
  "x-generated": "2026-11-25",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/spoofy-social-openapi.json#/components/schemas/AutomationCreate",
  "type": "object",
  "required": [
    "kind"
  ],
  "properties": {
    "kind": {
      "type": "string",
      "enum": [
        "spread",
        "scheduled",
        "recurring",
        "split",
        "campaign",
        "keep_above",
        "feed",
        "per_link"
      ]
    },
    "name": {
      "type": "string",
      "maxLength": 80
    },
    "timezone": {
      "type": "string",
      "description": "IANA time zone the times are in, e.g. \"America/Costa_Rica\" (default UTC)."
    },
    "start_at": {
      "type": "string",
      "format": "date-time",
      "description": "When the first run goes (default now), with an offset, e.g. 2026-10-18T14:00:00-06:00. Up to 90 days ahead."
    },
    "budget": {
      "type": "string",
      "pattern": "^\\d+\\.\\d{2,4}$",
      "description": "The most its orders may cost together, net of refunds. USD as a decimal string."
    },
    "notify": {
      "type": "object",
      "properties": {
        "email": {
          "type": "boolean",
          "default": true
        },
        "progress": {
          "type": "boolean",
          "default": false,
          "description": "Also an email at halfway."
        }
      }
    },
    "service": {
      "type": "integer",
      "description": "Service id (GET /api/v1/services)."
    },
    "link": {
      "type": "string"
    },
    "quantity": {
      "type": "integer",
      "description": "spread / split: the total · scheduled / recurring: each run · feed / per_link: each post (feed: both ends of quantity_min and quantity_max)."
    },
    "over": {
      "type": "string",
      "description": "spread: how long, e.g. \"3d\", \"12h\", \"90m\"."
    },
    "over_minutes": {
      "type": "integer",
      "description": "spread: the same in minutes (0 = all at once)."
    },
    "runs": {
      "type": "integer",
      "description": "spread / campaign steps: how many runs (default: about one every 3 h, kept within the service range) · per_link: how many posts the plan covers, one run each."
    },
    "interval_minutes": {
      "type": "integer",
      "description": "spread with runs: minutes between runs."
    },
    "pace": {
      "type": "string",
      "enum": [
        "even",
        "steady",
        "front",
        "launch"
      ],
      "description": "spread, campaign steps, and feed with spread_minutes (each post's parts): even (the default), an S-curve — steady (slow start, fast middle, slow end) or front (the bulk early) — or launch (added 2026-10-28): about half in the first run, at the start, then each run smaller than the one before to the window's end; a first half above one order's max goes in several runs within the first tenth of the window. Every run stays within one order's min and max."
    },
    "natural": {
      "type": "boolean",
      "description": "±15 % on each run's time and size, the total exact (default on; off = exact runs). Exact runs of equal size (2–100 runs, 1–1,440 minutes apart) on a service that delivers in runs itself go as one order, delivered in those runs."
    },
    "every": {
      "description": "recurring: \"6h\", \"1d\", \"1w\", \"daily\", or {\"n\": 2, \"unit\": \"days\"} · per_link: how often the posts come (\"daily\", \"weekly\"; optional) — it sets how long the plan takes links and never limits when you send one.",
      "oneOf": [
        {
          "type": "string"
        },
        {
          "type": "object",
          "properties": {
            "n": {
              "type": "integer"
            },
            "unit": {
              "type": "string",
              "enum": [
                "hours",
                "days",
                "weeks"
              ]
            }
          }
        }
      ]
    },
    "at": {
      "type": "string",
      "description": "recurring by day or week: the time of day in `timezone`, e.g. \"14:00\" · per_link: about when the posts come (optional)."
    },
    "times": {
      "type": "integer",
      "description": "recurring: how many runs."
    },
    "until": {
      "type": "string",
      "format": "date-time",
      "description": "recurring: no runs after this."
    },
    "steps": {
      "type": "array",
      "maxItems": 10,
      "description": "campaign: each step its own service, link and timing.",
      "items": {
        "type": "object",
        "required": [
          "service",
          "link",
          "quantity"
        ],
        "properties": {
          "service": {
            "type": "integer"
          },
          "link": {
            "type": "string"
          },
          "quantity": {
            "type": "integer"
          },
          "offset_minutes": {
            "type": "integer",
            "description": "Minutes after the campaign starts."
          },
          "over_minutes": {
            "type": "integer",
            "description": "Spread this step over this long."
          },
          "runs": {
            "type": "integer"
          },
          "pace": {
            "type": "string",
            "enum": [
              "even",
              "steady",
              "front",
              "launch"
            ]
          },
          "label": {
            "type": "string"
          }
        }
      }
    },
    "template": {
      "type": "string",
      "description": "A kit id (e.g. \"token-launch\") or one of your saved templates (GET /api/v1/automations/templates)."
    },
    "links": {
      "type": "object",
      "additionalProperties": {
        "type": "string"
      },
      "description": "With a template: the link for each slot, e.g. {\"x_post\": \"https://x.com/…\"}."
    },
    "quantities": {
      "type": "object",
      "additionalProperties": {
        "type": "integer"
      },
      "description": "With a kit: another quantity per slot or step index."
    },
    "target": {
      "type": "integer",
      "description": "keep_above: the count to stay at or above."
    },
    "days": {
      "type": "integer",
      "description": "keep_above / feed: for how many days (up to 90; a feed without posts: 30 by default) — a feed with posts ends then only should fewer posts come (default 90, as far as automations go) · per_link: how long it takes links (up to 90; default half as long again as the runs take at their pace, else 90)."
    },
    "check_every_minutes": {
      "type": "integer",
      "description": "keep_above: how often the public count is read (at least 30, default 60)."
    },
    "feed": {
      "type": "string",
      "description": "feed: https://t.me/yourchannel, https://www.youtube.com/@yourchannel, https://coinmarketcap.com/community/profile/YourHandle, https://www.pinterest.com/yourname/ (or a board), https://bsky.app/profile/you.bsky.social, https://www.reddit.com/user/yourname (or /r/yoursub), an RSS / Atom feed URL — or https://x.com/yourname while X’s own API is on here."
    },
    "posts": {
      "type": "integer",
      "description": "feed: how many new posts it orders for — your next N posts, then it completes (up to 500). A post whose order is refunded in full does not count, nor one skipped (past max_per_day, a short balance). Without a budget it may cost posts × one post's order at its price (which follows the price on sale)."
    },
    "max_per_day": {
      "type": "integer",
      "description": "feed: at most this many posts a day (default 5); more that day are skipped. A post in parts is one post."
    },
    "delay_minutes": {
      "type": "integer",
      "description": "feed: wait this long after a post before ordering (both ends of delay_min_minutes and delay_max_minutes)."
    },
    "quantity_min": {
      "type": "integer",
      "description": "feed: with quantity_max, a range instead of one amount — each new post gets a random whole number in it, both ends within one delivery of the service (drawn per post: the same post always draws the same)."
    },
    "quantity_max": {
      "type": "integer",
      "description": "feed: the range's top. What the plan can cost counts each post at it."
    },
    "spread_minutes": {
      "type": "integer",
      "minimum": 0,
      "maximum": 360,
      "description": "feed: spread each post's order over this many minutes, 30 to 360 (0, the default: all at once) — in `parts` orders at random times within the window, the first at the start."
    },
    "parts": {
      "type": "integer",
      "minimum": 1,
      "maximum": 10,
      "description": "feed, with spread_minutes: how many parts (2–10, default 3). Each part is at least the service's minimum, so a small amount goes in fewer, down to one. The parts of one post are one post toward posts and max_per_day."
    },
    "delay_min_minutes": {
      "type": "integer",
      "minimum": 0,
      "maximum": 1440,
      "description": "feed: the first part starts a random number of minutes after the post appears, from this…"
    },
    "delay_max_minutes": {
      "type": "integer",
      "minimum": 0,
      "maximum": 1440,
      "description": "feed: …to this."
    },
    "dry_run": {
      "type": "boolean",
      "default": false,
      "description": "Answer the plan and its cost; create nothing."
    }
  }
}