콘텐츠로 이동

블로그 API

블로그를 생성하고 관리합니다. API 키와 커스텀 도메인도 이 엔드포인트에서 관리합니다.

POST /blogs
파라미터타입필수설명
slugstringYes블로그 서브도메인 (영문 소문자 + 숫자 + 하이픈, 1-63자)
namestringYes블로그 이름 (최대 200자)
descriptionstringNo블로그 설명 (최대 1000자)

플랜별 블로그 개수 제한: Free 1개, Starter 1개, Creator 3개, Scale 5개, Enterprise 무제한.

curl
curl -X POST https://api.postlark.ai/v1/blogs \
-H "Authorization: Bearer pk_live_your_key" \
-H "Content-Type: application/json" \
-d '{
"slug": "my-tech-blog",
"name": "My Tech Blog",
"description": "Writing about AI, APIs, and developer tools."
}'
Response (201)
{
"id": "b1c2d3e4-5678-90ab-cdef-1234567890ab",
"slug": "my-tech-blog",
"name": "My Tech Blog",
"url": "https://my-tech-blog.postlark.ai",
"created_at": "2026-03-24T10:00:00.000Z"
}
GET /blogs

인증된 사용자가 소유한 모든 블로그를 최신순으로 반환합니다.

curl
curl https://api.postlark.ai/v1/blogs \
-H "Authorization: Bearer pk_live_your_key"
Response
{
"data": [
{
"id": "b1c2d3e4-5678-90ab-cdef-1234567890ab",
"slug": "my-tech-blog",
"name": "My Tech Blog",
"description": "Writing about AI, APIs, and developer tools.",
"custom_domain": null,
"created_at": "2026-03-24T10:00:00.000Z",
"updated_at": "2026-03-24T10:00:00.000Z"
}
]
}
PUT /blogs/:id
파라미터타입필수설명
namestringNo블로그 이름 (최대 200자)
descriptionstringNo블로그 설명 (최대 1000자)
theme_configobjectNo테마 커스터마이징 (플랜별 제한)

플랜별 테마 기능:

  • Starter+: customCss, adCode, cssUrl
  • Creator+: headerHtml, footerHtml
curl
curl -X PUT https://api.postlark.ai/v1/blogs/b1c2d3e4-5678-90ab-cdef-1234567890ab \
-H "Authorization: Bearer pk_live_your_key" \
-H "Content-Type: application/json" \
-d '{
"name": "My Renamed Blog",
"description": "Updated description for the blog.",
"theme_config": {
"customCss": "body { font-family: Georgia, serif; }",
"headerHtml": "<nav>Custom navigation</nav>"
}
}'
Response
{
"id": "b1c2d3e4-5678-90ab-cdef-1234567890ab",
"slug": "my-tech-blog",
"name": "My Renamed Blog",
"description": "Updated description for the blog.",
"custom_domain": null,
"theme_config": {
"customCss": "body { font-family: Georgia, serif; }",
"headerHtml": "<nav>Custom navigation</nav>"
},
"updated_at": "2026-03-25T09:30:00.000Z"
}
DELETE /blogs/:id
curl
curl -X DELETE https://api.postlark.ai/v1/blogs/b1c2d3e4-5678-90ab-cdef-1234567890ab \
-H "Authorization: Bearer pk_live_your_key"
Response
{
"deleted": true
}
POST /blogs/:id/api-keys
파라미터타입필수설명
namestringNo키 이름 (기본값: “Default”, 최대 100자)
curl
curl -X POST https://api.postlark.ai/v1/blogs/b1c2d3e4-5678-90ab-cdef-1234567890ab/api-keys \
-H "Authorization: Bearer pk_live_your_key" \
-H "Content-Type: application/json" \
-d '{ "name": "CI/CD Pipeline" }'
Response (201)
{
"id": "k1l2m3n4-5678-90ab-cdef-1234567890ab",
"name": "CI/CD Pipeline",
"key": "pk_live_a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6",
"prefix": "pk_live_a1b2",
"scopes": ["*"],
"expires_at": null,
"created_at": "2026-03-25T10:00:00.000Z"
}
GET /blogs/:id/api-keys

키 접두사와 메타데이터만 반환합니다 (전체 키는 반환하지 않음). 활성 (미폐기) 키만 표시됩니다.

curl
curl https://api.postlark.ai/v1/blogs/b1c2d3e4-5678-90ab-cdef-1234567890ab/api-keys \
-H "Authorization: Bearer pk_live_your_key"
Response
{
"data": [
{
"id": "k1l2m3n4-5678-90ab-cdef-1234567890ab",
"name": "CI/CD Pipeline",
"key_prefix": "pk_live_a1b2",
"scopes": ["*"],
"expires_at": null,
"last_used_at": "2026-03-25T15:30:00.000Z",
"created_at": "2026-03-25T10:00:00.000Z"
}
]
}
DELETE /blogs/:id/api-keys/:keyId

API 키를 소프트 삭제합니다. 키는 즉시 작동을 중지합니다.

curl
curl -X DELETE https://api.postlark.ai/v1/blogs/b1c2d3e4-5678-90ab-cdef-1234567890ab/api-keys/k1l2m3n4-5678-90ab-cdef-1234567890ab \
-H "Authorization: Bearer pk_live_your_key"
Response
{
"deleted": true
}
POST /blogs/:id/domain
파라미터타입필수설명
hostnamestringYes커스텀 도메인 (예: blog.yourdomain.com)
curl
curl -X POST https://api.postlark.ai/v1/blogs/b1c2d3e4-5678-90ab-cdef-1234567890ab/domain \
-H "Authorization: Bearer pk_live_your_key" \
-H "Content-Type: application/json" \
-d '{ "hostname": "blog.yourdomain.com" }'
Response
{
"hostname": "blog.yourdomain.com",
"status": "pending_verification",
"cname_target": "my-tech-blog.postlark.ai",
"instructions": "Add a CNAME record: blog.yourdomain.com → my-tech-blog.postlark.ai"
}
GET /blogs/:id/domain
curl
curl https://api.postlark.ai/v1/blogs/b1c2d3e4-5678-90ab-cdef-1234567890ab/domain \
-H "Authorization: Bearer pk_live_your_key"
Response
{
"hostname": "blog.yourdomain.com",
"status": "active",
"cname_target": "my-tech-blog.postlark.ai"
}
DELETE /blogs/:id/domain
curl
curl -X DELETE https://api.postlark.ai/v1/blogs/b1c2d3e4-5678-90ab-cdef-1234567890ab/domain \
-H "Authorization: Bearer pk_live_your_key"
Response
{
"deleted": true
}

참고: 테마, 커스텀 도메인, 인증