Authenticate API Requests

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:

Environment Description Endpoint URL
Sandbox For development and testing https://riskos.sandbox.socure.com/api/evaluation
Production For live applications https://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.

📘 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

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:

Monitoring

Monitor for suspicious activity:

Troubleshooting

Common issues

Possible causes:

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.

Possible causes:

Solutions:

  1. Check your IP allowlist configuration.
  2. Verify your current IP address.
  3. Contact Support if permissions seem incorrect.

Common mistakes:

// Wrong
--header 'Authorization: 'YOUR_API_KEY'  // Missing 'Bearer'

// Correct
--header 'Authorization: : 'Bearer YOUR_API_KEY'