{"openapi":"3.0.3","info":{"title":"Blog API","description":"Laravel Passport based REST API for the markdown blog.","version":"1.0.0"},"servers":[{"url":"http:\/\/www.closetoya.com\/api\/v1","description":"API v1"}],"tags":[{"name":"Docs"},{"name":"Auth"},{"name":"Posts"},{"name":"Categories"},{"name":"Search"},{"name":"Attachments"},{"name":"OAuth Clients"},{"name":"Admin"}],"paths":{"\/docs":{"get":{"tags":["Docs"],"summary":"HTML API \ubb38\uc11c","responses":{"200":{"description":"HTML documentation"}}}},"\/docs\/openapi":{"get":{"tags":["Docs"],"summary":"OpenAPI JSON","responses":{"200":{"description":"OpenAPI specification"}}}},"\/auth\/login":{"post":{"tags":["Auth"],"summary":"\uace0\uae09 OAuth \ub85c\uadf8\uc778","requestBody":{"required":true,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/LoginRequest"}}}},"responses":{"200":{"description":"\ub85c\uadf8\uc778 \uc131\uacf5","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/LoginResponse"}}}},"401":{"description":"\uc778\uc99d \uc2e4\ud328"},"403":{"description":"\uc2b9\uc778\ub418\uc9c0 \uc54a\uc740 \uacc4\uc815 \ub610\ub294 grant \uad8c\ud55c \uc5c6\uc74c"},"422":{"description":"\uac80\uc99d \uc624\ub958"}}}},"\/auth\/register":{"post":{"tags":["Auth"],"summary":"\ud68c\uc6d0\uac00\uc785","requestBody":{"required":true,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/RegisterRequest"}}}},"responses":{"201":{"description":"\ud68c\uc6d0\uac00\uc785 \uc131\uacf5"},"401":{"description":"OAuth client \uc624\ub958"},"422":{"description":"\uac80\uc99d \uc624\ub958"}}}},"\/auth\/refresh":{"post":{"tags":["Auth"],"summary":"\ud1a0\ud070 \uac31\uc2e0","requestBody":{"required":true,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/RefreshRequest"}}}},"responses":{"200":{"description":"\ud1a0\ud070 \uac31\uc2e0 \uc131\uacf5"},"401":{"description":"\uc720\ud6a8\ud558\uc9c0 \uc54a\uc740 refresh token \ub610\ub294 client"},"403":{"description":"grant \uad8c\ud55c \uc5c6\uc74c"},"422":{"description":"\uac80\uc99d \uc624\ub958"}}}},"\/user":{"get":{"tags":["Auth"],"summary":"\ud604\uc7ac \uc0ac\uc6a9\uc790 \uc870\ud68c","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"\uc131\uacf5"},"401":{"description":"\uc778\uc99d \ud544\uc694"}}}},"\/token\/validate":{"get":{"tags":["Auth"],"summary":"\ud604\uc7ac Bearer \ud1a0\ud070 \uc720\ud6a8\uc131 \ud655\uc778","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"\ud1a0\ud070 \uc720\ud6a8"},"401":{"description":"\uc720\ud6a8\ud558\uc9c0 \uc54a\uac70\ub098 \ub9cc\ub8cc\ub41c \ud1a0\ud070"}}}},"\/token\/reissue":{"post":{"tags":["Auth"],"summary":"\ud604\uc7ac \ud1a0\ud070 \uae30\uc900 \uc0c8 Bearer \ud1a0\ud070 \uc7ac\ubc1c\uae09","security":[{"bearerAuth":[]}],"requestBody":{"required":false,"content":{"application\/json":{"schema":{"type":"object","properties":{"token_name":{"type":"string","maxLength":100}}}}}},"responses":{"200":{"description":"\uc0c8 \ud1a0\ud070 \ubc1c\uae09 \uc131\uacf5"},"401":{"description":"\uc778\uc99d \ud544\uc694"},"422":{"description":"\uac80\uc99d \uc624\ub958"}}}},"\/tokens":{"get":{"tags":["Auth"],"summary":"\ub0b4 API \ud1a0\ud070 \ubaa9\ub85d","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"\uc870\ud68c \uc131\uacf5"},"401":{"description":"\uc778\uc99d \ud544\uc694"}}},"post":{"tags":["Auth"],"summary":"\uc0c8 API \ud1a0\ud070 \ubc1c\uae09","security":[{"bearerAuth":[]}],"requestBody":{"required":false,"content":{"application\/json":{"schema":{"type":"object","properties":{"token_name":{"type":"string","maxLength":100}}}}}},"responses":{"201":{"description":"\ubc1c\uae09 \uc131\uacf5"},"401":{"description":"\uc778\uc99d \ud544\uc694"},"422":{"description":"\uac80\uc99d \uc624\ub958"}}}},"\/tokens\/{id}":{"delete":{"tags":["Auth"],"summary":"\ub0b4 API \ud1a0\ud070 \ud3d0\uae30","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"\ud1a0\ud070 ID","schema":{"type":"string"}}],"responses":{"200":{"description":"\ud3d0\uae30 \uc131\uacf5"},"401":{"description":"\uc778\uc99d \ud544\uc694"},"404":{"description":"\ud1a0\ud070 \uc5c6\uc74c"}}}},"\/auth\/logout":{"post":{"tags":["Auth"],"summary":"\ub85c\uadf8\uc544\uc6c3","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"\ub85c\uadf8\uc544\uc6c3 \uc131\uacf5"},"401":{"description":"\uc778\uc99d \ud544\uc694"}}}},"\/oauth\/clients":{"get":{"tags":["OAuth Clients"],"summary":"\ub0b4 \uace0\uae09 OAuth \uc5f0\uacb0 \ubaa9\ub85d","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"\uc131\uacf5"}}},"post":{"tags":["OAuth Clients"],"summary":"\ub0b4 \uace0\uae09 OAuth \uc5f0\uacb0 \uc0dd\uc131","security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/CreateClientRequest"}}}},"responses":{"201":{"description":"\uc0dd\uc131 \uc131\uacf5"},"422":{"description":"\uac80\uc99d \uc624\ub958"}}}},"\/posts":{"get":{"tags":["Posts"],"summary":"\ud3ec\uc2a4\ud2b8 \ubaa9\ub85d","parameters":[{"name":"per_page","in":"query","required":false,"schema":{"type":"integer","default":20}}],"responses":{"200":{"description":"\uc131\uacf5"}}},"post":{"tags":["Posts"],"summary":"\ud3ec\uc2a4\ud2b8 \uc0dd\uc131","security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/CreatePostRequest"}}}},"responses":{"201":{"description":"\uc0dd\uc131 \uc131\uacf5"},"422":{"description":"\uac80\uc99d \uc624\ub958"}}}},"\/posts\/{slug}":{"get":{"tags":["Posts"],"summary":"\ud3ec\uc2a4\ud2b8 \uc0c1\uc138","parameters":[{"name":"slug","in":"path","required":true,"description":"\ud3ec\uc2a4\ud2b8 slug","schema":{"type":"string"}}],"responses":{"200":{"description":"\uc131\uacf5"},"404":{"description":"\ud3ec\uc2a4\ud2b8 \uc5c6\uc74c"}}}},"\/posts\/{slug}\/content":{"get":{"tags":["Posts"],"summary":"\ud3ec\uc2a4\ud2b8 \ubcf8\ubb38","parameters":[{"name":"slug","in":"path","required":true,"description":"\ud3ec\uc2a4\ud2b8 slug","schema":{"type":"string"}}],"responses":{"200":{"description":"\uc131\uacf5"},"404":{"description":"\ud3ec\uc2a4\ud2b8 \uc5c6\uc74c"}}}},"\/random":{"get":{"tags":["Posts"],"summary":"\ub79c\ub364 \ud3ec\uc2a4\ud2b8","responses":{"200":{"description":"\uc131\uacf5"},"404":{"description":"\ud3ec\uc2a4\ud2b8 \uc5c6\uc74c"}}}},"\/posts\/{id}":{"put":{"tags":["Posts"],"summary":"\ud3ec\uc2a4\ud2b8 \uc218\uc815(ID)","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"\ud3ec\uc2a4\ud2b8 ID","schema":{"type":"integer"}}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/UpdatePostRequest"}}}},"responses":{"200":{"description":"\uc218\uc815 \uc131\uacf5"},"403":{"description":"\uad8c\ud55c \uc5c6\uc74c"},"404":{"description":"\ud3ec\uc2a4\ud2b8 \uc5c6\uc74c"},"422":{"description":"\uac80\uc99d \uc624\ub958"}}},"delete":{"tags":["Posts"],"summary":"\ud3ec\uc2a4\ud2b8 \uc0ad\uc81c","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"\ud3ec\uc2a4\ud2b8 ID","schema":{"type":"integer"}}],"responses":{"200":{"description":"\uc0ad\uc81c \uc131\uacf5"},"403":{"description":"\uad8c\ud55c \uc5c6\uc74c"},"404":{"description":"\ud3ec\uc2a4\ud2b8 \uc5c6\uc74c"}}}},"\/posts\/slug\/{slug}":{"put":{"tags":["Posts"],"summary":"\ud3ec\uc2a4\ud2b8 \uc218\uc815(slug)","security":[{"bearerAuth":[]}],"parameters":[{"name":"slug","in":"path","required":true,"description":"\ud3ec\uc2a4\ud2b8 slug","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/UpdatePostRequest"}}}},"responses":{"200":{"description":"\uc218\uc815 \uc131\uacf5"},"403":{"description":"\uad8c\ud55c \uc5c6\uc74c"},"404":{"description":"\ud3ec\uc2a4\ud2b8 \uc5c6\uc74c"},"422":{"description":"\uac80\uc99d \uc624\ub958"}}}},"\/posts\/{id}\/unhide":{"post":{"tags":["Posts"],"summary":"\uc228\uae40 \ud3ec\uc2a4\ud2b8 \ubcf5\uad6c","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"\ud3ec\uc2a4\ud2b8 ID","schema":{"type":"integer"}}],"responses":{"200":{"description":"\ubcf5\uad6c \uc131\uacf5"},"403":{"description":"\uad8c\ud55c \uc5c6\uc74c"},"404":{"description":"\ud3ec\uc2a4\ud2b8 \uc5c6\uc74c"}}}},"\/posts\/{parentSlug}\/sub":{"post":{"tags":["Posts"],"summary":"\ud558\uc704 \ubb38\uc11c \uc0dd\uc131","security":[{"bearerAuth":[]}],"parameters":[{"name":"parentSlug","in":"path","required":true,"description":"\ubd80\ubaa8 \ud3ec\uc2a4\ud2b8 slug","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/CreateSubDocumentRequest"}}}},"responses":{"201":{"description":"\uc0dd\uc131 \uc131\uacf5"},"404":{"description":"\ubd80\ubaa8 \ud3ec\uc2a4\ud2b8 \uc5c6\uc74c"},"422":{"description":"\uac80\uc99d \uc624\ub958"}}}},"\/attachments":{"post":{"tags":["Attachments"],"summary":"\ucca8\ubd80\ud30c\uc77c \uc5c5\ub85c\ub4dc","security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"multipart\/form-data":{"schema":{"type":"object","required":["file","post_id"],"properties":{"file":{"type":"string","format":"binary"},"post_id":{"type":"integer"},"description":{"type":"string"}}}}}},"responses":{"201":{"description":"\uc5c5\ub85c\ub4dc \uc131\uacf5"},"403":{"description":"\uad8c\ud55c \uc5c6\uc74c"},"422":{"description":"\uac80\uc99d \uc624\ub958"}}}},"\/attachments\/{id}":{"delete":{"tags":["Attachments"],"summary":"\ucca8\ubd80\ud30c\uc77c \uc0ad\uc81c","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"\ucca8\ubd80\ud30c\uc77c ID","schema":{"type":"integer"}}],"responses":{"200":{"description":"\uc0ad\uc81c \uc131\uacf5"},"403":{"description":"\uad8c\ud55c \uc5c6\uc74c"},"404":{"description":"\ucca8\ubd80\ud30c\uc77c \uc5c6\uc74c"}}}},"\/categories":{"get":{"tags":["Categories"],"summary":"\uce74\ud14c\uace0\ub9ac \ubaa9\ub85d","responses":{"200":{"description":"\uc131\uacf5"}}}},"\/categories\/{path}":{"get":{"tags":["Categories"],"summary":"\uce74\ud14c\uace0\ub9ac \uc0c1\uc138","parameters":[{"name":"path","in":"path","required":true,"description":"\uce74\ud14c\uace0\ub9ac \uacbd\ub85c","schema":{"type":"string"}}],"responses":{"200":{"description":"\uc131\uacf5"},"404":{"description":"\uce74\ud14c\uace0\ub9ac \uc5c6\uc74c"}}}},"\/search":{"get":{"tags":["Search"],"summary":"\ud3ec\uc2a4\ud2b8 \uac80\uc0c9","parameters":[{"name":"q","in":"query","required":true,"schema":{"type":"string"}},{"name":"category","in":"query","required":false,"schema":{"type":"string"}},{"name":"author","in":"query","required":false,"schema":{"type":"string"}},{"name":"sort","in":"query","required":false,"schema":{"type":"string","enum":["relevance","date","views"]}},{"name":"per_page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"\uc131\uacf5"},"422":{"description":"\uac80\uc99d \uc624\ub958"}}}},"\/search\/suggestions":{"get":{"tags":["Search"],"summary":"\uac80\uc0c9\uc5b4 \uc81c\uc548","parameters":[{"name":"q","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"\uc131\uacf5"}}}},"\/admin\/clients":{"get":{"tags":["Admin"],"summary":"\uc804\uccb4 \uace0\uae09 OAuth \uc5f0\uacb0 \ubaa9\ub85d","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"\uc131\uacf5"},"403":{"description":"\uad00\ub9ac\uc790\ub9cc \ud5c8\uc6a9"}}},"post":{"tags":["Admin"],"summary":"\uace0\uae09 OAuth \uc5f0\uacb0 \uc0dd\uc131","security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/AdminCreateClientRequest"}}}},"responses":{"201":{"description":"\uc0dd\uc131 \uc131\uacf5"},"403":{"description":"\uad00\ub9ac\uc790\ub9cc \ud5c8\uc6a9"},"422":{"description":"\uac80\uc99d \uc624\ub958"}}}},"\/admin\/clients\/{id}":{"delete":{"tags":["Admin"],"summary":"\uace0\uae09 OAuth \uc5f0\uacb0 \uc0ad\uc81c","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"\ud074\ub77c\uc774\uc5b8\ud2b8 ID","schema":{"type":"integer"}}],"responses":{"200":{"description":"\uc0ad\uc81c \uc131\uacf5"},"403":{"description":"\uad00\ub9ac\uc790\ub9cc \ud5c8\uc6a9"},"404":{"description":"\ud074\ub77c\uc774\uc5b8\ud2b8 \uc5c6\uc74c"}}}}},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"Bearer"}},"schemas":{"User":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":"string"},"email":{"type":"string","format":"email"},"is_admin":{"type":"boolean"},"is_approved":{"type":"boolean"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}}},"AuthorSummary":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":"string"}}},"Post":{"type":"object","properties":{"id":{"type":"integer"},"title":{"type":"string"},"slug":{"type":"string"},"content":{"type":"string"},"category_path":{"type":"string","nullable":true},"parent_id":{"type":"integer","nullable":true},"status":{"type":"string"},"view_count":{"type":"integer"},"published_at":{"type":"string","format":"date-time","nullable":true},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"author":{"$ref":"#\/components\/schemas\/AuthorSummary"}}},"Pagination":{"type":"object","properties":{"current_page":{"type":"integer"},"last_page":{"type":"integer"},"per_page":{"type":"integer"},"total":{"type":"integer"}}},"LoginRequest":{"type":"object","required":["email","password","client_id","client_secret","grant_type"],"properties":{"email":{"type":"string","format":"email"},"password":{"type":"string"},"client_id":{"type":"string"},"client_secret":{"type":"string"},"grant_type":{"type":"string","enum":["password"]}}},"SimpleLoginRequest":{"type":"object","required":["email","password"],"properties":{"email":{"type":"string","format":"email"},"password":{"type":"string"},"token_name":{"type":"string","maxLength":100}}},"RegisterRequest":{"type":"object","required":["name","email","password","password_confirmation","client_id","client_secret"],"properties":{"name":{"type":"string"},"email":{"type":"string","format":"email"},"password":{"type":"string","minLength":8},"password_confirmation":{"type":"string"},"client_id":{"type":"string"},"client_secret":{"type":"string"}}},"RefreshRequest":{"type":"object","required":["refresh_token","client_id","client_secret","grant_type"],"properties":{"refresh_token":{"type":"string"},"client_id":{"type":"string"},"client_secret":{"type":"string"},"grant_type":{"type":"string","enum":["refresh_token"]}}},"LoginResponse":{"type":"object","properties":{"access_token":{"type":"string"},"token_type":{"type":"string"},"expires_in":{"type":"integer"},"refresh_token":{"type":"string","nullable":true},"user":{"$ref":"#\/components\/schemas\/User"}}},"SimpleLoginResponse":{"type":"object","properties":{"access_token":{"type":"string"},"token_type":{"type":"string"},"token_name":{"type":"string"},"expires_at":{"type":"string","format":"date-time","nullable":true},"user":{"$ref":"#\/components\/schemas\/User"}}},"CreatePostRequest":{"type":"object","required":["title","content"],"properties":{"title":{"type":"string","maxLength":255},"content":{"type":"string"},"slug":{"type":"string","maxLength":255},"category_path":{"type":"string","maxLength":255},"parent_slug":{"type":"string"}}},"UpdatePostRequest":{"type":"object","properties":{"title":{"type":"string","maxLength":255},"content":{"type":"string"},"slug":{"type":"string","maxLength":255},"status":{"type":"string","enum":["draft","published"]},"category_path":{"type":"string","maxLength":255}}},"CreateSubDocumentRequest":{"type":"object","required":["title","content"],"properties":{"title":{"type":"string","maxLength":255},"content":{"type":"string"},"slug":{"type":"string","maxLength":255},"excerpt":{"type":"string","maxLength":500,"nullable":true}}},"CreateClientRequest":{"type":"object","required":["name"],"properties":{"name":{"type":"string","maxLength":255},"redirect":{"type":"string","maxLength":255,"nullable":true}}},"AdminCreateClientRequest":{"type":"object","required":["name"],"properties":{"name":{"type":"string","maxLength":255},"redirect":{"type":"string","maxLength":255,"nullable":true},"personal_access_client":{"type":"boolean"},"password_client":{"type":"boolean"}}}}}}