# Settings for agents

Manage workspace preferences through the same API as the desk. The CLI and remote or stdio MCP use those exact routes,
validation and token scopes; they never borrow the person's browser session. A setting change is not approval to publish.

All paths below start at `https://app.flaghand.com/api/v1`; `W` means `/workspaces/{workspace}`. CLI examples omit the `flaghand` prefix.
For any named MCP operation, load its full schema with `getOperation {"operation_id":"…"}`. Use `callReadOperation`
for pure reads and `callWriteOperation` for mutations, with `operation_id` and `arguments`, or call the named tool directly.
`/mcp?toolset=all` lists all token-callable tools. A default connector grant has only read, drafts, media and request-approval;
calendar, webhooks, billing, cancel and inbox need their explicit scopes. Missing a scope never grants one automatically.

## Workspace preferences

| Setting | API | CLI | MCP operation | Permission |
|---|---|---|---|---|
| Posting time zone | `PATCH W` with `time_zone` | `workspaces rename --time-zone Europe/London` | `renameWorkspace` | drafts; workspace renaming still needs the owner's session |
| Weekly posting days and times per account | `GET/PUT W/connections/{id}/slots` with `zone`, `slots` | `connections get-slots`; `connections set-slots` | `getConnectionSlots`, `setConnectionSlots` | read / drafts; proposes times, never creates jobs |
| Email when a post needs its owner | `GET/PATCH W/notifications` with `post_attention_email` | `workspaces get-notifications`; `workspaces update-notifications --post-attention-email false` | `getNotifications`, `updateNotifications` | read / drafts; on by default |
| Automatic UTM tags | `GET/PATCH W/link-tracking` with `enabled` | `workspaces get-link-tracking`; `workspaces update-link-tracking --enabled true` | `getLinkTracking`, `updateLinkTracking` | read / drafts; off by default; never rewrites approved jobs |
| Private calendar feed: create, rotate, check, disable | `GET/POST/DELETE W/calendar-feed` | `calendar-feed get/create/delete` | `getCalendarFeed`, `createCalendarFeed`, `deleteCalendarFeed` | calendar; new secret shown once |
| Slack, Discord or signed event alerts | `GET/POST W/webhooks`; `DELETE W/webhooks/{id}` | `webhooks list/create/delete` | `listWebhooks`, `createWebhook`, `deleteWebhook` | webhooks; use the owner's supplied incoming URL |
| RSS/Atom/GitHub draft sources | `GET/POST W/feeds`; `DELETE W/feeds/{id}` | `feeds list/create/delete` | `listFeeds`, `createFeed`, `deleteFeed` | read / drafts; creates drafts only |
| Voice note | `GET/PUT W/voice` with `text` | `voice get`; `voice set --text '…'` | `getVoice`, `setVoice` | read / drafts; full replacement, empty clears |
| Voice lessons and relayed feedback | `GET/POST W/voice/lessons`; `PATCH/DELETE W/voice/lessons/{id}`; `GET/POST W/voice/relayed-verdicts`; `DELETE W/voice/relayed-verdicts/{id}` | `voice list-lessons/create-lesson/update-lesson/remove-lesson`; `voice list-relayed-verdicts/record-relayed-verdict/remove-relayed-verdict` | `listVoiceLessons`, `createVoiceLesson`, `updateVoiceLesson`, `removeVoiceLesson`, `listRelayedVerdicts`, `recordRelayedVerdict`, `removeRelayedVerdict` | read / drafts, with the owner's feedback boundaries below |
| Automation on/off, monthly credit budget, lookback and voice sample size | `GET W/automations`; `PATCH W/automations/{id}` | `automations list/update` | `listAutomations`, `updateAutomation` | read / drafts; existing feature switches still apply |
| Run a read automation and estimate its credits | `GET W/automations/{id}/estimate`; `POST W/automations/{id}/run` | `automations estimate/run` | `estimateAutomation`, `runAutomation` | read / drafts; voice learning still waits for the owner's confirmation |
| Best-times learning: start, refresh, reread history | `POST W/best-times/refresh` with optional `full` | `best-times refresh --full true` | `refreshBestTimes` | drafts, active plan; billed X reads and ongoing learning, never a publishing job |
| Billing: plan, invoices, cancel/resume, Checkout or portal link | `GET W/billing`; `POST W/billing/cancel`, `/resume`, `/checkout`, `/portal` | `billing get/cancel-plan/resume-plan/start-checkout/open-portal` | `getBilling`, `cancelPlan`, `resumePlan`, `startCheckout`, `openBillingPortal` | read / billing; card entry and payment consent stay with the person |
| Export data | `GET W/export` | `workspaces export --out workspace.zip` | `exportWorkspace` | read; also works after a plan lapses |

For best-times refresh, `full: true` rereads up to the same 800-post history as the Insights control. Existing credit
balance, automation on/off and budget checks remain; stopped reads keep their progress. Reaching the existing per-run
estimate returns `409 credit_run_limit`, with `error.credits`, `error.posts` and `error.fetched_at`, so the desk and agents
cannot mistake a partial refresh for completion. A failed billed platform read also returns `error.credits`, including
what was spent before failure. Read-only tokens cannot refresh.
The endpoint does not approve, schedule, start a waiting publishing job or send a post. See [credits](https://app.flaghand.com/docs/credits) and
[schedule and results](https://app.flaghand.com/docs/schedule-and-results).

## Finding and reading work

The desk's search has the same platform-name matching through `GET W/drafts?q=linkedin` and `GET W/jobs?q=linkedin`:
`flaghand drafts list --q linkedin --json`, `flaghand jobs list --q linkedin --json`, or MCP `listDrafts` / `listJobs`.
It also searches post text, titles and labels. Status, exact label, archive and workspace boundaries still apply.
Matching itself makes no platform request, but returning a draft can refresh a stale reply target through the existing
reply-target feature and its credit checks. API search can additionally find text in saved posting payloads, including a plug.

Activity filters use `listActivity` (`actor`, `kind`, `before`); suggestion filters use `listSuggestions`; month and
week reports use `getMonthlyReport` and `getWeeklyReport`. Client-only selection, expanded sections, preview theme,
viewport, clipboard and navigation do not change workspace preferences: use the underlying draft/media/report data,
not a fake UI-click endpoint. Full control mappings are in the [screen-action inventory](https://app.flaghand.com/docs/agents#screen-action-inventory).

## Decisions that stay with the person

Tokens can manage future scheduled posts without a per-post passkey.
No token can approve, post immediately, resume a paused queue, start a waiting job, retry a held job, take down a post or
approve a live edit. Tokens request the plan and return the product's approval link instead. Connecting a platform
returns its consent link; the person answers it. Tokens cannot manage passkeys, sign-in methods, members or agent
credentials, disconnect accounts or delete the workspace. Browser notification permission and registered devices stay
with the signed-in owner.

The owner's feedback is also not an agent's decision: only the owner can edit an owner-created voice lesson or restore
an owner-removed lesson. A token removes only its own relayed verdict. An agent withdrawing its suggestion is not an
owner dismissal or learning signal. Keep those provenance checks; never retry a refusal through a person's session.
Credit purchases and paid voice-bootstrap confirmations keep their existing owner approval. These are deliberate
boundaries, not settings silently missing from MCP.
