Connect an agent to BacklinkTool
Set up Claude Code, Codex, Cursor or a REST client.
Last updated
Create API key. Export BACKLINKTOOL_API_KEY.
claude mcp add --transport http --scope project backlinktool https://backlinktool.net/mcp --header 'Authorization: Bearer ${BACKLINKTOOL_API_KEY}'Open a new session in that project. Approve the project server when Claude Code prompts. See the Claude Code MCP documentation.
Use BacklinkTool for one batch on my selected project. Read the submission Skill and check my account and profile first. Confirm the project with me if unclear. Summarize receipts, tasks I need to handle and outcomes to verify.
codex mcp add backlinktool --url https://backlinktool.net/mcp --bearer-token-env-var BACKLINKTOOL_API_KEYStart a new Codex session with the same environment. Check /mcp for the BacklinkTool server.
Use BacklinkTool for one batch on my selected project. Read the submission Skill and check my account and profile first. Confirm the project with me if unclear. Summarize receipts, tasks I need to handle and outcomes to verify.
{"mcpServers":{"backlinktool":{"url":"https://backlinktool.net/mcp","headers":{"Authorization":"Bearer ${env:BACKLINKTOOL_API_KEY}"}}}}In .cursor/mcp.json, add this server. Merge it into mcpServers if you already have others.
From the workspace with the key in your environment, run:
cursor-agent mcp enable backlinktool
cursor-agent mcp list-tools backlinktool
Open Cursor from the same environment or continue in Cursor CLI. See the Cursor MCP documentation.
Use BacklinkTool for one batch on my selected project. Read the submission Skill and check my account and profile first. Confirm the project with me if unclear. Summarize receipts, tasks I need to handle and outcomes to verify.
curl --fail-with-body -H "Authorization: Bearer $BACKLINKTOOL_API_KEY" https://backlinktool.net/api/v1/meUse this command to verify your key. See the OpenAPI contract.
Send Idempotency-Key for each write and reuse it only for the same request. Include lease_id in the JSON body when writing to a task on an active lease.
Use the BacklinkTool OpenAPI contract and Skill to run one batch on my selected project. Check
GET /api/v1/meand the project profile first. Confirm the project with me if unclear. Summarize receipts, tasks I need to handle and outcomes to verify.
Run the blocks one at a time in a shell with curl, jq and uuidgen. Stop on errors and read error.next_action. Keep each idempotency key for retries of that exact write.
BASE_URL="${BASE_URL:-https://backlinktool.net}"
: "${BACKLINKTOOL_API_KEY:?Export your API key first}"
bl_curl() {
curl --fail-with-body --silent --show-error \
-H "Authorization: Bearer $BACKLINKTOOL_API_KEY" \
-H 'Content-Type: application/json' "$@"
}1. Check the account. Read remaining_credits, daily_remaining and claims_paused before claiming.
To claim a specific public active site, add "site_slug": "directory-slug" and set "limit": 1. If reason_code includes ALREADY_IN_HISTORY, check existing_task.state before submitting. If eligible_remaining_capped is true, display the count with a trailing plus sign, such as 1000+.
Starter and Pro can pass "pool": "explore" to claim up to 20 candidate sites per UTC day without spending credits. This quota is separate from verified claims. Owners have no daily cap. Free accounts receive 403 FORBIDDEN with an upgrade link. A full quota returns 429 DAILY_LIMIT with retry_after. The claim response’s daily_remaining is for the requested pool.
bl_curl "$BASE_URL/api/v1/me"
2. Find the project. Choose the active project the user authorized. Copy its projects[].id as PROJECT_ID.
bl_curl "$BASE_URL/api/v1/projects"
PROJECT_ID='<project ID from projects>'
3. Read the profile. Use fields for form data. If anything required is missing, follow the Skill to get the user's approval before updating the profile.
bl_curl "$BASE_URL/api/v1/projects/$PROJECT_ID/profile?locale=en"
4. Claim one directory task. Reuse the same CLAIM_KEY and request body on retries. Read reason_code and next_action if the response has no tasks. Otherwise copy tasks[0].id, lease_id and version. Use the task's playbook.entry_url, field_hints and receipt_rule to prepare the form. Leave the final submit button untouched at this step.
CLAIM_KEY="$(uuidgen)"
CLAIM="$(bl_curl -X POST "$BASE_URL/api/v1/projects/$PROJECT_ID/claim" \
-H "Idempotency-Key: $CLAIM_KEY" --data '{"limit":1,"kinds":["directory"]}')"
printf '%s\n' "$CLAIM" | jq .
TASK_ID="$(printf '%s\n' "$CLAIM" | jq -er '.tasks[0].id')"
LEASE_ID="$(printf '%s\n' "$CLAIM" | jq -er '.tasks[0].lease_id')"
VERSION="$(printf '%s\n' "$CLAIM" | jq -er '.tasks[0].version')"
Before filling the form. Call suggest_anchor or use the REST request below. Keep the version ID if you use the suggested text.
ANCHOR="$(bl_curl -X POST "$BASE_URL/api/v1/projects/$PROJECT_ID/copy-kit/suggest-anchor" \
-H "Idempotency-Key: $(uuidgen)" \
--data "$(jq -nc --arg task "$TASK_ID" '{task_id:$task,locale:"en"}')")"
printf '%s\n' "$ANCHOR" | jq '.anchor | if . then {id,text} else null end'
5. Lock intent right before the final click. Proceed only after the response shows task.state=intent_locked and you know this execution has yet to click. Read the current task.lease_id and track the returned task.version. The API checks the version internally. The request sends only the lease, even when you track the version.
LEASE="$(jq -nc --arg lease "$LEASE_ID" '{lease_id:$lease}')"
INTENT_KEY="$(uuidgen)"
INTENT="$(bl_curl -X POST "$BASE_URL/api/v1/tasks/$TASK_ID/intent" \
-H "Idempotency-Key: $INTENT_KEY" --data "$LEASE")"
printf '%s\n' "$INTENT" | jq -e '.task | select(.state == "intent_locked") | {id, lease_id, version}'
6. Click once on the target form, then immediately mark dispatched. Check the returned task.state, task.lease_id and task.version. If this API call fails, check current task state and retry only the API call with the same key and body. Never repeat the external submit click.
DISPATCH_KEY="$(uuidgen)"
DISPATCH="$(bl_curl -X POST "$BASE_URL/api/v1/tasks/$TASK_ID/dispatched" \
-H "Idempotency-Key: $DISPATCH_KEY" --data "$LEASE")"
printf '%s\n' "$DISPATCH" | jq -e '.task | select(.state == "dispatched") | {id, lease_id, version}'
LEASE_ID="$(printf '%s\n' "$DISPATCH" | jq -er '.task.lease_id')"
Receipt screenshots. After marking dispatch and before reporting, capture the receipt page or confirmation email if it contains no password, verification code, token or other private credentials. With MCP, call upload_evidence with task_id, content_type, standard padded image_base64 and idempotency_key. With REST, send raw PNG, JPEG or WebP bytes (for example, --data-binary @receipt.png with Content-Type: image/png) to PUT /api/v1/tasks/:id/evidence using Bearer auth. Add the returned evidence_id to the report's evidence_ids array. If capture or upload is unavailable, report with text evidence. The project owner can read linked screenshots through the task details for up to 180 days.
7. Report what you observed. This command assumes the site supplied a receipt that meets the playbook's rule. Paste the observed receipt as RECEIPT_TEXT and check for task.state=submitted. If a click may have happened and no valid receipt was available, follow the Skill and report uncertain.
read -r RECEIPT_TEXT
SUBMISSION='{"locale":"en","target_url":"https://project.example/tools","fields":{"name":"Example Tools","description":"Convert tabular data to JSON."},"assets":{"logo":"https://project.example/logo.png"},"account_email":"maker@project.example"}'
REPORT_KEY="$(uuidgen)"
REPORT="$(jq -nc --arg lease "$LEASE_ID" --arg text "$RECEIPT_TEXT" --argjson submission "$SUBMISSION" \
'{lease_id:$lease,result:"submitted",evidence:{text:$text},submission:$submission}')"
bl_curl -X POST "$BASE_URL/api/v1/tasks/$TASK_ID/report" \
-H "Idempotency-Key: $REPORT_KEY" --data "$REPORT"
Replace SUBMISSION with the actual form values. Include anchor_text and anchor_variant_id if used, and the complete comment_text for a blog. For uncertain after a possible click, send the same snapshot with result:"uncertain". Keep credentials out of the snapshot. Use search_ledger to filter history, get_task for detail, get_copy_kit for version counts and tag_tasks to edit account tags on up to 100 tasks.
8. Read the summary. Use counts, needs_human, uncertain and next_action to update the user.
bl_curl "$BASE_URL/api/v1/projects/$PROJECT_ID/summary"
Read the submission Skill or download the Skill ZIP. Keep your API key out of chats and version control.