> This page is for version v1.3 (default).
> For other versions, use one of these documentation indexes:
> - v1.3 (default): https://docs.twelvelabs.io/v1.3/llms.txt

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.twelvelabs.io/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.twelvelabs.io/_mcp/server.

# Register a redirect URI

POST https://api.twelvelabs.io/v1.3/connections/redirect-uris
Content-Type: application/json

This method registers a redirect URI so the [Authorize a connection](/v1.3/api-reference/data-connectors/authorize-a-connection) method accepts it.


Reference: https://docs.twelvelabs.io/api-reference/data-connectors/register-a-redirect-uri

## Authentication

- `x-api-key` header (required) — Your API key. You can find your API key on the API Keys page.

## Request

### Body (application/json)

This endpoint expects an object.

- `redirect_uri` (string, required) — The redirect URI to register. Must use HTTPS, resolve to a public host, and contain no wildcards. Register it exactly as your application sends it, because the authorization flow requires an exact match.

## Response

### 201

The redirect URI has been successfully registered.

- `_id` (string, optional) — The unique identifier of the redirect URI.
- `redirect_uri` (string, optional) — The registered redirect URI.
- `created_at` (string, optional) — The date and time, in the RFC 3339 format ("YYYY-MM-DDTHH:mm:ssZ"), when the redirect URI was registered.

## Errors

### 400 Bad Request Error

The request has failed.

- `code` (string, optional) — A string representing the code associated with the error. See the [Error codes](/v1.3/api-reference/error-codes) page for details.
- `message` (string, optional) — A human-readable string describing the error, intended to be suitable for display in a user interface.

### 409 Conflict Error

The redirect URI is already registered.

- `code` (string, optional) — A string representing the code associated with the error. See the [Error codes](/v1.3/api-reference/error-codes) page for details.
- `message` (string, optional) — A human-readable string describing the error, intended to be suitable for display in a user interface.
- `docs_url` (string, optional) — The URL of the relevant documentation page.

### 422 Unprocessable Entity Error

The redirect URI could not be registered. Either it failed validation (`redirect_uri_invalid`) because it must use HTTPS, resolve to a public host, and contain no wildcards, or you have reached the maximum number of registered redirect URIs (`redirect_uri_limit_exceeded`).

- `code` (string, optional) — A string representing the code associated with the error. See the [Error codes](/v1.3/api-reference/error-codes) page for details.
- `message` (string, optional) — A human-readable string describing the error, intended to be suitable for display in a user interface.
- `docs_url` (string, optional) — The URL of the relevant documentation page.

## Examples

**Request**

```json
{
  "redirect_uri": "https://app.example.com/oauth/done"
}
```

**Response**

```json
{
  "_id": "665f0a2c9b1e4d0012a3f7c9",
  "redirect_uri": "https://app.example.com/oauth/done",
  "created_at": "2026-05-29T12:00:00Z"
}
```

**SDK Code**

```python
import requests

url = "https://api.twelvelabs.io/v1.3/connections/redirect-uris"

payload = { "redirect_uri": "https://app.example.com/oauth/done" }
headers = {
    "x-api-key": "<apiKey>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript
const url = 'https://api.twelvelabs.io/v1.3/connections/redirect-uris';
const options = {
  method: 'POST',
  headers: {'x-api-key': '<apiKey>', 'Content-Type': 'application/json'},
  body: '{"redirect_uri":"https://app.example.com/oauth/done"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.twelvelabs.io/v1.3/connections/redirect-uris"

	payload := strings.NewReader("{\n  \"redirect_uri\": \"https://app.example.com/oauth/done\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("x-api-key", "<apiKey>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.twelvelabs.io/v1.3/connections/redirect-uris")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"redirect_uri\": \"https://app.example.com/oauth/done\"\n}"

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.twelvelabs.io/v1.3/connections/redirect-uris")
  .header("x-api-key", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"redirect_uri\": \"https://app.example.com/oauth/done\"\n}")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.twelvelabs.io/v1.3/connections/redirect-uris', [
  'body' => '{
  "redirect_uri": "https://app.example.com/oauth/done"
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'x-api-key' => '<apiKey>',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.twelvelabs.io/v1.3/connections/redirect-uris");
var request = new RestRequest(Method.POST);
request.AddHeader("x-api-key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"redirect_uri\": \"https://app.example.com/oauth/done\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "x-api-key": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = ["redirect_uri": "https://app.example.com/oauth/done"] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.twelvelabs.io/v1.3/connections/redirect-uris")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```