{"openapi":"3.1.0","info":{"title":"Prestoclick native API","version":"1","description":"JSON, camelCase, Bearer authentication and real HTTP status codes. Prestoclick also has a PP-v2-compatible API for existing SMM panel tooling, documented at https://prestoclick.com/api#pp-v2. Full reference with examples: https://prestoclick.com/api."},"servers":[{"url":"https://prestoclick.com/api/v1"}],"security":[{"bearerAuth":[]}],"paths":{"/balance":{"get":{"summary":"Read available credit","responses":{"200":{"description":"Balance","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Balance"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/orders":{"get":{"summary":"List your orders, newest first","responses":{"200":{"description":"Orders","content":{"application/json":{"schema":{"type":"object","properties":{"orders":{"type":"array","items":{"$ref":"#/components/schemas/Order"}}}}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/orders/{id}":{"get":{"summary":"Read one order","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"Order id"}],"responses":{"200":{"description":"Order","content":{"application/json":{"schema":{"type":"object","properties":{"order":{"$ref":"#/components/schemas/Order"}}}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found, or owned by another account (indistinguishable on purpose)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/campaigns":{"get":{"summary":"List your campaigns, newest first","responses":{"200":{"description":"Campaigns","content":{"application/json":{"schema":{"type":"object","properties":{"campaigns":{"type":"array","items":{"$ref":"#/components/schemas/Campaign"}}}}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"summary":"Create a campaign","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CampaignCreate"}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object","properties":{"campaign":{"$ref":"#/components/schemas/Campaign"}}}}}},"400":{"description":"Invalid JSON, validation failure, or a campaign that cannot be enabled","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/campaigns/{id}":{"get":{"summary":"Read one campaign","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"Campaign id"}],"responses":{"200":{"description":"Campaign","content":{"application/json":{"schema":{"type":"object","properties":{"campaign":{"$ref":"#/components/schemas/Campaign"}}}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found, or owned by another account (indistinguishable on purpose)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"summary":"Update campaign fields (enable through /resume, not here)","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"Campaign id"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CampaignUpdate"}}}},"responses":{"200":{"description":"Updated","content":{"application/json":{"schema":{"type":"object","properties":{"campaign":{"$ref":"#/components/schemas/Campaign"}}}}}},"400":{"description":"Invalid JSON, validation failure, or a campaign that cannot be enabled","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found, or owned by another account (indistinguishable on purpose)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"summary":"Permanently delete a campaign","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"Campaign id"}],"responses":{"204":{"description":"Deleted"},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found, or owned by another account (indistinguishable on purpose)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/campaigns/{id}/pause":{"post":{"summary":"Pause an enabled campaign","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"Campaign id"}],"responses":{"200":{"description":"Paused","content":{"application/json":{"schema":{"type":"object","properties":{"campaign":{"$ref":"#/components/schemas/Campaign"}}}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found, or owned by another account (indistinguishable on purpose)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/campaigns/{id}/resume":{"post":{"summary":"Validate and enable a paused campaign","description":"Stale planned runs are reported as missed instead of firing in a burst.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"Campaign id"}],"responses":{"200":{"description":"Resumed","content":{"application/json":{"schema":{"type":"object","properties":{"campaign":{"$ref":"#/components/schemas/Campaign"},"missedRuns":{"type":"integer"}}}}}},"400":{"description":"Invalid JSON, validation failure, or a campaign that cannot be enabled","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found, or owned by another account (indistinguishable on purpose)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/campaigns/{id}/runs":{"get":{"summary":"List a campaign's runs","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"Campaign id"}],"responses":{"200":{"description":"Runs","content":{"application/json":{"schema":{"type":"object","properties":{"runs":{"type":"array","items":{"$ref":"#/components/schemas/Run"}}}}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found, or owned by another account (indistinguishable on purpose)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/campaigns/{id}/runs/{runId}":{"get":{"summary":"Read one run","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"Campaign id"},{"name":"runId","in":"path","required":true,"schema":{"type":"string"},"description":"Run id"}],"responses":{"200":{"description":"Run","content":{"application/json":{"schema":{"type":"object","properties":{"run":{"$ref":"#/components/schemas/Run"}}}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found, or owned by another account (indistinguishable on purpose)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"Your API key from the API page after signing in"}},"schemas":{"Error":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"fields":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}},"blockers":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"text":{"type":"string"}}}}}},"Balance":{"type":"object","properties":{"balance":{"type":"string","pattern":"^\\d+(?:\\.\\d{1,6})?$","description":"Decimal string, up to 6 places"},"currency":{"const":"USD"}}},"Order":{"type":"object","properties":{"id":{"type":"string"},"providerServiceId":{"type":"string","description":"The product id"},"link":{"type":"string"},"quantity":{"type":"integer"},"params":{"type":"object"},"status":{"type":"string"},"startCount":{"anyOf":[{"type":"integer"},{"type":"null"}]},"remains":{"anyOf":[{"type":"integer"},{"type":"null"}]},"customerRate":{"type":"string","pattern":"^\\d+(?:\\.\\d{1,6})?$","description":"Price per 1,000 you paid"},"customerCharge":{"type":"string","pattern":"^\\d+(?:\\.\\d{1,6})?$","description":"Total charged"},"scheduleId":{"anyOf":[{"type":"string"},{"type":"null"}]},"scheduleRunId":{"anyOf":[{"type":"string"},{"type":"null"}]},"placedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}},"CampaignCreate":{"type":"object","required":["name","link","target","mode"],"additionalProperties":false,"properties":{"name":{"type":"string","minLength":1},"link":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"type":["string","number"]},"default":{}},"timezone":{"type":"string","minLength":1,"default":"UTC"},"enabled":{"type":"boolean","default":false,"description":"Validate and start the campaign immediately"},"dryRun":{"type":"boolean","default":false},"target":{"oneOf":[{"type":"object","required":["serviceGroupId"],"additionalProperties":false,"properties":{"serviceGroupId":{"type":"string"}}},{"type":"object","required":["providerId","providerServiceId"],"additionalProperties":false,"properties":{"providerId":{"type":"string"},"providerServiceId":{"type":"string"}}}]},"mode":{"oneOf":[{"type":"object","required":["kind","quantity","runAt"],"properties":{"kind":{"const":"once"},"quantity":{"type":"integer","minimum":1},"runAt":{"type":"string","format":"date-time"}}},{"type":"object","required":["kind","quantity","recurrenceRule"],"properties":{"kind":{"const":"repeat"},"quantity":{"type":"integer","minimum":1},"recurrenceRule":{"type":"object","required":["version","freq","interval","timesOfDay","startAt"],"properties":{"version":{"const":1},"freq":{"enum":["hour","day","week","month"]},"interval":{"type":"integer","minimum":1},"timesOfDay":{"type":"array","items":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"}},"weekdays":{"type":"array","items":{"type":"integer","minimum":0,"maximum":6}},"monthDay":{"anyOf":[{"type":"integer","minimum":1,"maximum":31},{"const":"last"}]},"startAt":{"type":"string"}}},"quietHours":{"type":"object","required":["from","to","action"],"properties":{"from":{"type":"string"},"to":{"type":"string"},"action":{"enum":["skip","shift"]}}},"maxRuns":{"type":"integer","minimum":1},"untilAt":{"type":"string","format":"date-time"}}},{"type":"object","required":["kind","totalQuantity","startAt","endAt","distribution"],"description":"Provide exactly one of chunksPerDay or chunkCount.","properties":{"kind":{"const":"drip"},"totalQuantity":{"type":"integer","minimum":1},"startAt":{"type":"string","format":"date-time"},"endAt":{"type":"string","format":"date-time"},"chunksPerDay":{"type":"number","exclusiveMinimum":0},"chunkCount":{"type":"integer","minimum":1},"minChunk":{"type":"integer","minimum":1},"maxChunk":{"type":"integer","minimum":1},"jitterMinutes":{"type":"integer","minimum":0},"distribution":{"enum":["even","random","front_loaded"]},"chunkSeed":{"type":"integer"}}}]},"maxRate":{"type":"string","pattern":"^\\d+(?:\\.\\d{1,6})?$","description":"Highest customer price per 1,000 the campaign may pay"},"maxSpendTotal":{"type":"string","pattern":"^\\d+(?:\\.\\d{1,6})?$","description":"Spend ceiling for the whole campaign"},"requireBalanceAbove":{"type":"string","pattern":"^\\d+(?:\\.\\d{1,6})?$","description":"Pause instead of ordering when credit would fall below this"}}},"CampaignUpdate":{"type":"object","minProperties":1,"additionalProperties":false,"properties":{"name":{"type":"string","minLength":1},"link":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"type":["string","number"]},"default":{}},"timezone":{"type":"string","minLength":1,"default":"UTC"},"dryRun":{"type":"boolean","default":false},"target":{"oneOf":[{"type":"object","required":["serviceGroupId"],"additionalProperties":false,"properties":{"serviceGroupId":{"type":"string"}}},{"type":"object","required":["providerId","providerServiceId"],"additionalProperties":false,"properties":{"providerId":{"type":"string"},"providerServiceId":{"type":"string"}}}]},"mode":{"oneOf":[{"type":"object","required":["kind","quantity","runAt"],"properties":{"kind":{"const":"once"},"quantity":{"type":"integer","minimum":1},"runAt":{"type":"string","format":"date-time"}}},{"type":"object","required":["kind","quantity","recurrenceRule"],"properties":{"kind":{"const":"repeat"},"quantity":{"type":"integer","minimum":1},"recurrenceRule":{"type":"object","required":["version","freq","interval","timesOfDay","startAt"],"properties":{"version":{"const":1},"freq":{"enum":["hour","day","week","month"]},"interval":{"type":"integer","minimum":1},"timesOfDay":{"type":"array","items":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"}},"weekdays":{"type":"array","items":{"type":"integer","minimum":0,"maximum":6}},"monthDay":{"anyOf":[{"type":"integer","minimum":1,"maximum":31},{"const":"last"}]},"startAt":{"type":"string"}}},"quietHours":{"type":"object","required":["from","to","action"],"properties":{"from":{"type":"string"},"to":{"type":"string"},"action":{"enum":["skip","shift"]}}},"maxRuns":{"type":"integer","minimum":1},"untilAt":{"type":"string","format":"date-time"}}},{"type":"object","required":["kind","totalQuantity","startAt","endAt","distribution"],"description":"Provide exactly one of chunksPerDay or chunkCount.","properties":{"kind":{"const":"drip"},"totalQuantity":{"type":"integer","minimum":1},"startAt":{"type":"string","format":"date-time"},"endAt":{"type":"string","format":"date-time"},"chunksPerDay":{"type":"number","exclusiveMinimum":0},"chunkCount":{"type":"integer","minimum":1},"minChunk":{"type":"integer","minimum":1},"maxChunk":{"type":"integer","minimum":1},"jitterMinutes":{"type":"integer","minimum":0},"distribution":{"enum":["even","random","front_loaded"]},"chunkSeed":{"type":"integer"}}}]},"maxRate":{"type":"string","pattern":"^\\d+(?:\\.\\d{1,6})?$","description":"Highest customer price per 1,000 the campaign may pay"},"maxSpendTotal":{"type":"string","pattern":"^\\d+(?:\\.\\d{1,6})?$","description":"Spend ceiling for the whole campaign"},"requireBalanceAbove":{"type":"string","pattern":"^\\d+(?:\\.\\d{1,6})?$","description":"Pause instead of ordering when credit would fall below this"}}},"Campaign":{"type":"object","description":"Fields not used by the campaign's kind are null.","properties":{"id":{"type":"string"},"name":{"type":"string"},"kind":{"enum":["once","repeat","drip"]},"link":{"type":"string"},"params":{"type":"object"},"timezone":{"type":"string"},"enabled":{"type":"boolean"},"pauseKind":{"anyOf":[{"type":"string"},{"type":"null"}]},"pausedReason":{"anyOf":[{"type":"string"},{"type":"null"}]},"pausedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"target":{"oneOf":[{"type":"object","properties":{"serviceGroupId":{"type":"string"}}},{"type":"object","properties":{"providerServiceId":{"type":"string"}}}]},"quantity":{"anyOf":[{"type":"integer"},{"type":"null"}]},"runAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"recurrenceRule":{"anyOf":[{"type":"object","required":["version","freq","interval","timesOfDay","startAt"],"properties":{"version":{"const":1},"freq":{"enum":["hour","day","week","month"]},"interval":{"type":"integer","minimum":1},"timesOfDay":{"type":"array","items":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"}},"weekdays":{"type":"array","items":{"type":"integer","minimum":0,"maximum":6}},"monthDay":{"anyOf":[{"type":"integer","minimum":1,"maximum":31},{"const":"last"}]},"startAt":{"type":"string"}}},{"type":"null"}]},"quietHours":{"anyOf":[{"type":"object"},{"type":"null"}]},"maxRuns":{"anyOf":[{"type":"integer"},{"type":"null"}]},"untilAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"totalQuantity":{"anyOf":[{"type":"integer"},{"type":"null"}]},"startAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"endAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"chunksPerDay":{"anyOf":[{"type":"number"},{"type":"null"}]},"chunkCount":{"anyOf":[{"type":"integer"},{"type":"null"}]},"minChunk":{"anyOf":[{"type":"integer"},{"type":"null"}]},"maxChunk":{"anyOf":[{"type":"integer"},{"type":"null"}]},"jitterMinutes":{"anyOf":[{"type":"integer"},{"type":"null"}]},"distribution":{"anyOf":[{"enum":["even","random","front_loaded"]},{"type":"null"}]},"maxRate":{"anyOf":[{"type":"string","pattern":"^\\d+(?:\\.\\d{1,6})?$","description":"Decimal string, up to 6 places"},{"type":"null"}]},"maxSpendTotal":{"anyOf":[{"type":"string","pattern":"^\\d+(?:\\.\\d{1,6})?$","description":"Decimal string, up to 6 places"},{"type":"null"}]},"requireBalanceAbove":{"anyOf":[{"type":"string","pattern":"^\\d+(?:\\.\\d{1,6})?$","description":"Decimal string, up to 6 places"},{"type":"null"}]},"dryRun":{"type":"boolean"},"nextRunAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"lastRunAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"runsFired":{"type":"integer"},"runsSucceeded":{"type":"integer"},"runsFailed":{"type":"integer"},"runsSkipped":{"type":"integer"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}},"Run":{"type":"object","properties":{"id":{"type":"string"},"campaignId":{"type":"string"},"seq":{"type":"integer"},"scheduledFor":{"type":"string","format":"date-time"},"plannedQuantity":{"type":"integer"},"status":{"type":"string"},"orderId":{"anyOf":[{"type":"string"},{"type":"null"}]},"attempt":{"type":"integer"},"error":{"anyOf":[{"type":"string"},{"type":"null"}]},"firedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}}}}}