Skip to content
techrace/
TECHRACE DOCUMENTATION

Quickstart

Connect a customer's Facebook Page and publish your first post in five steps.

1. Create an API key

In the console open Developers → API keys and create a key with customers:write, connections:write, connections:read, executions:write and executions:read. Copy it once and store it on your server, together with your project ID (shown on the same page, or returned by GET /api/v1/me).

Environment
Shell
export TECHRACE_API_KEY="rl_live_…"
export TECHRACE_PROJECT_ID="your-project-uuid"

2. Create a profile for your customer

curl -X POST "https://YOUR_DOMAIN/api/v1/projects/$TECHRACE_PROJECT_ID/customers" \
  -H "Authorization: Bearer $TECHRACE_API_KEY" \
  -H "Content-Type: application/json" \
  --data @- <<EOF
{
  "external_id": "user_1234",
  "name": "Acme Corp"
}
EOF
Response
JSON
{
  "customer": {
    "id": "8f1c2a4e-6b3d-4e21-9a77-1d0c5b2e9f10",
    "external_id": "user_1234",
    "name": "Acme Corp",
    "created_at": "2026-11-14T10:00:00.000Z",
    "deletion_requested_at": null
  }
}

3. Create a connect link

Pass return_url: the page in your app where the customer should land afterwards (https, or http://localhost while testing). Send the customer's browser to the returned url. They log in to Facebook and pick their Pages.

curl -X POST "https://YOUR_DOMAIN/api/v1/projects/$TECHRACE_PROJECT_ID/connect-sessions" \
  -H "Authorization: Bearer $TECHRACE_API_KEY" \
  -H "Content-Type: application/json" \
  --data @- <<EOF
{
  "customer_id": "8f1c2a4e-6b3d-4e21-9a77-1d0c5b2e9f10",
  "provider": "facebook",
  "return_url": "https://your-app.com/integrations/done"
}
EOF
Response
JSON
{
  "id": "0a6f2c9d-1e4b-4d73-9f58-7b3e2a1c8d05",
  "url": "https://YOUR_DOMAIN/connect#token=cs_…",
  "expires_at": "2026-11-14T10:15:00.000Z"
}

4. Get the connection

When the customer comes back, read connection_id from your return_url (or from the account.connected webhook). You can also list the profile's connections:

curl -X GET "https://YOUR_DOMAIN/api/v1/projects/$TECHRACE_PROJECT_ID/connections?customer_id=8f1c2a4e-6b3d-4e21-9a77-1d0c5b2e9f10" \
  -H "Authorization: Bearer $TECHRACE_API_KEY"
Response
JSON
{
  "data": [
    {
      "id": "3b7e9d12-5c4a-4f8e-8b21-6a0d2c9e7f34",
      "customer_id": "8f1c2a4e-6b3d-4e21-9a77-1d0c5b2e9f10",
      "provider": "facebook",
      "external_id": "1122334455",
      "name": "Joe's Bakery",
      "status": "connected",
      "scopes": [
        "pages_show_list",
        "pages_read_engagement",
        "pages_manage_posts"
      ],
      "metadata": {},
      "created_at": "2026-11-14T10:00:00.000Z"
    }
  ],
  "next_cursor": null
}

5. Publish a post

curl -X POST "https://YOUR_DOMAIN/api/v1/projects/$TECHRACE_PROJECT_ID/executions" \
  -H "Authorization: Bearer $TECHRACE_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: post-2026-11-14-001" \
  --data @- <<EOF
{
  "customer_id": "8f1c2a4e-6b3d-4e21-9a77-1d0c5b2e9f10",
  "connection_id": "3b7e9d12-5c4a-4f8e-8b21-6a0d2c9e7f34",
  "action": "publish",
  "input": {
    "content": "Fresh croissants every morning 🥐",
    "media_ids": [
      "e9a2c5d1-7f3b-4c86-b014-5d2e8a1f6c73"
    ]
  }
}
EOF
Response
JSON
{
  "execution": {
    "id": "c41d7e2a-9b85-4f10-a3d6-2e8f1b7c5a90",
    "customer_id": "8f1c2a4e-6b3d-4e21-9a77-1d0c5b2e9f10",
    "connection_id": "3b7e9d12-5c4a-4f8e-8b21-6a0d2c9e7f34",
    "action": "publish",
    "status": "queued",
    "attempts": 0,
    "available_at": "2026-11-14T10:00:00.000Z",
    "external_id": null,
    "external_url": null,
    "provider_data_erased_at": null,
    "error_code": null,
    "created_at": "2026-11-14T10:00:00.000Z"
  }
}

The post is published in the background. Check the result:

curl -X GET "https://YOUR_DOMAIN/api/v1/projects/$TECHRACE_PROJECT_ID/executions/$EXECUTION_ID" \
  -H "Authorization: Bearer $TECHRACE_API_KEY"