to.co API
웹사이트, POS 시스템, 스크립트 같은 자체 소프트웨어가 to.co의 회사 정보를 읽고 최신으로 유지하게 하세요. 키는 Pro와 Grow에서 제공됩니다.
- 기본 URL
https://api.to.co/v1/orgs/{host}- 인증
Authorization: Bearer toco_ak_…
API 키 받기
my.to.co에서 회사를 열고 API 키를 선택한 다음 키 만들기를 누르세요. 이름을 정하고, 범위와 만료일(최대 1년)을 고른 뒤 키를 복사하세요. 키는 한 번만 표시되며 해시만 보관됩니다.
모든 요청의 Authorization 헤더에 키를 보내세요. 키는 해당 회사에서만 작동하며, 다른 주소는 찾을 수 없음으로 응답합니다. API는 키만 받으며 브라우저 세션은 받지 않습니다.
호출 예시
curl https://api.to.co/v1/orgs/mybusiness.uk.to.co \
-H "Authorization: Bearer toco_ak_…"
범위와 요금제
키는 범위가 허용하는 일만, 그리고 각 요청 시점에 회사 요금제에 포함된 일만 할 수 있습니다. 읽기는 Pro와 Grow에서, 변경은 Grow에서 가능합니다.
| 범위 | 기능 | 최소 요금제 |
|---|---|---|
company:read | Your company details, services and locations. | Pro |
messages:read | Messages from your contact form (not those held as spam). | Pro |
company:write | Replace your services, and change phone numbers and opening hours. | Grow |
posts:read | The posts you write on to.co, drafts included. | Pro |
posts:write | Write, save, publish, unpublish and delete posts. | Grow |
경로
모든 경로는 기본 URL 아래에 있으며, {host} 자리에 회사의 to.co 주소(예: mybusiness.uk.to.co)를 넣습니다. 요청과 응답은 JSON입니다. 변경은 my.to.co에서 한 변경과 같은 확인, 기록, 다시 게시 과정을 거치며, 키가 한 것으로 기록됩니다.
| 경로 | 기능 | 범위 |
|---|---|---|
GET /v1/orgs/{host} | The company record, with its services and locations. | company:read |
GET /v1/orgs/{host}/services | The services, in order. | company:read |
GET /v1/orgs/{host}/locations | The locations, with phones and opening hours. | company:read |
GET /v1/orgs/{host}/messages | Contact form messages. Filter with ?status=new|read|replied|archived. | messages:read |
GET /v1/orgs/{host}/messages/{id} | One message. | messages:read |
PATCH /v1/orgs/{host} | Change the company phone numbers: JSON { "phones": … }. | company:write |
PUT /v1/orgs/{host}/services | Replace the whole list of services, in order: JSON { "services": [ … ] }. | company:write |
PATCH /v1/orgs/{host}/locations/{location} | Change a location: JSON with any of phones, normal_hours and special_hours. Every value is checked, and the answer carries the checks. The registered office comes from the register and cannot be changed. | company:write |
GET /v1/orgs/{host}/posts | Posts written on to.co, newest change first, a page at a time: ?limit, ?state and ?cursor (next_cursor from the page before). | posts:read |
GET /v1/orgs/{host}/posts/{id} | One post, its body as blocks, with its version as the ETag. | posts:read |
POST /v1/orgs/{host}/posts | A new draft: JSON { "title", "standfirst", "body" }, or the body as text/markdown. | posts:write |
PATCH /v1/orgs/{host}/posts/{id} | Save a post. Send the version you are changing as If-Match; JSON, or the body as text/markdown. | posts:write |
DELETE /v1/orgs/{host}/posts/{id} | Move a post to the bin. The owner can restore it in my.to.co for 30 days. | posts:write |
POST /v1/orgs/{host}/posts/{id}/publish | Publish the If-Match version. It is checked first, as when the owner publishes. | posts:write |
POST /v1/orgs/{host}/posts/{id}/unpublish | Take a post off the page and back to a draft. | posts:write |
크레딧과 한도
- 요청 하나에 API 크레딧 1개를 사용하며, 내 AI 어시스턴트가 비즈니스의 MCP 서버를 호출할 때와 같은 월간 한도에서 차감됩니다. 회사당 월 Pro 5,000개, Grow 50,000개입니다. 실패한 요청은 크레딧을 돌려받습니다. 크레딧은 매월 1일(UTC)에 다시 시작되며, 초과 요금은 없습니다. 응답에는 X-Credits-Limit, X-Credits-Remaining, X-Credits-Reset이 포함됩니다.
- 키당 분당 최대 120개 요청.
- 회사당 분당 최대 60건 변경. my.to.co와 MCP에서 한 변경도 함께 계산됩니다.
오류
오류는 HTTP 상태와 JSON으로 응답합니다. error(메시지), code(아래 코드 중 하나), request_id가 포함됩니다. 429에는 Retry-After가 포함됩니다.
invalid_request(400) — The body or a query value is not valid; the message says which field.cookie_not_accepted(400) — The request carried a browser session. This API takes an API key only.if_match_required(400) — A post change without If-Match.not_ready(400) — The post cannot be published yet; problems lists why.image_unknown(400) — A post body shows an image the post does not have. A key cannot upload images.invalid_key(401) — No key, or one that is unknown, revoked or expired.insufficient_scope(403) — The key does not have the scope this route needs.plan_required(403) — The company plan does not include this scope now; plan_needed names the plan that does.insufficient_role(403) — The person who made the key no longer has the role for this; an owner makes a new key.not_found(404) — Not found. A host other than the key's own company is always not found.registered_office(409) — The registered office comes from the company register and cannot be changed with a key.post_changed(409) — The post changed since the If-Match version. Read it again.post_deleted(409) — The post is in the bin.not_draft(409) — Only a draft can be scheduled.slug_taken(409) — Another post already uses that address.rate_limited(429) — Too many requests. Wait for Retry-After.credits_exhausted(429) — This month's API credits are used. They start again on the first of next month; there are no overage charges.credits_unavailable(503) — The API cannot count credits right now. Try again later.
웹훅
Grow에서는 새 메시지나 회사 정보 변경 같은 일이 생기면 to.co가 서명된 이벤트를 자체 서버로 보낼 수도 있습니다. my.to.co의 웹훅에서 설정하세요.