Median

CLI reference

Every median command, its arguments and flags, and the role it needs.

Updated Oct 4, 202610 minute read
median <group> <command> [args] [flags]

Install and sign in with the CLI guide. Endpoints behind each command are in the management API reference.

Conventions

ItemMeaning
--jsonEvery command. Prints one JSON value on stdout
--help, --versionHelp for any command, and the installed version
--no-<flag>Sets a boolean flag to false, for example --no-enabled
RepeatableThe flag can be passed more than once
<ms>A Unix timestamp in milliseconds
<id>For a conversation, customer, document or signal argument, a median.sh link to it works too. Not in --conversation flags
Role AnyA signed in account. No organization needed
Role MemberAnyone in the organization
Role AdminAdmins and owners. See roles

Aliases

GroupAlias
readopen
orgsorg
conversationsconvos, inbox
knowledgekb
signalssignal
taskstask
integrationsint

Session

CommandArgs and flagsRole
login--api <url> sets the API address. Default https://api.median.sh, or MEDIAN_API_URLAny
logoutRevokes this machine's sessionAny
whoamiAccount, bound organization and roleAny

read

CommandArgs and flagsRole
read <link>A /signal/, /inbox/, /customers/ or /knowledge/ link. Anything else fails with not_a_linkMember

orgs

CommandArgs and flagsRole
orgs listThe bound one is marked *Any
orgs currentMember
orgs create <name>--slug. Without it the slug is the name in lowercase, so a name with spaces or punctuation fails with invalid_slug. Pass --slug for those. Binds this session and your dashboard to the new organizationAny
orgs rename--name, --slug. Pass at least oneAdmin
orgs use <org>An id or slug. Rebinds this session onlyAny

A slug is 3 to 32 lowercase letters, numbers and single dashes. Reserved words such as admin, api, app, help, median, support and team are refused. You can be in 50 organizations at most.

keys

CommandArgs and flagsRole
keys listMasked values onlyAdmin
keys create--name. Prints MEDIAN_KEY and the publishable key onceAdmin
keys revoke <id>Admin

conversations

CommandArgs and flagsRole
conversations list--status, one of open, resolved, closed. --channel, one of widget, email, discord. --archived. --waiting for threads that need a person. --limit up to 200, default 50Member
conversations get <id>Every message, notes includedMember
conversations reply <id>--body, required. Takes the thread off the AIMember
conversations note <id>--body, required. Team onlyMember
conversations resolve <id>Member
conversations close <id>Member
conversations reopen <id>Member
conversations archive <id>Member
conversations unarchive <id>Member
conversations read <id>Member
conversations unread <id>Member
conversations snooze <id>--until, required. 30m, 2h, 3d, 1w or <ms>Member
conversations wake <id>Cancels a snoozeMember
conversations pause <id>Takes the thread off the AIMember
conversations resume <id>Hands it back to the AIMember
conversations delete <id>Archived conversations onlyMember

customers

CommandArgs and flagsRole
customers list--limit up to 100, default 50Member
customers get <id>Profile, learned facts, conversationsMember
customers refresh <id>--rebuild wipes the learned profile and rereads every conversationMember
customers reach-out <id>--body or --file <path>, one required. --subject, email only. --agent sends as the AI agent, which answers the reply. --brief tells the agent what to achieveMember
customers forget <id> <factId>Removes one learned factMember
customers delete <id>Deletes the customer and every conversation they hadMember

knowledge

CommandArgs and flagsRole
knowledge listFolders and documentsMember
knowledge search <query>--source, one of upload, manual, github, notion, web, learned. Matches titlesMember
knowledge get <id>Member
knowledge write--title, required. --body or --file <path>, one required. --folder <id>Admin
knowledge edit <id>--title, required. --body or --file <path>, one required. Synced documents refuseAdmin
knowledge delete <id>Admin
knowledge move <id>--folder <id>, top level if left out. --order, default 0Admin
knowledge retry <id>Indexes a failed document againAdmin
knowledge syncResyncs every connected repository and Notion pageAdmin
knowledge folders create <name>--description, --parent <id>. Three levels deep at mostAdmin
knowledge folders rename <id>--name, required. --description. Leaving it out keeps the current oneAdmin
knowledge folders move <id>--parent <id>, top level if left out. --order, default 0Admin
knowledge folders delete <id>Its contents move up a levelAdmin
knowledge suggestions listAdmin
knowledge suggestions approve <id>Writes it into the libraryAdmin
knowledge suggestions dismiss <id>Admin
knowledge crawls listAdmin
knowledge crawls start <url>The same site again updates pages already importedAdmin
knowledge crawls remove <id>Cancels a running crawlAdmin

signals

Statuses: open, planned, "in progress", "in review", done, declined. Quote the two with spaces. Priorities: urgent, high, medium, low.

CommandArgs and flagsRole
signals list--kind, bug or suggestion, required. --filter, one of live, all or a status. The default live hides done and declinedMember
signals get <id>Reporters and claimed commitsMember
signals file--kind, --title, --priority, required. --body. A repeated title fails with signal_existsMember
signals edit <id>--title, required. --body. Leaving it out keeps the descriptionMember
signals status <id> <status>done messages every reporterMember
signals priority <id> <priority>Member
signals accept <id>Sends it to every connected tracker and plans itMember
signals merge <id>--duplicate <id>, required. The duplicate folds into <id>Member
signals delete <id>Nobody is toldMember
signals commits apply <id>Accepts the commit as the fix and closes the signalMember
signals commits dismiss <id>Member

tasks

Statuses: requests, planned, in_progress, in_review, done. <task> is a key like MED-12, a number or an id. See Tasks.

CommandArgs and flagsRole
tasks list--status. --assignee as an email or user id. --limit up to 100, default 100Member
tasks get <task>With every commit and pull request on itMember
tasks create--title, required. --description or --file <path>. --status, default planned. --priority, one of urgent, high, medium, low. --assigneeMember
tasks edit <task>--title, --description, --file <path>Member
tasks status <task> <status>--place, top or bottom, default bottomMember
tasks priority <task> <priority>A priority, or none to clear itMember
tasks assign <task> <person>Email or user idMember
tasks unassign <task>Member
tasks delete <task>Tracker issues stayMember
tasks requests--limit up to 60, default 60Member
tasks adopt <signal>--status, default plannedMember
tasks decline <task>Cards in requests onlyMember
tasks settingsWith no flags, prints the settings. --prefix, --code on or off, --issues <owner/repo> or off, --watch <owner/repo> and --unwatch <owner/repo> change themMember reads, Admin changes

feedback

CommandArgs and flagsRole
feedback submit--from, required. A stable id for the person, 8 to 128 characters. --body or --file <path>, one required. --page <url>, --name, --email. --image <url>, repeatable. The last 6 are keptMember

With --json, outcome is bug, suggestion, spam or unread. unread means nothing was filed, because the reader was unavailable or filing is off. Without --json it prints one sentence, like Filed as a bug (<id>).

tools

CommandArgs and flagsRole
tools listEach endpoint with its tools, risk and switchMember
tools enable <name>Admin
tools disable <name>Admin
tools endpoint add <url>Connects a route, or resyncs one already connected. A Median key must existAdmin
tools endpoint remove <id>Its tools go with itAdmin
tools endpoint sync--url <url> when more than one endpoint is connectedAdmin
tools approvals--conversation <id> for one thread's recent callsMember
tools approve <id>The call runs nowMember
tools deny <id>Member
tools status <id>One call's state and resultMember
tools run <conversation> <tool>--input <json>. Runs now as the team, with no approvalMember
tools test <tool>--input <json> with flat string, number and boolean values. --as <user id>. --conversation <id> uses its stored visitor and cannot be combined with --as. Runs at any risk with no approval. Exits 1 when the tool failsAdmin
tools suggestions list--prompt <id> prints one brief in fullAdmin
tools suggestions built <id>Admin
tools suggestions dismiss <id>Admin

agent

CommandArgs and flagsRole
agent getAdmin
agent set--name, 2 to 40 characters. --personality, up to 2,000. --on <switch> and --off <switch>, both repeatableAdmin
SwitchDashboard label
requireEmailAsk for an email
messagePreviewPreview replies
autoResolveResolve conversations automatically
learnFromThreadsLearn from resolved conversations
suggestKnowledgeSuggest knowledge and tools
nightlySweepReview the inbox nightly
fileSignalsTrack bugs and suggestions

integrations

Connect each integration in the dashboard first. Channels, roles and teams go in by name. Repositories are written owner/repo.

CommandArgs and flagsRole
integrations statusMember
integrations email--enabled or --no-enabled. The first time on issues your addressAdmin
integrations slack--channel <name>, --enabledAdmin
integrations discord--tickets <channel>, --staff <role>, --no-ping to ping nobody, --mirror <channel>, --mirroring, --enabledAdmin
integrations linear--team <key or name>, --auto opens an issue as each signal is filedAdmin
integrations issues set <repo>--autoAdmin
integrations issues offOpen issues stay openAdmin
integrations commits watch <repo>--branch, --close closes the signal when the fix mergesAdmin
integrations commits stop <repo>Admin
integrations repos connect <repo>--branch, --path <folder>, --published-at <url>Admin
integrations repos published <repo> <url>Admin
integrations repos remove <repo>Imported documents stayAdmin

site

The public site's look, domain and sign-in. See Site themes, Custom domain and Site sign-in.

CommandArgs and flagsRole
site getMember
site set--theme paper, --scheme system, light or dark, --navigation top, sidebar or topics, --accent <hex> or --accent theme for the theme's ownAdmin
site css pull [file]Prints the CSS without a fileMember
site css push <file>Replaces the whole stylesheet, up to 60,000 charactersAdmin
site css clearAdmin
site domain getPrints the DNS records still to addMember
site domain set <hostname>Replaces any other domain. Prints the DNS records to addAdmin
site domain checkChecks the DNS records nowMember
site domain removeBack to <slug>.median.websiteAdmin
site sign-in getThe method, its settings and the OIDC redirect URIMember
site sign-in set <method>median, app or oidc. --app-url <url> for app. --issuer, --client-id and --client-secret for oidc; leave out the secret to keep the saved oneAdmin

members and invites

CommandArgs and flagsRole
membersLists everyone with their user idMember
members role <userId> <role>owner, admin or memberAdmin
members remove <userId>What they wrote stays. Your own id leaves the organization, which any member may doAdmin, or anyone for themselves
invites listAdmin
invites create <email>--role, one of member, admin, owner. Default member. Also prints the invitation's pathAdmin
invites revoke <id>Admin

Only an owner can make or invite an owner. Admins cannot change or remove other admins or owners. Nobody can change their own role, and the last owner cannot be demoted or removed.

webhooks

Events: message.created, conversation.created, conversation.updated, bug.created, suggestion.created, signal.updated, knowledge.suggestion.created.

CommandArgs and flagsRole
webhooks listAdmin
webhooks add <url>--event, repeatable. Default every event. A Median key must existAdmin
webhooks update <id>--url <url>. --event, repeatable. Replaces the listAdmin
webhooks remove <id>Pending retries stop tooAdmin

analytics

CommandArgs and flagsRole
analytics overviewMember
analytics conversations--days, one of 7, 30, 90. Default 30. --from <ms>Member
analytics satisfactionSame as conversationsMember
analytics signalsSame as conversationsMember
analytics knowledgeSame as conversationsMember
analytics billingSame as conversations. Amounts in microcreditsMember
analytics activitySame as conversationsAdmin
analytics fields <dataset>A dataset's field ids, kinds, values and time fieldsMember
analytics explore--query <json>, required. --days, 1 to 366. Default 30. --from <ms>Member, Admin for the logs dataset
analytics recordsSame as explore, measure optional. --limit up to 200, default 50Member, Admin for the logs dataset

Every command here except overview, fields and records prints JSON with or without --json.

billing

CommandArgs and flagsRole
billing overviewPlan, credits left, add-ons, this period's useAdmin
billing invoices--cursor. --limit up to 100, default 25Admin
billing limitsYour API rate limit tier. Prints JSONMember
billing usage--from <ms> and --to <ms>, default the last 30 days. --cursor. --limit up to 100, default 100. Prints JSONMember

logs

CommandArgs and flagsRole
logs list--from <ms> and --to <ms>, default the last 30 days. --snapshot <ms>, --cursor. --limit up to 200, default 100. --search. --category. --outcome. --by. --actor <userId>. --conversation <id>. --usage for billed usage onlyAdmin
logs get <id>The entry, plus up to 50 entries about the same conversationAdmin
FlagValues
--categoryai, tools, knowledge, conversations, customers, signals, integrations, webhooks, email, team, keys, access, settings, billing, api, system
--outcomesuccess, failed, denied, pending, canceled
--bymember, agent, assistant, customer, api, system

A page that is not the last ends with more: --cursor <cursor> --snapshot <ms>. Pass both to read the next page.

docs

CommandArgs and flagsRole
docs search <query>--limit up to 8, default 5Member
docs read <route>A route such as /agent/tools, or the page's address. Prints the page as markdownMember

call

CommandArgs and flagsRole
callLists every methodMember
call <method>A method of the MCP client, such as conversations.reply. --data <json> for its arguments. Always prints JSONThe method's
median call conversations.list --data '{"needsHuman":true}'
median call signals.setPriority --data '{"signalId":"q57...","priority":"high"}'

Method names, arguments and answers match median.<method> in median_run. A method added to Median works here without updating the CLI.

api

CommandArgs and flagsRole
api <method> <path><method> is GET, POST, PATCH, PUT or DELETE. --data <json> for the request body. Always prints JSONThe endpoint's
median api GET /v1/me
median api PATCH /v1/tasks/MED-12 --data '{"status":"done"}'

median api sends your session token, so it cannot call the messaging routes (/v1/config, /v1/thread, /v1/messages, /v1/typing, /v1/uploads). Those take MEDIAN_KEY and answer invalid_api_key to anything else.

Still need help?

    Esc