Skip to content
Documentation menu: 15-minute quickstart

15-minute quickstart

Reach your first approved, scheduled post in fifteen minutes using REST v2 or the hl CLI. Every request passes the policy gate and leaves a traceable audit row.

Target time: 15 minutesPrerequisites: Node 22 or curl

Three keys by design

honeloop bootstrap mints three separate API keys: agent(posts:read, posts:write, posts:publish,channels:read), reviewer (approvals:decide,posts:read) and operator (channels:manage,channels:read). No single key can both propose and approve its own post.

  1. 1

    Boot the stack and bootstrap keys

    On a fresh self-hosted install, run migrations, bootstrap your organisation and start the three containers (honeloop, postgres and temporal). Secrets print once in bootstrap.json and are stored only as peppered hashes.

    Self-host bootstrap (shell)

    # 1. Apply migrations on Postgres
    docker compose run --rm honeloop migrate
    
    # 2. Create your organisation, master key, seeded in_the_loop policy and three keys
    docker compose run --rm honeloop bootstrap \
      --org-name "Fernwood Studio" \
      --generate-master-key \
      --output json > bootstrap.json
    
    # 3. Start Postgres, Temporal and Honeloop
    docker compose up -d --wait
    
    # 4. Export the three minted keys into your shell session
    export HONELOOP_AGENT_KEY="$(jq -r '.keys.agent.secret' bootstrap.json)"
    export HONELOOP_REVIEWER_KEY="$(jq -r '.keys.reviewer.secret' bootstrap.json)"
    export HONELOOP_OPERATOR_KEY="$(jq -r '.keys.operator.secret' bootstrap.json)"
  2. 2

    Verify your key with system.ping

    Every capability is a POST /v2/<domain>/<verb> call withContent-Type: application/json and Authorization: Bearer. Callsystem.ping to confirm your key, principal ID and organisation ID.

    Request

    curl -sS -X POST "https://api.honeloop.example/v2/system/ping" \
      -H "Authorization: Bearer $HONELOOP_AGENT_KEY" \
      -H "Content-Type: application/json" \
      -H "X-Correlation-Id: quickstart-ping-001" \
      -d '{}'

    Response (HTTP 200)

    {
      "pong": true,
      "server_time": "2026-11-25T10:00:00.000Z",
      "principal_id": "0197e3a0-0000-7000-8000-0000000000a2",
      "org_id": "0197e3a0-0000-7000-8000-0000000000a1",
      "version": "0.1.0"
    }
  3. 3

    Connect or list an active channel

    Connect a Bluesky account using an app password with the operator key, then read the active channel ID with the agent key viachannels.list. Passing X-Honeloop-Org asserts the credential belongs to that organisation.

    Connect Bluesky and list active channels

    # Connect Bluesky with the operator key using an app password on stdin
    printf '%s\n' "$BSKY_APP_PASSWORD" | HONELOOP_API_KEY="$HONELOOP_OPERATOR_KEY" \
      hl channels connect \
        --base-url "https://api.honeloop.example" \
        --provider bluesky \
        --variant app_password \
        --identifier "fernwood.bsky.social" \
        --password-stdin
    
    # Or list active channels with the agent key
    curl -sS -X POST "https://api.honeloop.example/v2/channels/list" \
      -H "Authorization: Bearer $HONELOOP_AGENT_KEY" \
      -H "X-Honeloop-Org: 0197e3a0-0000-7000-8000-0000000000a1" \
      -H "Content-Type: application/json" \
      -d '{"status":"active"}'
  4. 4

    Create a draft post

    Drafting never publishes and is allowed at every autonomy level. Callposts.create with the agent key and keep the returned id and version (starts at1).

    Create draft (POST /v2/posts/create)

    curl -sS -X POST "https://api.honeloop.example/v2/posts/create" \
      -H "Authorization: Bearer $HONELOOP_AGENT_KEY" \
      -H "X-Honeloop-Org: 0197e3a0-0000-7000-8000-0000000000a1" \
      -H "Content-Type: application/json" \
      -H "Idempotency-Key: qs-example-create-0001" \
      -d '{
        "channel_ids": ["0197e3a0-0000-7000-8000-0000000000a5"],
        "parts": [
          { "kind": "text", "text": "Speckled oatmeal mugs are in the shop on Tuesday at 10:00." }
        ]
      }'
  5. 5

    Schedule the draft and handle HTTP 202 diversion

    posts.schedulerequires an Idempotency-Key header (8 to 128 printable ASCII characters) and the post's current version. Under the seeded in_the_loop policy, the call succeeds with HTTP 202 and an ApprovalDiversion body carrying approval_request.id and approval_request.version.

    Schedule draft (POST /v2/posts/schedule)

    # scheduled_at must be at least 30 seconds in the future (and at most 400 days ahead)
    curl -i -sS -X POST "https://api.honeloop.example/v2/posts/schedule" \
      -H "Authorization: Bearer $HONELOOP_AGENT_KEY" \
      -H "X-Honeloop-Org: 0197e3a0-0000-7000-8000-0000000000a1" \
      -H "Content-Type: application/json" \
      -H "Idempotency-Key: qs-example-schedule-0001" \
      -d '{
        "post_id": "0197e3b4-6f1a-7c2e-9d41-5b8e0a3c7f10",
        "scheduled_at": "2026-11-26T09:30:00.000Z",
        "version": 1
      }'

    Success-shaped diversion response (HTTP 202)

    HTTP/1.1 202 Accepted
    Content-Type: application/json; charset=utf-8
    X-Correlation-Id: 0197e3b4-6f1a-7c2e-9d41-5b8e0a3c7f99
    
    {
      "status": "approval_required",
      "post": {
        "id": "0197e3b4-6f1a-7c2e-9d41-5b8e0a3c7f10",
        "state": "pending_approval",
        "version": 2
      },
      "approval_request": {
        "id": "0197e3b9-2c40-7a55-8f17-6e4d9b1a0c22",
        "state": "pending",
        "version": 1,
        "origin": "diverted",
        "expires_at": "2026-11-28T10:00:00.000Z",
        "policy": {
          "capability": "posts.schedule",
          "resolved_autonomy": "in_the_loop",
          "source": "org",
          "warnings": []
        }
      },
      "resume": {
        "mode": "automatic",
        "correlation_id": "0197e3b4-6f1a-7c2e-9d41-5b8e0a3c7f99",
        "poll": {
          "capability": "posts.status",
          "post_id": "0197e3b4-6f1a-7c2e-9d41-5b8e0a3c7f10",
          "after_ms": 5000
        }
      },
      "warnings": []
    }

    If the agent key attempts to call approvals.decide on its own request, the policy gate refuses with HTTP 403scope_missing(required_scope: "approvals:decide") and logs the denial.

  6. 6

    Approve with the separate reviewer key

    Using the reviewer key (or a human reviewer in theweb approval inbox), callapprovals.decidewith the approval_request ID, the request's version and a freshIdempotency-Key. Approving commits the decision, moves the post toscheduled and starts the durable publish workflow.

    Approve request (REST or hl CLI)

    # Send approval_request.version (not post.version) with the reviewer key
    curl -sS -X POST "https://api.honeloop.example/v2/approvals/decide" \
      -H "Authorization: Bearer $HONELOOP_REVIEWER_KEY" \
      -H "X-Honeloop-Org: 0197e3a0-0000-7000-8000-0000000000a1" \
      -H "Content-Type: application/json" \
      -H "Idempotency-Key: qs-example-decide-0001" \
      -d '{
        "approval_request_id": "0197e3b9-2c40-7a55-8f17-6e4d9b1a0c22",
        "version": 1,
        "decision": "approved"
      }'
    
    # Equivalent hl CLI command
    HONELOOP_API_KEY="$HONELOOP_REVIEWER_KEY" hl approvals decide \
      0197e3b9-2c40-7a55-8f17-6e4d9b1a0c22 \
      --version 1 \
      --approve
  7. 7

    Confirm status with posts.status

    Call posts.statusto read the post's lifecycle state and each channel rendition's status. Once approved, the post transitions scheduled to publishing topublished (or failed with a per-rendition error andrecreate flag — read thenever-publish-again rule before automating retries).

    Check post status (POST /v2/posts/status)

    curl -sS -X POST "https://api.honeloop.example/v2/posts/status" \
      -H "Authorization: Bearer $HONELOOP_AGENT_KEY" \
      -H "X-Honeloop-Org: 0197e3a0-0000-7000-8000-0000000000a1" \
      -H "Content-Type: application/json" \
      -d '{"post_id":"0197e3b4-6f1a-7c2e-9d41-5b8e0a3c7f10"}'

Run the CI-verified quickstart script #

This repository ships an executable Node script atapps/site/scripts/quickstart.mjs that runs steps 2 through 7 end to end: ping, channel lookup, draft creation, schedule with idempotency key, HTTP 202 diversion check, agent self-approval refusal check, reviewer decision with idempotent replay check and finalposts.status verification.

Run against a compose stack

# Run the full verified quickstart flow from this repository against a compose stack
node apps/site/scripts/quickstart.mjs \
  --base-url "http://127.0.0.1:3000" \
  --bootstrap-json bootstrap.json \
  --channel-id "0197e3a0-0000-7000-8000-0000000000a5"

Expanded hl CLI and automation connectors #

Once your workspace is running, the hl CLI exposes 69 generated ergonomic verbs plus universal hl call <domain.verb> across all 132registered capabilities (27 domains). Every command supports--json for scripts and attaches idempotency keys automatically on mutations:

  • Publishing and governance: posts publish-now,posts get|cancel|validate, approvals list|decide,webhooks, channels list|update, series andpreviews.
  • Media and studio: uploads, AI image and video generation, narrated slideshows, video clipping, and stock photo verbs (media search-stock,media import-stock).
  • Analytics, automation and agent tools: analytics query,autoposts, shortlinks, tags, sets,signatures, customers, agent (copilot, URL extraction and web research) and inline hl assist.
  • Universal fallback with secret scrubbing: hl call <domain.verb>(including plugs, comments and auto-shorten preferences) supports--data, --input, --list and lazy dynamicx-secret schema protection so sensitive inputs are scrubbed automatically.

Common hl CLI workflows

# Upload a video or PDF, tag a post, publish immediately or start a recurring series
hl media upload ./launch-demo.mp4 --alt "Launch walkthrough clip"
hl posts create --channels "$CHANNEL_ID" --text "Release 2.4 is out." --tags release
hl posts publish-now "$POST_ID" --version 1
hl series create --name "Weekly Digest" --source-post "$POST_ID" --rrule "FREQ=WEEKLY;BYDAY=MO" --timezone UTC

# Query analytics, manage agency queues and previews, refine copy, or invoke any capability
hl analytics query --channel "$CHANNEL_ID" --from 2026-11-01T00:00:00Z --until 2026-11-25T00:00:00Z --granularity day
hl channels update "$CHANNEL_ID" --timezone America/New_York --posting-times "mon@09:00,wed@14:30"
hl previews create "$POST_ID" --expires-in-hours 72
hl assist --action shorten --provider bluesky --tone concise --text "Long product announcement copy."
hl call --list
hl call slots.suggest --data '{"channel_ids":["'"$CHANNEL_ID"'"],"count":3}'

Automation ecosystem (n8n, Make and Zapier) #

The repository ships three CI-verified first-party connector packages underintegrations/ built directly on REST v2 — defaulting to the hosted cloud origin with overrides for self-hosted installs, automatic Idempotency-Key generation, native HTTP 202 ApprovalDiversion branching and constant-time HMAC-SHA256 webhook signature verification:

  • n8n (integrations/n8n-nodes-honeloop): Community action and webhook trigger nodes covering posts, channels, media import, approvals, events, webhooks, analytics and slot suggestions, with automatic webhook registration and 300-second replay protection.
  • Make (integrations/make): Custom App specification and IML verification helpers for creating drafts, scheduling, publishing immediately, importing media, watching events and handling signed instant webhooks.
  • Zapier (integrations/zapier): Zapier Platform CLI integration with polling and REST Hook triggers, draft/schedule/publish/media actions and channel or post searches.

Production operations, schedules and secret scanning #

  • Database isolation: PostgreSQL ships 87 versioned SQL migrations and 63 forced row-level security tenant tables (62 org-scoped plus organizations) across five roles with zero BYPASSRLS.
  • Background Temporal schedules: Alongside publishing, reconciliation, analytics ingestion, webhooks, notifications, AutoPosts and token refresh, the control worker runs plugs:evaluate (every 10 minutes),shortlinks:sync_clicks (hourly), billing:dunning_grace (daily) and billing:invoice_x_usage (monthly X API pass-through invoicing).
  • Cloud Kubernetes ingress and media isolation (deploy/cloud/):Production ingress sets 520m body limits and 600s read/send timeouts for 512 MiB video uploads, routes /p/resolve, /p/mediaand /p/comments to the API plane (CDN serves /p), and mounts1Gi/2Gi ephemeral /tmp volumes for streaming media,ffmpeg video clipping and narrated slideshows (with a 512 MiB /tmpwatchdog on opt-in yt-dlp ingest) and poppler-utils(pdftoppm) PDF rasterisation.
  • Secret compartmentalisation: Stripe secrets split intohoneloop-stripe and API-only honeloop-stripe-webhook (enforced by fail-closed webhookCloudMode). Synchronous API secrets (honeloop-agent-api, honeloop-media-voices,honeloop-media-stock) stay on honeloop-api, while worker-only Media Studio secrets (deepgram_api_key, elevenlabs_api_key and image/video provider keys in honeloop-media-studio) stay strictly onhoneloop-worker-control away from provider workers.
  • Self-identifying credential scanning: All ten Honeloop secret prefixes (hlk_, hlt_, hlr_, hlm_,hli_, hlp_, hlpr_, hlv_,hlws_ and hls_) are enforced by Gitleaks rules in CI, blocked by the Content Agent's text hard checks, and rejected when passed in any URL path or query string.