Portal Community
Refresh before expiry: You can only refresh a token that has not yet expired. Once a token expires, you must go through the full OAuth flow again via auth/getToken. Schedule this node to run every 50 days — well before the 60-day window closes.

When to Use

Configuration

Operation

FieldRequiredDescription
resourceRequiredMust be auth.
operationRequiredMust be refresh-token.
longLivedTokenRequiredThe current valid long-lived access token to refresh. Retrieve from BizFirst Credentials Manager.

Sample Configuration JSON

{
  "resource": "auth",
  "operation": "refresh-token",
  "longLivedToken": "{{ $credential.instagram.accessToken }}"
}

Validation Errors

ErrorCause
longLivedToken is requiredlongLivedToken field is missing or empty.
Graph API error 190Token is expired, revoked, or invalid. Full re-authentication required.
Graph API error 463Token cannot be refreshed yet (minimum 24-hour interval between refreshes).

Output

Success Port

FieldTypeDescription
statusstring"success"
accessTokenstringNew long-lived access token with reset 60-day expiry. Update in BizFirst Credentials Manager immediately.
tokenTypestringToken type — typically "bearer".
expiresInnumberSeconds until the new token expires (approx. 5,183,944 = 60 days).
payloadstringRaw JSON response from the Graph API.

Error Port

FieldTypeDescription
statusstring"error"
errorCodestringGraph API error code.
errorMessagestringError description.
payloadstringRaw error response.

Sample Output JSON

{
  "status": "success",
  "accessToken": "EAABsbCS4sZBwBOZBqkNEW...(refreshed long token)",
  "tokenType": "bearer",
  "expiresIn": 5183944,
  "payload": "{\"access_token\":\"EAAB...\",\"token_type\":\"bearer\",\"expires_in\":5183944}"
}

Expression Reference

ExpressionValue
{{ $output.instagram.accessToken }}New token to store in Credentials Manager
{{ $output.instagram.expiresIn }}New expiry duration in seconds

Node Policies & GuardRails

Examples

Scheduled 50-day refresh cron

{
  "resource": "auth",
  "operation": "refresh-token",
  "longLivedToken": "{{ $credential.instagram.accessToken }}"
}
// On success: update Credentials Manager with new accessToken
// On error 190: trigger re-authentication notification to account owner

Pre-operation token freshness check

// Conditional: if token age > 50 days (calculated from stored creation timestamp)
{
  "resource": "auth",
  "operation": "refresh-token",
  "longLivedToken": "{{ $credential.instagram.accessToken }}"
}
// Update stored token, then proceed with the actual Instagram operation

Before executing a high-priority scheduled campaign post, checks whether the token is more than 50 days old and refreshes it if needed, ensuring the subsequent publish operation succeeds.