Skip to content
MyStocks Developers
API v1

API v1

Current stable contract

Versioning policyRelease changelog
Sandbox console
Govern

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.

GET

/security

Get enterprise security controls

Full endpoint documentation
Production onlygetEnterpriseSecurity

Returns 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

AuthorizationstringRequired

Bearer sk_sandbox_<your_key> for sandbox requests.

Response fields

policyobject
policy.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.requireSignedRequestsboolean

Require 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.requireMtlsboolean

Require upstream mTLS verification headers from the API gateway.

Example: false

policy.scopedKeysRequiredboolean

When 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 | null

Required API key rotation interval in days.

Example: 90

policy.oauthClientCredentialsEnabledboolean

Indicates OAuth client-credentials support is enabled for this partner.

Example: false

policy.soc2EvidenceUrlstring | null

HTTPS link to SOC 2 evidence or trust-center artifact.

policy.pentestEvidenceUrlstring | null

HTTPS link to penetration-test evidence.

policy.lastRotationAtstring | null
keyobject
key.keyIdstring
key.partnerIdstring
key.keyTypefull | data
key.scopesstring[]
key.requiredScopeForThisEndpointstring | null
key.rotationDueAtstring | null
signedRequestSpecobject
signedRequestSpec.headersstring[]
signedRequestSpec.algorithmstring

Example: "HMAC-SHA256"

signedRequestSpec.payloadstring

Example: "timestamp.method.path.sha256(raw_request_body)"

signedRequestSpec.timestampToleranceSecondsinteger

Example: 300

mtlsobject
mtls.acceptedGatewayHeadersstring[]

Response codes

200Active enterprise security policy.
PATCH

/security

Update enterprise security controls

Full endpoint documentation
Production onlyupdateEnterpriseSecurity

Updates 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

AuthorizationstringRequired

Bearer sk_sandbox_<your_key> for sandbox requests.

Idempotency-KeystringheaderRequired

Unique 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"]

requireSignedRequestsboolean

Require 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

requireMtlsboolean

Require upstream mTLS verification headers from the API gateway.

Example: false

scopedKeysRequiredboolean

When 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 | null

Required API key rotation interval in days.

Example: 90

oauthClientCredentialsEnabledboolean

Indicates OAuth client-credentials support is enabled for this partner.

Example: false

soc2EvidenceUrlstring | null

HTTPS link to SOC 2 evidence or trust-center artifact.

pentestEvidenceUrlstring | null

HTTPS link to penetration-test evidence.

lastRotationAtstring | null

Response fields

messagestring
policyobject
policy.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.requireSignedRequestsboolean

Require 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.requireMtlsboolean

Require upstream mTLS verification headers from the API gateway.

Example: false

policy.scopedKeysRequiredboolean

When 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 | null

Required API key rotation interval in days.

Example: 90

policy.oauthClientCredentialsEnabledboolean

Indicates OAuth client-credentials support is enabled for this partner.

Example: false

policy.soc2EvidenceUrlstring | null

HTTPS link to SOC 2 evidence or trust-center artifact.

policy.pentestEvidenceUrlstring | null

HTTPS link to penetration-test evidence.

policy.lastRotationAtstring | null

Response 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.

POST

/oauth/token

Issue OAuth client-credentials access token

Full endpoint documentation
Production onlycreateOAuthToken

Issues 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

AuthorizationstringRequired

Bearer sk_sandbox_<your_key> for sandbox requests.

Request body

grant_typeclient_credentials
client_idstring

Optional partner client identifier. Defaults to the authenticated key document id.

client_secretstringRequired

Partner API key used as the client secret.

scopestring

Space-delimited scopes requested for the short-lived access token.

Example: "trading:write reports:read"

Response fields

access_tokenstring

Example: "ms_oauth_..."

token_typestring

Example: "Bearer"

expires_ininteger

Example: 900

scopestring

Response 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.

GET

/certification

Get certification checklist

Full endpoint documentation
Production onlygetCertification

Returns 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

AuthorizationstringRequired

Bearer sk_sandbox_<your_key> for sandbox requests.

Response fields

partnerIdstring
statusin_progress | go_live_requested | approved
checksobject
checklistobject[]
checklist[].idstring
checklist[].titlestring
checklist[].descriptionstring
checklist[].requiredboolean
checklist[].ownerpartner | mystocks
progressobject
progress.requiredinteger
progress.completedinteger
progress.percentinteger
goLiveRequestedAtstring | null
approvedAtstring | null

Response codes

200Certification progress.
PATCH

/certification

Update certification evidence

Full endpoint documentation
Production onlyupdateCertification

Updates 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

AuthorizationstringRequired

Bearer sk_sandbox_<your_key> for sandbox requests.

Idempotency-KeystringheaderRequired

Unique 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

checksobjectRequired

Response fields

partnerIdstring
statusin_progress | go_live_requested | approved
checksobject
checklistobject[]
checklist[].idstring
checklist[].titlestring
checklist[].descriptionstring
checklist[].requiredboolean
checklist[].ownerpartner | mystocks
progressobject
progress.requiredinteger
progress.completedinteger
progress.percentinteger
goLiveRequestedAtstring | null
approvedAtstring | null
messagestring

Response codes

200Updated certification progress.
POST

/certification

Request go-live review

Full endpoint documentation
Production onlyrequestGoLiveReview

Requests MyStocks operations review for production go-live approval after certification evidence is attached.

Parameters

This endpoint has no path or query parameters.

Headers

AuthorizationstringRequired

Bearer sk_sandbox_<your_key> for sandbox requests.

Idempotency-KeystringheaderRequired

Unique 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_liveRequired

Response fields

partnerIdstring
statusin_progress | go_live_requested | approved
checksobject
checklistobject[]
checklist[].idstring
checklist[].titlestring
checklist[].descriptionstring
checklist[].requiredboolean
checklist[].ownerpartner | mystocks
progressobject
progress.requiredinteger
progress.completedinteger
progress.percentinteger
goLiveRequestedAtstring | null
approvedAtstring | null
messagestring

Response codes

200Go-live review requested.

Was this page useful?

Your signal helps us tighten partner onboarding docs.

Send note

Last updated on

On this page