revokeUserApiKey
Revokes an existing API key, making it invalid for future authentication. Use this when:- You suspect a key has been compromised
- You no longer need access from a particular application
- You want to rotate keys for security
Parameters
The unique identifier of the API key to revoke
Returns
Always
true if the operation succeededUnix timestamp (in milliseconds) when the key was revoked
Usage
Revoke from Settings UI
Revoke All Keys (Security Response)
Example Response
Behavior
Immediate Effect
Once revoked, the API key becomes invalid immediately:- The
revokedAttimestamp is set to the current time - The key is marked as revoked in the database
- All future authentication attempts with this key will fail
Idempotent Operation
Revoking an already-revoked key succeeds without error:Cannot Reactivate
There is no way to reactivate a revoked key. You must create a new API key if you need access again.Security Considerations
When to Revoke
Revoke API keys in these situations:Key Compromise
Key Compromise
If you suspect your API key has been exposed:
- In public GitHub repository
- In logs or error messages
- On a compromised device
- Shared accidentally
Application Decommissioned
Application Decommissioned
When you stop using an application that has your API key:
- Uninstalled browser extension
- Removed Raycast extension
- Deprecated integration
Regular Rotation
Regular Rotation
As a security best practice:
- Rotate keys every 90 days
- Rotate after team member departure
- Rotate after security audit
Revocation Audit Trail
Revoked keys remain in the database for audit purposes:Error Handling
Key Not Found
If the key doesn’t exist or belongs to another user:Unauthorized
If the user is not authenticated:Permission Denied
If trying to revoke another user’s key:Post-Revocation
Update Applications
After revoking a key, update any applications using it:- Raycast Extension: Update API key in extension preferences
- Browser Extension: Re-authenticate through popup
- CI/CD: Update secrets in your pipeline
- Scripts: Update environment variables
Monitor Failed Attempts
Watch for authentication failures that might indicate:- Applications still using revoked keys
- Unauthorized access attempts
- Forgotten integrations
Related APIs
Create API Key
Generate a new API key after revocation
List API Keys
View all your API keys
Authentication
Learn about API authentication