Oviond
Guides

Authentication

Credential formats for OAuth2, API key, and basic auth integrations

Authentication

Each integration uses one of three authentication types. The credentials object you pass in API requests must match the integration's auth type.

OAuth2

Most integrations (Google Analytics, Facebook, etc.) use OAuth2. Provide the access token and refresh token from the OAuth2 flow:

{
  "credentials": {
    "access_token": "ya29.a0ARrdaM...",
    "refresh_token": "1//0eXy..."
  }
}

The API will automatically refresh expired access tokens when a refresh token is provided.

API Key

Some integrations use a simple API key:

{
  "credentials": {
    "apiKey": "sk_live_abc123..."
  }
}

The API key location (header, query parameter) is handled automatically per integration.

Basic Auth

A few integrations require username/password credentials:

{
  "credentials": {
    "username": "your-username",
    "password": "your-password"
  }
}

Checking Auth Type

You can check an integration's auth type via the integrations endpoint:

curl https://api.oviond.com/v1/integrations/{id}

The response includes authType which will be "oauth2", "apiKey", or "basic".

Testing Credentials

Before querying data, validate that credentials work:

curl -X POST https://api.oviond.com/v1/integrations/{id}/test \
  -H "Content-Type: application/json" \
  -d '{
    "credentials": { "apiKey": "YOUR_API_KEY" },
    "profile": { "accountId": "YOUR_ACCOUNT_ID" }
  }'

A successful response returns status 200. Failed auth returns status 401 with an error message.