{"openapi":"3.1.0","info":{"title":"AutoSEO Public API","version":"1.0.0","description":"Read websites, articles, backlinks, and period stats. Update article title, body, and featured image. Inserted backlink anchors and internal links are protected."},"servers":[{"url":"https:\/\/getautoseo.com","description":"AutoSEO"}],"security":[{"bearerAuth":[]},{"apiKeyHeader":[]}],"tags":[{"name":"Sites"},{"name":"Articles"},{"name":"Backlinks"},{"name":"Stats"},{"name":"Docs"}],"paths":{"\/api\/v1\/sites":{"get":{"tags":["Sites"],"operationId":"listSites","summary":"List websites on this account","parameters":[{"name":"page","in":"query","schema":{"type":"integer","minimum":1}},{"name":"per_page","in":"query","schema":{"type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"Paginated websites","content":{"application\/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#\/components\/schemas\/Site"}},"meta":{"$ref":"#\/components\/schemas\/PageMeta"}}}}}},"401":{"description":"Error","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}},"403":{"description":"Error","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}}}}},"\/api\/v1\/sites\/{id}\/articles":{"get":{"tags":["Articles"],"operationId":"listArticles","summary":"List articles for one website","parameters":[{"name":"id","in":"path","required":true,"description":"Website id","schema":{"type":"integer"}},{"name":"from","in":"query","schema":{"type":"string","format":"date"}},{"name":"to","in":"query","schema":{"type":"string","format":"date"}},{"name":"status","in":"query","schema":{"type":"string"}},{"name":"page","in":"query","schema":{"type":"integer","minimum":1}},{"name":"per_page","in":"query","schema":{"type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"Paginated articles","content":{"application\/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#\/components\/schemas\/Article"}},"meta":{"$ref":"#\/components\/schemas\/PageMeta"}}}}}},"401":{"description":"Error","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}},"404":{"description":"Error","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}}}}},"\/api\/v1\/articles\/{id}":{"get":{"tags":["Articles"],"operationId":"getArticle","summary":"Get one article including HTML body and protected_links","parameters":[{"name":"id","in":"path","required":true,"description":"Article id","schema":{"type":"integer"}}],"responses":{"200":{"description":"Article with body","content":{"application\/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#\/components\/schemas\/ArticleWithBody"}}}}}},"401":{"description":"Error","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}},"404":{"description":"Error","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}}}},"put":{"tags":["Articles"],"operationId":"updateArticle","summary":"Update article title and HTML body","parameters":[{"name":"id","in":"path","required":true,"description":"Article id","schema":{"type":"integer"}}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","required":["body"],"properties":{"title":{"type":"string","maxLength":255},"body":{"type":"string","description":"HTML body. Same sanitising as the editor."},"reason":{"type":"string","maxLength":2000}}}}}},"responses":{"200":{"description":"Updated article","content":{"application\/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#\/components\/schemas\/ArticleWithBody"}}}}}},"401":{"description":"Error","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}},"404":{"description":"Error","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}},"422":{"description":"Error","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}},"429":{"description":"Error","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}}}}},"\/api\/v1\/articles\/{id}\/featured-image":{"post":{"tags":["Articles"],"operationId":"replaceFeaturedImage","summary":"Replace the article featured image","parameters":[{"name":"id","in":"path","required":true,"description":"Article id","schema":{"type":"integer"}}],"requestBody":{"required":true,"content":{"multipart\/form-data":{"schema":{"type":"object","properties":{"image":{"type":"string","format":"binary"},"url":{"type":"string","format":"uri"},"reason":{"type":"string"}}}},"application\/json":{"schema":{"type":"object","required":["url"],"properties":{"url":{"type":"string","format":"uri"},"reason":{"type":"string"}}}}}},"responses":{"200":{"description":"Article with new featured image","content":{"application\/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#\/components\/schemas\/Article"}}}}}},"401":{"description":"Error","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}},"404":{"description":"Error","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}},"422":{"description":"Error","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}},"429":{"description":"Error","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}}}}},"\/api\/v1\/sites\/{id}\/backlinks":{"get":{"tags":["Backlinks"],"operationId":"listBacklinks","summary":"List backlinks acquired for one website","parameters":[{"name":"id","in":"path","required":true,"description":"Website id","schema":{"type":"integer"}},{"name":"from","in":"query","schema":{"type":"string","format":"date"}},{"name":"to","in":"query","schema":{"type":"string","format":"date"}},{"name":"page","in":"query","schema":{"type":"integer","minimum":1}},{"name":"per_page","in":"query","schema":{"type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"Paginated backlinks","content":{"application\/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#\/components\/schemas\/Backlink"}},"meta":{"$ref":"#\/components\/schemas\/PageMeta"}}}}}},"401":{"description":"Error","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}},"404":{"description":"Error","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}}}}},"\/api\/v1\/sites\/{id}\/stats":{"get":{"tags":["Stats"],"operationId":"getStats","summary":"Article and backlink counts for a website in a period","parameters":[{"name":"id","in":"path","required":true,"description":"Website id","schema":{"type":"integer"}},{"name":"period","in":"query","schema":{"type":"string"},"description":"this_month, last_month, last_30_days, YYYY-MM, or YYYY-MM-DD"},{"name":"from","in":"query","schema":{"type":"string","format":"date"}},{"name":"to","in":"query","schema":{"type":"string","format":"date"}}],"responses":{"200":{"description":"Period stats","content":{"application\/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#\/components\/schemas\/Stats"}}}}}},"401":{"description":"Error","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}},"404":{"description":"Error","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}},"422":{"description":"Error","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}}}}},"\/api\/v1\/openapi.json":{"get":{"tags":["Docs"],"operationId":"getOpenApi","summary":"OpenAPI 3.1 document","security":[],"responses":{"200":{"description":"OpenAPI document","content":{"application\/json":{"schema":{"type":"object"}}}}}}}},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"Account API key"},"apiKeyHeader":{"type":"apiKey","in":"header","name":"X-API-Key"}},"schemas":{"Site":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":"string","nullable":true},"website_url":{"type":"string","nullable":true},"language":{"type":"string","nullable":true},"country":{"type":"string","nullable":true},"geographic_scope":{"type":"string","nullable":true},"industry":{"type":"string","nullable":true}}},"Article":{"type":"object","properties":{"id":{"type":"integer"},"site_id":{"type":"integer"},"title":{"type":"string","nullable":true},"url":{"type":"string","nullable":true},"status":{"type":"string","nullable":true},"published_at":{"type":"string","nullable":true},"target_keyword":{"type":"string","nullable":true},"word_count":{"type":"integer","nullable":true},"featured_image_url":{"type":"string","nullable":true}}},"ArticleWithBody":{"allOf":[{"$ref":"#\/components\/schemas\/Article"},{"type":"object","properties":{"body":{"type":"string"},"protected_links":{"type":"array","items":{"$ref":"#\/components\/schemas\/ProtectedLink"}}}}]},"ProtectedLink":{"type":"object","properties":{"type":{"type":"string","enum":["backlink","internal"]},"href":{"type":"string"},"text":{"type":"string"}}},"Backlink":{"type":"object","properties":{"id":{"type":"integer"},"acquired_at":{"type":"string","nullable":true},"source_domain":{"type":"string","nullable":true},"source_url":{"type":"string","nullable":true},"target_url":{"type":"string","nullable":true},"anchor_text":{"type":"string","nullable":true},"anchor_type":{"type":"string","nullable":true},"status":{"type":"string","nullable":true},"category":{"type":"string","enum":["industry","local"]}}},"Stats":{"type":"object","properties":{"site_id":{"type":"integer"},"from":{"type":"string"},"to":{"type":"string"},"articles_published":{"type":"integer"},"backlinks_acquired":{"type":"integer"},"backlinks_industry":{"type":"integer"},"backlinks_local":{"type":"integer"}}},"PageMeta":{"type":"object","properties":{"page":{"type":"integer"},"per_page":{"type":"integer"},"total":{"type":"integer"},"last_page":{"type":"integer"}}},"Error":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"protected_links":{"type":"array","items":{"$ref":"#\/components\/schemas\/ProtectedLink"}},"limit":{"type":"integer"}}}}}}