{"openapi":"3.1.0","info":{"title":"Marble API","version":"1.0.0","description":"A headless CMS API for managing and delivering content programmatically."},"servers":[{"url":"https://api.marblecms.com","description":"Production"}],"security":[{"apiKey":[]}],"components":{"securitySchemes":{"apiKey":{"type":"apiKey","in":"header","name":"Authorization","description":"Your Marble API key"}},"schemas":{"PostsListResponse":{"type":"object","properties":{"posts":{"type":"array","items":{"$ref":"#/components/schemas/Post"}},"pagination":{"$ref":"#/components/schemas/Pagination"}},"required":["posts","pagination"]},"Post":{"type":"object","properties":{"id":{"type":"string","example":"cryitfjp5678mn09qrstuvwx"},"slug":{"type":"string","example":"getting-started-with-nextjs"},"title":{"type":"string","example":"Getting Started with Next.js"},"status":{"type":"string","enum":["published","draft"],"example":"published"},"featured":{"type":"boolean","example":false},"coverImage":{"type":"string","nullable":true,"example":"https://media.marblecms.com/cover.jpg"},"description":{"type":"string","example":"A beginner's guide to Next.js"},"publishedAt":{"type":"string","format":"date-time","example":"2024-01-15T10:00:00Z"},"updatedAt":{"type":"string","format":"date-time","example":"2024-01-16T12:00:00Z"},"authors":{"type":"array","items":{"$ref":"#/components/schemas/AuthorRef"}},"category":{"$ref":"#/components/schemas/CategoryRef"},"tags":{"type":"array","items":{"$ref":"#/components/schemas/TagRef"}},"fields":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"array","items":{"type":"string"}},{"nullable":true}]},"description":"Custom field values keyed by field key","example":{"release_date":"2024-01-15","priority_score":5,"hashtags":["#javascript","#nextjs"]}},"content":{"type":"string","example":"<p>Hello world</p>"}},"required":["id","slug","title","status","featured","coverImage","description","publishedAt","updatedAt","authors","category","tags","fields","content"]},"AuthorRef":{"type":"object","properties":{"id":{"type":"string","example":"cryitfjp1234jl04vdnycek8"},"name":{"type":"string","example":"John Doe"},"image":{"type":"string","nullable":true,"example":"https://media.marblecms.com/avatar.jpg"},"bio":{"type":"string","nullable":true,"example":"Technical writer and developer"},"role":{"type":"string","nullable":true,"example":"Editor"},"slug":{"type":"string","example":"john-doe"},"socials":{"type":"array","items":{"$ref":"#/components/schemas/SocialRef"}}},"required":["id","name","image","bio","role","slug","socials"]},"SocialRef":{"type":"object","properties":{"url":{"type":"string","format":"uri","example":"https://twitter.com/johndoe"},"platform":{"type":"string","example":"twitter"}},"required":["url","platform"]},"CategoryRef":{"type":"object","properties":{"id":{"type":"string","example":"cryitfjp1234jl04vdnycek8"},"name":{"type":"string","example":"Technology"},"slug":{"type":"string","example":"technology"},"description":{"type":"string","nullable":true,"example":"Tech news and tutorials"}},"required":["id","name","slug","description"]},"TagRef":{"type":"object","properties":{"id":{"type":"string","example":"cryitfjp1234jl04vdnycek8"},"name":{"type":"string","example":"JavaScript"},"slug":{"type":"string","example":"javascript"},"description":{"type":"string","nullable":true,"example":"JavaScript tutorials"}},"required":["id","name","slug","description"]},"Pagination":{"type":"object","properties":{"limit":{"type":"integer","minimum":0,"exclusiveMinimum":true,"example":10},"currentPage":{"type":"integer","minimum":0,"exclusiveMinimum":true,"example":1},"nextPage":{"type":"integer","nullable":true,"example":2},"previousPage":{"type":"integer","nullable":true,"example":null},"totalPages":{"type":"integer","example":5},"totalItems":{"type":"integer","example":42}},"required":["limit","currentPage","nextPage","previousPage","totalPages","totalItems"]},"Error":{"type":"object","properties":{"error":{"type":"string","example":"Invalid query parameters"},"details":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string","example":"limit"},"message":{"type":"string","example":"Expected number, received string"}},"required":["field","message"]}},"message":{"type":"string","example":"Validation failed"}},"required":["error"]},"PageNotFound":{"type":"object","properties":{"error":{"type":"string","enum":["Invalid page number"]},"details":{"type":"object","properties":{"message":{"type":"string","example":"Page 10 does not exist."},"totalPages":{"type":"integer","example":5},"requestedPage":{"type":"integer","example":10}},"required":["message","totalPages","requestedPage"]}},"required":["error","details"]},"ServerError":{"type":"object","properties":{"error":{"type":"string","example":"Internal server error"},"message":{"type":"string","example":"Failed to fetch resource"}},"required":["error"]},"ContentFormat":{"type":"string","enum":["html","markdown"],"example":"html","description":"Content format (html or markdown)"},"PostResponse":{"type":"object","properties":{"post":{"$ref":"#/components/schemas/Post"}},"required":["post"]},"NotFound":{"type":"object","properties":{"error":{"type":"string","example":"Post not found"},"message":{"type":"string","example":"The requested resource does not exist"}},"required":["error","message"]},"CreatePostResponse":{"type":"object","properties":{"post":{"type":"object","properties":{"id":{"type":"string","example":"cryitfjp5678mn09qrstuvwx"},"slug":{"type":"string","example":"getting-started-with-nextjs"},"title":{"type":"string","example":"Getting Started with Next.js"},"status":{"type":"string","example":"draft"},"featured":{"type":"boolean","example":false},"publishedAt":{"type":"string","example":"2024-01-15T10:00:00.000Z"},"createdAt":{"type":"string","example":"2024-01-15T10:00:00.000Z"}},"required":["id","slug","title","status","featured","publishedAt","createdAt"]}},"required":["post"]},"Forbidden":{"type":"object","properties":{"error":{"type":"string","example":"Forbidden"},"message":{"type":"string","example":"Write operations require a private API key (msk_...). Public keys are read-only."}},"required":["error","message"]},"Conflict":{"type":"object","properties":{"error":{"type":"string","example":"Slug already in use"},"message":{"type":"string","example":"A resource with this slug already exists in this workspace"}},"required":["error"]},"CreatePostBody":{"type":"object","properties":{"title":{"type":"string","minLength":1,"example":"Getting Started with Next.js"},"content":{"type":"string","minLength":1,"example":"<p>Hello world</p>"},"description":{"type":"string","minLength":1,"example":"A beginner's guide to Next.js"},"slug":{"type":"string","minLength":1,"example":"getting-started-with-nextjs"},"categoryId":{"type":"string","minLength":1,"example":"cryitfjp2345kl05weoybfk9"},"status":{"type":"string","enum":["published","draft"],"example":"draft"},"tags":{"type":"array","items":{"type":"string"},"example":["cryitfjp4567no07ygqadhm1"],"description":"Array of tag IDs to attach to the post"},"authors":{"type":"array","items":{"type":"string"},"example":["cryitfjp3456lm06xfpzcgl0"],"description":"Array of author IDs. If omitted, the first workspace author is used."},"featured":{"type":"boolean","default":false,"example":false},"coverImage":{"type":"string","nullable":true,"format":"uri","example":"https://media.marblecms.com/cover.jpg"},"publishedAt":{"type":"string","format":"date-time","example":"2024-01-15T10:00:00Z","description":"ISO 8601 datetime. Defaults to current time if omitted."},"fields":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"array","items":{"type":"string"}},{"nullable":true}]},"description":"Custom field values keyed by field key. Select values must use option values; multiselect values must be arrays of option values. Use null to clear optional fields.","example":{"release_date":"2024-01-15","priority_score":5,"audience":["developers","founders"],"featured_customer":true,"subtitle":null}}},"required":["title","content","description","slug","categoryId","status"]},"UpdatePostResponse":{"type":"object","properties":{"post":{"type":"object","properties":{"id":{"type":"string","example":"cryitfjp5678mn09qrstuvwx"},"slug":{"type":"string","example":"updated-post-slug"},"title":{"type":"string","example":"Updated Post Title"},"status":{"type":"string","example":"published"},"featured":{"type":"boolean","example":true},"publishedAt":{"type":"string","example":"2024-02-01T10:00:00.000Z"},"updatedAt":{"type":"string","example":"2024-02-01T12:00:00.000Z"}},"required":["id","slug","title","status","featured","publishedAt","updatedAt"]}},"required":["post"]},"UpdatePostBody":{"type":"object","properties":{"title":{"type":"string","minLength":1,"example":"Updated Post Title"},"content":{"type":"string","minLength":1,"example":"<p>Updated content</p>"},"description":{"type":"string","minLength":1,"example":"Updated description"},"slug":{"type":"string","minLength":1,"example":"updated-post-slug"},"categoryId":{"type":"string","minLength":1,"example":"cryitfjp2345kl05weoybfk9"},"status":{"type":"string","enum":["published","draft"],"example":"published"},"tags":{"type":"array","items":{"type":"string"},"example":["cryitfjp4567no07ygqadhm1"],"description":"Array of tag IDs. Replaces all existing tags when provided."},"authors":{"type":"array","items":{"type":"string"},"example":["cryitfjp3456lm06xfpzcgl0"],"description":"Array of author IDs. Replaces all existing authors when provided."},"featured":{"type":"boolean","example":true},"coverImage":{"type":"string","nullable":true,"format":"uri","example":"https://media.marblecms.com/new-cover.jpg"},"publishedAt":{"type":"string","format":"date-time","example":"2024-02-01T10:00:00Z"},"fields":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"array","items":{"type":"string"}},{"nullable":true}]},"description":"Custom field values keyed by field key. Select values must use option values; multiselect values must be arrays of option values. Use null to clear optional fields.","example":{"release_date":"2024-01-15","priority_score":5,"audience":["developers","founders"],"featured_customer":true,"subtitle":null}}}},"DeleteResponse":{"type":"object","properties":{"id":{"type":"string","example":"cryitfjp5678mn09qrstuvwx"}},"required":["id"]},"CategoriesListResponse":{"type":"object","properties":{"categories":{"type":"array","items":{"$ref":"#/components/schemas/Category"}},"pagination":{"$ref":"#/components/schemas/Pagination"}},"required":["categories","pagination"]},"Category":{"type":"object","properties":{"id":{"type":"string","example":"cryitfjp2345kl05weoybfk9"},"name":{"type":"string","example":"Technology"},"slug":{"type":"string","example":"technology"},"description":{"type":"string","nullable":true,"example":"Tech news and tutorials"},"count":{"type":"object","properties":{"posts":{"type":"integer","example":15}},"required":["posts"],"description":"Number of published posts in this category"}},"required":["id","name","slug","description","count"]},"CategoryResponse":{"type":"object","properties":{"category":{"$ref":"#/components/schemas/Category"}},"required":["category"]},"CreateCategoryResponse":{"type":"object","properties":{"category":{"type":"object","properties":{"id":{"type":"string","example":"cryitfjp2345kl05weoybfk9"},"name":{"type":"string","example":"Technology"},"slug":{"type":"string","example":"technology"},"description":{"type":"string","nullable":true,"example":"Tech news and tutorials"}},"required":["id","name","slug","description"]}},"required":["category"]},"CreateCategoryBody":{"type":"object","properties":{"name":{"type":"string","minLength":1,"example":"Technology"},"slug":{"type":"string","minLength":1,"example":"technology"},"description":{"type":"string","example":"Tech news and tutorials"}},"required":["name","slug"]},"UpdateCategoryBody":{"type":"object","properties":{"name":{"type":"string","minLength":1,"example":"Engineering"},"slug":{"type":"string","minLength":1,"example":"engineering"},"description":{"type":"string","nullable":true,"example":"Engineering articles and tutorials"}}},"TagsListResponse":{"type":"object","properties":{"tags":{"type":"array","items":{"$ref":"#/components/schemas/Tag"}},"pagination":{"$ref":"#/components/schemas/Pagination"}},"required":["tags","pagination"]},"Tag":{"type":"object","properties":{"id":{"type":"string","example":"cryitfjp4567no07ygqadhm1"},"name":{"type":"string","example":"JavaScript"},"slug":{"type":"string","example":"javascript"},"description":{"type":"string","nullable":true,"example":"JavaScript tutorials"},"count":{"type":"object","properties":{"posts":{"type":"integer","example":8}},"required":["posts"],"description":"Number of published posts with this tag"}},"required":["id","name","slug","description","count"]},"TagResponse":{"type":"object","properties":{"tag":{"$ref":"#/components/schemas/Tag"}},"required":["tag"]},"CreateTagResponse":{"type":"object","properties":{"tag":{"type":"object","properties":{"id":{"type":"string","example":"cryitfjp4567no07ygqadhm1"},"name":{"type":"string","example":"JavaScript"},"slug":{"type":"string","example":"javascript"},"description":{"type":"string","nullable":true,"example":"JavaScript tutorials and guides"}},"required":["id","name","slug","description"]}},"required":["tag"]},"CreateTagBody":{"type":"object","properties":{"name":{"type":"string","minLength":1,"example":"JavaScript"},"slug":{"type":"string","minLength":1,"example":"javascript"},"description":{"type":"string","example":"JavaScript tutorials and guides"}},"required":["name","slug"]},"UpdateTagBody":{"type":"object","properties":{"name":{"type":"string","minLength":1,"example":"TypeScript"},"slug":{"type":"string","minLength":1,"example":"typescript"},"description":{"type":"string","nullable":true,"example":"TypeScript tutorials and guides"}}},"AuthorsListResponse":{"type":"object","properties":{"authors":{"type":"array","items":{"$ref":"#/components/schemas/Author"}},"pagination":{"$ref":"#/components/schemas/Pagination"}},"required":["authors","pagination"]},"Author":{"type":"object","properties":{"id":{"type":"string","example":"cryitfjp3456lm06xfpzcgl0"},"name":{"type":"string","example":"John Doe"},"image":{"type":"string","nullable":true,"example":"https://media.marblecms.com/avatar.jpg"},"slug":{"type":"string","example":"john-doe"},"bio":{"type":"string","nullable":true,"example":"Technical writer and developer"},"role":{"type":"string","nullable":true,"example":"Editor"},"socials":{"type":"array","items":{"$ref":"#/components/schemas/Social"}},"count":{"type":"object","properties":{"posts":{"type":"integer","example":12}},"required":["posts"],"description":"Number of published posts by this author"}},"required":["id","name","image","slug","bio","role","socials"]},"Social":{"type":"object","properties":{"url":{"type":"string","format":"uri","example":"https://twitter.com/johndoe"},"platform":{"type":"string","example":"twitter"}},"required":["url","platform"]},"AuthorResponse":{"type":"object","properties":{"author":{"$ref":"#/components/schemas/Author"}},"required":["author"]},"CreateAuthorResponse":{"type":"object","properties":{"author":{"type":"object","properties":{"id":{"type":"string","example":"cryitfjp3456lm06xfpzcgl0"},"name":{"type":"string","example":"John Doe"},"slug":{"type":"string","example":"john-doe"},"bio":{"type":"string","nullable":true,"example":"Technical writer and developer"},"role":{"type":"string","nullable":true,"example":"Editor"},"image":{"type":"string","nullable":true,"example":"https://media.marblecms.com/avatar.jpg"},"socials":{"type":"array","items":{"$ref":"#/components/schemas/Social"}}},"required":["id","name","slug","bio","role","image","socials"]}},"required":["author"]},"CreateAuthorBody":{"type":"object","properties":{"name":{"type":"string","minLength":1,"example":"John Doe"},"slug":{"type":"string","minLength":1,"example":"john-doe"},"bio":{"type":"string","nullable":true,"example":"Technical writer and developer"},"role":{"type":"string","nullable":true,"example":"Editor"},"email":{"type":"string","nullable":true,"format":"email","example":"john@example.com"},"image":{"type":"string","nullable":true,"format":"uri","example":"https://media.marblecms.com/avatar.jpg"},"socials":{"type":"array","items":{"$ref":"#/components/schemas/SocialInput"},"description":"Social media links for this author"}},"required":["name","slug"]},"SocialInput":{"type":"object","properties":{"platform":{"type":"string","enum":["x","twitter","github","facebook","instagram","youtube","tiktok","linkedin","website","onlyfans","discord","bluesky"],"example":"x"},"url":{"type":"string","format":"uri","example":"https://x.com/johndoe"}},"required":["platform","url"]},"UpdateAuthorBody":{"type":"object","properties":{"name":{"type":"string","minLength":1,"example":"John Doe"},"slug":{"type":"string","minLength":1,"example":"john-doe"},"bio":{"type":"string","nullable":true,"example":"Updated bio"},"role":{"type":"string","nullable":true,"example":"Senior Editor"},"email":{"type":"string","nullable":true,"format":"email","example":"john@example.com"},"image":{"type":"string","nullable":true,"format":"uri","example":"https://media.marblecms.com/new-avatar.jpg"},"socials":{"type":"array","items":{"$ref":"#/components/schemas/SocialInput"},"description":"Social media links. Replaces all existing socials when provided."}}},"MediaListResponse":{"type":"object","properties":{"media":{"type":"array","items":{"$ref":"#/components/schemas/Media"}},"pagination":{"$ref":"#/components/schemas/Pagination"}},"required":["media","pagination"]},"Media":{"type":"object","properties":{"id":{"type":"string","example":"cryitfjp1234jl04vdnycek8"},"name":{"type":"string","example":"Hero image"},"url":{"type":"string","format":"uri","example":"https://cdn.marblecms.com/media/hero.jpg"},"alt":{"type":"string","nullable":true,"example":"A dashboard screenshot"},"size":{"type":"integer","example":382019,"description":"File size in bytes"},"mimeType":{"type":"string","nullable":true,"example":"image/jpeg"},"width":{"type":"integer","nullable":true,"example":1600},"height":{"type":"integer","nullable":true,"example":900},"duration":{"type":"integer","nullable":true,"example":12000,"description":"Duration in milliseconds"},"blurHash":{"type":"string","nullable":true,"example":"LEHV6nWB2yk8pyo0adR*.7kCMdnj"},"type":{"$ref":"#/components/schemas/MediaType"},"createdAt":{"type":"string","format":"date-time","example":"2024-01-15T10:00:00Z"},"updatedAt":{"type":"string","format":"date-time","example":"2024-01-16T12:00:00Z"}},"required":["id","name","url","alt","size","mimeType","width","height","duration","blurHash","type","createdAt","updatedAt"]},"MediaType":{"type":"string","enum":["image","video","audio","document"]},"MediaResponse":{"type":"object","properties":{"media":{"$ref":"#/components/schemas/Media"}},"required":["media"]},"UpdateMediaBody":{"type":"object","properties":{"name":{"type":"string","minLength":1,"example":"Updated hero image"},"alt":{"type":"string","nullable":true,"example":"Dashboard with a post editor open"}}},"UploadMediaBody":{"type":"object","properties":{"file":{"type":"string","format":"binary","description":"Media file to upload. Maximum size: 5 MiB."},"name":{"type":"string","example":"Hero image"},"alt":{"type":"string","example":"Dashboard screenshot"}}},"FieldsListResponse":{"type":"object","properties":{"fields":{"type":"array","items":{"$ref":"#/components/schemas/Field"}}},"required":["fields"]},"Field":{"type":"object","properties":{"id":{"type":"string","example":"cryitfjp7890yz12abcdefg"},"key":{"type":"string","example":"audience"},"name":{"type":"string","example":"Audience"},"description":{"type":"string","nullable":true,"example":"Who this post is for"},"type":{"$ref":"#/components/schemas/FieldType"},"required":{"type":"boolean","example":false},"position":{"type":"integer","example":0},"options":{"type":"array","items":{"$ref":"#/components/schemas/FieldOption"}},"createdAt":{"type":"string","format":"date-time","example":"2024-01-15T10:00:00Z"},"updatedAt":{"type":"string","format":"date-time","example":"2024-01-16T12:00:00Z"}},"required":["id","key","name","description","type","required","position","options","createdAt","updatedAt"]},"FieldType":{"type":"string","enum":["text","number","boolean","date","richtext","select","multiselect"]},"FieldOption":{"type":"object","properties":{"id":{"type":"string","example":"cryitfjp9012ab34cdefghij"},"value":{"type":"string","example":"developers"},"label":{"type":"string","example":"Developers"},"position":{"type":"integer","example":0},"createdAt":{"type":"string","format":"date-time","example":"2024-01-15T10:00:00Z"},"updatedAt":{"type":"string","format":"date-time","example":"2024-01-16T12:00:00Z"}},"required":["id","value","label","position","createdAt","updatedAt"]},"FieldResponse":{"type":"object","properties":{"field":{"$ref":"#/components/schemas/Field"}},"required":["field"]},"CreateFieldBody":{"type":"object","properties":{"key":{"type":"string","minLength":1,"maxLength":50,"pattern":"^[a-z0-9_]+$","example":"audience"},"name":{"type":"string","minLength":1,"maxLength":50,"example":"Audience"},"description":{"type":"string","maxLength":280,"example":"Who this post is for"},"type":{"$ref":"#/components/schemas/FieldType"},"required":{"type":"boolean","example":false},"options":{"type":"array","items":{"$ref":"#/components/schemas/FieldOptionInput"},"maxItems":100,"description":"Required for select and multiselect fields. Not allowed for other field types.","example":[{"value":"developers","label":"Developers"},{"value":"founders","label":"Founders"}]}},"required":["key","name","type"]},"FieldOptionInput":{"type":"object","properties":{"value":{"type":"string","minLength":1,"maxLength":80,"example":"developers"},"label":{"type":"string","minLength":1,"maxLength":80,"example":"Developers"}},"required":["value","label"]},"UpdateFieldBody":{"type":"object","properties":{"key":{"type":"string","minLength":1,"maxLength":50,"pattern":"^[a-z0-9_]+$","example":"audience"},"name":{"type":"string","minLength":1,"maxLength":50,"example":"Audience"},"description":{"type":"string","nullable":true,"maxLength":280,"example":"Who this post is for"},"type":{"$ref":"#/components/schemas/FieldType"},"required":{"type":"boolean","example":false},"options":{"type":"array","items":{"$ref":"#/components/schemas/FieldOptionInput"},"maxItems":100,"description":"Replacement option list. Only valid for select and multiselect fields.","example":[{"value":"developers","label":"Developers"},{"value":"founders","label":"Founders"}]}}}},"parameters":{}},"paths":{"/v1/posts":{"get":{"tags":["Posts"],"summary":"List posts","description":"Get a paginated list of published posts with optional filtering","parameters":[{"schema":{"type":"integer","example":10,"description":"Number of posts per page (1-100)"},"required":false,"description":"Number of posts per page (1-100)","name":"limit","in":"query"},{"schema":{"type":"integer","example":1,"description":"Page number"},"required":false,"description":"Page number","name":"page","in":"query"},{"schema":{"type":"string","enum":["asc","desc"],"default":"desc","example":"desc","description":"Sort order by publishedAt"},"required":false,"description":"Sort order by publishedAt","name":"order","in":"query"},{"schema":{"type":"array","items":{"type":"string"},"example":["tech","news"],"description":"Category slugs to include"},"required":false,"description":"Category slugs to include","name":"categories","in":"query","style":"form","explode":false},{"schema":{"type":"array","items":{"type":"string"},"example":["changelog"],"description":"Category slugs to exclude"},"required":false,"description":"Category slugs to exclude","name":"excludeCategories","in":"query","style":"form","explode":false},{"schema":{"type":"array","items":{"type":"string"},"example":["javascript","react"],"description":"Tag slugs to include"},"required":false,"description":"Tag slugs to include","name":"tags","in":"query","style":"form","explode":false},{"schema":{"type":"array","items":{"type":"string"},"example":["outdated"],"description":"Tag slugs to exclude"},"required":false,"description":"Tag slugs to exclude","name":"excludeTags","in":"query","style":"form","explode":false},{"schema":{"type":"string","example":"nextjs","description":"Search query for title and content"},"required":false,"description":"Search query for title and content","name":"query","in":"query"},{"schema":{"$ref":"#/components/schemas/ContentFormat"},"required":false,"description":"Content format (html or markdown)","name":"format","in":"query"},{"schema":{"type":"string","enum":["true","false"],"example":"true","description":"Filter by featured status"},"required":false,"description":"Filter by featured status","name":"featured","in":"query"},{"schema":{"type":"string","enum":["published","draft","all"],"default":"published","example":"published","description":"Filter by post status. Use 'published' for live posts, 'draft' for unpublished posts, or 'all' for both."},"required":false,"description":"Filter by post status. Use 'published' for live posts, 'draft' for unpublished posts, or 'all' for both.","name":"status","in":"query"}],"responses":{"200":{"description":"Paginated list of posts","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PostsListResponse"}}}},"400":{"description":"Invalid query parameters or page number","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/Error"},{"$ref":"#/components/schemas/PageNotFound"}]}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}}}}},"post":{"tags":["Posts"],"summary":"Create post","description":"Create a new post. Requires a private API key. Category is required. If authors are not provided, the first workspace author is used.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatePostBody"}}}},"responses":{"201":{"description":"Post created successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatePostResponse"}}}},"400":{"description":"Invalid request body or referenced resources not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Public API key used for write operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Forbidden"}}}},"409":{"description":"Post with this slug already exists","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Conflict"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}}}}}},"/v1/posts/{identifier}":{"get":{"tags":["Posts"],"summary":"Get post","description":"Get a single post by ID or slug, with optional status filtering","parameters":[{"schema":{"type":"string","example":"my-post-slug","description":"Post ID or slug"},"required":true,"description":"Post ID or slug","name":"identifier","in":"path"},{"schema":{"$ref":"#/components/schemas/ContentFormat"},"required":false,"description":"Content format (html or markdown)","name":"format","in":"query"},{"schema":{"type":"string","enum":["published","draft","all"],"default":"published","example":"published","description":"Filter by post status. Use 'published' for live posts, 'draft' for unpublished posts, or 'all' for both."},"required":false,"description":"Filter by post status. Use 'published' for live posts, 'draft' for unpublished posts, or 'all' for both.","name":"status","in":"query"}],"responses":{"200":{"description":"The requested post","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PostResponse"}}}},"404":{"description":"Post not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFound"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}}}}},"patch":{"tags":["Posts"],"summary":"Update post","description":"Update an existing post by ID or slug. All fields are optional — only provided fields are updated. Requires a private API key.","parameters":[{"schema":{"type":"string","example":"my-post-slug","description":"Post ID or slug"},"required":true,"description":"Post ID or slug","name":"identifier","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdatePostBody"}}}},"responses":{"200":{"description":"Post updated successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdatePostResponse"}}}},"400":{"description":"Invalid request body or referenced resources not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Public API key used for write operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Forbidden"}}}},"404":{"description":"Post not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFound"}}}},"409":{"description":"Post with this slug already exists","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Conflict"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}}}}},"delete":{"tags":["Posts"],"summary":"Delete post","description":"Delete a post by ID or slug. Requires a private API key.","parameters":[{"schema":{"type":"string","example":"my-post-slug","description":"Post ID or slug"},"required":true,"description":"Post ID or slug","name":"identifier","in":"path"}],"responses":{"200":{"description":"Post deleted successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeleteResponse"}}}},"403":{"description":"Public API key used for write operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Forbidden"}}}},"404":{"description":"Post not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFound"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}}}}}},"/v1/categories":{"get":{"tags":["Categories"],"summary":"List categories","description":"Get a paginated list of categories","parameters":[{"schema":{"type":"integer","minimum":1,"maximum":100,"default":10,"example":"10","description":"Number of items per page (1-100)"},"required":false,"description":"Number of items per page (1-100)","name":"limit","in":"query"},{"schema":{"type":"integer","minimum":0,"exclusiveMinimum":true,"default":1,"example":"1","description":"Page number"},"required":false,"description":"Page number","name":"page","in":"query"}],"responses":{"200":{"description":"Paginated list of categories","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CategoriesListResponse"}}}},"400":{"description":"Invalid query parameters or page number","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/Error"},{"$ref":"#/components/schemas/PageNotFound"}]}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}}}}},"post":{"tags":["Categories"],"summary":"Create category","description":"Create a new category. Requires a private API key.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateCategoryBody"}}}},"responses":{"201":{"description":"Category created successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateCategoryResponse"}}}},"400":{"description":"Invalid request body","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Public API key used for write operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Forbidden"}}}},"409":{"description":"Category with this slug already exists","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Conflict"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}}}}}},"/v1/categories/{identifier}":{"get":{"tags":["Categories"],"summary":"Get category","description":"Get a single category by ID or slug","parameters":[{"schema":{"type":"string","example":"technology","description":"Category ID or slug"},"required":true,"description":"Category ID or slug","name":"identifier","in":"path"}],"responses":{"200":{"description":"The requested category","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CategoryResponse"}}}},"404":{"description":"Category not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFound"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}}}}},"patch":{"tags":["Categories"],"summary":"Update category","description":"Update an existing category by ID or slug. Requires a private API key.","parameters":[{"schema":{"type":"string","example":"technology","description":"Category ID or slug"},"required":true,"description":"Category ID or slug","name":"identifier","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateCategoryBody"}}}},"responses":{"200":{"description":"Category updated successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateCategoryResponse"}}}},"400":{"description":"Invalid request body","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Public API key used for write operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Forbidden"}}}},"404":{"description":"Category not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFound"}}}},"409":{"description":"Category with this slug already exists","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Conflict"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}}}}},"delete":{"tags":["Categories"],"summary":"Delete category","description":"Delete a category by ID or slug. Requires a private API key. Cannot delete a category that has posts assigned to it.","parameters":[{"schema":{"type":"string","example":"technology","description":"Category ID or slug"},"required":true,"description":"Category ID or slug","name":"identifier","in":"path"}],"responses":{"200":{"description":"Category deleted successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeleteResponse"}}}},"400":{"description":"Category has posts assigned to it","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Public API key used for write operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Forbidden"}}}},"404":{"description":"Category not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFound"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}}}}}},"/v1/tags":{"get":{"tags":["Tags"],"summary":"List tags","description":"Get a paginated list of tags","parameters":[{"schema":{"type":"integer","minimum":1,"maximum":100,"default":10,"example":"10","description":"Number of items per page (1-100)"},"required":false,"description":"Number of items per page (1-100)","name":"limit","in":"query"},{"schema":{"type":"integer","minimum":0,"exclusiveMinimum":true,"default":1,"example":"1","description":"Page number"},"required":false,"description":"Page number","name":"page","in":"query"}],"responses":{"200":{"description":"Paginated list of tags","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TagsListResponse"}}}},"400":{"description":"Invalid query parameters or page number","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/Error"},{"$ref":"#/components/schemas/PageNotFound"}]}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}}}}},"post":{"tags":["Tags"],"summary":"Create tag","description":"Create a new tag. Requires a private API key.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateTagBody"}}}},"responses":{"201":{"description":"Tag created successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateTagResponse"}}}},"400":{"description":"Invalid request body","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Public API key used for write operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Forbidden"}}}},"409":{"description":"Tag with this slug already exists","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Conflict"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}}}}}},"/v1/tags/{identifier}":{"get":{"tags":["Tags"],"summary":"Get tag","description":"Get a single tag by ID or slug","parameters":[{"schema":{"type":"string","example":"javascript","description":"Tag ID or slug"},"required":true,"description":"Tag ID or slug","name":"identifier","in":"path"}],"responses":{"200":{"description":"The requested tag","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TagResponse"}}}},"404":{"description":"Tag not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFound"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}}}}},"patch":{"tags":["Tags"],"summary":"Update tag","description":"Update an existing tag by ID or slug. Requires a private API key.","parameters":[{"schema":{"type":"string","example":"javascript","description":"Tag ID or slug"},"required":true,"description":"Tag ID or slug","name":"identifier","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateTagBody"}}}},"responses":{"200":{"description":"Tag updated successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateTagResponse"}}}},"400":{"description":"Invalid request body","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Public API key used for write operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Forbidden"}}}},"404":{"description":"Tag not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFound"}}}},"409":{"description":"Tag with this slug already exists","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Conflict"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}}}}},"delete":{"tags":["Tags"],"summary":"Delete tag","description":"Delete a tag by ID or slug. Requires a private API key.","parameters":[{"schema":{"type":"string","example":"javascript","description":"Tag ID or slug"},"required":true,"description":"Tag ID or slug","name":"identifier","in":"path"}],"responses":{"200":{"description":"Tag deleted successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeleteResponse"}}}},"403":{"description":"Public API key used for write operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Forbidden"}}}},"404":{"description":"Tag not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFound"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}}}}}},"/v1/authors":{"get":{"tags":["Authors"],"summary":"List authors","description":"Get a paginated list of authors who have published posts","parameters":[{"schema":{"type":"integer","minimum":1,"maximum":100,"default":10,"example":"10","description":"Number of items per page (1-100)"},"required":false,"description":"Number of items per page (1-100)","name":"limit","in":"query"},{"schema":{"type":"integer","minimum":0,"exclusiveMinimum":true,"default":1,"example":"1","description":"Page number"},"required":false,"description":"Page number","name":"page","in":"query"}],"responses":{"200":{"description":"Paginated list of authors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthorsListResponse"}}}},"400":{"description":"Invalid query parameters or page number","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/Error"},{"$ref":"#/components/schemas/PageNotFound"}]}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}}}}},"post":{"tags":["Authors"],"summary":"Create author","description":"Create a new author. Requires a private API key. Plan limits apply.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateAuthorBody"}}}},"responses":{"201":{"description":"Author created successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateAuthorResponse"}}}},"400":{"description":"Invalid request body","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Public API key used for write operation or plan limit reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Forbidden"}}}},"409":{"description":"Author with this slug already exists","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Conflict"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}}}}}},"/v1/authors/{identifier}":{"get":{"tags":["Authors"],"summary":"Get author","description":"Get a single author by ID or slug","parameters":[{"schema":{"type":"string","example":"john-doe","description":"Author ID or slug"},"required":true,"description":"Author ID or slug","name":"identifier","in":"path"}],"responses":{"200":{"description":"The requested author","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthorResponse"}}}},"404":{"description":"Author not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFound"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}}}}},"patch":{"tags":["Authors"],"summary":"Update author","description":"Update an existing author by ID or slug. Requires a private API key.","parameters":[{"schema":{"type":"string","example":"john-doe","description":"Author ID or slug"},"required":true,"description":"Author ID or slug","name":"identifier","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateAuthorBody"}}}},"responses":{"200":{"description":"Author updated successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateAuthorResponse"}}}},"400":{"description":"Invalid request body","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Public API key used for write operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Forbidden"}}}},"404":{"description":"Author not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFound"}}}},"409":{"description":"Author with this slug already exists","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Conflict"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}}}}},"delete":{"tags":["Authors"],"summary":"Delete author","description":"Delete an author by ID or slug. Requires a private API key.","parameters":[{"schema":{"type":"string","example":"john-doe","description":"Author ID or slug"},"required":true,"description":"Author ID or slug","name":"identifier","in":"path"}],"responses":{"200":{"description":"Author deleted successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeleteResponse"}}}},"403":{"description":"Public API key used for write operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Forbidden"}}}},"404":{"description":"Author not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFound"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}}}}}},"/v1/media":{"get":{"tags":["Media"],"summary":"List media assets","description":"Retrieve media assets for the authenticated workspace.","parameters":[{"schema":{"type":"integer","minimum":1,"maximum":100,"default":10,"example":"10","description":"Number of items per page (1-100)"},"required":false,"description":"Number of items per page (1-100)","name":"limit","in":"query"},{"schema":{"type":"integer","minimum":0,"exclusiveMinimum":true,"default":1,"example":"1","description":"Page number"},"required":false,"description":"Page number","name":"page","in":"query"},{"schema":{"type":"string","example":"hero","description":"Search media by name, alt text, URL, or MIME type"},"required":false,"description":"Search media by name, alt text, URL, or MIME type","name":"query","in":"query"},{"schema":{"allOf":[{"$ref":"#/components/schemas/MediaType"},{"example":"image","description":"Filter by inferred media type"}]},"required":false,"description":"Filter by inferred media type","name":"type","in":"query"},{"schema":{"type":"string","enum":["asc","desc"],"default":"desc","example":"desc","description":"Sort order by creation date"},"required":false,"description":"Sort order by creation date","name":"order","in":"query"}],"responses":{"200":{"description":"Media assets retrieved successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MediaListResponse"}}}},"400":{"description":"Invalid query parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Page number does not exist","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PageNotFound"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}}}}}},"/v1/media/{id}":{"get":{"tags":["Media"],"summary":"Get media asset","description":"Retrieve a single media asset by ID.","parameters":[{"schema":{"type":"string","example":"cryitfjp1234jl04vdnycek8","description":"Media asset ID"},"required":true,"description":"Media asset ID","name":"id","in":"path"}],"responses":{"200":{"description":"Media asset retrieved successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MediaResponse"}}}},"404":{"description":"Media asset not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFound"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}}}}},"patch":{"tags":["Media"],"summary":"Update media asset","description":"Update media asset metadata. Requires a private API key.","parameters":[{"schema":{"type":"string","example":"cryitfjp1234jl04vdnycek8","description":"Media asset ID"},"required":true,"description":"Media asset ID","name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateMediaBody"}}}},"responses":{"200":{"description":"Media asset updated successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MediaResponse"}}}},"400":{"description":"Invalid request body","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Public API key used for write operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Forbidden"}}}},"404":{"description":"Media asset not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFound"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}}}}},"delete":{"tags":["Media"],"summary":"Delete media asset","description":"Delete a media asset and its R2 object. Requires a private API key.","parameters":[{"schema":{"type":"string","example":"cryitfjp1234jl04vdnycek8","description":"Media asset ID"},"required":true,"description":"Media asset ID","name":"id","in":"path"}],"responses":{"200":{"description":"Media asset deleted successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeleteResponse"}}}},"403":{"description":"Public API key used for write operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Forbidden"}}}},"404":{"description":"Media asset not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFound"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}}}}}},"/v1/media/upload":{"post":{"tags":["Media"],"summary":"Upload media asset","description":"Upload a media file and create a media asset. Requires a private API key. Maximum file size is 5 MiB.","requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/UploadMediaBody"}}}},"responses":{"201":{"description":"Media asset uploaded successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MediaResponse"}}}},"400":{"description":"Invalid upload request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Public API key used for write operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Forbidden"}}}},"413":{"description":"File exceeds the upload size limit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}}}}}},"/v1/fields":{"get":{"tags":["Fields"],"summary":"List fields","description":"Get all custom field definitions for the workspace.","responses":{"200":{"description":"List of custom field definitions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FieldsListResponse"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}}}}},"post":{"tags":["Fields"],"summary":"Create field","description":"Create a custom field definition. Requires a private API key.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateFieldBody"}}}},"responses":{"201":{"description":"Field created successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FieldResponse"}}}},"400":{"description":"Invalid request body","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"API key missing the required field write scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Forbidden"}}}},"409":{"description":"Field with this key already exists","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Conflict"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}}}}}},"/v1/fields/{identifier}":{"get":{"tags":["Fields"],"summary":"Get field","description":"Get a single custom field definition by ID or key.","parameters":[{"schema":{"type":"string","example":"audience","description":"Field ID or key"},"required":true,"description":"Field ID or key","name":"identifier","in":"path"}],"responses":{"200":{"description":"The requested field definition","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FieldResponse"}}}},"404":{"description":"Field not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFound"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}}}}},"patch":{"tags":["Fields"],"summary":"Update field","description":"Update a custom field definition by ID or key. Type and options cannot be changed after values have been saved.","parameters":[{"schema":{"type":"string","example":"audience","description":"Field ID or key"},"required":true,"description":"Field ID or key","name":"identifier","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateFieldBody"}}}},"responses":{"200":{"description":"Field updated successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FieldResponse"}}}},"400":{"description":"Invalid request body or unsafe schema change","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"API key missing the required field write scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Forbidden"}}}},"404":{"description":"Field not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFound"}}}},"409":{"description":"Field key conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Conflict"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}}}}},"delete":{"tags":["Fields"],"summary":"Delete field","description":"Delete a custom field definition by ID or key. Requires a private API key.","parameters":[{"schema":{"type":"string","example":"audience","description":"Field ID or key"},"required":true,"description":"Field ID or key","name":"identifier","in":"path"}],"responses":{"200":{"description":"Field deleted successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeleteResponse"}}}},"403":{"description":"API key missing the required field write scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Forbidden"}}}},"404":{"description":"Field not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFound"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}}}}}}}}