{"openapi":"3.1.0","info":{"title":"aiitem Draft API","version":"1.0.0","description":"Save a tool listing or community article as an English draft. Sign in to aiitem to review the draft and publish when ready."},"servers":[{"url":"https://aiitem.net"}],"externalDocs":{"description":"Request examples and preview workflow","url":"https://aiitem.net/api-docs"},"tags":[{"name":"Discovery","description":"Look up the current categories and tags in the directory."},{"name":"Drafts","description":"Save a private entry to the account that issued the key."}],"paths":{"/api/taxonomies":{"get":{"operationId":"listTaxonomies","summary":"List published categories or tags","description":"Fetch the current values before assigning them to a draft. Use type=category for either draft type and type=tag for tool listings.","tags":["Discovery"],"parameters":[{"name":"type","in":"query","required":true,"schema":{"type":"string","enum":["category","tag"]}}],"responses":{"200":{"description":"Published taxonomy values","content":{"application/json":{"schema":{"type":"object","required":["code","message","data"],"properties":{"code":{"type":"integer","const":0},"message":{"type":"string","const":"ok"},"data":{"type":"array","items":{"$ref":"#/components/schemas/Taxonomy"}}}}}}},"400":{"description":"Request failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Request failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/tools/drafts":{"post":{"operationId":"createToolDraft","summary":"Save a tool listing for review","description":"Describe what people can make with the tool and provide its public website. The result is a private draft with links to edit and preview it.","tags":["Drafts"],"security":[{"bearerAuth":[]},{"apiKeyHeader":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ToolDraftInput"}}}},"responses":{"201":{"description":"Tool draft created","content":{"application/json":{"schema":{"type":"object","required":["code","message","data"],"properties":{"code":{"type":"integer","const":0},"message":{"type":"string","const":"ok"},"data":{"$ref":"#/components/schemas/ToolDraft"}}}}}},"400":{"description":"Request failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Request failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"The Tool domain has already been submitted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"413":{"description":"Request failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Request failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Request failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/posts/drafts":{"post":{"operationId":"createPostDraft","summary":"Save a community article for review","description":"Save a workflow tip, walkthrough, or other English article for review. An article can have one category and one external link in the body.","tags":["Drafts"],"security":[{"bearerAuth":[]},{"apiKeyHeader":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PostDraftInput"}}}},"responses":{"201":{"description":"Post draft created","content":{"application/json":{"schema":{"type":"object","required":["code","message","data"],"properties":{"code":{"type":"integer","const":0},"message":{"type":"string","const":"ok"},"data":{"$ref":"#/components/schemas/PostDraft"}}}}}},"400":{"description":"Request failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Request failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"413":{"description":"Request failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Request failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Request failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"API key created in your aiitem account."},"apiKeyHeader":{"type":"apiKey","in":"header","name":"X-API-Key","description":"Send the same aiitem API key in this header as an alternative to Bearer authentication."}},"schemas":{"ErrorResponse":{"type":"object","required":["code","message"],"properties":{"code":{"type":"integer","const":-1},"message":{"type":"string"}}},"Taxonomy":{"type":"object","required":["id","slug","type","name","title","toolCount","postCount"],"properties":{"id":{"type":"string"},"slug":{"type":"string"},"type":{"type":"string","enum":["category","tag"]},"name":{"type":"string"},"title":{"type":"string"},"description":{"type":["string","null"]},"image":{"type":["string","null"]},"toolCount":{"type":"integer","minimum":0},"postCount":{"type":"integer","minimum":0}}},"ToolDraftInput":{"type":"object","additionalProperties":false,"required":["name","website","description","content"],"examples":[{"name":"Example SVG Tool","website":"https://example.com","description":"A sample listing for a sketch-to-SVG tool.","content":"Replace this sample with a factual description of your tool. For a sketch-to-SVG workflow, explain which image formats it accepts, how to start tracing, which parts stay editable in the export, and what to check before opening the finished file in a design app.","categories":["design"],"tags":["svg"]}],"properties":{"name":{"type":"string","minLength":1,"maxLength":120},"website":{"type":"string","minLength":1,"maxLength":2000,"description":"The public HTTP(S) website for the tool being listed."},"description":{"type":"string","minLength":1,"maxLength":100},"content":{"type":"string","minLength":200,"maxLength":50000,"description":"Describe the task, the steps, and the result in English. The body needs at least 200 readable characters, excluding HTML and Markdown formatting."},"categories":{"type":"array","minItems":1,"maxItems":3,"uniqueItems":true,"items":{"type":"string","maxLength":100},"description":"Published category slugs or IDs from listTaxonomies. Include a category when assigning tags."},"tags":{"type":"array","maxItems":5,"uniqueItems":true,"items":{"type":"string","maxLength":100},"description":"Published tag slugs or IDs from listTaxonomies."}}},"PostDraftInput":{"type":"object","additionalProperties":false,"required":["title","content"],"examples":[{"title":"Check an SVG export before publishing","description":"Three checks for graphics that will be reused on the web.","content":"Open the exported file on light and dark backgrounds to check contrast. Zoom in to look for extra paths near the edges, then reopen the file in your design app and confirm that the shapes remain editable. Finally, test the graphic at the smallest size it will appear on the site.","category":"design"}],"properties":{"title":{"type":"string","minLength":1,"maxLength":200},"description":{"type":"string","maxLength":500},"content":{"type":"string","minLength":200,"maxLength":100000,"description":"Write at least 200 readable English characters, excluding HTML and Markdown formatting. The body accepts one external HTTP(S) link and may also link to aiitem pages."},"category":{"type":"string","maxLength":100,"description":"One published category slug or ID from listTaxonomies."}}},"ToolDraft":{"type":"object","required":["id","slug","status","name","editUrl","previewUrl","message"],"properties":{"id":{"type":"string"},"slug":{"type":"string"},"status":{"type":"string","const":"draft"},"name":{"type":"string"},"editUrl":{"type":"string","format":"uri"},"previewUrl":{"type":"string","format":"uri"},"message":{"type":"string"}}},"PostDraft":{"type":"object","required":["id","slug","status","title","editUrl","previewUrl","message"],"properties":{"id":{"type":"string"},"slug":{"type":"string"},"status":{"type":"string","const":"draft"},"title":{"type":"string"},"editUrl":{"type":"string","format":"uri"},"previewUrl":{"type":"string","format":"uri"},"message":{"type":"string"}}}}}}