Skip to content

Authentication

SheetsToJson uses API keys to authenticate requests to the API. All API requests must include your API key in the headers.

Getting Your API Key

  1. Sign up for a free account
  2. Register a Google Sheet to get started
  3. Navigate to the API Keys section for your sheet
  4. Click Create API Key and give it a name
  5. Copy your API key (you won't be able to see it again!)

Keep Your API Keys Secret

API keys grant access to your sheet data. Never commit them to version control or expose them in client-side code.

Using Your API Key

Include your API key in the X-API-Key header with every request:

bash
curl -H "X-API-Key: your_api_key_here" \
  https://api.sheetstojson.com/api/v1/SHEET_ID/Sheet1

API Key Permissions

When creating an API key, you can configure permissions:

PermissionDescription
ReadGet data from your sheet (GET requests)
WriteCreate, update, and delete rows (POST, PUT, DELETE)
SchemaRefresh and view sheet schema
AnalyticsView usage analytics

Best Practice

Create separate API keys for different applications or environments (development, staging, production). This makes it easier to rotate keys and revoke access if needed.

API Key Security

Do's ✅

  • Store API keys in environment variables
  • Use different keys for development and production
  • Rotate keys periodically
  • Revoke unused or compromised keys immediately
  • Limit permissions to only what's needed

Don'ts ❌

  • Never commit API keys to Git
  • Don't expose keys in client-side JavaScript
  • Don't share keys in public forums or documentation
  • Don't reuse the same key across multiple applications

Rate Limits

API keys are subject to rate limits based on your subscription plan:

PlanRequests per Month
Free Trial3,000 (100/day)
Starter10,000
Professional100,000
Business1,000,000

When you exceed your rate limit, you'll receive a 429 Too Many Requests response:

json
{
  "success": false,
  "error": "rate_limit_exceeded",
  "message": "Rate limit exceeded. Upgrade your plan or try again later.",
  "retry_after": 3600
}

Managing API Keys

List All Keys

View all API keys for a sheet in your dashboard.

Update Key Permissions

You can update permissions for an existing key without creating a new one:

  1. Go to your sheet's API Keys page
  2. Click Edit next to the key
  3. Toggle permissions on/off
  4. Click Save Changes

Revoke a Key

To revoke an API key:

  1. Go to your sheet's API Keys page
  2. Click Revoke next to the key
  3. Confirm the revocation

Revoking is Permanent

Once revoked, an API key cannot be restored. Any applications using that key will immediately lose access.

Troubleshooting

401 Unauthorized

Problem: Your API key is invalid or missing.

Solutions:

  • Ensure you're including the X-API-Key header
  • Check that your API key hasn't been revoked
  • Verify you're using the correct API key for this sheet

403 Forbidden

Problem: Your API key doesn't have permission for this operation.

Solutions:

  • Check your key's permissions in the dashboard
  • Create a new key with the required permissions
  • Contact support if you need elevated access

429 Rate Limited

Problem: You've exceeded your plan's rate limit.

Solutions:

  • Wait for the rate limit window to reset (check retry_after header)
  • Upgrade to a plan with higher limits
  • Optimize your code to make fewer requests (use caching, batch operations)

Next Steps

Built with VitePress