Authentication
All tools authenticate using theX-API-KEY passed in the MCP server header, or with sign-in. No additional auth is needed per-tool call. The agency custom fields tools work only with sign-in.
Workspace Tools
list_clients
List all available RevyOps workspaces accessible via your API key(s). Call this first to discover which workspaces you can query, then pass the workspace name to other tools.
Parameters: none
Returns: List of workspace names and IDs, each workspace’s time_zone, and a flag indicating the default workspace. A key that doesn’t resolve to one workspace, such as an agency master (ML-) key or a mistyped key, is left out of the list without an error.
Filter & Query Tools
The universal filter engine answers “which records match X” for any entity (contact, company, opportunity, email, and more). Useget_filter_schema to discover entities and fields, get_field_options to see real values for a field, then query_entity to run the filter.
get_filter_schema
List the entities you can filter, or get one entity’s fields, relations and operators. Call with no entity first (small answer: entity ids and labels), then call again with an entity id for the fields you need to build a filter.
Returns: With an entity: each field’s id, label, type, allowed operators, options and their display names (
option_labels, e.g. revyops → API), whether get_field_options works on it, sortable/searchable/custom/aggregatable flags. Each relation’s name, target entity, cardinality. Also agg_columns (ready-made aggregate column specs) and the entity’s params and default_columns/default_sort.
get_field_options
List the values that actually occur in one filter field, to turn a vague ask into exact values for an eq/neq condition. Only useful for fields whose schema entry says dynamic_options: true.
Returns:
{"options": [...], "truncated": bool}. An empty list doesn’t necessarily mean no values exist. truncated: true means there are more distinct values than can be listed.
query_entity
Filter any entity with the full filter engine (the one the web UI uses). Prefer this over search_contacts/search_companies for anything beyond an exact email/domain/name lookup: boolean logic, ranges, dates, custom fields, conditions on related records, or any entity other than contact/company.
The
where condition tree has four node kinds, tagged by node:
{"node": "group", "op": "and"|"or", "children": [...]}{"node": "not", "child": {...}}{"node": "cond", "field": "status", "op": "eq", "value": [...]}{"node": "rel", "relation": "emails", "quantifier": "any", "where": {...}}
eq,neq,contains,not_contains: always take a non-empty list of alternatives, even for a single value. There is noin/not_inoperator.lt,lte,gt,gte: a single scalar.between,not_between:{"from": x, "to": y}; one side may be omitted for an open range.within,not_within:{"anchor": <anchor>, "n": <int>}, date/datetime fields only. Anchors:today,yesterday,this_week,last_week,this_month,last_month,this_quarter,last_quarter,this_year,last_year,last_days. Days are the workspace’s calendar days in its time zone, and weeks start on Monday.is_empty,is_not_empty: novaluekey.
rel quantifiers: any/none (no op/value), count (op + value), min/max (op + value + field), latest/earliest (op + value + field + order_field).
Limits: depth 8, 100 nodes, 3 relation hops, 200 columns, per_page 1..1000.
Returns: {count, num_pages, current_page, results}. A custom.<name> column lands under each row’s custom_fields.<name>; a multi-value custom field arrives as a JSON-encoded string.
list_activity_conditions
The activity phrases the app’s filter builder speaks for one entity. verbs are shortcuts over the activity stream, such as “has replied” or “has not accepted our LinkedIn request in the last 5 days”. “has replied” counts email and LinkedIn replies, while linkedin_messaged_us (“has messaged us on LinkedIn”) counts only LinkedIn messages the person sent us. Each verb says whether it can be counted (“at least 3 times”) and which activity entities it reads. rollups are named dates computed from activity, such as “Last email sent is not in the last 14 days”.
activity_condition
Builds one activity condition as a where node, in exactly the shape the app’s filter builder writes. A view saved from it opens in the builder as that phrase and stays editable. Combine several in a group node. For example, “accepted our LinkedIn request 5 to 30 days ago and has not replied” is three conditions: accepted_linkedin with has over 30 days, accepted_linkedin with has not over 5 days, and replied with has never.
Returns:
{"where": <node>, "reads": "<the phrase>"}. The builder may word a windowed single-channel verb as its named date: “has been emailed by us in the last 30 days” opens as “Last email sent is in the last 30 days”.
list_saved_views
The saved views this workspace sees in the app’s sidebar, for the contact, company and people lists. Each has id, name, description, entity, the where tree and sort, the visible columns, editable (whether this key may change it) and synced. Views shared from the agency to several workspaces are listed but are read-only to a key.
save_view
Save a filter as a saved view in the workspace’s sidebar, or update one. Build and check the filter with query_entity first, then pass the same where tree: it’s stored exactly as given and runs the same on the list page, in workflow triggers and in sync. The filter is checked before saving. A bad field or operator is refused with the path of the bad node, and nothing is saved. The reply includes match_count, how many records match right now.
People open and edit saved views in the app’s filter builder, which speaks a narrower language than query_entity. The view is stored in the form the builder reads: not is folded into the conditions, and a count of at least 1 or exactly 0 becomes any or none. Both forms match the same records, and the reply’s where is the stored form. A filter the builder still can’t open is refused with problems: each one gives a path into that where and a hint on how to say it. The usual case is a second relative date inside one activity relation. “Accepted 5 to 30 days ago” is two conditions, which activity_condition builds.
A new view is visible to everyone in the workspace and shows API as its creator.
delete_saved_view
Delete a saved view this workspace owns. Refused with 409 while a workflow starts from the view or it syncs to a webhook; the message says which.
Workflow Tools
A workflow does something when a record enters a saved view. Your agent builds and changes workflows whose trigger view belongs to this workspace alone (owned_by_client: true), such as views it saved with save_view. A workflow the agency shares across several workspaces takes only this workspace’s own values and its on/off switch; its steps, name and trigger are changed in the builder, or by an agent an Agency admin signed in with Agency workflows ticked. editable says which workflows your agent may change. A step’s settings stay each workspace’s own even then, so the agent sets them per workspace. Every change needs a read & write (RV-) key. Everything your agent builds shows in the builder exactly as if it had been built there.
Webhook URLs always come back redacted to their host. Sending a redacted value back keeps the real URL.
list_workflows
Workflows on saved views shared with this workspace: id, name, status, trigger (the saved view), owned_by_client, editable, enabled_for_client, step_count, has_draft, last_run.
get_workflow
One workflow’s steps: steps (the version it runs), draft_steps (unpublished edits of a live workflow), client_overrides (this workspace’s own values) and readiness, the problems that still stop it running, by step id. Empty readiness means it can run.
create_workflow
Create a workflow, off and without steps, on a saved view of this workspace with at least one condition.
update_workflow
Rename a workflow or change its trigger. The trigger changes only while the workflow is off, to a view on the same list.
add_workflow_step
Add one step: filter, branch (If / Else), webhook, alert, ai-agent, send-to, find-data, verify-phone or verify-email. It goes last, right after after_step_id, or into an If / Else path with path_id. New steps start with the builder’s defaults; an If / Else comes with Path 1 and Everyone else. The reply is the whole workflow with created_id and readiness.
Conditions use the workflow operators:
is, is not, contains, does not contain, starts with, ends with, gt, lt, is one of, is known, is unknown. Field keys come from get_workflow_fields.
A send-to step sends each person to Close CRM. mappings is a list of {target, close_field, source}: target is contact or lead, close_field is the Close field’s name, and source is the value to write, text with merge fields such as {{First Name}}. With start_workflow on, the Close workflow (sequence_id) and sender (sender_account_id, sender_email, sender_name) are set per workspace with set_workflow_client_values. Testing the step and turning the workflow on really write to Close.
An AI Agent step can start from a saved agent prompt: your agent copies the document’s text into prompt and its id into prompt_template_id, the same as Insert template in the builder. The step keeps its own copy, so a later edit to the document reaches the step only when the template is inserted again. Ideal Customer Profiles go into the prompt as {{Company ICP: <name>}} or {{Person ICP: <name>}} and are read in each time the step runs.
A find-data step looks the person up with a data provider and adds what it finds as the person’s own identifiers, as Add identifier does, on contact and people workflows only. find is a list of email, phone (mobile) and linkedin_url; only_if_missing (on by default) skips what the person already has. A value another person already holds is left with them. The step needs the provider’s API key connected for this workspace in the app, under Integrations; your agent can’t set one.
A verify-phone step checks each of the person’s phones with Twilio and stores its phone status (valid, unreachable, invalid, unknown) and line type (mobile, landline, voip, other); the phone itself is never changed. only_unchecked (on by default) skips phones Twilio already checked; line_status also asks whether the line is in service (beta, costs more). It needs Twilio connected for this workspace in the app.
A verify-email step checks each of the person’s emails with millionverifier or bounceban and stores the result as that provider’s email status, through the status mapping the workspace chose in the app; the email itself is never changed. only_unchecked (on by default) skips emails that provider already checked. It needs the provider connected and its results classified for this workspace in the app.
update_workflow_step
Change one step. config keys you pass replace the current ones, null removes one, and the rest stay. conditions replace a filter step’s whole list.
move_workflow_step
Move a step, with everything inside it, right after another step, into an If / Else path, or to a place in the top level.
remove_workflow_step
Remove a step. Removing an If / Else removes its paths and their steps too.
add_workflow_path
Add a named path to an If / Else step, before Everyone else, which takes every record no other path matched. The reply’s created_id is the new path’s id.
update_workflow_path
Rename a path or replace its conditions. Everyone else has no conditions.
remove_workflow_path
Remove a path and its steps. Everyone else and the last remaining path can’t be removed; remove the If / Else step instead.
set_workflow_client_values
Set the workspace’s own values on a workflow of this workspace or a shared one: webhook url and rate_per_sec, alert email_to and message, send-to sequence_id, sender_account_id, sender_name and sender_email, per step, plus flow_speed (1 to 10). A Slack alert’s account and channel come from the Slack the workspace connected in the app, so they are picked in the builder. They override the shared values for this workspace only, and null clears one back to the shared value. On a live workflow they wait in the draft until publish_workflow_draft.
get_workflow_fields
The fields conditions and merge fields use for one list, with the operators conditions take. The list also holds the workspace’s Ideal Customer Profiles (source: "icp") with the exact token to put in a prompt. Profiles and recent activities are prompt tokens only, not condition fields.
get_workflow_ai_options
The AI providers and models an AI Agent step can use, and whether the workspace has each provider’s API key connected. Keys are connected in the app, not by the agent, and a step without one can’t be tested or turned on.
list_workflow_test_records
Records to test steps on: the trigger view’s records for this workspace, or a search.
test_workflow_step
Run one saved step, with the workspace’s own values, on records of the trigger view. Webhook and Alert steps really send, so your agent asks first and tests on one record. An AI Agent step shows what it would write, writes nothing, and lists under unresolved_tokens any merge field or profile in the prompt that didn’t resolve. Filter and If / Else steps show which records match.
A Find data step calls the provider for real on up to 5 records, so it can use the account’s credits, and adds nothing.
turn_workflow_on
Turn a workflow on for this workspace, after you agree. A workflow of this workspace goes live as a whole. A shared workflow must already be on, and only this workspace’s part is switched. Readiness is checked again first, and the call is refused with the problems if anything is missing.
turn_workflow_off
Turn a workflow off for this workspace. A workflow of this workspace pauses as a whole; on a shared workflow only this workspace stops.
publish_workflow_draft
Make a live workflow’s draft the version it runs. Records already inside finish the version they started on. On a shared workflow only the workspace’s own values are applied.
discard_workflow_draft
Drop a live workflow’s unpublished edits. On a shared workflow only the workspace’s own pending values are dropped.
delete_workflow
Delete a workflow of this workspace, with its run history. Refused with 409 while it’s on.
list_workflow_runs
The workspace’s runs of a workflow, newest first, with counts by status and each step’s result and error.
Custom Fields Tools
list_custom_fields
List the custom fields defined for contacts, companies or opportunities, with each one’s type (text, number, date, dropdown_singleselect, dropdown_multiselect), dropdown options, and whether the agency master schema or this workspace defines it. Needs a read & write (RV-) key; with a read-only (RO-) key the call is refused.
create_custom_field
Define a custom field for this workspace and set its type, so it exists on every record and in the filter schema before any value is written. Values already stored are validated against the type; the call fails and names them when they don’t fit. Repeat the call to change the type of a field this workspace owns (type: "text" clears the type and keeps the field and its values). A field the agency master schema owns keeps the agency’s type, and the call answers 409 agency_master_field. An Agency admin changes that type in Schema Settings, or with update_agency_custom_field. Field names ignore case: a new name that matches a standard field in any case, such as LinkedIn URL for linkedin_url, answers 400 duplicate_field_name, and one that matches another field in a different case answers 409 duplicate_field_name, naming the field to use instead. Needs a read & write (RV-) key.
Agency Custom Fields Tools
The agency custom fields tools change the agency’s master schema, so every change reaches every workspace in the agency at once, including workspaces added later. Claude lists them only when an Agency admin signed in and ticked Agency custom fields, which needs read and write access to all workspaces. An API key never has them. Each call checks again that the person who signed in is still an admin of the agency and that the app still has the access, so a change in Connected AI agents or to the person’s role applies to the next call. They don’t rename or delete a field, rename an option, or change a value on a record; an Agency admin does that in Schema Settings.list_agency_custom_fields
List the master schema for contacts, companies or opportunities, with the type and dropdown options the agency set for each field. type is text when the agency set none. in_master_schema is false for a field the agency typed but never added to the master schema. workspace_types lists the workspaces that set their own type for the field: the agency’s type wins everywhere, and a workspace’s own type applies there only while the agency sets none.
update_agency_custom_field
Set or change a master field’s type, or add and remove its dropdown options. A refused call changes nothing.
- Setting or changing the type first checks every value stored in every active workspace, and fails with 400
existing_values_invalid, naming values that don’t fit. Archived workspaces aren’t checked. A field with no agency type needs one before its options can change. - Removing an option is refused with 409
options_in_usewhile any record in an active workspace holds it. The answer lists each option with the number of records holding it. Change those records first. - The agency type can’t be removed with this tool.
For example, adding Bounced to the contact field Email Search Result in every workspace:
promote_custom_field
Add a field that one or more workspaces have to the master schema, the same as Add to master schema in Schema Settings. Only the name moves: each workspace keeps the type it set, and the other workspaces read the field as text, until you give it an agency type with update_agency_custom_field. After promoting, a workspace can no longer change the field’s type with create_custom_field. The field must already exist in at least one workspace. Removing a field from the master schema is done in Schema Settings.
A name that matches a master field or a standard field in another case is refused with
duplicate_field_name.
Campaign Tools
get_campaigns
Get all campaigns with performance metrics.
Returns: Per-campaign metrics, sent, replies, bounces, interested, reply rate, open rate, click rate, unsubscribes, start/end dates.
get_campaign_drilldown
Drill into a specific campaign to see individual contacts or companies.
get_campaign_stats
Get high-level campaign statistics across all campaigns.
add_campaign_note
Add or update a note on a campaign. Needs a read & write (RV-) key; with a read-only (RO-) key the call is refused.
archive_campaign
Archive or unarchive a campaign. Needs a read & write (RV-) key; with a read-only (RO-) key the call is refused.
Contact Tools
search_contacts
Search contacts by email, name, domain, or LinkedIn URL.
get_contact
Get full contact details including custom fields. email_statuses lists every source’s result for the contact’s email, newest check first, beside the email_status that wins. See Email Statuses.
update_contact
Update a contact’s fields. Text such as \u00b7 that an agent sends as literal escape characters is saved as the real character, so a value with a middle dot matches a filter on it.
Write a verifier’s result with
email_status, not as a custom field such as “Million Verifier Result”: each source keeps its own result, and Email Statuses explains which one Email Status shows.
create_person
Create a person from their emails, LinkedIn URLs and phones, or add new ones to the person who already has the others. Calls POST /public/people, so sending the same call twice changes nothing.
At least one identifier is needed and at most 20 are allowed. A value that already belongs to another person is refused with 409
identifier_exists, naming that person. The tool tells the agent to ask the user before merging.
update_person
Edit one person. Calls PATCH /public/people/{person_id}.
Removing an identifier with emails, activity, a CRM link or a do-not-contact mark is refused first with 409
would_delete_history; call again with mode detach (move it and its history to a new person) or delete. The last identifier can’t be removed.
Company Tools
search_companies
Search companies by domain or name.
get_company
Get full company details including custom fields.
update_company
Update a company’s fields.
Opportunity Tools
Opportunities synced from Close CRM or HubSpot are read-only exceptcustom_fields; everything else is edited in that CRM. Creating, updating and deleting need a read & write (RV-) key. Field values are described on Opportunities.
create_opportunity
Create an opportunity linked to at least one contact or company. Linking contacts also links their companies unless company_ids is given.
get_opportunity
Get one opportunity with its linked contact and company IDs and custom fields. editable is false for synced opportunities.
update_opportunity
Update an opportunity. Only the arguments you pass change; contact_ids and company_ids replace the current links. Moving to a new stage records previous_stage and stage_changed_at, and won or lost sets closed_at once.
delete_opportunity
Delete an opportunity created in RevyOps. Synced ones must be deleted in the CRM.
Email Tools
search_emails
Search email records by campaign, contact, or type.
mark_email_interested
Mark a contact’s reply as interested. It marks the newest reply from that address, or the newest reply with exactly the subject you give. If the contact never replied but was emailed, it adds a placeholder reply, which counts as a reply for scoring. The change is queued, so it can take a few seconds to show. It cannot be undone from here; unmark in the app.
get_email_thread
Get the full email thread between your team and a contact.
LinkedIn Tools
get_linkedin_campaigns
Get all LinkedIn campaigns with performance metrics for a workspace.
Returns: Per-campaign metrics: messages sent, InMails sent, connection requests, profiles viewed, posts liked, replies, interested count, disposition breakdown, campaign dates.
get_linkedin_campaign_drilldown
Drill into a specific LinkedIn campaign to see individual contacts or companies.
get_linkedin_thread
Get the full LinkedIn message thread between your team and a contact.
Analytics Tools
get_deliverability
Get deliverability metrics broken down by sending domain and inbox.
get_contacts_stats
Get contact-level aggregate statistics.
get_variable_report_variables
Get available tracking variables and campaigns for A/B reporting.
get_variable_report
Generate an A/B test style report grouped by tracking variables.
Integrations Tools
list_integrations
List every integration the workspace can connect (sequencers, CRMs and signals), whether it is connected, when it last synced, and the activity types it supplies with the newest record of each in the last 30 days. Call it before designing a play that depends on deal stage, customer status, replies or website visits. A connected integration whose last_received_at is null is connected but silent. Sequencers record emails sent, replied and bounced, never opens. Same data as List Integrations.
Opportunity Mapping Tools
Normalized Stage and Lost Reason Category put every CRM’s deals on one scale. Each workspace maps its own stage and lost reason names once; unmapped values leave both fields empty. Won and lost deals are alwaysclosed. Both tools need a read & write (RV-) key.
list_opportunity_mappings
List the open deal stages and lost reasons this workspace’s synced deals carry, how many deals carry each, and the standard value each maps to (null when unmapped). Same data as List Opportunity Mappings.
map_opportunity_values
Map stages or lost reasons onto the standard values. Only the values you send change, null removes a mapping, and stored deals update before the call returns. The answer lists every value with its deal count, so a mapping with deals: 0 is a typo or a stage no deal has reached yet. Same as Save Opportunity Mappings.
Activity Sources Tools
Sources (origins) are the keys incoming activities are tagged with. A source’sscored_activities lists what it may send: standard types (email, call, linkedin_message, sms, whatsapp) plus custom:<activity type id> entries. revyops is the implicit source used when ingestion omits source.
list_sources
List the activity sources (origins) registered for a workspace. Each source has an id, a key (the value senders put in source), a display_name, and scored_activities.
create_source
Register a new activity source (origin). Needs a read & write (RV-) key; with a read-only (RO-) key the call is refused.
update_source
Update a source’s display name or the activity types it may send. scored_activities replaces the whole list. Dropping a type stops the source from sending it and drops it from that type’s scoring rules. Needs a read & write (RV-) key; with a read-only (RO-) key the call is refused.
delete_source
Delete an activity source. Fails (409) if activities tagged with this source already exist. Needs a read & write (RV-) key; with a read-only (RO-) key the call is refused.
set_activity_sources
Set which sources feed a custom activity type. source_keys replaces the current set: keys not listed are unbound. Passing [] leaves the type on the built-in revyops source only. Only the workspace’s own custom activity types can be bound this way. Needs a read & write (RV-) key; with a read-only (RO-) key the call is refused.
Custom Activity Types Tools
Custom activity types (“Activities”) are user-defined activities you can log against contacts/companies. Creating one also creates its scoring rule.list_custom_activity_types
List the custom activity types defined for a workspace: id (external_object_type), name, applies_to (contact/company), field schema, and the source keys currently bound to it.
create_custom_activity_type
Create a new custom activity type and its scoring rule. Needs a read & write (RV-) key; with a read-only (RO-) key the call is refused.
update_custom_activity_type
Update a custom activity type’s name, field schema, or applies_to. Needs a read & write (RV-) key; with a read-only (RO-) key the call is refused.
delete_custom_activity_type
Delete a custom activity type. Fails (409) if existing logged activities still use this type. Needs a read & write (RV-) key; with a read-only (RO-) key the call is refused.
get_activity
One logged activity: its type, properties, occured_at and linked contact, person and company IDs. Find IDs with query_entity on the type’s custom_activity_<id> entity, filtering on its fields as custom.<field_name>; the id column is the activity ID. editable is false for activities synced from another tool.
update_activity
Change one custom activity logged in RevyOps in place, such as a meeting’s outcome, without logging a new one. Properties you leave out keep their value and null clears one; values are checked against the activity type. The linked people and companies are rescored. Needs a read & write (RV-) key.
delete_activity
Delete one custom activity logged in RevyOps. The type and the person’s other activities stay, and the linked people and companies are rescored. Synced activities are deleted at their source. Needs a read & write (RV-) key.
Scoring Rules Tools
list_scoring_rules
List a workspace’s scoring rules. Auto-provisions any missing standard/custom rules. One rule per logical activity event; its origins lists every source it scores. Each rule carries a frequency_cap.
update_scoring_rule
Update a scoring rule’s weight, decay profile, enabled state, or frequency cap. The rule’s activity type, condition, and origins are system-owned. Needs a read & write (RV-) key; with a read-only (RO-) key the call is refused.
The frequency cap limits how often the rule adds points to one person:
every: each occurrence scores (no cap).window: one occurrence percap_nxcap_unitbucket (UTC-anchored, fixed buckets).identity: one occurrence per distinct value ofcap_identity_field. Only rules carrying a field schema (custom activities, meetings) can cap this way; email/LinkedIn/SMS/WhatsApp/call rules reject this mode.
Decay Profiles Tools
Decay profiles define how a score contribution fades: period is in days, where -1 means persistent (no decay).list_decay_profiles
List scoring decay profiles for a workspace.
create_decay_profile
Create a custom scoring decay profile. Needs a read & write (RV-) key; with a read-only (RO-) key the call is refused.
update_decay_profile
Update a scoring decay profile’s name or period. System profiles may forbid editing name and/or period. Needs a read & write (RV-) key; with a read-only (RO-) key the call is refused.
delete_decay_profile
Delete a custom scoring decay profile. System (built-in) profiles cannot be deleted (400). Needs a read & write (RV-) key; with a read-only (RO-) key the call is refused.
Scoring Settings Tools
Workspace-wide scoring settings. A company’s score is its own activities plus the scores of its top N people by Activity Score; people with a negative score always count.get_scoring_settings
Get the workspace’s scoring settings: company_top_people, the roll-up limit (default 10).
update_scoring_settings
Set how many top people roll up into a company’s score. Changing it recalculates the workspace’s scores in the background. Needs a read & write (RV-) key; with a read-only (RO-) key the call is refused.
Settings Documents Tools
Settings documents are the agency’s Markdown AI agent prompts, guides, shared documents, and Ideal Customer Profiles (ICPs), assigned per workspace.kind is agent_prompt (prompts, guides, shared documents) or icp.
list_folders
List the folders holding settings documents assigned to a workspace: id, name, and how many of the workspace’s documents sit in each.
list_documents
List the settings documents assigned to a workspace: id, name, folder, type, rev, locked and owner_level (content is null; read it with get_document). locked is worked out for the key calling: true means this key cannot write the document. owner_level is platform (Guides and the Your Setup templates), agency (shared across the agency’s workspaces) or client (this workspace’s alone). Each API key belongs to one workspace, so you see that workspace’s view only.
get_document
Read one settings document (name, rev, locked, and Markdown content). For long documents, call with outline=True first to get the headings, then read just the part you need with section.
search_documents
Find which settings documents mention something, without reading them all. Matches names and content (case-insensitive substring); returns id, name, folder, rev, match count, and the first few matching lines with line numbers. Up to 20 documents, most recently updated first.
put_document
Create a settings document, or update one. Only the fields passed change. Without document_id, creates a document assigned to this workspace only (name required). With document_id, content you pass replaces the whole body (to change a few lines, use patch_document). Content is capped at 64,000 characters. Locked documents (Guides) and documents shared with other workspaces are read-only. Needs a read & write (RV-) key; with a read-only (RO-) key the call is refused.
Every document in a reply carries
kind (agent_prompt or icp), so a read holds everything needed to write it back: send the same kind, folder_id and document_type.
patch_document
Change part of a settings document: replace exact snippets and/or append text. Edits run in order, then append. Each find must appear exactly once (after prior edits run); otherwise nothing changes. Locked documents are refused. Needs a read & write (RV-) key; with a read-only (RO-) key the call is refused.
delete_document
Permanently delete a settings document this workspace owns alone. There is no undo. Locked documents and documents shared with other workspaces cannot be deleted here. Needs a read & write (RV-) key; with a read-only (RO-) key the call is refused.
document_versions
List a document’s saved versions, newest first (id, name, who saved it, when, length), or read one version in full with version_id. Every save is kept; the list comes a page at a time.
restore_document_version
Put an earlier version of a document back. The restore is saved as a new version, so nothing is lost and it can itself be undone. Needs the same rights as editing the document. Returns the new rev and the length, not the content. Needs a read & write (RV-) key; with a read-only (RO-) key the call is refused.

