Enterprise Security
Optional hardening controls for enterprise partners — IP allowlists, scoped keys, signed requests, mTLS, and short-lived OAuth client-credentials tokens — plus the go-live certification checklist MyStocks reviews before production approval. Production-only, full-key required.
For Hosted API/OnPrem/Both choices, separate approvals and credential lifecycles, start with Deployment options and Partner workspace.
Optional hardening controls for enterprise partners — IP allowlists, scoped keys, signed requests, mTLS, short-lived OAuth tokens — plus the go-live certification checklist MyStocks reviews before production approval. These endpoints are production-only (not mirrored in sandbox) and require a full API key.
Human console authorization is managed separately from API-key scopes. See Team access and partner support for member roles, permissions, revocable sessions, privileged-role MFA, and access-review controls.
Scoped keys
With scopedKeysRequired enabled, a key with no scopes is denied (403) — enforced, not advisory.
Give a full-access key the "*" scope explicitly; scope others to just what they need
(e.g. market:read, trading:write).
Signed requests
Send X-MS-Timestamp + X-MS-Signature = hex
HMAC-SHA256(apiKey, "{ts}.{METHOD}.{path}{?query}.{sha256(body)}"). The query string is part of
the signed path (leading ?, empty when absent).
mTLS
Your gateway must verify the client certificate and forward x-client-cert-verified: success
(or a genuine Envoy XFCC with a Hash=), and strip any client-supplied copies of those headers at
the edge — the app trusts them only under that assumption.
Security policy
Read or update your enterprise security policy: IP allowlist, requireSignedRequests, requireMtls,
key-rotation window, and security-evidence URLs. Once signed requests or mTLS are enabled, subsequent
write requests must satisfy the configured controls — enable them from a machine that already complies.
The response also shows your key's scopes and when rotation is next due.
/security
Get enterprise security controls
Full endpoint documentationgetEnterpriseSecurityReturns the active enterprise security policy for the authenticated partner key, including IP allowlists, signed-request requirements, mTLS gateway requirements, scoped-key governance, rotation policy, and security evidence metadata.
Parameters
This endpoint has no path or query parameters.
Headers
AuthorizationstringRequiredBearer sk_sandbox_<your_key> for sandbox requests.
Response fields
policyobjectpolicy.ipAllowliststring[]Exact IP addresses or IPv4 CIDR ranges allowed to call this partner key. Empty means no IP restriction.
Example: ["203.0.113.10","198.51.100.0/24"]
policy.requireSignedRequestsbooleanRequire HMAC-signed non-GET requests. Send X-MS-Timestamp (ISO-8601, within a 5-minute window) and X-MS-Signature = hex HMAC-SHA256(apiKey, "{timestamp}.{METHOD}.{path}{?query}.{sha256(body)}"). The signed path includes the query string (leading ?, empty when absent) so query-parameter tampering is detected. Signing without the query string is accepted for backward compatibility but deprecated.
Example: true
policy.requireMtlsbooleanRequire upstream mTLS verification headers from the API gateway.
Example: false
policy.scopedKeysRequiredbooleanWhen true, API keys must carry explicit scopes — a key with no scopes is denied (403) rather than granted broad access. A key that should retain full access under this policy must hold the scope. When false (default), unscoped keys keep broad access.
Example: true
policy.keyRotationDaysinteger | nullRequired API key rotation interval in days.
Example: 90
policy.oauthClientCredentialsEnabledbooleanIndicates OAuth client-credentials support is enabled for this partner.
Example: false
policy.soc2EvidenceUrlstring | nullHTTPS link to SOC 2 evidence or trust-center artifact.
policy.pentestEvidenceUrlstring | nullHTTPS link to penetration-test evidence.
policy.lastRotationAtstring | nullkeyobjectkey.keyIdstringkey.partnerIdstringkey.keyTypefull | datakey.scopesstring[]key.requiredScopeForThisEndpointstring | nullkey.rotationDueAtstring | nullsignedRequestSpecobjectsignedRequestSpec.headersstring[]signedRequestSpec.algorithmstringExample: "HMAC-SHA256"
signedRequestSpec.payloadstringExample: "timestamp.method.path.sha256(raw_request_body)"
signedRequestSpec.timestampToleranceSecondsintegerExample: 300
mtlsobjectmtls.acceptedGatewayHeadersstring[]Response codes
200Active enterprise security policy./security
Update enterprise security controls
Full endpoint documentationupdateEnterpriseSecurityUpdates partner-managed enterprise controls. A full API key is required. Once signed requests or mTLS are enabled, subsequent write requests must satisfy the configured controls.
Parameters
This endpoint has no path or query parameters.
Headers
AuthorizationstringRequiredBearer sk_sandbox_<your_key> for sandbox requests.
Idempotency-KeystringheaderRequiredUnique string that makes write calls safe to retry on network failure. Required for money movement, trading, KYC, subscriptions, and webhook creation. Deduplicated for 24 hours -- duplicate keys return the cached response. HTTP 409 if a concurrent request with the same key is still in progress.
Example: dep_user42_1743152580
Request body
ipAllowliststring[]Exact IP addresses or IPv4 CIDR ranges allowed to call this partner key. Empty means no IP restriction.
Example: ["203.0.113.10","198.51.100.0/24"]
requireSignedRequestsbooleanRequire HMAC-signed non-GET requests. Send X-MS-Timestamp (ISO-8601, within a 5-minute window) and X-MS-Signature = hex HMAC-SHA256(apiKey, "{timestamp}.{METHOD}.{path}{?query}.{sha256(body)}"). The signed path includes the query string (leading ?, empty when absent) so query-parameter tampering is detected. Signing without the query string is accepted for backward compatibility but deprecated.
Example: true
requireMtlsbooleanRequire upstream mTLS verification headers from the API gateway.
Example: false
scopedKeysRequiredbooleanWhen true, API keys must carry explicit scopes — a key with no scopes is denied (403) rather than granted broad access. A key that should retain full access under this policy must hold the scope. When false (default), unscoped keys keep broad access.
Example: true
keyRotationDaysinteger | nullRequired API key rotation interval in days.
Example: 90
oauthClientCredentialsEnabledbooleanIndicates OAuth client-credentials support is enabled for this partner.
Example: false
soc2EvidenceUrlstring | nullHTTPS link to SOC 2 evidence or trust-center artifact.
pentestEvidenceUrlstring | nullHTTPS link to penetration-test evidence.
lastRotationAtstring | nullResponse fields
messagestringpolicyobjectpolicy.ipAllowliststring[]Exact IP addresses or IPv4 CIDR ranges allowed to call this partner key. Empty means no IP restriction.
Example: ["203.0.113.10","198.51.100.0/24"]
policy.requireSignedRequestsbooleanRequire HMAC-signed non-GET requests. Send X-MS-Timestamp (ISO-8601, within a 5-minute window) and X-MS-Signature = hex HMAC-SHA256(apiKey, "{timestamp}.{METHOD}.{path}{?query}.{sha256(body)}"). The signed path includes the query string (leading ?, empty when absent) so query-parameter tampering is detected. Signing without the query string is accepted for backward compatibility but deprecated.
Example: true
policy.requireMtlsbooleanRequire upstream mTLS verification headers from the API gateway.
Example: false
policy.scopedKeysRequiredbooleanWhen true, API keys must carry explicit scopes — a key with no scopes is denied (403) rather than granted broad access. A key that should retain full access under this policy must hold the scope. When false (default), unscoped keys keep broad access.
Example: true
policy.keyRotationDaysinteger | nullRequired API key rotation interval in days.
Example: 90
policy.oauthClientCredentialsEnabledbooleanIndicates OAuth client-credentials support is enabled for this partner.
Example: false
policy.soc2EvidenceUrlstring | nullHTTPS link to SOC 2 evidence or trust-center artifact.
policy.pentestEvidenceUrlstring | nullHTTPS link to penetration-test evidence.
policy.lastRotationAtstring | nullResponse codes
200Updated enterprise security policy.OAuth tokens
OAuth 2.0 client-credentials grant for partners with oauthClientCredentialsEnabled in their security
policy. Send your pk_live_ key as the client secret (HTTP Basic auth, form body, or JSON body) and
receive a short-lived ms_oauth_ Bearer token (15 minutes) — optionally narrowed to a scope subset.
Use tokens instead of the raw key inside less-trusted workloads.
/oauth/token
Issue OAuth client-credentials access token
Full endpoint documentationcreateOAuthTokenIssues a short-lived Bearer token for partners that have OAuth client credentials enabled in their enterprise security policy. Provide the partner API key as the client secret via HTTP Basic auth, form body, or JSON body.
Parameters
This endpoint has no path or query parameters.
Headers
AuthorizationstringRequiredBearer sk_sandbox_<your_key> for sandbox requests.
Request body
grant_typeclient_credentialsclient_idstringOptional partner client identifier. Defaults to the authenticated key document id.
client_secretstringRequiredPartner API key used as the client secret.
scopestringSpace-delimited scopes requested for the short-lived access token.
Example: "trading:write reports:read"
Response fields
access_tokenstringExample: "ms_oauth_..."
token_typestringExample: "Bearer"
expires_inintegerExample: 900
scopestringResponse codes
200Short-lived OAuth access token.403OAuth client credentials are not enabled for this partner.Certification
The go-live certification checklist: sandbox golden path, concurrency/idempotency tests, webhook retry
handling, failover drill, reconciliation exports, and enterprise security controls. PATCH
partner-owned checks with status, evidenceUrl, and notes. POST requests a MyStocks go-live review
once your checks pass and evidence is attached — the final approval check can only be set by MyStocks
operations.
/certification
Get certification checklist
Full endpoint documentationgetCertificationReturns the sandbox-to-production checklist covering golden-path tests, concurrency/idempotency tests, webhook retry tests, failover drills, reconciliation exports, enterprise security, and MyStocks go-live approval.
Parameters
This endpoint has no path or query parameters.
Headers
AuthorizationstringRequiredBearer sk_sandbox_<your_key> for sandbox requests.
Response fields
partnerIdstringstatusin_progress | go_live_requested | approvedchecksobjectchecklistobject[]checklist[].idstringchecklist[].titlestringchecklist[].descriptionstringchecklist[].requiredbooleanchecklist[].ownerpartner | mystocksprogressobjectprogress.requiredintegerprogress.completedintegerprogress.percentintegergoLiveRequestedAtstring | nullapprovedAtstring | nullResponse codes
200Certification progress./certification
Update certification evidence
Full endpoint documentationupdateCertificationUpdates partner-owned certification checks with status, evidence URL, and notes. MyStocks-owned approval checks cannot be marked passed or waived by partners.
Parameters
This endpoint has no path or query parameters.
Headers
AuthorizationstringRequiredBearer sk_sandbox_<your_key> for sandbox requests.
Idempotency-KeystringheaderRequiredUnique string that makes write calls safe to retry on network failure. Required for money movement, trading, KYC, subscriptions, and webhook creation. Deduplicated for 24 hours -- duplicate keys return the cached response. HTTP 409 if a concurrent request with the same key is still in progress.
Example: dep_user42_1743152580
Request body
checksobjectRequiredResponse fields
partnerIdstringstatusin_progress | go_live_requested | approvedchecksobjectchecklistobject[]checklist[].idstringchecklist[].titlestringchecklist[].descriptionstringchecklist[].requiredbooleanchecklist[].ownerpartner | mystocksprogressobjectprogress.requiredintegerprogress.completedintegerprogress.percentintegergoLiveRequestedAtstring | nullapprovedAtstring | nullmessagestringResponse codes
200Updated certification progress./certification
Request go-live review
Full endpoint documentationrequestGoLiveReviewRequests MyStocks operations review for production go-live approval after certification evidence is attached.
Parameters
This endpoint has no path or query parameters.
Headers
AuthorizationstringRequiredBearer sk_sandbox_<your_key> for sandbox requests.
Idempotency-KeystringheaderRequiredUnique string that makes write calls safe to retry on network failure. Required for money movement, trading, KYC, subscriptions, and webhook creation. Deduplicated for 24 hours -- duplicate keys return the cached response. HTTP 409 if a concurrent request with the same key is still in progress.
Example: dep_user42_1743152580
Request body
actionrequest_go_liveRequiredResponse fields
partnerIdstringstatusin_progress | go_live_requested | approvedchecksobjectchecklistobject[]checklist[].idstringchecklist[].titlestringchecklist[].descriptionstringchecklist[].requiredbooleanchecklist[].ownerpartner | mystocksprogressobjectprogress.requiredintegerprogress.completedintegerprogress.percentintegergoLiveRequestedAtstring | nullapprovedAtstring | nullmessagestringResponse codes
200Go-live review requested.Was this page useful?
Your signal helps us tighten partner onboarding docs.
Last updated on