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

# Redirect URIs

> What a redirect URI is, why exact matching matters, and how to register callback URLs for OAuth.

A **`redirect_uri`** is your app's callback URL in OAuth. After the user signs in and approves access, COSMIC sends the browser back to this URL with either a `code` or an OAuth error.

## What to register

Register every callback URL your app will use in the{" "}
<a href="https://natecosmic.com/developers" rel="noopener noreferrer" target="_blank">developer portal</a>, including separate values for local, staging, and production when applicable.

<Note>
  The `redirect_uri` sent in the authorize request and token request must exactly match one registered value, including scheme, host, path, query string, and trailing slash.
</Note>

## Example client callback

```text theme={null}
https://partner.example.com/oauth/callback?code=<authorization_code>&state=<state>
```

## Requirements

* Use HTTPS callback URLs for non-local environments.
* Register callback URLs in the{" "}
  <a href="https://natecosmic.com/developers" rel="noopener noreferrer" target="_blank">developer portal</a> before users run OAuth.
* Send the same `redirect_uri` in authorize and token exchange requests.

## Related

* [Creating apps](/guides/creating-apps)
* [OAuth](/guides/oauth)
* [Authorization](/concepts/authorization)
