Start Conversation | Rankhog Docs

API Reference

Start Conversation

Start a conversation from a prompt, like the New composer in Rankhog. A Reddit post or comment link becomes a reply opportunity: Rankhog reads the...

Server URLhttps://api.rankhog.com/

POST

``/agent/v1/conversations

Send

Authorization

Body

Start a conversation from a prompt, like the New composer in Rankhog. A Reddit post or comment link becomes a reply opportunity: Rankhog reads the thread and drafts the reply the prompt asks for. Anything else starts a conversation the agent answers; it can start a post when a community is named. Set post.subreddit to start a new post in a community directly: the opportunity is a reddit_post with its planned action from the start, an empty prompt runs nothing and costs nothing (write the title and body with update_opportunity_draft at expectedRevision 0), and a prompt has the agent draft it. If the thread already has an opportunity, the prompt joins that conversation (outcome existing). Nothing is sent to Reddit until a person confirms. With an organization API key the agent answers but the AI draft waits for a person. Poll get_opportunity_conversation for the reply. Cache policy: live. Idempotency: required. Auth modes: api_key, mcp_oauth, session_bearer.

Authorization

apiKeyAuth

AuthorizationBearer

Rankhog organization API key sent as Authorization: Bearer rhog_....

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Copy

managedRedditAccountId*string

Length1 <= length <= 160

organizationId*string

Length1 <= length <= 160

websiteId*string

Length1 <= length <= 160

conversationId?string

Optional. Your own ULID for the new conversation. Taken only when free; the same ids and prompt replay, anything else is a 409.

Match^[0-9A-HJKMNP-TV-Z]{26}$

idempotencyKey*string

Length1 <= length <= 160

opportunityId?string

Optional. Your own ULID for the new opportunity, so you can link to it before the response arrives. Same rules as conversationId.

Match^[0-9A-HJKMNP-TV-Z]{26}$

post?object

Start a new post in this community. The opportunity is a reddit_post with its planned action from the first read, so update_opportunity_draft can write the title and body at revision 0. With an empty prompt nothing else runs and nothing costs; with a prompt the agent drafts the post (one draft credit, and with an organization API key the draft waits for a person).

prompt?string

What the team wants, in plain words. A Reddit post or comment link becomes a reply to it; anything else starts a conversation the agent answers, and it can start a post when a community is named. Required unless post is set.

Default""Lengthlength <= 4000

Response Body

200 application/json

400 application/json

401 application/json

402 application/json

403 application/json

404 application/json

409 application/json

429 application/json

500 application/json

cURL

JavaScript

Go

Python

Java

C#

curl -X POST "https://api.rankhog.com/agent/v1/conversations" \
  -H "Authorization: Bearer " \
  -H "Content-Type: application/json" \
  -d '{
    "managedRedditAccountId": "mra_2x9rnkhdemo",
    "organizationId": "org_2x9rnkhdemo",
    "websiteId": "site_2x9rnkhdemo",
    "idempotencyKey": "start-2026-09-30-001",
    "prompt": "Reply to this and keep it short: https://www.reddit.com/r/SaaS/comments/1abcde/how_do_you_find_users/"
  }'

200400401402403404409429500

{
  "conversationId": "conv_2x9conversation",
  "itemId": "item_2x9prompt",
  "kind": "reddit_comment",
  "opportunityId": "opp_2x9opportunity",
  "outcome": "created"
}
{
  "error": {
    "code": "agentic_invalid_input",
    "message": "Name the community like r/SaaS."
  }
}

Missing authentication

{
  "error": {
    "code": "agentic_unauthorized",
    "message": "Authenticate before using Rankhog agentic capabilities."
  }
}

Invalid API key

{
  "error": {
    "code": "agentic_paid_plan_required",
    "details": {
      "managedAccountBillingStatus": "active",
      "productId": "site_demo",
      "subscriptionStatus": "past_due"
    },
    "message": "This product has no active plan or trial yet. Call get_product_setup with productId site_demo: it gives the link where the person starts the 7-day trial. Never pay for them."
  }
}

Missing OAuth scope

{
  "error": {
    "code": "agentic_missing_scope",
    "details": {
      "missingScopes": [\
        "rankhog:read",\
        "conversation:write"\
      ]
    },
    "message": "Missing required scope: rankhog:read, conversation:write."
  }
}

API key organization mismatch

Organization access denied

Website access denied

{
  "error": {
    "code": "agentic_managed_account_not_found",
    "message": "Managed Reddit account not found."
  }
}

Product not set up

{
  "error": {
    "code": "agentic_workspace_unavailable",
    "message": "This product is not set up for Reddit work yet."
  }
}

Thread already has work

{
  "error": {
    "code": "agentic_write_rate_limited",
    "details": {
      "limit": 30,
      "windowSeconds": 3600
    },
    "message": "You can start 30 conversations an hour. Try again in a few minutes."
  }
}
{
  "error": {
    "code": "agentic_internal_error",
    "message": "Rankhog could not complete this agentic request."
  }
}

Post Opportunity Conversation MessagePOST\ \ Steer an opportunity conversation or answer its pending question with the optional answer.questionId, then queue an agent turn. Create Reddit Post DraftPOST\ \ Create a ready manual Reddit post draft after fetching subreddit rules.