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

# Register Redirect URI

> Register a new OAuth redirect URI for your account.

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST "https://api.adrelay.dev/v1/redirect-uris" \
    -H "X-API-Key: $ADRELAY_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{"uri": "https://myapp.com/callback"}'
  ```

  ```javascript Node.js theme={null}
  import { AdRelay } from "@adrelay/sdk";

  const client = new AdRelay({ apiKey: process.env.ADRELAY_API_KEY });
  const { data } = await client.redirectUris.create("https://myapp.com/callback");

  console.log(data.id);  // Use this ID to delete later
  console.log(data.uri); // "https://myapp.com/callback"
  ```

  ```python Python theme={null}
  import requests

  response = requests.post(
      "https://api.adrelay.dev/v1/redirect-uris",
      headers={
          "X-API-Key": "your-api-key-here",
          "Content-Type": "application/json",
      },
      json={"uri": "https://myapp.com/callback"},
  )

  data = response.json()["data"]
  ```
</RequestExample>

<ResponseExample>
  ```json 201 theme={null}
  {
    "data": {
      "id": "uri_abc123",
      "uri": "https://myapp.com/callback",
      "createdAt": "2026-03-24T12:00:00.000Z"
    }
  }
  ```

  ```json 400 theme={null}
  {
    "error": {
      "code": "BAD_REQUEST",
      "message": "HTTPS is required for non-localhost redirect URIs",
      "retryable": false,
      "requestId": "req_abc123"
    }
  }
  ```

  ```json 409 theme={null}
  {
    "error": {
      "code": "CONFLICT",
      "message": "Redirect URI already registered",
      "retryable": false,
      "requestId": "req_abc123"
    }
  }
  ```
</ResponseExample>

## Validation Rules

* Must be a valid URL
* `https://` is required for non-localhost hosts
* `http://` is only allowed for `localhost` and `127.0.0.1`
* Maximum 10 custom URIs per account
* Duplicate URIs are rejected with `409 CONFLICT`
