Authentication

OAuth 2.0 flows, scopes, and token management.

Authentication

TaskNation uses OAuth 2.0 for all API authentication. We support two grant types depending on your integration pattern.

Authorization Code Flow (User Context)

Use this when acting on behalf of a specific TaskNation user (pro or homeowner). This is the most common flow for CRM and business management integrations.

# Step 1: Redirect user to authorize
GET https://auth.tasknation.com/oauth2/auth
  ?client_id=YOUR_CLIENT_ID
  &response_type=code
  &redirect_uri=YOUR_REDIRECT_URI
  &scope=supply::businesses supply::leads offline_access
  &state=RANDOM_STRING_MIN_8_CHARS

# Step 2: Exchange code for tokens
POST https://auth.tasknation.com/oauth2/token
Content-Type: application/x-www-form-urlencoded

grant_type=authorization_code
&code=AUTH_CODE_FROM_CALLBACK
&client_id=YOUR_CLIENT_ID
&client_secret=YOUR_CLIENT_SECRET
&redirect_uri=YOUR_REDIRECT_URI

Client Credentials Flow (Application Context)

Use this for server-to-server calls that don't act on behalf of a specific user (e.g., category lookups, keyword search).

POST https://auth.tasknation.com/oauth2/token
Content-Type: application/x-www-form-urlencoded

grant_type=client_credentials
&client_id=YOUR_CLIENT_ID
&client_secret=YOUR_CLIENT_SECRET
&scope=demand::categories demand::search

Token Response

{
  "access_token": "eyJhbGciOiJSUzI1NiIs...",
  "token_type": "Bearer",
  "expires_in": 3600,
  "refresh_token": "xRklFvy60UpMa1...",
  "scope": "supply::businesses supply::leads offline_access"
}

Scopes

ScopeDescriptionPartner Type
supply::businessesRead/write business profilesSupply
supply::leadsAccess and manage leads/negotiationsSupply
supply::messagesSend and receive messagesSupply
supply::reviewsRead business reviewsSupply
demand::requestsCreate and manage service requestsDemand
demand::categoriesBrowse service categoriesDemand
demand::searchSearch for businessesDemand
offline_accessReceive refresh tokens (180-day validity)Both

Refresh Token Grace Period

TaskNation implements a 60-second grace period for refresh tokens. If a network error occurs during exchange, you can retry with the same refresh token within 60 seconds.

Developer Portal | TaskNation