---
title: "YouTube API OAuth token lifetimes"
description: "Google OAuth tokens for YouTube: lifetime in expires_in, 7-day refresh tokens while the app is in Testing, 100 refresh tokens per account per client, six months unused."
---

> Documentation Index
> Fetch the complete documentation index at: https://pubnio.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# YouTube API OAuth token lifetimes

Google returns an access token's lifetime in expires_in, in seconds. Refresh tokens issued while the app's publishing status is Testing expire in 7 days. An account can hold 100 refresh tokens per client, and a refresh token unused for six months stops working. (Checked 2026-12-05.)

## Facts

| Fact                                  | Official value                     | Source                                                                                                                               | Checked    |
| ------------------------------------- | ---------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------ | ---------- |
| Access token lifetime                 | Returned in expires_in, in seconds | [YouTube Data API: OAuth 2.0 for Web Server Applications](https://developers.google.com/youtube/v3/guides/auth/server-side-web-apps) | 2026-12-05 |
| Refresh token while in Testing (days) | 7                                  | [Using OAuth 2.0 to Access Google APIs](https://developers.google.com/identity/protocols/oauth2)                                     | 2026-12-05 |
| Refresh tokens per account per client | 100                                | [Using OAuth 2.0 to Access Google APIs](https://developers.google.com/identity/protocols/oauth2)                                     | 2026-12-05 |
| Unused refresh token                  | Invalid after six months unused    | [Using OAuth 2.0 to Access Google APIs](https://developers.google.com/identity/protocols/oauth2)                                     | 2026-12-05 |

## Where official docs disagree

The official pages read for this page agree on every value above.

## What PubNio enforces

- PubNio refreshes a YouTube token 10 minutes before expires_in runs out.

## Read the live value

- [`GET /api/v1/integrations/accounts/{accountId}`](https://pubnio.com/api/v1/docs#tag/integrations/GET/api/v1/integrations/accounts/{accountId}) reports `needs_reconnect` with reason
  `token_expired` when a YouTube token can no longer be used; [`POST /api/v1/integrations/accounts/{accountId}/reconnect`](https://pubnio.com/api/v1/docs#tag/integrations/POST/api/v1/integrations/accounts/{accountId}/reconnect) keeps the account ID.

## Related errors

- A provider 401 becomes an `auth` provider error and a 403 a `permission` error; neither is retried.
- [YouTube error codes](https://pubnio.com/docs/errors/youtube/) lists the errors PubNio returns for YouTube and how to fix each.

## Limits

- Past 100 refresh tokens for one account and client, Google invalidates the oldest; reconnecting the same channel many times can drop an earlier grant.

## Sources

- [YouTube Data API: OAuth 2.0 for Web Server Applications](https://developers.google.com/youtube/v3/guides/auth/server-side-web-apps), checked 2026-12-05

  ```text
  The remaining lifetime of the access token in seconds.
  ```

- [Using OAuth 2.0 to Access Google APIs](https://developers.google.com/identity/protocols/oauth2), checked 2026-12-05

  ```text
  is issued a refresh token expiring in 7 days
  There is currently a limit of 100 refresh tokens per Google Account
  The refresh token has not been used for six months.
  ```

## Related

- [Posting limits](https://pubnio.com/docs/providers/youtube/limits/)
- [Rate limits and quota](https://pubnio.com/docs/providers/youtube/quota/)
- [Scopes and permissions](https://pubnio.com/docs/providers/youtube/scopes/)
- [App review and access](https://pubnio.com/docs/providers/youtube/app-review/)
- [Media requirements](https://pubnio.com/docs/providers/youtube/media/)
- [API versions](https://pubnio.com/docs/providers/youtube/versioning/)
- [YouTube error codes](https://pubnio.com/docs/errors/youtube/)
- [Publishing to YouTube](https://pubnio.com/docs/networks/youtube/)
- [Provider API explainers](https://pubnio.com/docs/providers/)

Source: https://pubnio.com/docs/providers/youtube/tokens/index.mdx
