Skip to main content

Check Connection Status

Verifies if the current OAuth token is valid and active.

Endpoint

GET /api/zapier/status

Headers

Authorization: Bearer your-access-token

Success Response

{
"active": true,
"auth_type": "oauth",
"user_id": "550e8400-e29b-41d4-a716-446655440000",
"scopes": ["read", "write"],
"expires_at": "2024-01-01T13:00:00Z",
"created_at": "2024-01-01T12:00:00Z",
"last_used_at": "2024-01-01T12:30:00Z"
}

Response Fields

  • active: Whether the token is currently active
  • auth_type: Type of authentication (always "oauth")
  • user_id: ID of the authenticated user
  • scopes: Array of granted OAuth scopes
  • expires_at: ISO 8601 timestamp of token expiration
  • created_at: ISO 8601 timestamp of token creation
  • last_used_at: ISO 8601 timestamp of last token usage

Failure Response

{
"active": false,
"error": "unauthorized",
"error_description": "Invalid or expired token"
}

Example Usage

cURL

curl -X GET https://app.justanudge.co/api/zapier/status \
-H "Authorization: Bearer your-access-token"

JavaScript

const response = await fetch('https://app.justanudge.co/api/zapier/status', {
headers: {
'Authorization': 'Bearer your-access-token'
}
});

const status = await response.json();

if (status.active) {
console.log('Connection is active');
} else {
console.log('Connection failed:', status.error_description);
}

Use Cases

This endpoint is particularly useful for:

  • Testing OAuth connections in Zapier
  • Verifying token validity before making other API calls
  • Checking token expiration times
  • Debugging authentication issues