human-survey
v1.2.0Self-reported attribution: which channel and which creator your users first heard you from.
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
login Sign in
Sign in with an email address and store an API key on this machine. Called with only an email, it mails a six-digit code and returns nothing usable — the code has to come from the person, out of their inbox. Called with the email and that code, it stores a key at ~/.humansurvey/credentials and reports where it was written. The key itself is never printed. Signing in and signing up are the same act: an address that has never been used gets an account.
| Parameter | Type | Description |
|---|---|---|
email * | string | The person’s email address. They will read the code out of this inbox. |
code | string | The six digits from the email. Omit on the first call — you cannot know this value; ask the person for it. |
name | string | A label for the key, e.g. the project it is for. |
get_catalog Platform catalog
List the platforms HumanSurvey knows: the slug to use as catalog_slug, the display label, and which class of channel it is. These are the named channels a respondent can be shown — TikTok, ChatGPT, LinkedIn, Reddit and so on — plus the descriptive options that have no brand behind them, like "a friend or colleague told me". No API key needed.
list_forms List forms
List the forms on this account: id, name, respondent URL, whether it is active or paused, whether it has been configured with questions yet, and how many responses it has collected.
get_form Read a form
Read one form: its settings, and the question configuration currently shown to respondents — every question, every candidate, and the order mode. Returns the configuration as JSON, because that is the exact shape a configuration write takes.
| Parameter | Type | Description |
|---|---|---|
form_id * | string | The form id, as reported by the forms listing. |
create_form Create a form
Create a form and return its id, its respondent URL, and the iframe and postMessage listener to embed that URL in a host page. The form has no questions yet and shows nothing to respondents until it is configured. allowed_origins restricts which sites may embed it; leaving it empty allows any site, which means any site can spend this account’s response quota.
| Parameter | Type | Description |
|---|---|---|
name * | string | An internal label. Respondents never see it. |
allowed_origins | array | Origins permitted to embed the form, e.g. ["https://app.example.com"]. Scheme and host only — a path is rejected rather than trimmed. |
theme | object | Exactly these four tokens. Any other key is rejected rather than ignored. |
configure_form Configure the questions
Set the questions and candidates a form shows. Replaces the whole configuration and stores it as a new immutable version, so responses already collected keep describing the list they were actually shown. Re-sending an identical configuration reuses the existing version rather than making another. A form is one single-select question, optionally expanding into a second. Give a candidate an `expands` naming another question to reveal it when that candidate is picked — that is how "TikTok" becomes "which account". Candidate ids must be stable keys that survive a rename. Using a handle as an i…
| Parameter | Type | Description |
|---|---|---|
form_id * | string | The form to configure. |
nodes * | array | One to twelve questions. Exactly one must not be reachable by any `expands` — that one is asked first. |
get_attribution Attribution rollup
What respondents said, aggregated. Reports, per question, how many completed responses named each candidate out of how many answered that question, the unresolved answers in the same list, how often a follow-up question failed to find an answer, and revenue where conversion events have been recorded. Computed fresh on every call, including any mappings made since — so a rollup of a past window can legitimately change between two reads.
| Parameter | Type | Description |
|---|---|---|
form_id * | string | The form to report on. Required: combining forms would mix two respondent populations into one denominator. |
by | string | "candidate" (default) is one row per option; "node" collapses to one row per question. |
from | string | Start of the window, inclusive. ISO 8601; a value with no timezone is read as UTC. |
metric | string | Sort order only; counts and revenue are both reported either way. Revenue appears on the rows of the first question and nowhere else, because a respondent’s money belongs to the respondent rather th… |
to | string | End of the window, exclusive. |
list_unresolved Free-text answers
The answers respondents typed instead of picking from the list, grouped by the exact text and ordered by how often it was typed. Reports the spelling variants seen, when each was first and last typed, and whether a mapping already covers it. These are verbatim words. Two texts that read alike may be different people, and a text may name somebody who is not on the candidate list at all.
| Parameter | Type | Description |
|---|---|---|
form_id * | string | The form to read. |
from | string | Start of the window, inclusive. |
include_mapped | boolean | Include texts that a live mapping already resolves. Off by default. |
limit | integer | |
to | string | End of the window, exclusive. |
remap Map a typed answer to a candidate
Record that a specific typed answer means a specific candidate. It applies to every response already carrying that text as well as every future one, so numbers reported for past windows change. The original text is never altered and a mapping can be revoked, but a report may already have been read. Only map a text whose meaning is established — a text that merely resembles a candidate’s name is not evidence that it is that candidate. One live mapping per text per question.
| Parameter | Type | Description |
|---|---|---|
candidate_id * | string | The candidate it means. Not validated against the current configuration, because a candidate may have been removed while its history still needs the mapping. |
form_id * | string | |
node_id * | string | The question the text was typed into. The same words can mean different things in different questions. |
raw * | string | The typed text, exactly as reported. It is normalized the same way on both sides. |
note | string | Why. Kept with the mapping. |
revoke_remap Undo a mapping
Stop a mapping from applying. The typed answers it covered return to the unresolved list — in past windows as well as future ones, because rollups join mappings when they are read rather than when they are made. Numbers already reported for those windows will therefore change. Nothing is deleted: the mapping is marked revoked and kept, so a report produced while it was live can still be explained. Revoking an already-revoked mapping is not an error and does not move the time it stopped applying. Mapping ids appear beside any text that is already mapped in the free-text listing, and in the…
| Parameter | Type | Description |
|---|---|---|
form_id * | string | The form the mapping belongs to. |
remap_id * | string | The mapping to revoke. A mapping id alone is never enough — it is checked against this form and this account. |