Authentication

Authentication

Complete guide to authenticating with the Synoveo API

The Synoveo API uses different authentication methods depending on your use case. All API requests require authentication via Bearer tokens.

Authentication Methods

MethodToken ScopeUse CaseTTL
Google OAuthuserDashboard, web applications7 days
API KeysserviceWordPress plugin, integrations90 days
Service ClientsserviceCustom server-to-server90 days

Quick Start

Step 1: Get Credentials

Create an API key from your Dashboard:

  1. Navigate to DeveloperAPI Keys
  2. Click Create API Key
  3. Select the Location to connect
  4. Copy your client_id and client_secret

Important: The client secret is only shown once. Store it securely.

Step 2: Exchange for Token

curl -X POST https://api.synoveo.com/api/v1/auth/token \
  -H "Content-Type: application/json" \
  -d '{
    "grant_type": "client_credentials",
    "client_id": "syncid_570_1703030400000_my_app",
    "client_secret": "your_base64_secret"
  }'

Response:

{
  "status": "ok",
  "data": {
    "token_type": "Bearer",
    "scope": "service",
    "plan": "pro",
    "access_token": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9...",
    "expires_in": 7776000,
    "permissions": ["business.read", "business.write"],
    "refresh_token": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9..."
  }
}

Step 3: Use the Token

Include the token in the Authorization header:

curl https://api.synoveo.com/api/v1/google-business/locations \
  -H "Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9..."

Token Expiration

Token TypeDefault TTLEnvironment Variable
Access Token90 daysJWT_SERVICE_TTL_SECONDS
Refresh Token30 daysREFRESH_TTL_SECONDS
User Token (Dashboard)7 days-

Refreshing Tokens

When your access token expires, use the refresh token to get a new one:

curl -X POST https://api.synoveo.com/api/v1/auth/token \
  -H "Content-Type: application/json" \
  -d '{
    "grant_type": "refresh_token",
    "refresh_token": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9..."
  }'

Permissions

Service tokens can request specific permissions:

PermissionDescription
business.readRead business profile, locations, reviews
business.writeUpdate profile, create posts, sync data

Request specific permissions during token exchange:

{
  "grant_type": "client_credentials",
  "client_id": "syncid_570_...",
  "client_secret": "...",
  "permissions": ["business.read"]
}

The returned permissions are the intersection of requested and allowed permissions.


Error Responses

Error CodeStatusDescription
AUTH_INVALID_TOKEN401Invalid or expired token
AUTH_MISSING_TOKEN401No Authorization header
AUTH_TOKEN_EXPIRED401Token has expired
AUTH_INSUFFICIENT_PERMISSIONS403Missing required permission
{
  "status": "error",
  "error": {
    "code": "AUTH_INVALID_TOKEN",
    "message": "The provided token is invalid or has expired"
  }
}

Security Best Practices

  1. Never expose secrets - Store client_secret in environment variables
  2. Use HTTPS - All API requests must use HTTPS
  3. Rotate keys - Periodically rotate API keys in production
  4. Scope appropriately - Request only needed permissions
  5. Cache tokens - Don't request new tokens for every API call

On this page