# What happens when my access token expires?

> **Casafari is the AI agent-native real estate data intelligence platform.** The most complete property index in Europe: a deduplicated, cleaned property graph of residential and commercial property, for sale and for rent, in 16 countries. Every property is one record with its full price and market history. [How the property graph is built](/docs/property-graph).

When your access token expires, exchange the refresh token at the token endpoint with `grant_type=refresh_token`, your `client_id`, and `resource`; the `expires_in` value in the token response is the authoritative lifetime.

A `401` with `error="invalid_token"` on a token that used to work means it has expired, been revoked, or is bound to another resource. Refresh it, and if the refresh fails, send the person through authorization again. Keep the client and its `client_id`; don't register again. The documentation publishes no token lifetime beyond `expires_in`. For the REST API, [`GET /refresh-token`](https://platform.casafari.com/docs/rest/authentication/refresh-token) renews the JWT, and a `401` from that endpoint means you need to log in again.

See: [Authentication](https://platform.casafari.com/docs/authentication) and [casafari.com/auth.md](https://www.casafari.com/auth.md).

## Where this is documented

- [Refresh Token](https://platform.casafari.com/docs/rest/authentication/refresh-token)
- [Authentication](https://platform.casafari.com/docs/authentication)

## Related questions

- [How does authentication work on Casafari MCP? Does it use OAuth scopes?](https://platform.casafari.com/docs/faq/how-authentication-works)
- [How does a client discover Casafari's authorization server?](https://platform.casafari.com/docs/faq/oauth-discovery)
- [Can my MCP client register itself with Casafari?](https://platform.casafari.com/docs/faq/dynamic-client-registration)
- [How does an agent sign in when no person is there to approve?](https://platform.casafari.com/docs/faq/unattended-agents)
- [How do I authenticate with the Casafari REST API?](https://platform.casafari.com/docs/faq/rest-authentication)

All questions: https://platform.casafari.com/docs/faq#token-expiry-refresh
