Skip to main content

Authentication Methods

Snip API supports two authentication methods:

API Key

Recommended for server-to-server API access

Bearer Token (JWT)

Used for web application authentication

API Key Authentication

The recommended method for API access. Include your API key in the request header:

Getting Your API Key

1

Login

Log in to your account at snip.sa
2

Navigate to Profile

Go to ProfileAPI Keys section
3

Generate Key

Click “Regenerate API Key” to generate a new key
4

Store Securely

Copy and securely store your API key

Example Request

Bearer Token Authentication

Used for web applications. Include your JWT token in the Authorization header:

Getting a JWT Token

Authenticate with your credentials to receive a JWT token:

Using the JWT Token

Security Best Practices

  • Never commit API keys to version control
  • Use environment variables to store keys
  • Rotate keys regularly
  • Never share keys publicly
  • Never expose API keys in client-side code
  • Use server-side proxies for client applications
  • Implement proper CORS policies
  • Regenerate keys if compromised
  • Update all applications using the old key
  • Previous keys are immediately invalidated
  • Track API usage in your dashboard
  • Set up alerts for unusual activity
  • Review access logs regularly

Managing API Keys

Regenerate API Key

Regenerating your API key will immediately invalidate the previous key. Update all applications using the old key.

Get Current API Key

Authentication Errors

Example Error Response

Environment Variables

Store your credentials securely using environment variables: