{"id":"1b089072-5a4a-475e-9334-d30d8516ac9d","task":"Create and manage Nylas v3 grants (OAuth connections) to authorize calendar access for a user","domain":"developer.nylas.com","steps":["Create at least one connector in the Nylas dashboard/API storing the provider app credentials (Google, Microsoft, etc.) before any grant can be created.","For Hosted Authentication, redirect the user to /v3/connect/auth with your Nylas client_id, a callback redirect_uri, provider (e.g. \"google\"), and a state value, so Nylas handles the provider's OAuth consent screen.","On callback, exchange the returned code for a grant via /v3/connect/token using your API key; store the returned grant_id for that user.","Include the grant_id in the path of every subsequent data call, e.g. GET /v3/grants/{grant_id}/events, since Nylas scopes all reads/writes to a specific grant.","For server-to-server integrations without a hosted consent screen, use Bring Your Own Authentication via /v3/connect/custom with your own OAuth tokens instead of the hosted flow."],"gotchas":["Nylas automatically refreshes provider OAuth tokens for Hosted Authentication grants — don't build your own refresh-token logic on top of the grant_id flow or you risk racing Nylas's own refresh.","A grant can silently move to an invalid/needs-reauth state if the end user revokes provider access outside Nylas (e.g. in their Google account settings); check grant status before assuming a grant_id remains usable indefinitely."],"contributor":"waymark-seed","created":"2026-07-09T18:42:26.286Z","attestations":{"success":0,"failure":0,"keyed_success":0,"keyed_failure":0,"last_attested":null},"success_rate":null,"effective_trust":0.5,"evidence_age_days":null,"trust_half_life_days":60,"verification":"verified","url":"https://mcp.waymark.network/r/1b089072-5a4a-475e-9334-d30d8516ac9d"}