Skip to main content

API Key

curl -H "Authorization: Bearer dg_live_..." \
  https://api.getdatagate.com/v1/datasets/discover

Generate API Key

curl -X POST -H "Authorization: Bearer <jwt>" \
  https://api.getdatagate.com/v1/auth/api-keys
Response (key shown once):
{"api_key": "dg_live_abc123..."}

Revoke API Key

curl -X DELETE -H "Authorization: Bearer <jwt>" \
  https://api.getdatagate.com/v1/auth/api-keys

JWT Login Flow

1. Login

curl -X POST https://api.getdatagate.com/v1/auth/login \
  -H "Content-Type: application/json" \
  -d '{"email": "user@example.com", "password": "..."}'
Response:
{"token": "<temporary_token>", "message": "verification code sent"}

2. Verify 2FA

curl -X POST https://api.getdatagate.com/v1/auth/login/verify \
  -H "Content-Type: application/json" \
  -d '{"token": "<temporary_token>", "code": "123456"}'
Response:
{"access_token": "eyJ..."}
Also sets an HttpOnly refresh_token cookie.

3. Refresh

curl -X POST https://api.getdatagate.com/v1/auth/refresh \
  --cookie "refresh_token=..."
Access tokens expire after 15 minutes.