maintenance.createPlan

Start a maintenance plan for a job's customer (owner or office). AI can draft the priced lines for one term; the owner approves them before the plan is sent. The first term's invoice is created now (and sent if send_first is true). When a term ends, the next term's invoice is created automatically and sent if auto_send is on. With visits_per_term, each term also gets that many service due dates (see services.listDue), so the shop knows when each covered visit is due; schedule the actual visit with visits.create as usual.

WhoAgents can call this
RESTPOST /v1/maintenance-plans
MCP toolmaintenance_createPlan
Writesyes, send an Idempotency-Key
AreaScheduling and visits

When to use it

Start a maintenance plan for a job's customer (owner or office). AI can draft the priced lines for one term; the owner approves them before the plan is sent.

What to tell the owner

Say what you did in plain words and what happens next.

Input

FieldTypeRequired
job_idstring (uuid)yes
namestringyes
term_monthsintegeryes
starts_onstringno
linesarrayyes
lines[].descriptionstringyes
lines[].quantitynumberyes
lines[].unit_price_minorintegeryes
lines[].kindstring (one of item, fee, discount)no
lines[].taxablebooleanno
tax_rate_id['string', 'null', ' ', '(', 'u', 'u', 'i', 'd', ')']no
auto_sendbooleanno
send_firstbooleanno
visits_per_termintegerno
visit_titlestringno

Example

POST https://doingwork.work/v1/maintenance-plans
content-type: application/json
Idempotency-Key: 3f1c...

{
  "job_id": "00000000-0000-4000-8000-000000000000",
  "name": "Ruiz Plumbing",
  "term_months": 1,
  "lines": [
    {
      "description": "40 gallon gas heater, installed",
      "quantity": "...",
      "unit_price_minor": 50000
    }
  ]
}

Output

JSON. The response shape isn't published yet; read the fields you need and ignore the rest. Errors are {code, message, status}.

Errors

CodeStatusWhat to do
invalid_input, invalid_token, rate_limitedCan happen on any call. See errors.