Start here

Getting started

Five minutes from a key to your first client, login link and order. Everything below is copy-paste ready in nine languages.

#Which API do I need?

Base URL
Every example uses https://api.your-brand.com. Replace it with the API host of your Octolit installation - your account manager gives it to you, and GET /api/external/v1/me confirms it. Always HTTPS, always JSON.

#Partner API in 5 minutes

  1. Create a key

    In the Octolit CRM open Settings › API & Webhooks, switch the API on, then API keys › New key. Pick only the scopes you need, set an IP allow-list and an expiry. The key is shown once. Per brand, Brand settings has the switches Partner API, Single sign-on and Trading webhooks.

    shell
    export OCTOLIT_PARTNER_KEY="pk_live_..."   # never commit it
  2. Check the key

    GET /me answers with your company, the key's scopes, the brands it can see and the current rate limit.

    GET /api/external/v1/me
    curl "https://api.your-brand.com/api/external/v1/me" \
      -H "X-Api-Key: $OCTOLIT_PARTNER_KEY"
    200 OK
    {
      "key": {
        "id": 1042,
        "name": "Main",
        "prefix": "pk_live_3f",
        "scopes": [
          "clients:read"
        ],
        "ip_allowlist": [
          "string"
        ],
        "status": "active",
        "expires_at": "2026-11-11T09:31:00Z",
        "created_at": "2026-11-11T09:30:00.000000Z",
        "last_used_at": "2026-11-11T09:29:58Z"
      },
      "company_id": 10,
      "requests_per_minute": 120,
      "server_time": "2026-11-11T09:30:00.000000Z"
    }
  3. Create a client by your own id

    PUT /users/{external_id} is idempotent: the same external_id always maps to the same client. Send only the fields you know; brand_id is fixed after creation.

    PUT /api/external/v1/users/cust_10042
    curl -X PUT "https://api.your-brand.com/api/external/v1/users/cust_10042" \
      -H "X-Api-Key: $OCTOLIT_PARTNER_KEY" \
      -H "Content-Type: application/json" \
      -d '{
      "brand_id": 13,
      "email": "anna@example.com",
      "first_name": "Anna",
      "last_name": "Lindqvist",
      "country": "SE"
    }'
  4. Send the user into the trader

    Ask for a one-time login link and redirect the browser to login_url. The link works once and expires in minutes. Prefer JWT single sign-on when your platform already has a session.

    POST /api/external/v1/users/cust_10042/sso
    curl -X POST "https://api.your-brand.com/api/external/v1/users/cust_10042/sso" \
      -H "X-Api-Key: $OCTOLIT_PARTNER_KEY" \
      -H "Content-Type: application/json" \
      -d '{
      "target": "trader"
    }'
  5. Subscribe to events

    Settings › API & Webhooks › Webhooks › New endpoint: your HTTPS URL and the events. Press Send test event and verify the signature before you trust a payload.

#Trading API in 5 minutes

  1. Create a key in the trader

    Your broker switches the Trading API on for your brand. In the trader open API access (Pro mode) and create a key: read-only or with the trade scope, optional IP allow-list and expiry. Keys start with qk_ and are shown once.

    shell
    export OCTOLIT_API_KEY="qk_..."
  2. Read your account

    GET /api/open/v1/account
    curl "https://api.your-brand.com/api/open/v1/account" \
      -H "X-API-Key: $OCTOLIT_API_KEY"
    200 OK
    {
      "client_id": 1042,
      "key": {
        "id": 1042,
        "name": "Main",
        "prefix": "pk_live_3f",
        "scopes": [
          "read"
        ],
        "trading_account_ids": [
          55
        ],
        "ip_allowlist": [
          "string"
        ],
        "expires_at": "2026-11-11T09:31:00Z",
        "created_at": "2026-11-11T09:30:00.000000Z"
      },
      "trading_account_ids": [
        55
      ],
      "limits": {
        "requests_per_min": 1200,
        "client_requests_per_min": 1,
        "orders_per_sec": 10,
        "account_orders_per_sec": 1,
        "max_keys": 5
      },
      "websocket": true,
      "trading_stopped": true,
      "server_time": "2026-11-11T09:30:00.000000Z"
    }
  3. Place a market order

    Orders need the trade scope and a client_order_id of your own. Send the same id again and you get the same order back (200 replayed), never a second fill. Quantity is in lots or units.

    POST /api/open/v1/orders
    curl -X POST "https://api.your-brand.com/api/open/v1/orders" \
      -H "X-API-Key: $OCTOLIT_API_KEY" \
      -H "Content-Type: application/json" \
      -d '{
      "client_order_id": "ord-2026-0001",
      "trading_account_id": 55,
      "symbol": "EURUSD",
      "side": "buy",
      "type": "market",
      "lots": 0.1
    }'
  4. Stream prices

    POST /stream_ticket gives a 60-second ticket; open wss://api.your-brand.com/rt/v1/ws?ticket=… and subscribe to up to 100 symbols. WebSocket reference →

#Where to next