Skip to main content

AdminConfigApi

Struct AdminConfigApi 

Source
pub struct AdminConfigApi { /* private fields */ }
Expand description

Platform configuration: pricing, plans, feature flags, rate limits, runtime

Implementations§

Source§

impl AdminConfigApi

Source

pub async fn create_admin_spec_package_stripe_price( &self, package_id: &str, ) -> Result<Map<String, Value>>

Create the Stripe product and price for a package

Creates the product and price in Stripe and persists the resulting price id onto the package. Until this has run, the package cannot be bought: POST /api/v1/billing/spec-packages/{packageId}/checkout-session answers 400 and says so.

POST /api/v1/admin/config/spec-packages/{packageId}/stripe-price

Required scopes: admin.

Source

pub async fn create_plan_stripe_price( &self, plan_id: &PlanLLMLimitsTierAccessItem, body: &CreatePlanStripePriceRequest, ) -> Result<CreatePlanStripePriceResponse>

Create Stripe Product+Price for plan

POST /api/v1/admin/config/plans/{planId}/stripe-price

Required scopes: admin.

Source

pub async fn delete_custom_plan( &self, plan_id: &str, params: &DeleteCustomPlanParams, ) -> Result<DeleteCustomPlanResponse>

Remove a custom plan

Refuses while tenants are assigned to the plan. The answer is 409 naming how many, and the caller opts in with ?force=1 — an exact string match, so ?force=true does NOT force. Deleting a plan out from under its tenants leaves them on an id that no longer resolves, which is why the guard is there.

The count in the message is a floor, not a census: it is what the tenant scan saw at that moment.

DELETE /api/v1/admin/config/custom-plans/{planId}

Required scopes: admin.

Source

pub async fn delete_model_pricing_override( &self, model_ref: &str, ) -> Result<DeleteModelPricingOverrideResponse>

Drop the price override for one model

Removes the override so the model bills at its catalogue rate again. The 404 is keyed on the OVERRIDE map, not the model catalogue: deleting an override that was never set is 404 even for a model that exists.

DELETE /api/v1/admin/config/model-pricing/{modelRef}

Required scopes: admin.

Source

pub async fn delete_promo_code( &self, code: &str, ) -> Result<DeletePromoCodeResponse>

Remove a promo code

Removes the code only. Redemption and reward records already written against it are NOT cascaded — they remain, keyed by the code string, so a code deleted and later re-created inherits the history of its name.

DELETE /api/v1/admin/config/promo-codes/{code}

Required scopes: admin.

Source

pub async fn export(&self) -> Result<ExportAdminConfigResponse>

Bulk download of every admin-config KV override

GET /api/v1/admin/config/export

Required scopes: admin.

Source

pub async fn get_admin_agent_memory_config(&self) -> Result<Map<String, Value>>

Get agent memory overrides (decay, models, embedding dims)

GET /api/v1/admin/config/agent-memory

Required scopes: admin.

Source

pub async fn get_admin_auth_config(&self) -> Result<Map<String, Value>>

Get auth runtime overrides (super-admin email, OTP/JWKS TTLs)

GET /api/v1/admin/config/auth

Required scopes: admin.

Source

pub async fn get_admin_backpressure_config(&self) -> Result<Map<String, Value>>

Get backpressure overrides (SSE buffers + tool queue watermarks)

GET /api/v1/admin/config/backpressure

Required scopes: admin.

Source

pub async fn get_admin_code_interpreter_config( &self, ) -> Result<Map<String, Value>>

Get code-interpreter overrides (isolation, timeout, memory)

GET /api/v1/admin/config/code-interpreter

Required scopes: admin.

Source

pub async fn get_admin_disabled_tools( &self, ) -> Result<GetAdminDisabledToolsResponse>

Tool ids disabled platform-wide

GET /api/v1/admin/config/disabled-tools

Required scopes: admin.

Source

pub async fn get_admin_evaluation_config(&self) -> Result<Map<String, Value>>

Get evaluation overrides (timeouts, regression threshold, auto-rollback)

GET /api/v1/admin/config/evaluation

Required scopes: admin.

Source

pub async fn get_admin_founder_config( &self, ) -> Result<GetAdminFounderConfigResponse>

Founder identity, stored and from the environment

Same three-layer read as SMTP, except the third key is effective rather than source: the resolved values themselves, not a label saying where they came from. Resolution is per FIELD, so a founder id from storage can sit beside a public key from the environment.

GET /api/v1/admin/config/founder

Required scopes: admin.

Source

pub async fn get_admin_guardrails(&self) -> Result<GetAdminGuardrailsResponse>

Get guardrail config

GET /api/v1/admin/config/guardrails

Required scopes: admin.

Source

pub async fn get_admin_idempotency_config(&self) -> Result<Map<String, Value>>

Get idempotency overrides (enabled, TTL hours, max cache bytes)

GET /api/v1/admin/config/idempotency

Required scopes: admin.

Source

pub async fn get_admin_integrations( &self, ) -> Result<GetAdminIntegrationsResponse>

Get integration toggles

GET /api/v1/admin/config/integrations

Required scopes: admin.

Source

pub async fn get_admin_llm_adapters_config(&self) -> Result<Map<String, Value>>

Get LLM adapter overrides (retries, circuit breaker, per-provider RPM)

GET /api/v1/admin/config/llm-adapters

Required scopes: admin.

Source

pub async fn get_admin_logging_config(&self) -> Result<Map<String, Value>>

Get logging overrides (PII mode, file level, activity verbosity)

GET /api/v1/admin/config/logging

Required scopes: admin.

Source

pub async fn get_admin_long_running_config(&self) -> Result<Map<String, Value>>

Get long-running run overrides

GET /api/v1/admin/config/long-running

Required scopes: admin.

Source

pub async fn get_admin_mcp_config(&self) -> Result<Map<String, Value>>

Get MCP overrides (session limits, idle timeout)

GET /api/v1/admin/config/mcp

Required scopes: admin.

Source

pub async fn get_admin_multimodal_config(&self) -> Result<Map<String, Value>>

Get multimodal overrides (size + duration caps + format allowlists)

GET /api/v1/admin/config/multimodal

Required scopes: admin.

Source

pub async fn get_admin_o_auth_identity_config( &self, ) -> Result<GetAdminOAuthIdentityConfigResponse>

Apple native sign-in identifiers and the OAuth return-to allowlist

Three-layer read with effective, as with founder identity. The environment’s oauth_return_to_hosts is a comma-separated variable, split, trimmed and lower-cased before it appears here.

GET /api/v1/admin/config/oauth-identity

Required scopes: admin.

Source

pub async fn get_admin_persistence_config(&self) -> Result<Map<String, Value>>

Get persistence overrides (snapshot interval, KV auto-cap)

GET /api/v1/admin/config/persistence

Required scopes: admin.

Source

pub async fn get_admin_plans(&self) -> Result<GetAdminPlansResponse>

Get plan overrides

GET /api/v1/admin/config/plans

Required scopes: admin.

Source

pub async fn get_admin_registration_config( &self, ) -> Result<GetAdminRegistrationConfigResponse>

Registration state, setup progress, and the waitlist

Answers three things at once because the admin screen needs all three to decide whether the doors CAN open: the effective registration config, how far platform setup has got, and who signed up while it was shut.

The waitlist is real registered tenants in status waitlisted, not leads — they activate lazily on their first login after the doors open.

GET /api/v1/admin/config/registration

Required scopes: admin.

Source

pub async fn get_admin_retention_config(&self) -> Result<Map<String, Value>>

Get retention overrides (run / event / audit / feed / artifact TTLs)

GET /api/v1/admin/config/retention

Required scopes: admin.

Source

pub async fn get_admin_run_command_config(&self) -> Result<Map<String, Value>>

Get run_command overrides (enabled, allowed commands, deno_allow)

GET /api/v1/admin/config/run-command

Required scopes: admin.

Source

pub async fn get_admin_server_config(&self) -> Result<Map<String, Value>>

Get HTTP server overrides (trust_proxy, body cap, shutdown timeout)

GET /api/v1/admin/config/server

Required scopes: admin.

Source

pub async fn get_admin_setup_state(&self) -> Result<SetupStateResponse>

Platform setup progress

Answers the state plus the two vocabularies needed to read it — which steps exist and which are required — so a client does not hard-code either and drift when the list changes.

GET /api/v1/admin/config/setup-state

Required scopes: admin.

Source

pub async fn get_admin_smtp_config(&self) -> Result<GetAdminSmtpConfigResponse>

Get SMTP config, stored and from the environment

Three-layer read, the shape this whole config family uses: kv is what an operator saved, env is what the process environment supplies, and source says which of them is actually in force. The password is never in either — only has_password, so a UI can show that a credential exists without ever holding it.

GET /api/v1/admin/config/smtp

Required scopes: admin.

Source

pub async fn get_admin_spec_packages( &self, ) -> Result<GetAdminSpecPackagesResponse>

Every SPEC package, archived ones included

The operator’s view: unlike the tenant-facing /api/v1/billing/spec-packages, archived packages are present and the Stripe price id is NOT redacted. Sorted by display_order, then by name.

GET /api/v1/admin/config/spec-packages

Required scopes: admin.

Source

pub async fn get_admin_sse_config(&self) -> Result<Map<String, Value>>

Get SSE overrides (heartbeat, polling, reconnect hint)

GET /api/v1/admin/config/sse

Required scopes: admin.

Source

pub async fn get_admin_stripe_config(&self) -> Result<Map<String, Value>>

Get Stripe runtime config (keys redacted)

GET /api/v1/admin/config/stripe

Required scopes: admin.

Source

pub async fn get_admin_tool_overrides( &self, ) -> Result<GetAdminToolOverridesResponse>

Per-tool presentation overrides

A map keyed by tool id. Empty object when nothing is stored — never null.

GET /api/v1/admin/config/tool-overrides

Required scopes: admin.

Source

pub async fn get_admin_tool_security_config(&self) -> Result<Map<String, Value>>

Get tool security overrides (egress, SSRF, payload caps, concurrency)

GET /api/v1/admin/config/tool-security

Required scopes: admin.

Source

pub async fn get_admin_webhooks_config(&self) -> Result<Map<String, Value>>

Get webhook delivery overrides (separate from webhooks-policy)

GET /api/v1/admin/config/webhooks

Required scopes: admin.

Source

pub async fn get_admin_worker_pool_config(&self) -> Result<Map<String, Value>>

Get worker pool overrides (max workers, mode, queue size)

GET /api/v1/admin/config/worker-pool

Required scopes: admin.

Source

pub async fn get_feature_flags(&self) -> Result<GetFeatureFlagsResponse>

Get feature flags

GET /api/v1/admin/config/feature-flags

Required scopes: admin.

Source

pub async fn get_markup_config(&self) -> Result<GetMarkupConfigResponse>

Get markup config

GET /api/v1/admin/config/markup

Required scopes: admin.

Source

pub async fn get_platform_urls(&self) -> Result<GetPlatformURLSResponse>

Get platform base URLs (public_base_url, webhook_base_url)

GET /api/v1/admin/config/platform-urls

Required scopes: admin.

Source

pub async fn get_rate_limits(&self) -> Result<GetRateLimitsResponse>

Get rate limit config

GET /api/v1/admin/config/rate-limits

Required scopes: admin.

Source

pub async fn get_reconciliation(&self) -> Result<Map<String, Value>>

Get last reconciliation result

GET /api/v1/admin/config/reconciliation

Required scopes: admin.

Source

pub async fn get_runtime_config(&self) -> Result<GetRuntimeConfigResponse>

Get runtime config

GET /api/v1/admin/config/runtime

Required scopes: admin.

Source

pub async fn get_security_policies(&self) -> Result<Map<String, Value>>

Get CORS / SSRF / upload / admin-RBAC policies

GET /api/v1/admin/config/security-policies

Required scopes: admin.

Source

pub async fn get_webhooks_policy(&self) -> Result<Map<String, Value>>

Get webhook delivery + Stripe verification policy

GET /api/v1/admin/config/webhooks-policy

Required scopes: admin.

Source

pub async fn import( &self, body: &ImportAdminConfigRequest, ) -> Result<Map<String, Value>>

Bulk-apply a previously exported snapshot

POST /api/v1/admin/config/import

Required scopes: admin.

Source

pub async fn list_custom_plans(&self) -> Result<ListCustomPlansResponse>

The admin-authored plan catalogue

Custom plans layer over the four built-in tiers. Ordered by program ascending — rows with no program sort FIRST, because an absent program compares as the empty string — then by id. count is plans.length, not a total across pages: there is no paging, the catalogue is one stored record.

Optional fields are ABSENT rather than null throughout, so a client must test presence and not compare against null.

GET /api/v1/admin/config/custom-plans

Required scopes: admin.

Source

pub async fn list_promo_codes(&self) -> Result<ListPromoCodesResponse>

Referral and promo codes

A promo code pays its owner tenant bonus tokens for every paid subscription redeemed with it, and grants the subscriber a welcome balance. count is the array length; there is no paging.

GET /api/v1/admin/config/promo-codes

Required scopes: admin.

Source

pub async fn list_promo_rewards( &self, code: &str, ) -> Result<ListPromoRewardsResponse>

What one promo code has paid out

One entry per reward actually granted — the audit trail behind a code’s uses. Matched before the {code} route, so a code literally named rewards cannot shadow it.

GET /api/v1/admin/config/promo-codes/{code}/rewards

Required scopes: admin.

Source

pub async fn run_reconciliation(&self) -> Result<Map<String, Value>>

Run reconciliation

POST /api/v1/admin/config/reconciliation

Required scopes: admin.

Source

pub async fn set_feature_flags( &self, body: &Map<String, Value>, ) -> Result<Map<String, Value>>

Set feature flags

PUT /api/v1/admin/config/feature-flags

Required scopes: admin.

Source

pub async fn set_model_pricing_override( &self, model_ref: &str, body: &SetModelPricingOverrideRequest, ) -> Result<SetModelPricingOverrideResponse>

Override the billed price of one model

Sets what the platform charges for a model, independent of the catalogue. Validated by hand rather than by a schema, so the failures are worth stating: a body that is not JSON is 400; input_per_million or output_per_million missing, negative, or not coercible to a finite number is 400; cached_input_per_million, when present, must be a non-negative number or 400.

WRITE SEMANTICS: the entry replaces, the map merges. This overwrites the override for this model only and leaves every other model’s override untouched. Omitting cached_input_per_million removes it, and cached tokens then bill at the full input rate.

Note the response key is modelRef — camelCase, an outlier in a snake_case API, and documented as sent.

PUT /api/v1/admin/config/model-pricing/{modelRef}

Required scopes: admin.

Source

pub async fn set_rate_limits( &self, body: &Map<String, Value>, ) -> Result<Map<String, Value>>

Set rate limits

PUT /api/v1/admin/config/rate-limits

Required scopes: admin.

Source

pub async fn test_admin_smtp_config( &self, body: &TestAdminSmtpConfigRequest, ) -> Result<TestAdminSmtpConfigResponse>

Send a test email through the effective SMTP config

Sends for real, using whichever layer source reports — this is not a dry run. A delivery failure is 500 carrying the SMTP error text, not a 200 with ok: false, so a client must read the status rather than a field.

POST /api/v1/admin/config/smtp/test

Required scopes: admin.

Source

pub async fn test_admin_stripe_config(&self) -> Result<Map<String, Value>>

Verify stored secret_key authenticates against Stripe (read-only)

POST /api/v1/admin/config/stripe/test

Required scopes: admin.

Source

pub async fn update_admin_agent_memory_config( &self, body: &Map<String, Value>, ) -> Result<Map<String, Value>>

Update agent memory overrides

PUT /api/v1/admin/config/agent-memory

Required scopes: admin.

Source

pub async fn update_admin_auth_config( &self, body: &Map<String, Value>, ) -> Result<Map<String, Value>>

Update auth runtime overrides

PUT /api/v1/admin/config/auth

Required scopes: admin.

Source

pub async fn update_admin_backpressure_config( &self, body: &Map<String, Value>, ) -> Result<Map<String, Value>>

Update backpressure overrides

PUT /api/v1/admin/config/backpressure

Required scopes: admin.

Source

pub async fn update_admin_code_interpreter_config( &self, body: &Map<String, Value>, ) -> Result<Map<String, Value>>

Update code-interpreter overrides

PUT /api/v1/admin/config/code-interpreter

Required scopes: admin.

Source

pub async fn update_admin_disabled_tools( &self, body: &Vec<String>, ) -> Result<UpdateAdminDisabledToolsResponse>

Replace the platform-wide disabled tool list

The body is a bare JSON ARRAY, not an object — an outlier on a surface where every other write takes an object, and a client that wraps it in {disabled_tools: \[…\]} gets 400.

Gated on a FRESH MFA challenge.

WRITE SEMANTICS: replaces. The array given becomes the list. It must be NON-EMPTY and every element a non-empty string, so there is no way to disable nothing through this route — clearing the list is not expressible here.

PUT /api/v1/admin/config/disabled-tools

Required scopes: admin.

Source

pub async fn update_admin_evaluation_config( &self, body: &Map<String, Value>, ) -> Result<Map<String, Value>>

Update evaluation overrides

PUT /api/v1/admin/config/evaluation

Required scopes: admin.

Source

pub async fn update_admin_founder_config( &self, body: &UpdateAdminFounderConfigRequest, ) -> Result<Map<String, Value>>

Set the stored founder identity

Answers the same body the GET does.

WRITE SEMANTICS: merges. Omitted fields keep their stored values. Unlike SMTP, an empty string IS accepted on every field here and means “leave unset” — deliberately, because the admin UI echoes current values back and a no-op save of an unset identity must not 422.

PUT /api/v1/admin/config/founder

Required scopes: admin.

Source

pub async fn update_admin_guardrails( &self, body: &Map<String, Value>, ) -> Result<Map<String, Value>>

Update guardrail config

PUT /api/v1/admin/config/guardrails

Required scopes: admin.

Source

pub async fn update_admin_idempotency_config( &self, body: &Map<String, Value>, ) -> Result<Map<String, Value>>

Update idempotency overrides

PUT /api/v1/admin/config/idempotency

Required scopes: admin.

Source

pub async fn update_admin_integrations( &self, body: &Map<String, Value>, ) -> Result<Map<String, Value>>

Update integrations

PUT /api/v1/admin/config/integrations

Required scopes: admin.

Source

pub async fn update_admin_llm_adapters_config( &self, body: &Map<String, Value>, ) -> Result<Map<String, Value>>

Update LLM adapter overrides

PUT /api/v1/admin/config/llm-adapters

Required scopes: admin.

Source

pub async fn update_admin_logging_config( &self, body: &Map<String, Value>, ) -> Result<Map<String, Value>>

Update logging overrides

PUT /api/v1/admin/config/logging

Required scopes: admin.

Source

pub async fn update_admin_long_running_config( &self, body: &Map<String, Value>, ) -> Result<Map<String, Value>>

Update long-running overrides

PUT /api/v1/admin/config/long-running

Required scopes: admin.

Source

pub async fn update_admin_mcp_config( &self, body: &Map<String, Value>, ) -> Result<Map<String, Value>>

Update MCP overrides

PUT /api/v1/admin/config/mcp

Required scopes: admin.

Source

pub async fn update_admin_multimodal_config( &self, body: &Map<String, Value>, ) -> Result<Map<String, Value>>

Update multimodal overrides

PUT /api/v1/admin/config/multimodal

Required scopes: admin.

Source

pub async fn update_admin_o_auth_identity_config( &self, body: &UpdateAdminOAuthIdentityConfigRequest, ) -> Result<Map<String, Value>>

Set Apple identifiers and the return-to allowlist

Answers the same body the GET does.

WRITE SEMANTICS: merges. Omitted fields keep their stored values; a present oauth_return_to_hosts REPLACES the stored list rather than adding to it.

PUT /api/v1/admin/config/oauth-identity

Required scopes: admin.

Source

pub async fn update_admin_persistence_config( &self, body: &Map<String, Value>, ) -> Result<Map<String, Value>>

Update persistence overrides

PUT /api/v1/admin/config/persistence

Required scopes: admin.

Source

pub async fn update_admin_plans( &self, body: &UpdateAdminPlansRequest, ) -> Result<UpdateAdminPlansResponse>

Update plans

PUT /api/v1/admin/config/plans

Required scopes: admin.

Source

pub async fn update_admin_registration_config( &self, body: &UpdateAdminRegistrationConfigRequest, ) -> Result<Map<String, Value>>

Open or close registration, and set signup defaults

Opening registration when it is currently CLOSED requires confirm_open: true. Without it the answer is 400, and the message says so. This is not ceremony: on 2026-06-11 a long-lived admin tab running a stale bundle re-submitted its whole form four times in one day, each time carrying a stale registration_open: true, and silently re-opened doors an operator had ordered shut. An explicit confirm is something no stale form can send by accident. Closing, and a no-op re-save while already open, need no confirm.

A second 400 refuses opening while required setup steps are outstanding, and names them.

Answers the same body the GET does.

WRITE SEMANTICS: merges. Omitted fields keep their stored values. default_signup_plan and allowed_email_domains are stored only when present; an empty default_signup_plan clears it back to the free default.

PUT /api/v1/admin/config/registration

Required scopes: admin.

Source

pub async fn update_admin_retention_config( &self, body: &Map<String, Value>, ) -> Result<Map<String, Value>>

Update retention overrides

PUT /api/v1/admin/config/retention

Required scopes: admin.

Source

pub async fn update_admin_run_command_config( &self, body: &Map<String, Value>, ) -> Result<Map<String, Value>>

Update run_command overrides

PUT /api/v1/admin/config/run-command

Required scopes: admin.

Source

pub async fn update_admin_server_config( &self, body: &Map<String, Value>, ) -> Result<Map<String, Value>>

Update server overrides

PUT /api/v1/admin/config/server

Required scopes: admin.

Source

pub async fn update_admin_setup_state( &self, body: &UpdateAdminSetupStateRequest, ) -> Result<SetupStateResponse>

Mark setup steps complete, or flip the registration gate

WRITE SEMANTICS: mixed, and the mixed half is the point. completed_steps is a UNION — the steps given are ADDED to the stored list and never removed — so re-sending the same PATCH is idempotent and there is no way to un-complete a step through this route. registration_open is a plain overwrite.

Opening registration requires confirm_open: true when it is currently closed, exactly as PUT /api/v1/admin/config/registration does. The guard lives in both places on purpose: without it here, the lower-level endpoint was a way around the confirm that the launch-day incident of 2026-06-11 put there.

Opening also refuses with 400 while any required step is outstanding, naming them.

status reaching live is a ONE-WAY latch. Once setup has completed, CLOSING registration is an operational mode — a pre-registration wave — and does NOT return the platform to in_progress. Before that was fixed, closing sent the super admin back into the setup wizard on every page, and the wizard’s only exit was the very switch they had just turned off.

The write is a compare-and-set retried up to six times; a persistently contended record answers 503 rather than overwriting a concurrent change.

PATCH /api/v1/admin/config/setup-state

Required scopes: admin.

Source

pub async fn update_admin_smtp_config( &self, body: &UpdateAdminSmtpConfigRequest, ) -> Result<Map<String, Value>>

Update stored SMTP config

Answers the same body the GET does, so a client does not re-read to see what took effect.

WRITE SEMANTICS: merges. A field the body omits keeps its stored value. An empty string CLEARS, but only where the validator admits one: password and from_name accept "", while host, user and from are rejected with 422 before the merge is reached — host and user require at least one character and from must parse as an email. So a stored host cannot be blanked through this route, only overwritten.

password: "" is the operator-initiated clear: it drops both the encrypted and plaintext fields so the next read falls back to the environment. A password is stored AES-GCM-encrypted when an encryption key is configured; without one it is stored in plaintext and the server logs a warning rather than refusing.

PUT /api/v1/admin/config/smtp

Required scopes: admin.

Source

pub async fn update_admin_spec_packages( &self, body: &UpdateAdminSpecPackagesRequest, params: &UpdateAdminSpecPackagesParams, ) -> Result<Map<String, Value>>

Replace the SPEC-package map

WRITE SEMANTICS: replaces. The map given becomes the whole map, so a package omitted from the body is DELETED. Two guards exist because of that.

A drop that would remove a package with a wired stripe_price_id is refused with 422 unless the caller opts in per id: ?confirm_drop=\<id\>\[,\<id\>\]. Tenants may be subscribed against that price, so losing it silently is not a save, it is a billing incident. The refusal names every id it is protecting.

Each map KEY must equal its record’s package_id, or 422. The map is keyed by id everywhere downstream, so a key that disagrees with its record orphans the package at the next read.

updated_at is stamped by the server on every record in the payload and is not read from the body.

PUT /api/v1/admin/config/spec-packages

Required scopes: admin.

Source

pub async fn update_admin_sse_config( &self, body: &Map<String, Value>, ) -> Result<Map<String, Value>>

Update SSE overrides

PUT /api/v1/admin/config/sse

Required scopes: admin.

Source

pub async fn update_admin_stripe_config( &self, body: &UpdateAdminStripeConfigRequest, ) -> Result<Map<String, Value>>

Update Stripe keys/mode/price IDs; rebuilds BillingManager

PUT /api/v1/admin/config/stripe

Required scopes: admin.

Source

pub async fn update_admin_tool_overrides( &self, body: &UpdateAdminToolOverridesRequest, ) -> Result<UpdateAdminToolOverridesResponse>

Replace the per-tool presentation overrides

These affect PRESENTATION only. The runtime tool catalogue is code-defined, so an override changes what the catalogue page shows and nothing about what an agent can call — including hidden, which hides the row by default while the runtime still serves the tool. An operator reaching for hidden to switch a tool OFF wants disabled-tools instead.

Gated on a FRESH MFA challenge.

WRITE SEMANTICS: replaces. The map given becomes the whole map, so an id omitted from the body is deleted. Two further rules follow from that: an entry whose fields are all empty is DROPPED rather than stored — sending {} for an id is how the client deletes just that one — and hidden is stored only when literally true, so hidden: false deletes the flag rather than recording it.

Every key is checked against the runtime’s built-in tool ids: an unknown id is 422, distinct from the 400 a malformed body gets. The outer object is strict — an unexpected top-level key is rejected, not stripped.

PUT /api/v1/admin/config/tool-overrides

Required scopes: admin.

Source

pub async fn update_admin_tool_security_config( &self, body: &Map<String, Value>, ) -> Result<Map<String, Value>>

Update tool security overrides

PUT /api/v1/admin/config/tool-security

Required scopes: admin.

Source

pub async fn update_admin_webhooks_config( &self, body: &Map<String, Value>, ) -> Result<Map<String, Value>>

Update webhook delivery overrides

PUT /api/v1/admin/config/webhooks

Required scopes: admin.

Source

pub async fn update_admin_worker_pool_config( &self, body: &Map<String, Value>, ) -> Result<Map<String, Value>>

Update worker pool overrides

PUT /api/v1/admin/config/worker-pool

Required scopes: admin.

Source

pub async fn update_markup_config( &self, body: &Map<String, Value>, ) -> Result<Map<String, Value>>

Update markup

PUT /api/v1/admin/config/markup

Required scopes: admin.

Source

pub async fn update_platform_urls( &self, body: &UpdatePlatformURLSRequest, ) -> Result<Map<String, Value>>

Update public_base_url and webhook_base_url

PUT /api/v1/admin/config/platform-urls

Required scopes: admin.

Source

pub async fn update_runtime_config( &self, body: &Map<String, Value>, ) -> Result<Map<String, Value>>

Update runtime

PUT /api/v1/admin/config/runtime

Required scopes: admin.

Source

pub async fn update_security_policies( &self, body: &UpdateSecurityPoliciesRequest, ) -> Result<Map<String, Value>>

Update security policies

PUT /api/v1/admin/config/security-policies

Required scopes: admin.

Source

pub async fn update_webhooks_policy( &self, body: &UpdateWebhooksPolicyRequest, ) -> Result<Map<String, Value>>

Update webhooks policy

PUT /api/v1/admin/config/webhooks-policy

Required scopes: admin.

Source

pub async fn upsert_custom_plan( &self, plan_id: &str, body: &CustomPlanInput, ) -> Result<UpsertCustomPlanResponse>

Create or replace one custom plan

WRITE SEMANTICS: replaces. The stored record is rebuilt from this body; only created_at survives from the previous version. An omitted field does NOT keep its stored value — it takes the schema’s default or disappears.

Two defaults make an omission destructive, and the dangerous one is active. It is default(true), so re-saving a DEACTIVATED plan without sending active silently reactivates it. visibility is default("hidden"), so re-saving a public plan without sending it hides the plan from every tenant. Neither reports anything: the answer is 200 and the record looks freshly written.

Unknown keys are stripped rather than rejected, so a typo’d field name is accepted and dropped with a 200.

A built-in plan id (free, starter, pro, enterprise) is 409, pointing at PUT /api/v1/admin/config/plans — the route that does own those.

PUT /api/v1/admin/config/custom-plans/{planId}

Required scopes: admin.

Source

pub async fn upsert_promo_code( &self, code: &str, body: &PromoCodeInput, ) -> Result<UpsertPromoCodeResponse>

Create or replace one promo code

WRITE SEMANTICS: replaces. Only uses and created_at survive from the previous version; every other field comes from this body, and an omitted field is dropped.

target_plan_id is the omission that costs money. It scopes the code to one plan, and the reward path returns early when it is set and does not match the plan being paid for. Replace a scoped code without resending it and the code becomes redeemable on EVERY plan — 200, no warning, and the stored row looks the same size as before. active behaves the same way as on custom plans: default(true), so omitting it reactivates a deactivated code.

PUT /api/v1/admin/config/promo-codes/{code}

Required scopes: admin.

Trait Implementations§

Source§

impl Clone for AdminConfigApi

Source§

fn clone(&self) -> AdminConfigApi

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for AdminConfigApi

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more