← Receivers

links:create

links family

Create a tracked link in one of two shapes. ACTOR-BOUND (`actorId` given): the click elevates that contact to rung-4 identity at `/go/:id`, pre-warms their snapshot, and personalises the page + chat; the caller must hold authority over the contact's workspace. CAMPAIGN-ONLY (`campaignId` given, no `actorId`): the shape cold ad traffic needs, since an ad click is anonymous by definition and can never name a contact at mint time — the contact-owner walk is skipped, `actor_id` is stored null, and the click is attributed to the campaign alone. Exactly one of `actorId` / `campaignId` is required; supplying neither is refused. Minting is authed in both shapes; only the CLICK is anonymous. `slug` and `createdBy` are stamped from the attested session, never the body.

Effect
ask
Awaits an outcome — the call returns the response below.
Caller
member
The class of authority the caller must already hold, decided from the attested context with no round trip.
Cost
free
What one call costs, so you can budget before acting.
Reversible
no
This cannot be undone. Dry-run it first where the contract allows.
Idempotent
no
Not safe to blind-retry — dedupe on the envelope idempotencyKey.

Send it with your agent

One click hands your coding agent a prompt that registers the substrate, reads this contract, and makes the call. Launch opens the app; the others copy the prompt.

Claude Code
Codex
Cursor
Gemini CLI
Claude Desktop
ChatGPT
curl -X POST https://one.ie/api/ask/links:create \
  -H "Authorization: Bearer $ONE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"data": { "actorId": "u-123", "destination": "/pricing", "expiresInDays": 90 }}'

The key is never in a link. npx -y @oneie/cli login writes it to ~/.config/oneie/key on your machine.

Request

Validated before dispatch — an invalid payload is refused with the fix, never half-applied.

  • actorId string optional Contact (actor) the link is bound to — must belong to the caller's workspace or a descendant. Omit for cold ad traffic, in which case `campaignId` is REQUIRED so the click is never fully unattributed
  • destination string optional Path the click lands on (must start with '/'); default '/'
  • context string optional Extra context injected into the agent's system prompt for this session
  • greeting string optional Override the chat agent's opening line
  • campaignId string optional Group clicks under a campaign for the learning loop. REQUIRED when `actorId` is absent. Forwarded onto the destination URL as `utm_campaign` so the landing page and the click row report the same campaign; capped at 128 chars
  • expiresInDays number optional Link TTL in days; omitted = never expires

Response

What comes back from the call.

  • id string
  • sig string
  • url string

Traffic

Every call to links:create, counted where it is dispatched — over HTTP or in-process alike. Aggregate only — no actor, no payload, no workspace.

Counting…

Wiring

Every place in the open source that names links:create, and the file that answers it. Read from the tree at build time — a receiver is reached by NAME through one door, so there is no import edge to follow and a grep is the honest shape of the question. Structure, not volume — the count is in Traffic above.

Called from

API route 1
  • one.ie/web/src/pages/api/links.ts:8
Agent runtime 1
  • channels/src/tools/crm.ts:143
Workflow 2
  • one.ie/web/src/lib/workflow-templates.ts:610
  • one.ie/web/src/lib/workflows/campaign-ads-social.tql.ts:27
CLI 1
  • packages/cli/src/links.ts:25
SDK 1
  • packages/sdk/src/client.ts:244

Answered by

links:create one.ie/web/src/lib/resolvers/links.ts:178 Dispatched through POST /api/ask/links:create, after the envelope validates the payload.

links family · 1 more

JSON Schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "actorId": {
      "description": "Contact (actor) the link is bound to — must belong to the caller's workspace or a descendant. Omit for cold ad traffic, in which case `campaignId` is REQUIRED so the click is never fully unattributed",
      "type": "string"
    },
    "destination": {
      "description": "Path the click lands on (must start with '/'); default '/'",
      "type": "string"
    },
    "context": {
      "description": "Extra context injected into the agent's system prompt for this session",
      "type": "string"
    },
    "greeting": {
      "description": "Override the chat agent's opening line",
      "type": "string"
    },
    "campaignId": {
      "description": "Group clicks under a campaign for the learning loop. REQUIRED when `actorId` is absent. Forwarded onto the destination URL as `utm_campaign` so the landing page and the click row report the same campaign; capped at 128 chars",
      "type": "string"
    },
    "expiresInDays": {
      "description": "Link TTL in days; omitted = never expires",
      "type": "number"
    }
  }
}
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "sig": {
      "type": "string"
    },
    "url": {
      "type": "string"
    }
  },
  "required": [
    "id",
    "sig",
    "url"
  ]
}