Create the referral link
well_create_referral_codeMake the workspace's referral link when well_get_referral_code says it has none (has_link: false), and return it with how many people joined Well with it. A repeat call returns the same link (created: false).
The link lets someone open their OWN account on Well and counts them for this workspace; it gives no access to the workspace, so any member may make it, and the user's ask for their referral link is the consent. A demo workspace has no link (refusal: DEMO_WORKSPACE).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| workspace_id | No | Target workspace. Omit when the token authorizes one workspace. Required when it authorizes several — a write lands in exactly one workspace and this call would not say which. | |
| conversation_id | No | The conversation id returned by the previous Well result, in its meta under well/conversation_id, in its structuredContent, or in its JSON text block. Pass it back on every call in the same conversation, including a call a card makes, so the chosen workspace and the earlier answers still apply. It decides the conversation on its own: nothing the host states about the session replaces it. Omit it only on the first call of a conversation. | |
| idempotency_key | No | Optional client-supplied key. A retried write with the same key returns the original result instead of re-applying the operation. | |
| workspace_scope | No | Restrict this call to the family: the token's primary workspace plus the company workspaces under it that you are a member of. Unrelated authorized workspaces drop out of the read; row reads merge across the family, while a per-workspace figure still reports exactly one workspace. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| error | No | ||
| created | No | True when this call made the link, false when it returned the live one. | |
| refusal | No | Present only when the call did nothing. DEMO_WORKSPACE: the workspace holds sample data, so it has no referral link. INSUFFICIENT_PERMISSIONS: only an owner or admin, or the member who made the link, may stop it. | |
| success | Yes | ||
| workspace_id | No | ||
| people_joined | No | How many people joined Well with this link: the people in the workspaces it brought in. Derived on each call; 0 when nobody did yet. Null when the count could not be read in time: give the link and say the count is not available right now, never 0. | |
| referral_link | No | The workspace's referral link. Anyone who opens it and signs up to Well counts for this workspace; it gives no access to the workspace. Give it to the user exactly as returned, alone on its line. | |
| last_joined_at | No | When the latest person joined with the link (ISO 8601), or null when nobody did yet. | |
| conversation_id | No | The conversation this result belongs to. Pass it back as the conversation_id argument on every later Well call in the same conversation. | |
| newly_connected | No | Tools that connected to this workspace since the last result and that no session was told about yet, oldest first. Present only when at least one tool is new. The connected-line rule says when to tell an entry; when it does, one line per entry, in the person's language: "<name> is connected.". Never fold several entries into one sentence. Each entry comes back once, on one result only: never repeat its line later. | |
| conversation_id_note | No | Present only when the server opened a fresh lane, stating that no choice recorded earlier was read. | |
| people_joined_capped | No | True when the link brought in more workspaces than one count reads, so people_joined is a floor. | |
| conversation_id_source | No | Where the conversation id came from: the host's own request meta, the caller's argument, or a fresh lane the server opened. |