{"openapi":"3.1.0","info":{"title":"The Marketing Manager API","version":"1.0.0","description":"Scoped, audited access to clients, tasks, monthly work, connected sites and logins. Keys are made on the API keys page of the admin. Nothing here emails a client."},"servers":[{"url":"https://themarketingmanager.co.uk"}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer","description":"ymt_live_… keys from the API keys page"}},"schemas":{"Ok":{"type":"object","required":["ok"],"properties":{"ok":{"const":true},"data":{},"meta":{"type":"object"}}},"Error":{"type":"object","required":["ok","error","message"],"properties":{"ok":{"const":false},"error":{"type":"string","enum":["unauthorized","forbidden","not_found","validation_error","conflict","rate_limited","not_ready","internal","method_not_allowed"]},"message":{"type":"string"},"details":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"problem":{"type":"string"}}}}}}},"responses":{"Error":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"x-scopes":{"read:clients":"List and read clients (audits joined to their business)","write:clients":"Change a client’s details, status and plan (not logins or site tokens)","read:tasks":"List tasks","write:tasks":"Create, change, finish and bulk-change tasks","read:monthly":"Read the time log and monthly reports","write:monthly":"Log and approve time, and save monthly reports","write:time":"Log AI-assisted time, which waits for a person to approve it","read:sites":"List connected websites and their latest figures (never tokens)","write:sites":"Add, change, test, refresh and switch off websites","read:vault":"Whether a client’s Cloudways login is saved (never the login itself)","write:vault":"Save or remove a client’s Cloudways login","reveal:vault":"Read a saved password. Off unless chosen; every use is logged","admin:keys":"Make and turn off API keys"},"paths":{"/api/v1/me":{"get":{"operationId":"getMe","summary":"The key in use: its name, scopes and limit","tags":["Keys"],"security":[{"bearer":[]}],"x-scopes":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Ok"}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/clients":{"get":{"operationId":"getClients","summary":"List clients","tags":["Clients"],"security":[{"bearer":[]}],"x-scopes":["read:clients"],"parameters":[{"name":"q","in":"query","required":false,"schema":{"type":"string","maxLength":200,"description":"Name, website, contact, email or reference"}},{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["submitted","in_progress","audit_complete","no_show","presented","proposal_delivered","won","lost","archived"]}},{"name":"market","in":"query","required":false,"schema":{"type":"string","enum":["GB","US"]}},{"name":"managed","in":"query","required":false,"schema":{"type":"boolean","description":"Won clients only"}},{"name":"domain","in":"query","required":false,"schema":{"type":"string","maxLength":200}},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100000,"description":"Page, from 1"}},{"name":"per_page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":200,"description":"Per page (default 50, at most 200)"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Ok"}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}},"post":{"operationId":"postClients","summary":"Add a client (their business and record)","tags":["Clients"],"security":[{"bearer":[]}],"x-scopes":["write:clients"],"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","maxLength":200},"description":"Any unique string; a retry with the same key and body gets the first answer"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Ok"}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["name"],"properties":{"name":{"type":"string","maxLength":200,"description":"Business name"},"website":{"type":["string","null"],"format":"uri"},"email":{"type":["string","null"],"format":"email"},"phone":{"type":["string","null"],"maxLength":60},"contact_name":{"type":["string","null"],"maxLength":120},"notes":{"type":["string","null"],"maxLength":5000,"description":"Business notes"},"status":{"type":"string","enum":["submitted","in_progress","audit_complete","no_show","presented","proposal_delivered","won","lost","archived"],"description":"Default submitted; won for a client already signed up"},"monthly_pence":{"type":["integer","null"],"minimum":0,"maximum":10000000,"description":"Price a month, in pence"},"monthly_hours":{"type":["number","null"],"minimum":0,"maximum":744},"managed_since":{"type":["string","null"],"format":"date"},"market":{"type":"string","enum":["GB","US"]},"force":{"type":"boolean","description":"Add it even if a business with the same website or email is here already"}}}}}}}},"/api/v1/clients/{id}":{"get":{"operationId":"getClientsId","summary":"One client","tags":["Clients"],"security":[{"bearer":[]}],"x-scopes":["read:clients"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Ok"}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}},"patch":{"operationId":"patchClientsId","summary":"Change a client","tags":["Clients"],"security":[{"bearer":[]}],"x-scopes":["write:clients"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","maxLength":200}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Ok"}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"name":{"type":"string","maxLength":200,"description":"Business name"},"website":{"type":["string","null"],"format":"uri"},"email":{"type":["string","null"],"format":"email"},"phone":{"type":["string","null"],"maxLength":60},"contact_name":{"type":["string","null"],"maxLength":120},"notes":{"type":["string","null"],"maxLength":5000,"description":"Business notes"},"status":{"type":"string","enum":["submitted","in_progress","audit_complete","no_show","presented","proposal_delivered","won","lost","archived"]},"brand_notes":{"type":["string","null"],"maxLength":20000},"discovery_notes":{"type":["string","null"],"maxLength":20000},"prototype_url":{"type":["string","null"],"format":"uri"},"prototype_show":{"type":"boolean"},"prototype_style":{"type":["string","null"],"maxLength":60},"staging_url":{"type":["string","null"],"format":"uri"},"monthly_hours":{"type":["number","null"],"minimum":0,"maximum":744},"monthly_carry":{"type":"boolean"},"managed_since":{"type":["string","null"],"format":"date"},"market":{"type":"string","enum":["GB","US"]},"hours_per_month":{"type":["integer","null"],"minimum":0,"maximum":744},"monthly_pence":{"type":["integer","null"],"minimum":0,"maximum":10000000,"description":"Price a month, in pence"},"site_fee_on":{"type":["boolean","null"],"description":"Website, hosting and dashboard cost: true, false, or null for automatic"},"site_fee_pence":{"type":["integer","null"],"minimum":0,"maximum":10000000}}}}}}}},"/api/v1/clients/{id}/notes":{"get":{"operationId":"getClientsIdNotes","summary":"A client’s notes, newest first","tags":["Clients"],"security":[{"bearer":[]}],"x-scopes":["read:clients"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"kind","in":"query","required":false,"schema":{"type":"string","enum":["note","task","status","closed"]}},{"name":"q","in":"query","required":false,"schema":{"type":"string","maxLength":200}},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100000,"description":"Page, from 1"}},{"name":"per_page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":200,"description":"Per page (default 50, at most 200)"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Ok"}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}},"post":{"operationId":"postClientsIdNotes","summary":"Add a note to a client (a launch, a DNS change, a QA milestone)","tags":["Clients"],"security":[{"bearer":[]}],"x-scopes":["write:clients"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","maxLength":200},"description":"Any unique string; a retry with the same key and body gets the first answer"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Ok"}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["body"],"properties":{"body":{"type":"string","maxLength":5000,"description":"The note, as it should read on the client’s record"}}}}}}}},"/api/v1/tasks":{"get":{"operationId":"getTasks","summary":"List tasks (default: open ones)","tags":["Tasks"],"security":[{"bearer":[]}],"x-scopes":["read:tasks"],"parameters":[{"name":"client_id","in":"query","required":false,"schema":{"type":"string","format":"uuid"}},{"name":"q","in":"query","required":false,"schema":{"type":"string","maxLength":200}},{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["todo","doing","waiting","done"]}},{"name":"label","in":"query","required":false,"schema":{"type":"string","maxLength":60}},{"name":"assignee","in":"query","required":false,"schema":{"type":"string","maxLength":200}},{"name":"due_before","in":"query","required":false,"schema":{"type":"string","format":"date"}},{"name":"due_after","in":"query","required":false,"schema":{"type":"string","format":"date"}},{"name":"important","in":"query","required":false,"schema":{"type":"boolean"}},{"name":"tab","in":"query","required":false,"schema":{"type":"string","enum":["open","overdue","today","week","none","done","all"],"description":"As the admin’s tabs (default open)"}},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100000,"description":"Page, from 1"}},{"name":"per_page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":200,"description":"Per page (default 50, at most 200)"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Ok"}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}},"post":{"operationId":"postTasks","summary":"Create a task","tags":["Tasks"],"security":[{"bearer":[]}],"x-scopes":["write:tasks"],"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","maxLength":200},"description":"Any unique string; a retry with the same key and body gets the first answer"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Ok"}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["title"],"properties":{"title":{"type":"string","maxLength":300},"notes":{"type":["string","null"],"maxLength":10000},"status":{"type":"string","enum":["todo","doing","waiting","done"]},"label":{"type":["string","null"],"maxLength":60},"due_date":{"type":["string","null"],"format":"date"},"important":{"type":"boolean"},"client_id":{"type":["string","null"],"format":"uuid","description":"The client (audit id)"},"assignee":{"type":["string","null"],"maxLength":200,"description":"An email address, or a name such as Matt or Guy, matched to an admin"},"remind_at":{"type":["string","null"],"format":"date-time"},"outcome":{"type":["string","null"],"enum":["no_answer","voicemail","spoke","emailed","not_interested"]},"done_note":{"type":["string","null"],"maxLength":4000},"notify":{"type":"boolean","description":"Email the person it is assigned to (internal staff only)"}}}}}}}},"/api/v1/tasks/{id}":{"patch":{"operationId":"patchTasksId","summary":"Change or finish a task (status done sets done_at)","tags":["Tasks"],"security":[{"bearer":[]}],"x-scopes":["write:tasks"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","maxLength":200}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Ok"}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"title":{"type":"string","maxLength":300},"notes":{"type":["string","null"],"maxLength":10000},"status":{"type":"string","enum":["todo","doing","waiting","done"]},"label":{"type":["string","null"],"maxLength":60},"due_date":{"type":["string","null"],"format":"date"},"important":{"type":"boolean"},"client_id":{"type":["string","null"],"format":"uuid","description":"The client (audit id)"},"assignee":{"type":["string","null"],"maxLength":200,"description":"An email address, or a name such as Matt or Guy, matched to an admin"},"remind_at":{"type":["string","null"],"format":"date-time"},"outcome":{"type":["string","null"],"enum":["no_answer","voicemail","spoke","emailed","not_interested"]},"done_note":{"type":["string","null"],"maxLength":4000},"notify":{"type":"boolean","description":"Email the person it is assigned to (internal staff only)"}}}}}}}},"/api/v1/tasks/bulk":{"post":{"operationId":"postTasksBulk","summary":"Create or change up to 50 tasks","tags":["Tasks"],"security":[{"bearer":[]}],"x-scopes":["write:tasks"],"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","maxLength":200},"description":"Any unique string; a retry with the same key and body gets the first answer"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Ok"}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["items"],"properties":{"items":{"type":"array","items":{"type":"object"},"maxItems":50,"minItems":1,"description":"Each { op: create|update, id (update), ...task fields }"}}}}}}}},"/api/v1/clients/{id}/time-entries":{"get":{"operationId":"getClientsIdTimeentries","summary":"A client’s time log","tags":["Monthly"],"security":[{"bearer":[]}],"x-scopes":["read:monthly","write:time"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"month","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-(0[1-9]|1[0-2])$","description":"YYYY-MM"}},{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["approved","pending"]}},{"name":"source","in":"query","required":false,"schema":{"type":"string","enum":["person","ai"]}},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100000,"description":"Page, from 1"}},{"name":"per_page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":200,"description":"Per page (default 50, at most 200)"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Ok"}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}},"post":{"operationId":"postClientsIdTimeentries","summary":"Log time (write:time: AI-assisted, waiting for approval)","tags":["Monthly"],"security":[{"bearer":[]}],"x-scopes":["write:monthly","write:time"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","maxLength":200},"description":"Any unique string; a retry with the same key and body gets the first answer"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Ok"}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"date":{"type":"string","format":"date","description":"When the work was done (default today, London)"},"task":{"type":"string","maxLength":300,"description":"What was done"},"area":{"type":"string","enum":["Website","SEO and content","Google Business Profile","Google Merchant Center","Ads","Social media","Reviews","Tracking and reporting","Hosting and security","Meetings and calls","Other"]},"minutes":{"type":"integer","minimum":1,"maximum":1440,"description":"Our team’s time, in minutes"},"source":{"type":"string","enum":["person","ai"]},"tool":{"type":"string","maxLength":40,"description":"For AI-assisted work: Claude, ChatGPT, Grok, Gemini, Copilot or Other"},"type":{"type":"string","enum":["content","seo","code","research","design","admin"],"description":"For AI-assisted work: the type of work, which sets the factor"},"hands_on_minutes":{"type":"integer","minimum":1,"maximum":1440,"description":"For AI-assisted work: the time a person spent on it"},"factor":{"type":"number","minimum":1,"maximum":10,"description":"For AI-assisted work: instead of the type’s factor (write:monthly only)"},"links":{"type":["string","null"],"maxLength":1000},"status":{"type":"string","enum":["approved","pending"]}}}}}}}},"/api/v1/time-entries/{id}":{"patch":{"operationId":"patchTimeentriesId","summary":"Change or approve a time entry","tags":["Monthly"],"security":[{"bearer":[]}],"x-scopes":["write:monthly"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","maxLength":200}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Ok"}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"date":{"type":"string","format":"date","description":"When the work was done (default today, London)"},"task":{"type":"string","maxLength":300,"description":"What was done"},"area":{"type":"string","enum":["Website","SEO and content","Google Business Profile","Google Merchant Center","Ads","Social media","Reviews","Tracking and reporting","Hosting and security","Meetings and calls","Other"]},"minutes":{"type":"integer","minimum":1,"maximum":1440,"description":"Our team’s time, in minutes"},"hands_on_minutes":{"type":"integer","minimum":1,"maximum":1440,"description":"For AI-assisted work: the time a person spent on it"},"factor":{"type":"number","minimum":1,"maximum":10,"description":"For AI-assisted work: instead of the type’s factor (write:monthly only)"},"links":{"type":["string","null"],"maxLength":1000},"status":{"type":"string","enum":["approved","pending"]}}}}}}}},"/api/v1/clients/{id}/monthly":{"get":{"operationId":"getClientsIdMonthly","summary":"A month: the report, the hours and the log","tags":["Monthly"],"security":[{"bearer":[]}],"x-scopes":["read:monthly"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"month","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-(0[1-9]|1[0-2])$","description":"YYYY-MM (default: the month a report is being written for)"}},{"name":"internal","in":"query","required":false,"schema":{"type":"boolean","description":"Include entries waiting for approval and who logged what"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Ok"}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/clients/{id}/monthly/{month}":{"put":{"operationId":"putClientsIdMonthlyMonth","summary":"Save a month’s report (fields left out are kept); rebuilds the client’s copy","tags":["Monthly"],"security":[{"bearer":[]}],"x-scopes":["write:monthly"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"month","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","maxLength":200}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Ok"}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"summary":{"type":["string","null"],"maxLength":5000},"results":{"type":["string","null"],"maxLength":5000,"description":"One per line"},"done":{"type":["string","null"],"maxLength":10000,"description":"One per line; leave out to fill from the time log when there is nothing yet"},"next_month":{"type":["string","null"],"maxLength":5000},"needs":{"type":["string","null"],"maxLength":5000},"show_log":{"type":"boolean"}}}}}}}},"/api/v1/clients/{id}/monthly/{month}/attachments":{"post":{"operationId":"postClientsIdMonthlyMonthAttachments","summary":"Add a screenshot, PDF or export to a month’s report (up to 4 MB)","tags":["Monthly"],"security":[{"bearer":[]}],"x-scopes":["write:monthly"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"month","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","maxLength":200},"description":"Any unique string; a retry with the same key and body gets the first answer"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Ok"}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["filename","content_base64"],"properties":{"filename":{"type":"string","maxLength":160,"description":"With its extension: png, jpg, webp, gif, pdf, csv, xls or xlsx"},"content_base64":{"type":"string","maxLength":5800000,"description":"The file, base64 (at most 4 MB once decoded)"},"caption":{"type":["string","null"],"maxLength":200,"description":"Shown under it on the report"}}}}}}}},"/api/v1/clients/{id}/monthly/{month}/attachments/{n}":{"delete":{"operationId":"deleteClientsIdMonthlyMonthAttachmentsN","summary":"Remove a file from a month’s report (by its index)","tags":["Monthly"],"security":[{"bearer":[]}],"x-scopes":["write:monthly"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"month","in":"path","required":true,"schema":{"type":"string"}},{"name":"n","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Ok"}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/clients/{id}/monthly/{month}/pdf":{"post":{"operationId":"postClientsIdMonthlyMonthPdf","summary":"The saved report as a PDF (base64). Sending it stays with a person","tags":["Monthly"],"security":[{"bearer":[]}],"x-scopes":["read:monthly"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"month","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","maxLength":200}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Ok"}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/sites":{"get":{"operationId":"getSites","summary":"List connected websites","tags":["Sites"],"security":[{"bearer":[]}],"x-scopes":["read:sites"],"parameters":[{"name":"q","in":"query","required":false,"schema":{"type":"string","maxLength":200}},{"name":"status","in":"query","required":false,"schema":{"type":"string","maxLength":40,"description":"last_status, e.g. ok or unreachable"}},{"name":"kind","in":"query","required":false,"schema":{"type":"string","enum":["tt","other"]}},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100000,"description":"Page, from 1"}},{"name":"per_page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":200,"description":"Per page (default 50, at most 200)"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Ok"}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}},"post":{"operationId":"postSites","summary":"Add a website (TT Theme: paste + token; other: url)","tags":["Sites"],"security":[{"bearer":[]}],"x-scopes":["write:sites"],"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","maxLength":200},"description":"Any unique string; a retry with the same key and body gets the first answer"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Ok"}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"name":{"type":"string","maxLength":180},"paste":{"type":"string","maxLength":1000,"description":"TT Theme: the Insights share address from Appearance → Theme Settings → Integrations"},"token":{"type":"string","maxLength":300,"description":"TT Theme: the share token (kept encrypted, never shown again)"},"url":{"type":"string","format":"uri","description":"Any other website: its address"},"save_anyway":{"type":"boolean","description":"Save a TT site even if the first test fails"}}}}}}}},"/api/v1/sites/{id}":{"get":{"operationId":"getSitesId","summary":"One website","tags":["Sites"],"security":[{"bearer":[]}],"x-scopes":["read:sites"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Ok"}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}},"patch":{"operationId":"patchSitesId","summary":"Rename, reconnect, set market, or switch on/off","tags":["Sites"],"security":[{"bearer":[]}],"x-scopes":["write:sites"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","maxLength":200}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Ok"}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"name":{"type":"string","maxLength":180},"paste":{"type":"string","maxLength":1000,"description":"TT Theme: the Insights share address from Appearance → Theme Settings → Integrations"},"token":{"type":"string","maxLength":300,"description":"TT Theme: the share token (kept encrypted, never shown again)"},"market":{"type":"string","enum":["GB","US"]},"enabled":{"type":"boolean"}}}}}}},"delete":{"operationId":"deleteSitesId","summary":"Switch a website off (purge=1 removes it)","tags":["Sites"],"security":[{"bearer":[]}],"x-scopes":["write:sites"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"purge","in":"query","required":false,"schema":{"type":"boolean","description":"Remove for good instead of switching off"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Ok"}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/sites/{id}/insights":{"get":{"operationId":"getSitesIdInsights","summary":"Its latest figures (no token)","tags":["Sites"],"security":[{"bearer":[]}],"x-scopes":["read:sites"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Ok"}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/sites/{id}/test":{"post":{"operationId":"postSitesIdTest","summary":"Test the connection now","tags":["Sites"],"security":[{"bearer":[]}],"x-scopes":["write:sites"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","maxLength":200}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Ok"}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/sites/{id}/refresh":{"post":{"operationId":"postSitesIdRefresh","summary":"Fetch its figures now","tags":["Sites"],"security":[{"bearer":[]}],"x-scopes":["write:sites"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","maxLength":200}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Ok"}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/sites/{id}/metrics/refresh":{"post":{"operationId":"postSitesIdMetricsRefresh","summary":"Refresh Google and Bing figures","tags":["Sites"],"security":[{"bearer":[]}],"x-scopes":["write:sites"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","maxLength":200}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Ok"}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/sites/{id}/speed":{"post":{"operationId":"postSitesIdSpeed","summary":"Run a speed test (background)","tags":["Sites"],"security":[{"bearer":[]}],"x-scopes":["write:sites"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","maxLength":200}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Ok"}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/sites/{id}/domain":{"post":{"operationId":"postSitesIdDomain","summary":"Check DNS, expiry and SSL (background)","tags":["Sites"],"security":[{"bearer":[]}],"x-scopes":["write:sites"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","maxLength":200}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Ok"}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/sites/{id}/login":{"post":{"operationId":"postSitesIdLogin","summary":"Save the WordPress one-click sign-in key (encrypted)","tags":["Sites"],"security":[{"bearer":[]}],"x-scopes":["write:sites"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","maxLength":200}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Ok"}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["key_id","secret"],"properties":{"key_id":{"type":"string","maxLength":120},"secret":{"type":"string","maxLength":400}}}}}}}},"/api/v1/clients/{id}/credentials":{"get":{"operationId":"getClientsIdCredentials","summary":"Whether a login is saved (never the login)","tags":["Credentials"],"security":[{"bearer":[]}],"x-scopes":["read:vault"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Ok"}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/clients/{id}/credentials/{kind}":{"put":{"operationId":"putClientsIdCredentialsKind","summary":"Save a login (encrypted by the vault)","tags":["Credentials"],"security":[{"bearer":[]}],"x-scopes":["write:vault"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"kind","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","maxLength":200}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Ok"}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"username":{"type":["string","null"],"maxLength":300},"password":{"type":["string","null"],"maxLength":300},"notes":{"type":["string","null"],"maxLength":4000},"keep_password":{"type":"boolean","description":"Keep the saved password when none is sent"}}}}}}},"delete":{"operationId":"deleteClientsIdCredentialsKind","summary":"Remove a login","tags":["Credentials"],"security":[{"bearer":[]}],"x-scopes":["write:vault"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"kind","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Ok"}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/clients/{id}/credentials/{kind}/reveal":{"post":{"operationId":"postClientsIdCredentialsKindReveal","summary":"Read the password (reveal:vault only; logged)","tags":["Credentials"],"security":[{"bearer":[]}],"x-scopes":["reveal:vault"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"kind","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","maxLength":200}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Ok"}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["why"],"properties":{"why":{"type":"string","maxLength":300,"description":"What it is needed for. Kept in the audit log."}}}}}}}},"/api/v1/keys":{"get":{"operationId":"getKeys","summary":"List API keys","tags":["Keys"],"security":[{"bearer":[]}],"x-scopes":["admin:keys"],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Ok"}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}},"post":{"operationId":"postKeys","summary":"Make a key (shown once)","tags":["Keys"],"security":[{"bearer":[]}],"x-scopes":["admin:keys"],"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","maxLength":200},"description":"Any unique string; a retry with the same key and body gets the first answer"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Ok"}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["label","scopes"],"properties":{"label":{"type":"string","maxLength":60},"scopes":{"type":"array","items":{"type":"string","enum":["read:clients","write:clients","read:tasks","write:tasks","read:monthly","write:monthly","write:time","read:sites","write:sites","read:vault","write:vault","reveal:vault","admin:keys"]},"maxItems":20,"minItems":1},"rate_limit_per_min":{"type":"integer","minimum":1,"maximum":1000},"expires_in_days":{"type":"integer","minimum":1,"maximum":3650,"description":"Stops working after this many days (default: never)"}}}}}}}},"/api/v1/keys/{id}":{"delete":{"operationId":"deleteKeysId","summary":"Turn a key off","tags":["Keys"],"security":[{"bearer":[]}],"x-scopes":["admin:keys"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Ok"}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/v1/keys/{id}/rotate":{"post":{"operationId":"postKeysIdRotate","summary":"A new key in place of this one; the old one keeps working for grace_hours","tags":["Keys"],"security":[{"bearer":[]}],"x-scopes":["admin:keys"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","maxLength":200}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Ok"}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"grace_hours":{"type":"integer","minimum":0,"maximum":168,"description":"How long the old key keeps working (default 24; 0 turns it off now)"}}}}}}}}}}