콘텐츠로 이동

CLI

웹 앱에서 만든 이름이 있는 API 키를 환경 변수로 설정하세요.

Terminal window
export ANKK_THREADS_API_KEY="<your-api-key>"

기본 대상은 https://threads-api.ankk.app입니다. 로컬 개발에서는 이름이 있는 HTTPS 터널을 사용합니다.

Terminal window
export ANKK_THREADS_API_BASE_URL="https://threads-api-dev.ankk.app"

주요 명령:

Terminal window
ankk-threads accounts list
ankk-threads content list
ankk-threads content create --account-id <uuid> --text "Hello Threads"
ankk-threads content publish <content-id>
ankk-threads status <job-id> --kind publish
ankk-threads uploads put image.jpg --content-type image/jpeg
ankk-threads listening add threads --account-id <uuid>
ankk-threads listening posts --query launch
ankk-threads analytics collect-account \
--account-id <uuid> \
--from 2026-07-01T00:00:00Z \
--to 2026-07-08T00:00:00Z \
--timezone Asia/Seoul
ankk-threads analytics posts --account-id <uuid>

자동화에는 --json을 사용하세요. CLI는 얇은 클라이언트로 유지됩니다. 검증, 소유권, 멱등성, 게시 실행, canonical 상태는 API와 도메인 서비스가 관리합니다.

서명된 고객 웹훅을 관리합니다.

Terminal window
ankk-threads webhooks list
ankk-threads webhooks create \
--name production \
--url https://example.com/webhooks/ankk \
--event threads.publish.succeeded threads.publish.failed
ankk-threads webhooks deliveries --json