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

# GitHub token

> Track when a GitHub personal access token expires by connecting it to Expira. Works with GitHub.com and GitHub Enterprise Server.

This integration tracks the expiry of **the token you connect**. Use it for a token your systems depend on, such as a CI or deploy token, so Expira reminds you before it stops working.

> [!NOTE]
>
> To track **every** fine-grained token in your GitHub organisation, use the [GitHub App](https://docs.expira.dev/integrations/github-app.md) instead. GitHub has no API that lists a user's own tokens.

## How it works

Once a day (08:30 UTC) Expira calls `GET /user` with the token and reads GitHub's `github-authentication-token-expiration` response header. The asset is named "GitHub Token —" followed by the connection's display name.

If the token has **no expiry date**, GitHub sends no header and Expira creates no asset. Fine-grained tokens always have one; classic tokens only if you set one.

## Connect a token

**1. Pick the token**

Use the token whose expiry you want to track. It needs no extra permissions: `GET /user` works with any valid token.

**2. Add the connection in Expira**

Go to **Integrations → GitHub → Add connection** and fill in:

* **Display name**, for example "CI deploy token".
* **GitHub URL**: `https://github.com`, or your GitHub Enterprise Server address such as `https://github.example.com`.
* **Personal Access Token** (starts with `github_pat_` for fine-grained tokens).

**3. Sync**

Press **Sync**. The token appears under **Assets** with its expiry date.

## GitHub Enterprise Server

The URL must use `https` and be reachable from the public internet, because Expira calls it from the cloud. A server that only resolves on a VPN or a private network can't be reached. See [Troubleshooting](https://docs.expira.dev/integrations/troubleshooting.md#host-not-reachable).

## When the token is renewed

Paste the new token into the connection's **Edit** form. The next sync updates the expiry date.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.