본문 형식
본문은 html(HTML 문자열)이나 content(편집기 형식 TipTap JSON)로 보내세요. 응답에는 둘 다 옵니다. html에서 블로그가 그리지 않는 태그(script·style 등)는 저장할 때 빠지고, content에 편집기가 모르는 노드가 있으면 422로 돌려보냅니다.
아워블로그 REST API로 글을 만들고 고치고 발행하세요. 사내 시스템·자동화 도구에서 블로그를 바로 다룰 수 있습니다. Claude·ChatGPT에서 쓰려면 MCP 연결을 보세요. MCP 연결 방법
모든 요청에 Authorization 머리말로 키를 보내세요.
Authorization: Bearer ob_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxhttps://ourblog.app/api/v1본문은 html(HTML 문자열)이나 content(편집기 형식 TipTap JSON)로 보내세요. 응답에는 둘 다 옵니다. html에서 블로그가 그리지 않는 태그(script·style 등)는 저장할 때 빠지고, content에 편집기가 모르는 노드가 있으면 422로 돌려보냅니다.
오류는 언제나 같은 모양입니다. code로 판단하고, message는 사람에게 보여 줄 때 쓰세요.
{
"error": {
"code": "validation_error",
"message": "이 블로그에 같은 주소의 글이 있습니다",
"field": "slug"
}
}| 상태 | code | 뜻 |
|---|---|---|
| 400 | invalid_json | 본문이 JSON 객체가 아닙니다 |
| 401 | unauthorized | 키가 없거나 맞지 않거나 취소된 키입니다 |
| 404 | not_found | 없는 글·언어판·주소입니다 |
| 409 | cannot_publish · not_published · language_not_enabled | 지금 상태로는 할 수 없는 동작입니다(예: 제목 없는 글 발행, 켜지 않은 언어) |
| 413 | payload_too_large | 요청 본문이 너무 큽니다(본문 HTML 50만 자까지) |
| 422 | validation_error | 칸 값이 맞지 않습니다. field에 어느 칸인지 적힙니다 |
| 429 | rate_limited | 키 하나로 1분에 120번까지입니다. Retry-After 초 뒤 다시 보내세요 |
키 하나로 1분에 120번까지 보낼 수 있습니다. 응답 머리말 X-RateLimit-Remaining에 남은 횟수가 나옵니다.
GET/api/v1/blog
키가 연결된 블로그의 이름·주소·언어·시간대·요금제를 돌려줍니다.
요청
curl https://ourblog.app/api/v1/blog \
-H "Authorization: Bearer $OURBLOG_API_KEY"응답
{
"id": "b29a07fb-0529-40a7-b102-dce455cbffb0",
"slug": "ourblog",
"name": "아워블로그 블로그",
"description": "우리 언어로 쓰고, 해외 고객을 만나세요.",
"url": "https://ourblog.ourblog.app",
"sourceLang": "ko",
"languages": ["ko", "en", "ja", "zh-CN"],
"timezone": "Asia/Seoul",
"plan": "global_pro"
}GET/api/v1/posts
최근 발행한 글부터 돌려줍니다. 아직 발행하지 않은 글이 맨 앞에 옵니다.
쿼리
statusstringcategoryIdstringlimitintegeroffsetinteger요청
curl "https://ourblog.app/api/v1/posts?status=published&limit=5" \
-H "Authorization: Bearer $OURBLOG_API_KEY"응답
{
"data": [
{
"id": "75658e84-1174-4efc-b0d0-3aa64d93ca0b",
"slug": "welcome",
"title": "아워블로그 블로그를 시작합니다",
"description": "…",
"status": "published",
"categoryId": null,
"authorName": "OurBlog",
"publishedAt": "2026-11-28T11:05:41.953Z",
"updatedAt": "2026-11-29T11:05:44.172Z",
"createdAt": "2026-11-29T11:05:44.172Z",
"hasUnpublishedChanges": false,
"url": "https://ourblog.ourblog.app/welcome"
}
],
"total": 1,
"limit": 5,
"offset": 0
}GET/api/v1/posts/{id 또는 slug}
글 id나 주소(slug)로 찾습니다. 고치는 중인 판(title·content·html)과 블로그에 공개된 판(published), 언어판 목록(translations)을 함께 돌려줍니다.
요청
curl https://ourblog.app/api/v1/posts/api-first-post \
-H "Authorization: Bearer $OURBLOG_API_KEY"응답
{
"id": "f869bcde-3488-4022-b327-2b59488bc249",
"slug": "api-first-post",
"title": "API로 쓴 첫 글",
"description": "REST API로 만든 임시 글입니다.",
"status": "draft",
"categoryId": null,
"authorName": "아워블로그",
"publishedAt": null,
"updatedAt": "2026-11-29T11:17:22.551Z",
"createdAt": "2026-11-29T11:17:22.548Z",
"hasUnpublishedChanges": false,
"url": null,
"seoTitle": "",
"canonicalUrl": null,
"content": { "type": "doc", "content": [ … ] },
"html": "<h2>소제목</h2><p>본문 <strong>굵게</strong>와 …</p>",
"published": null,
"translations": []
}POST/api/v1/posts
임시 글로 만듭니다. 블로그에 내려면 발행(publish)을 따로 부르세요. 201을 돌려줍니다.
본문(JSON)
titlestringhtmlstringcontentobjectdescriptionstringslugstringseoTitlestringauthorNamestringcategoryIdstring | null요청
curl -X POST https://ourblog.app/api/v1/posts \
-H "Authorization: Bearer $OURBLOG_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"title": "API로 쓴 첫 글",
"description": "REST API로 만든 임시 글입니다.",
"slug": "api-first-post",
"authorName": "아워블로그",
"html": "<h2>소제목</h2><p>본문 <strong>굵게</strong>와 <a href=\"https://ourblog.app\">링크</a>.</p>"
}'응답
{
"id": "f869bcde-3488-4022-b327-2b59488bc249",
"slug": "api-first-post",
"title": "API로 쓴 첫 글",
"description": "REST API로 만든 임시 글입니다.",
"status": "draft",
"categoryId": null,
"authorName": "아워블로그",
"publishedAt": null,
"updatedAt": "2026-11-29T11:17:22.551Z",
"createdAt": "2026-11-29T11:17:22.548Z",
"hasUnpublishedChanges": false,
"url": null,
"seoTitle": "",
"canonicalUrl": null,
"content": { "type": "doc", "content": [ … ] },
"html": "<h2>소제목</h2><p>본문 <strong>굵게</strong>와 …</p>",
"published": null,
"translations": []
}PATCH/api/v1/posts/{id 또는 slug}
보낸 칸만 바꿉니다. 이미 공개된 글은 고친 내용이 바로 나가지 않고 hasUnpublishedChanges가 true가 됩니다. 발행하면 블로그에 나갑니다.
본문(JSON)
htmlstringcontentobjectdescriptionstringslugstringseoTitlestringauthorNamestringcategoryIdstring | nulltitlestring요청
curl -X PATCH https://ourblog.app/api/v1/posts/f869bcde-3488-4022-b327-2b59488bc249 \
-H "Authorization: Bearer $OURBLOG_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "description": "설명을 고쳤습니다." }'응답
{
"id": "f869bcde-3488-4022-b327-2b59488bc249",
"title": "API로 쓴 첫 글",
"description": "설명을 고쳤습니다.",
"status": "draft",
…
}POST/api/v1/posts/{id 또는 slug}/publish
고치는 판을 블로그에 공개합니다. 주소를 바꿨으면 옛 주소는 새 주소로 넘어갑니다(308). at을 보내면 그 시각에 공개합니다(1분 뒤부터 1년 안, 아직 공개 전인 글만).
본문(JSON)
atstring요청
curl -X POST https://ourblog.app/api/v1/posts/f869bcde-3488-4022-b327-2b59488bc249/publish \
-H "Authorization: Bearer $OURBLOG_API_KEY"응답
{
"id": "f869bcde-3488-4022-b327-2b59488bc249",
"slug": "api-first-post",
"status": "published",
"publishedAt": "2026-11-29T11:17:22.743Z",
"url": "https://ourblog.ourblog.app/api-first-post",
…
}POST/api/v1/posts/{id 또는 slug}/unpublish
공개되거나 예약된 글을 블로그에서 내립니다. 내용은 임시 글로 남습니다.
요청
curl -X POST https://ourblog.app/api/v1/posts/f869bcde-3488-4022-b327-2b59488bc249/unpublish \
-H "Authorization: Bearer $OURBLOG_API_KEY"응답
{ "id": "f869bcde-…", "status": "draft", "url": null, … }DELETE/api/v1/posts/{id 또는 slug}
글과 언어판·버전 기록을 지웁니다. 되돌릴 수 없습니다.
요청
curl -X DELETE https://ourblog.app/api/v1/posts/f869bcde-3488-4022-b327-2b59488bc249 \
-H "Authorization: Bearer $OURBLOG_API_KEY"응답
{ "id": "f869bcde-3488-4022-b327-2b59488bc249", "deleted": true }GET/api/v1/posts/{id 또는 slug}/translations/{lang}
블로그 설정에서 켠 언어(en · ja · zh-CN · zh-TW · ko)의 판을 돌려줍니다.
요청
curl https://ourblog.app/api/v1/posts/api-first-post/translations/en \
-H "Authorization: Bearer $OURBLOG_API_KEY"응답
{
"postId": "f869bcde-3488-4022-b327-2b59488bc249",
"lang": "en",
"status": "manual",
"slug": "my-first-post-via-the-api",
"title": "My first post via the API",
"description": "",
"content": { "type": "doc", "content": [ … ] },
"html": "<p>Hello from the API.</p>",
"updatedAt": "2026-11-29T11:17:22.845Z",
"url": "https://ourblog.ourblog.app/en/my-first-post-via-the-api"
}PUT/api/v1/posts/{id 또는 slug}/translations/{lang}
언어판을 만들거나 고칩니다. 안 보낸 칸은 지금 값을 그대로 둡니다. publish를 true로 보내면 블로그에 냅니다(원문이 공개돼 있을 때 보입니다). 언어 추가는 유료 요금제에서 켭니다.
본문(JSON)
titlestringdescriptionstringslugstringhtml / contentstring / objectpublishboolean요청
curl -X PUT https://ourblog.app/api/v1/posts/api-first-post/translations/en \
-H "Authorization: Bearer $OURBLOG_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "title": "My first post via the API", "html": "<p>Hello from the API.</p>", "publish": true }'응답
{ "lang": "en", "status": "manual", "slug": "my-first-post-via-the-api", "url": "https://ourblog.ourblog.app/en/my-first-post-via-the-api", … }GET/api/v1/categories
관리 화면의 순서대로 돌려줍니다. 글의 categoryId에 이 id를 씁니다.
요청
curl https://ourblog.app/api/v1/categories \
-H "Authorization: Bearer $OURBLOG_API_KEY"응답
{
"data": [
{ "id": "4c1e…", "slug": "guide", "name": "이용 안내", "description": "", "postCount": 12 }
]
}GET/api/v1/leads
블로그 문의 폼으로 들어온 문의를 최근 것부터 돌려줍니다. 이름·연락처가 들어 있으니 키를 받은 시스템 밖으로 내보내지 마세요.
쿼리
statusstringformIdstringfrom / tostringqstringlimitinteger요청
curl "https://ourblog.app/api/v1/leads?status=new&from=2026-11-01" \
-H "Authorization: Bearer $OURBLOG_API_KEY"응답
{
"data": [
{
"id": "0b7d…",
"createdAt": "2026-11-28T02:14:09.000Z",
"status": "new",
"form": { "id": "9a31…", "name": "상담 신청" },
"email": "kim@example.com",
"phone": "+821012345678",
"name": "김민지",
"company": "예시병원",
"message": "상담 가능한 시간을 알려 주세요.",
"answers": {},
"lang": "ko",
"country": "KR",
"post": { "id": "75658e84-…", "title": "…" },
"pageUrl": "https://…",
"referrer": null,
"consent": true
}
]
}