Authentication
The My Virtual Office API uses API keys to authenticate requests. API keys are tied to your seller account and allow you to make requests on behalf of your account.Generating API Keys
- Log in to your My Virtual Office dashboard
- Navigate to Settings > API Keys
- Click Generate API Key
- Enter a name for your key (e.g., “Production API Key”)
- Optionally set an expiration date
- Click Generate Key
Using API Keys
Include your API key in every request using one of these methods:X-API-Key Header (Recommended)
Authorization Bearer Header
API Key Format
API keys follow this format:sk_live_- Prefix identifying this as a live API key- 48 random alphanumeric characters
Key Security Best Practices
Never expose keys in client-side code
Never expose keys in client-side code
API keys should only be used in server-side code. Never include them in JavaScript that runs in the browser, mobile apps, or any publicly accessible code.
Use environment variables
Use environment variables
Store your API keys in environment variables rather than hardcoding them in your application code.
Rotate keys periodically
Rotate keys periodically
Regularly generate new API keys and revoke old ones to minimize risk if a key is compromised.
Use separate keys for different environments
Use separate keys for different environments
Create separate API keys for development, staging, and production environments.
Set expiration dates
Set expiration dates
For additional security, set expiration dates on your API keys and rotate them before they expire.
Managing API Keys
From your dashboard, you can:- View all your API keys (only the prefix is shown for security)
- See when each key was last used
- Revoke keys that are no longer needed or may be compromised
- Delete keys permanently
Authentication Errors
| HTTP Code | Error | Description |
|---|---|---|
| 401 | Unauthorized | API key is missing |
| 401 | Unauthorized | API key is invalid |
| 401 | Unauthorized | API key has been revoked |
| 401 | Unauthorized | API key has expired |

