The Refiner connector lets your AI agent act in each user's Refiner account. Each user connects their own Refiner access token once, and Scalekit sends it with every call, so your agent never handles credentials. It comes with 19 tools.
- Tools
- 19
- What they doRead · write · destructive
- 9 · 8 · 29 read8 write2 destructive
- Users sign in with
- Access token
Setup
Install the SDK
Terminal window npm install @scalekit-sdk/node dotenvTerminal window pip install scalekit-sdk-python python-dotenvSet your credentials
Add your Scalekit credentials to your
.envfile. Find values in app.scalekit.com > Developers > API Credentials..env SCALEKIT_ENVIRONMENT_URL=<your-environment-url>SCALEKIT_CLIENT_ID=<your-client-id>SCALEKIT_CLIENT_SECRET=<your-client-secret>Create the Refiner connection
In AgentKit > Connections, create a Refiner connection. The name you give it is the
connection_nameyour code passes. See Configure connections.Authorize a user and make your first call
quickstart.mts import { ScalekitClient } from '@scalekit-sdk/node'import 'dotenv/config'import { createInterface } from 'node:readline/promises'const scalekit = new ScalekitClient(process.env.SCALEKIT_ENVIRONMENT_URL,process.env.SCALEKIT_CLIENT_ID,process.env.SCALEKIT_CLIENT_SECRET,)const actions = scalekit.actionsconst connector = 'refiner'const identifier = 'user_123'// Generate an authorization link for the userconst { link } = await actions.getAuthorizationLink({ connectionName: connector, identifier })console.log('Authorize Refiner:', link)const rl = createInterface({ input: process.stdin, output: process.stdout })await rl.question('Press Enter after authorizing...')rl.close()// Make your first callconst result = await actions.executeTool({connector,identifier,toolName: 'refiner_get_account_info',toolInput: {},})console.log(result)Terminal window npx tsx quickstart.mtsquickstart.py import osfrom scalekit import ScalekitClientfrom dotenv import load_dotenvload_dotenv()scalekit_client = ScalekitClient(env_url=os.getenv("SCALEKIT_ENVIRONMENT_URL"),client_id=os.getenv("SCALEKIT_CLIENT_ID"),client_secret=os.getenv("SCALEKIT_CLIENT_SECRET"),)actions = scalekit_client.actionsconnection_name = "refiner"identifier = "user_123"# Generate an authorization link for the userlink_response = actions.get_authorization_link(connection_name=connection_name,identifier=identifier,)print("Authorize Refiner:", link_response.link)input("Press Enter after authorizing...")# Make your first callresult = actions.execute_tool(tool_input={},tool_name="refiner_get_account_info",connection_name=connection_name,identifier=identifier,)print(result)Terminal window python quickstart.pyEach user opens the link once and enters their Refiner credentials there. See Authorize a user for the full flow and statuses.
Tools
Pass the exact name toexecute_toolrefiner_get_account_infoGet the Refiner account's subscription plan, usage counters and environments.Read-onlyGet Account Info
Get the Refiner account's subscription plan, usage counters and environments. Returns plan, monthly tracked users, events, page views and survey responses with their limits, plus each environment's uuid, name and usage. Use for usage and limit checks. Use refiner_get_environment to identify the environment of the API key.
Inputs
This tool takes no inputs.
refiner_get_contactGet everything Refiner stores about one contact.Read-onlyGet Contact
Get everything Refiner stores about one contact. Returns uuid, remote_id, email, display_name, first and last seen, attributes, segments and account. Use when you know the contact's ID, email or Refiner UUID. Use refiner_list_contacts to search.
Inputs
emailstring- Email address of the contact; use when you have no user ID. Example: jane@awesome.com
idstring- Your own user ID for the contact, the same ID used with identify user. Example: user_123
uuidstring- Refiner-generated contact UUID returned by identify user. Example: 15cce3d0-ed5d-11ea-aaef-e58a2a43e996
refiner_get_environmentVerify the API key and return the Refiner environment it belongs to.Read-onlyGet Environment
Verify the API key and return the Refiner environment it belongs to. Returns project_uuid, project_name and an authentication message. Use to confirm the connection works. Use refiner_get_account_info for plan and usage.
Inputs
This tool takes no inputs.
refiner_get_form_historyList previous versions of a survey.Read-onlyGet Form History
List previous versions of a survey. Returns an items array of versions with uuid, action, created_at and a snapshot of name, config, channels and question elements, plus a pagination object. Use refiner_list_forms to find the form_uuid.
Inputs
form_uuidstringrequired- UUID of the survey. Example: 3894dc20-8fe9-11ea-892e-d13af52e06ae
pageinteger- Page number for numeric pagination, starting at 1. Example: 2
page_lengthinteger- Number of items per page, up to 1000 (server default 100). Example: 50
refiner_get_reportingGet aggregated survey reporting for a date range.Read-onlyGet Reporting
Get aggregated survey reporting for a date range. Returns figures for the chosen type: nps (detractors, passives, promoters, nps score), csat (distribution and csat score), ratings (distribution, sum, average), distribution (value counts) or count (views and responses), plus the date range used. Use for summary metrics. Use refiner_list_responses for individual answers.
Inputs
typestringrequired- Report type to compute. Example: npsone of
npscsatratingsdistributioncount date_range_endstring- End of the range, ISO 8601 (server default end of today). Example: 2025-04-18
date_range_startstring- Start of the range, ISO 8601 (server default 7 days ago). Example: 2024-12-12
form_uuidsarray- UUIDs of surveys to include; omit for all. Example: ["3894dc20-8fe9-11ea-892e-d13af52e06ae"]
question_identifiersarray- Only count data points for these question identifiers (slugs); omit for all matching questions. Example: ["nps"]
segment_uuidsarray- Only count users in these segment UUIDs. Example: ["0ff87720-9ae5-11ea-bce5-65a395204572"]
tag_uuidsarray- Only count responses carrying one of these tag UUIDs. Example: ["4f5637d0-3d0d-11ea-b965-614418dec30c"]
refiner_list_contactsList contacts (users) tracked in Refiner.Read-onlyList Contacts
List contacts (users) tracked in Refiner. Returns an items array of contacts with uuid, remote_id, email, display_name, first and last seen, attributes, segments and account, plus a pagination object. Use to browse or search contacts. Use refiner_get_contact for one known contact.
Inputs
form_uuidstring- Only contacts linked to this survey UUID. Example: 3894dc20-8fe9-11ea-892e-d13af52e06ae
order_bystring- Field to sort by (server default first_seen_at). Example: last_seen_atone of
display_nameemailfirst_seen_atlast_seen_atlast_form_submission_atdefaultfirst_seen_at pageinteger- Page number for numeric pagination, starting at 1. Example: 2
page_cursorstring- Cursor from the previous response's pagination.next_page_cursor. Faster than page numbers for large result sets. Example: eyJpdiI6ImpCMlY3cERCbEo0Qk1Ge
page_lengthinteger- Number of items per page, up to 1000 (server default 100). Example: 50
searchstring- Only contacts whose email, ID or name matches. Example: jane
segment_uuidstring- Only contacts in this segment UUID. Example: 0ff87720-9ae5-11ea-bce5-65a395204572
refiner_list_formsList surveys (forms) in the Refiner environment, ordered by name.Read-onlyList Forms
List surveys (forms) in the Refiner environment, ordered by name. Returns an items array of surveys with uuid and name, and a pagination object. With include_info it adds channels, publish and archive dates, response and view counts, folder and page_url. Use to find a form_uuid for responses, reports and publishing. Use refiner_get_form_history for a survey's past versions.
Inputs
include_configinteger- Set to 1 to include each survey's configuration and question elements (server default 0). Can be large. Example: 0one of
01default0 include_infointeger- Set to 1 to add metadata such as creation and publish dates, response and view counts, and folder (server default 0). Example: 1one of
01default0 liststring- Which surveys to return by state (server default all). Example: publishedone of
allpublisheddraftsarchivedall_with_archived pageinteger- Page number for numeric pagination, starting at 1. Example: 2
page_lengthinteger- Number of items per page, up to 1000 (server default 100). Example: 50
refiner_list_responsesList survey responses collected in Refiner, newest first.Read-onlyList Responses
List survey responses collected in Refiner, newest first. Returns an items array where each item has uuid, timestamps, the survey (uuid, name), the answers in data and the responding contact with account, plus a pagination object with next_page_cursor. Use to read raw answers. Use refiner_get_reporting for aggregated NPS, CSAT or rating figures.
Inputs
date_range_endstring- Only responses before this time, ISO 8601 (YYYY-MM-DD or YYYY-MM-DD hh:mm:ss). Example: 2024-12-31
date_range_startstring- Only responses at or after this time, ISO 8601 (YYYY-MM-DD or YYYY-MM-DD hh:mm:ss). Based on last_data_reception_at, or last_shown_at when include is all. Example: 2024-01-01
form_uuidstring- UUID of a survey; only responses to that survey are returned. Find it with list forms. Example: 3894dc20-8fe9-11ea-892e-d13af52e06ae
includestring- Which responses to return (server default completed): completed, partials (partial plus completed) or all (also dismissed views). Example: partialsone of
completedpartialsalldefaultcompleted pageinteger- Page number for numeric pagination, starting at 1. Example: 2
page_cursorstring- Cursor from the previous response's pagination.next_page_cursor. Faster than page numbers for large result sets. Example: eyJpdiI6ImpCMlY3cERCbEo0Qk1Ge
page_lengthinteger- Number of items per page, up to 1000 (server default 100). Example: 50
searchstring- Return only responses whose contact user ID, Refiner UUID, email or name matches. Example: jane@awesome.com
segment_uuidstring- UUID of a segment; only responses from users in that segment are returned. Example: 0ff87720-9ae5-11ea-bce5-65a395204572
tag_uuidstring- UUID of a response tag; only responses with that tag are returned. Example: 4f5637d0-3d0d-11ea-b965-614418dec30c
with_attributesinteger- Set to 1 to include all stored attributes on each response's contact. Example: 1one of
01
refiner_list_segmentsList user segments in Refiner, ordered by name.Read-onlyList Segments
List user segments in Refiner, ordered by name. Returns an items array of segments with uuid, name and is_manual, plus a pagination object. Use to find a segment_uuid for filtering or for add and remove segment calls.
Inputs
pageinteger- Page number for numeric pagination, starting at 1. Example: 2
page_lengthinteger- Number of items per page, up to 1000 (server default 100). Example: 50
refiner_add_contact_to_segmentAdd a user to a manual segment.WriteAdd Contact To Segment
Add a user to a manual segment. Returns message, contact_uuid and segment_uuid. Creates the user if no match exists. Use refiner_list_segments to find manual segments. Use refiner_remove_contact_from_segment to undo.
Inputs
segment_uuidstringrequired- UUID of the manual segment. Example: 4f5637d0-3d0d-11ea-b965-614418dec30c
emailstring- Email address of the contact; use when you have no user ID. Example: jane@awesome.com
idstring- Your own user ID for the contact, the same ID used with identify user. Example: user_123
refiner_duplicate_formDuplicate a survey into a new draft.WriteDuplicate Form
Duplicate a survey into a new draft. Returns message, source_form_uuid and new_form_uuid. Use refiner_publish_form to publish the copy.
Inputs
form_uuidstringrequired- UUID of the survey to copy. Example: 3894dc20-8fe9-11ea-892e-d13af52e06ae
namestringrequired- Name of the new survey. Example: NPS survey copy
refiner_identify_userCreate or update a contact by user ID or email and attach traits.WriteIdentify User
Create or update a contact by user ID or email and attach traits. Returns message and contact_uuid. Returns 409 if another identify for the same user is in progress. Use to sync backend user data. Use refiner_track_event to record an event instead.
Inputs
accountobject- Account to group the user under; must contain id and may include name and other account traits. Example: {"id": "acct_1", "name": "Awesome Inc."}
emailstring- Email address of the contact; use when you have no user ID. Example: jane@awesome.com
idstring- Your own user ID for the contact, the same ID used with identify user. Example: user_123
traitsobject- Extra user traits as a flat object of attribute slug to value. Strings up to 4 KB, numbers and booleans are typed automatically, and slugs ending in _at are parsed as dates. Example: {"plan": "pro", "created_at": "2020-08-20T14:48:00.000Z"}
refiner_publish_formPublish or unpublish a survey.WritePublish Form
Publish or unpublish a survey. Returns a confirmation message. Use refiner_list_forms to find the form_uuid.
Inputs
form_uuidstringrequired- UUID of the survey. Example: 3894dc20-8fe9-11ea-892e-d13af52e06ae
publishedinteger- 1 publishes the survey, 0 unpublishes it (server default 1). Example: 1one of
01default1
refiner_remove_contact_from_segmentRemove a user from a manual segment.WriteRemove Contact From Segment
Remove a user from a manual segment. Returns a confirmation message. Use refiner_add_contact_to_segment to add users.
- Idempotent
Inputs
segment_uuidstringrequired- UUID of the manual segment. Example: 4f5637d0-3d0d-11ea-b965-614418dec30c
emailstring- Email address of the contact; use when you have no user ID. Example: jane@awesome.com
idstring- Your own user ID for the contact, the same ID used with identify user. Example: user_123
refiner_store_responseStore a survey response for a user, for example to import historical data or collect answers through your own UI.WriteStore Response
Store a survey response for a user, for example to import historical data or collect answers through your own UI. Returns message and the new response uuid. Use to create a response. Use refiner_tag_response to tag an existing one.
Inputs
answersobjectrequired- Answers keyed by question identifier (slug). Strings up to 255 characters, numbers and booleans. Example: {"nps": 9, "comment": "Great product"}
form_uuidstringrequired- UUID of the survey to attach the response to; it may be empty and unpublished. Example: 3894dc20-8fe9-11ea-892e-d13af52e06ae
accountobject- Account to group the user under; needs at least id. Example: {"id": "acct_1"}
datestring- When the response was recorded, ISO 8601 (server default now). Example: 2024-06-05T13:02:57Z
emailstring- Email address of the contact; use when you have no user ID. Example: jane@awesome.com
idstring- Your own user ID for the contact, the same ID used with identify user. Example: user_123
prevent_duplicatesboolean- Set false to disable duplicate detection (server default true). Example: false
tagsarray- Tags to attach, up to 20. Example: ["onboarding"]
uuidstring- Refiner contact UUID; alternative to id and email. Example: 15cce3d0-ed5d-11ea-aaef-e58a2a43e996
refiner_tag_responseAdd tags to an existing survey response.WriteTag Response
Add tags to an existing survey response. Returns message ok. Use refiner_list_responses to find the response uuid first.
Inputs
tagsarrayrequired- Tags to add, up to 20. Example: ["bug", "pricing"]
uuidstringrequired- UUID of the survey response to tag. Example: cb47c260-ed64-11ea-8187-a7fc8351fba4
refiner_track_eventRecord a named event for a user.WriteTrack Event
Record a named event for a user. Returns message ok. Creates the user if no match exists. Use for backend events that trigger surveys. Use refiner_identify_user to update traits.
Inputs
eventstringrequired- Name of the event that occurred. Example: Upgraded plan
emailstring- Email address of the contact; use when you have no user ID. Example: jane@awesome.com
idstring- Your own user ID for the contact, the same ID used with identify user. Example: user_123
refiner_archive_formArchive a survey.DestructiveArchive Form
Archive a survey. Returns message ok. Use refiner_list_forms with list set to archived to see archived surveys.
- Idempotent
Inputs
form_uuidstringrequired- UUID of the survey to archive. Example: 3894dc20-8fe9-11ea-892e-d13af52e06ae
refiner_delete_contactPermanently delete a contact and their survey responses.DestructiveDelete Contact
Permanently delete a contact and their survey responses. Returns message ok. Use refiner_identify_user to blank sensitive fields instead if responses must be kept.
- Idempotent
Inputs
emailstring- Email address of the contact; use when you have no user ID. Example: jane@awesome.com
idstring- Your own user ID for the contact, the same ID used with identify user. Example: user_123
uuidstring- Refiner-generated contact UUID. Example: 15cce3d0-ed5d-11ea-aaef-e58a2a43e996
No tools match.