{"openapi":"3.1.0","info":{"title":"articles.fast API","version":"1.0.0","description":"Write, humanize, score and publish articles. Docs: https://articles.fast/docs/api"},"servers":[{"url":"https://articles.fast/api/v1"}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer","description":"API key from Account (af_…) or an OAuth access token."}},"responses":{"Error":{"description":"Error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}}}},"paths":{"/me":{"get":{"operationId":"getAccount","summary":"Workspace, plan and credits","responses":{"200":{"description":"OK"},"401":{"$ref":"#/components/responses/Error"}}}},"/articles":{"get":{"operationId":"listArticles","summary":"List articles","parameters":[{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":20}},{"name":"site_id","in":"query","schema":{"type":"integer"}},{"name":"status","in":"query","schema":{"type":"string"}},{"name":"before","in":"query","schema":{"type":"string","format":"date-time"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":["string","null"]},"status":{"type":"string","enum":["queued","drafting","scoring","humanizing","polishing","checking","done","failed"]},"mode":{"type":"string"},"template":{"type":["string","null"]},"site_id":{"type":["integer","null"]},"words":{"type":["integer","null"]},"credits_used":{"type":"integer"},"scores":{"type":"object","properties":{"before":{"type":["object","null"],"properties":{"label":{"type":["string","null"]},"human":{"type":"integer"},"ai":{"type":"integer"},"error":{"type":"boolean"}}},"after":{"type":["object","null"],"properties":{"label":{"type":["string","null"]},"human":{"type":"integer"},"ai":{"type":"integer"},"error":{"type":"boolean"}}},"independent":{"type":["object","null"],"properties":{"label":{"type":["string","null"]},"human":{"type":"integer"},"ai":{"type":"integer"},"error":{"type":"boolean"}}}}},"text":{"type":["string","null"]},"error":{"type":["string","null"]},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"url":{"type":"string"}}}},"has_more":{"type":"boolean"},"next_before":{"type":["string","null"]}}}}}},"401":{"$ref":"#/components/responses/Error"}}},"post":{"operationId":"createArticle","summary":"Start an article (spends credits)","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":100,"pattern":"^[A-Za-z0-9_\\-:.]+$"},"description":"Replays the original response for 24 hours instead of creating twice."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["mode"],"properties":{"mode":{"type":"string","enum":["generate","paste"]},"topic":{"type":"string","maxLength":300},"text":{"type":"string"},"title":{"type":"string","maxLength":200},"keyword":{"type":"string","maxLength":200},"audience":{"type":"string","maxLength":300},"notes":{"type":"string","maxLength":4000},"template":{"type":"string","enum":["guide","howto","comparison","explainer"]},"length":{"type":"integer","enum":[800,1500,2500]},"site_id":{"type":"integer"}}}}}},"responses":{"202":{"description":"Accepted","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string"},"credits_used":{"type":"integer"},"credits_left":{"type":"integer"}}}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"402":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/articles/{id}":{"get":{"operationId":"getArticle","summary":"Get an article","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"Article id"},{"name":"include_text","in":"query","schema":{"type":"boolean","default":true}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":["string","null"]},"status":{"type":"string","enum":["queued","drafting","scoring","humanizing","polishing","checking","done","failed"]},"mode":{"type":"string"},"template":{"type":["string","null"]},"site_id":{"type":["integer","null"]},"words":{"type":["integer","null"]},"credits_used":{"type":"integer"},"scores":{"type":"object","properties":{"before":{"type":["object","null"],"properties":{"label":{"type":["string","null"]},"human":{"type":"integer"},"ai":{"type":"integer"},"error":{"type":"boolean"}}},"after":{"type":["object","null"],"properties":{"label":{"type":["string","null"]},"human":{"type":"integer"},"ai":{"type":"integer"},"error":{"type":"boolean"}}},"independent":{"type":["object","null"],"properties":{"label":{"type":["string","null"]},"human":{"type":"integer"},"ai":{"type":"integer"},"error":{"type":"boolean"}}}}},"text":{"type":["string","null"]},"error":{"type":["string","null"]},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"url":{"type":"string"}}}}}},"404":{"$ref":"#/components/responses/Error"}}}},"/articles/{id}/publish":{"post":{"operationId":"publishArticle","summary":"Publish or schedule to WordPress","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"Article id"},{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":100,"pattern":"^[A-Za-z0-9_\\-:.]+$"},"description":"Replays the original response for 24 hours instead of creating twice."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["site_id"],"properties":{"site_id":{"type":"integer"},"publish_at":{"type":"string","format":"date-time"},"as_draft":{"type":"boolean"},"image_id":{"type":"integer"}}}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"integer"},"article_id":{"type":"string"},"site_id":{"type":"integer"},"publish_at":{"type":"string","format":"date-time"},"as_draft":{"type":"boolean"},"status":{"type":"string","enum":["scheduled","publishing","published","failed"]},"post_url":{"type":["string","null"]},"error":{"type":["string","null"]},"finished_at":{"type":["string","null"]}}}}}},"400":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/sites":{"get":{"operationId":"listSites","summary":"List sites","responses":{"200":{"description":"OK"}}}},"/schedule":{"get":{"operationId":"listSchedule","summary":"List publishing jobs","parameters":[{"name":"site_id","in":"query","schema":{"type":"integer"}},{"name":"status","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"article_id":{"type":"string"},"site_id":{"type":"integer"},"publish_at":{"type":"string","format":"date-time"},"as_draft":{"type":"boolean"},"status":{"type":"string","enum":["scheduled","publishing","published","failed"]},"post_url":{"type":["string","null"]},"error":{"type":["string","null"]},"finished_at":{"type":["string","null"]}}}}}}}}}}}},"/schedule/{id}":{"get":{"operationId":"getScheduleItem","summary":"Get a publishing job","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"Schedule id"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"integer"},"article_id":{"type":"string"},"site_id":{"type":"integer"},"publish_at":{"type":"string","format":"date-time"},"as_draft":{"type":"boolean"},"status":{"type":"string","enum":["scheduled","publishing","published","failed"]},"post_url":{"type":["string","null"]},"error":{"type":["string","null"]},"finished_at":{"type":["string","null"]}}}}}},"404":{"$ref":"#/components/responses/Error"}}},"delete":{"operationId":"cancelScheduleItem","summary":"Cancel a scheduled item","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"Schedule id"}],"responses":{"200":{"description":"Cancelled"},"409":{"$ref":"#/components/responses/Error"}}}}}}