OurBlog

API 문서

아워블로그 REST API로 글을 만들고 고치고 발행하세요. 사내 시스템·자동화 도구에서 블로그를 바로 다룰 수 있습니다. Claude·ChatGPT에서 쓰려면 MCP 연결을 보세요. MCP 연결 방법

API 키 만들기

  1. 관리 화면의 블로그 설정 맨 아래 「API 키」에서 키 이름을 쓰고 「키 만들기」를 누르세요.
  2. 키는 만들 때 한 번만 보입니다. 바로 복사해 안전한 곳에 두세요. 키 하나는 블로그 하나에만 쓰입니다.
  3. 키가 새었다면 같은 곳에서 「취소」를 누르세요. 그 키를 쓰는 연결은 바로 끊깁니다.

인증

모든 요청에 Authorization 머리말로 키를 보내세요.

Authorization: Bearer ob_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

기본 주소

https://ourblog.app/api/v1

본문 형식

본문은 html(HTML 문자열)이나 content(편집기 형식 TipTap JSON)로 보내세요. 응답에는 둘 다 옵니다. html에서 블로그가 그리지 않는 태그(script·style 등)는 저장할 때 빠지고, content에 편집기가 모르는 노드가 있으면 422로 돌려보냅니다.

오류

오류는 언제나 같은 모양입니다. code로 판단하고, message는 사람에게 보여 줄 때 쓰세요.

{
  "error": {
    "code": "validation_error",
    "message": "이 블로그에 같은 주소의 글이 있습니다",
    "field": "slug"
  }
}
상태code뜻
400invalid_json본문이 JSON 객체가 아닙니다
401unauthorized키가 없거나 맞지 않거나 취소된 키입니다
404not_found없는 글·언어판·주소입니다
409cannot_publish · not_published · language_not_enabled지금 상태로는 할 수 없는 동작입니다(예: 제목 없는 글 발행, 켜지 않은 언어)
413payload_too_large요청 본문이 너무 큽니다(본문 HTML 50만 자까지)
422validation_error칸 값이 맞지 않습니다. field에 어느 칸인지 적힙니다
429rate_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

최근 발행한 글부터 돌려줍니다. 아직 발행하지 않은 글이 맨 앞에 옵니다.

쿼리

statusstring
draft · scheduled · published
categoryIdstring
이 카테고리의 글만
limitinteger
1~100, 기본 20
offsetinteger
건너뛸 개수, 기본 0

요청

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)

titlestring
제목(300자까지). 글을 만들 때는 꼭 넣으세요
htmlstring
본문 HTML. h2·h3·p·ul·ol·blockquote·a·strong·em·img를 씁니다. 보내면 본문 전체를 바꿉니다
contentobject
html 대신 편집기 형식(TipTap JSON, type이 doc)으로 본문을 보낼 때
descriptionstring
검색 결과에 나갈 요약(1000자까지)
slugstring
글 주소. 글자·숫자·하이픈만. 비우면 제목으로 만듭니다
seoTitlestring
검색 결과용 제목. 비우면 제목을 씁니다
authorNamestring
글쓴이 이름
categoryIdstring | null
카테고리 id(GET /categories)

요청

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)

htmlstring
본문 HTML. h2·h3·p·ul·ol·blockquote·a·strong·em·img를 씁니다. 보내면 본문 전체를 바꿉니다
contentobject
html 대신 편집기 형식(TipTap JSON, type이 doc)으로 본문을 보낼 때
descriptionstring
검색 결과에 나갈 요약(1000자까지)
slugstring
글 주소. 글자·숫자·하이픈만. 비우면 제목으로 만듭니다
seoTitlestring
검색 결과용 제목. 비우면 제목을 씁니다
authorNamestring
글쓴이 이름
categoryIdstring | null
카테고리 id(GET /categories)
titlestring
제목

요청

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
블로그 시간대의 시각 YYYY-MM-DDTHH:mm

요청

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)

titlestring
그 언어의 제목
descriptionstring
그 언어의 요약
slugstring
그 언어의 글 주소. 비우면 제목으로 만듭니다
html / contentstring / object
본문
publishboolean
true면 블로그에 냅니다. 기본 false(쓰는 중)

요청

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

블로그 문의 폼으로 들어온 문의를 최근 것부터 돌려줍니다. 이름·연락처가 들어 있으니 키를 받은 시스템 밖으로 내보내지 마세요.

쿼리

statusstring
new · contacted · spam
formIdstring
이 폼으로 들어온 것만
from / tostring
블로그 시간대의 날짜 YYYY-MM-DD
qstring
이름·이메일·전화·회사·내용에서 찾기
limitinteger
1~500, 기본 50

요청

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
    }
  ]
}