Authenticate API Requests

Authenticate RiskOS™ API requests with Bearer token authentication. Retrieve your API key, configure IP allowlists, and troubleshoot 401 and 403 errors.

RiskOS™ APIs use Bearer Token authentication to secure all API requests. This guide will walk you through everything you need to authenticate successfully and troubleshoot common issues.


Retrieve your API key

  1. Get your API key from the Developer Workbench > API Keys section in the RiskOS™ Dashboard.

  1. Include it in your request headers:
Authorization: Bearer YOUR_API_KEY
  1. Make your first request and you're ready to go!

API key management

Environment-specific keys

Each environment requires its own API key:

EnvironmentDescriptionEndpoint URL
SandboxFor development and testinghttps://riskos.sandbox.socure.com/api/evaluation
ProductionFor live applicationshttps://riskos.socure.com/api/evaluation
⚠️

Important:

Never use production keys in development environments or commit keys to version control.


IP allowlists

RiskOS™ supports optional IP allowlisting to provide an extra layer of network-level security.

Allowlisting restricts access to trusted network ranges — even if valid credentials are presented.

This section covers restricting who can call your RiskOS™ account. To allowlist Socure's own IP addresses on your firewall — so your network permits Socure API traffic and webhook deliveries — use these references instead:

Socure IP additions are always additive — keep every Socure IP you already allowlist and add the new ones.

📘

Note:

IP allowlisting is an optional security control, not a requirement for API access. It defines where requests are allowed from, while your API key defines who is making the request. Both checks apply only if IP allowlisting is enabled.


How it works

  1. Authentication first: Your API key is validated
  2. Authorization check: Request origin IP is verified against your allowlist
  3. Access granted: Only if both checks pass

Configuration

  1. Go to the Developer Workbench > IP Filtering section in the RiskOS™ Dashboard.
  2. Add your trusted IP addresses or CIDR ranges.
  3. Save your configuration.

Behavior

  • Allowed IPs: Normal API 2xx responses
  • Blocked IPs: HTTP 403 Forbidden response

Security best practices

Environment Variables

Store API keys in environment variables, never in code:

# .env file
RISKOS_SANDBOX_KEY=YOUR_SANDBOX_KEY
RISKOS_PROD_KEY=YOUR_PRODUCTION_KEY
Secure Storage

Use secure secret management:

  • AWS Secrets Manager
  • Azure Key Vault
  • HashiCorp Vault
  • Kubernetes Secrets
Monitoring

Monitor for suspicious activity:

  • Unusual request patterns
  • Failed authentication attempts
  • Requests from unexpected IPs

Troubleshooting

Common issues

401 Unauthorized

Possible causes:

  • Missing Authorization header
  • Incorrect API key format
  • Invalid API key
  • Wrong environment key (using a Sandbox key for Production, or the reverse)
  • A recently regenerated or deleted key — after you regenerate a key and delete the deprecated one, the old token stops working, so any client still sending it receives a 401
    Solutions:
  1. Verify the header format: Authorization: Bearer YOUR_API_KEY
  2. Check your API key in the Developer Workbench.
  3. Ensure you're using the correct environment key. Sandbox and Production use separate keys and separate endpoints.
  4. If you recently rotated a key, update every client and stored secret to the current Active token. See API and SDK Keys for the zero-downtime rotation steps.
403 Forbidden

Possible causes:

  • Request from non-allowlisted IP address.
  • Account permissions issue.
  • API endpoint access restrictions.
    Solutions:
  1. Check your IP allowlist configuration.
  2. Verify your current IP address.
  3. Contact Support if permissions seem incorrect.
Header Not Sent

Common mistakes:

# Wrong — missing "Bearer"
--header 'Authorization: YOUR_API_KEY'

# Correct
--header 'Authorization: Bearer YOUR_API_KEY'

Related topics