Operations
Fresh approval flow
- Allocate a canonical UUID
operation_idfor the exact draft. - Start with
purpose:"credential","binding"or"mcp"and the matching complete request schema. - Use an offered authentication method. The Apple flow must use the returned nonce and the subject already linked to this account.
- Verify exactly one of
passwordorapple_token, plusmfa_codewhen required. - Submit the exact approved request with the same operation ID before approval expiry; MCP uses its dedicated approval endpoint.
Credential request
null means no expiration for API/TradingView. Optional integration_id is for replacement within an existing exact namespace policy.
The issuance response contains credential metadata and a one-time secret on new issuance. A committed duplicate cannot recover the secret. After a lost response, inspect metadata and revoke a key whose secret was not retained before explicitly creating another.
TradingView binding policy
In addition to restricted credential fields, a binding hasmode, position_mode, allow_market_terminate, optional positive decimal-string max_quantity, fresh source UUID and guided position_request when applicable. One exact exchange link is required. Each alert selects one instrument within the optional allowlist. The returned immutable revision accompanies subsequent signals.
single/multiple controls OPEN occupancy per instrument, while the signal’s exact-position/strategy/market target controls what termination selects. The explicit market grant is additional authority, including manual and other strategies’ positions in that exact market. It is not enabled by choosing multiple-position mode.
Both credential and binding issuance wrap the proposed
request with the required operation_id. Fresh-auth start also requires purpose; verify requires operation_id and proof, referring to that existing challenge. Inside proof, exactly one offered password or apple_token is required, with mfa_code conditionally required by the challenge. Do not include both authentication methods. Revoke requests require the exact id (credential) or integration_id (binding) specified by their endpoint. See the endpoint schemas for wire bounds and request wrappers.
MCP consent
MCP approval is separate from ordinary key issuance. Never sendkind:"mcp" to
POST /integrations/credentials. Use the OAuth request supplied by the client
and the authenticated Settings flow.
- Preview the authorization
using
authorization. The server validates the registered callback, exact resource, state and S256 PKCE challenge, then returnsclient_name, normalizedauthorization, all five supportedallowed_scopesandresource. Preview creates no grant; Settings enables only read by default. - Form
MCPConsentRequestfrom that authorization, one to 32 owned activeexchange_link_ids, and one to five supportedscopesselected by the account owner. Optionalexpires_atis null/omitted for no expiration, or future UTC Unix seconds within 30 days. Optionalinstrument_idsselects up to 64 exact IDs; empty/omitted permits all instruments on the links. - Continue submits the selected permissions without a separate consent flag.
Start fresh authentication with
purpose:"mcp"and the complete request, verify the offered proof and required MFA, then approve the connection with the sameoperation_idand unchanged request before the five-minute approval expires.
scope is optional and defaults to read when
omitted/empty. Duplicate/unknown requested scopes are rejected. The client owns
its registered callback, opaque state and PKCE verifier; never construct or paste
these sensitive callback values into chat. The allowed_scopes in preview are
all supported choices, independently of the client’s initial scope. The account
owner’s selection determines the grant under OAuth scope rules;
the token response reports the actual granted scopes. Preview grants no access,
and refresh cannot expand the selected permissions.
Approval requires current Pro/trial entitlement and returns 201 with credential
metadata and a sensitive redirect_url. The callback contains a two-minute,
single-use code, original state and issuer; access/refresh tokens are obtained by
the OAuth client separately. A committed retry returns 409 OAUTH_APPROVAL_CONSUMED
and cannot recover the code. After an ambiguous response inspect connection
metadata and explicitly restart OAuth instead of automatically replaying approval.
The approval route shares the 12-requests/minute/IP credential-security limiter;
preview retains bounded request/concurrency admission without consuming that quota.
An MCP service refusal from preview/approve returns OAuth-shaped 503 data with
error, error_description and iss; error is temporarily_unavailable.
Reauthentication with purpose mcp uses the normal integration error
MCP_NOT_ACTIVATED. Other validation/admission failures retain the documented
integration error shape. See MCP setup and permissions.
Metadata, retention and revocation
Metadatakind is api, tradingview or mcp. MCP credentials come from the OAuth consent flow, not ordinary key issuance. Read the availability booleans when offering a connection. They do not grant permission or replace linked-account checks.
Active metadata is listed first, followed by recent history, up to 100 rows. Inactive credentials become eligible for cleanup 30 days after their own expiry or revocation, provided retained command evidence no longer references them. Unrevoked keyless TradingView setups remain visible for disconnection. A credential’s expiry does not itself remove its setup or free the unrevoked-binding capacity.
Export metadata you need beyond its retention window without exporting secrets. The Settings Events list retains the command receipt semantics described in commands and receipts.
Confirmed revocation is 200 {"revoked":true}. If the result is REVOCATION_UNCERTAIN, refresh metadata before an explicit retry. New handoff authorization changes do not interrupt trading-owned protection or recovery.
Settings groups credentials by integration_id and presents one Disconnect
action per integration. It uses the namespace endpoint above for every kind and
removes the item after a confirmed response. Individual Remove key controls
appear under Keys only when multiple replacement keys exist; these use the
exact credential endpoint and leave the other keys active. No additional delete
request or automatic mutation retry is required.