<!-- llms.txt: https://workos.com/llms.txt -->

# RedirectUri

#### Example RedirectUri

```json
{
  "object": "redirect_uri",
  "id": "redir_01EHZNVPK3SFK441A1RGBFSHRT",
  "uri": "https://example.com/callback",
  "default": true,
  "created_at": "2026-01-15T12:00:00.000Z",
  "updated_at": "2026-01-15T12:00:00.000Z"
}
```

## Create a redirect URI

Creates a new redirect URI for an application.

#### Request

```bash
curl --request POST \
  --url "https://api.workos.com/user_management/redirect_uris" \
  --header "Authorization: Bearer sk_example_123456789" \
  --header "Content-Type: application/json" \
  -d @- <<'BODY'
    {
        "uri": "https://example.com/callback"
    }
BODY
```

```rb
require "workos"

WorkOS.configure do |config|
  config.api_key = "sk_example_123456789"
end

WorkOS.client.user_management.create_redirect_uri(uri: "https://example.com/callback")
```

```py
from workos import WorkOSClient

client = WorkOSClient(api_key="sk_example_123456789", client_id="client_123456789")

client.user_management.create_redirect_uri(uri="https://example.com/callback")
```

```go
package main

import (
	"context"

	"github.com/workos/workos-go/v9"
)

func main() {
	client := workos.NewClient("sk_example_123456789")

	_, err := client.UserManagement().CreateRedirectURI(context.Background(), &workos.UserManagementCreateRedirectURIParams{
		URI: "https://example.com/callback",
	})
	if err != nil {
		panic(err)
	}
}
```

```php
<?php

use WorkOS\WorkOS;

$workos = new WorkOS(
    apiKey: "sk_example_123456789",
    clientId: "client_123456789",
);

$workos
    ->userManagement()
    ->createRedirectUri(uri: "https://example.com/callback");
```

```java
import com.workos.WorkOS;
import com.workos.usermanagement.UserManagementApi.CreateRedirectUriOptions;

WorkOS workos = new WorkOS("sk_example_123456789");

CreateRedirectUriOptions options =
    CreateRedirectUriOptions.builder().uri("https://example.com/callback").build();

workos.userManagement.createRedirectUri(options);
```

```cs
using WorkOS;

var client = new WorkOSClient(new WorkOSOptions {
    ApiKey = "sk_example_123456789",
    ClientId = "client_123456789",
});

await client.UserManagement.CreateRedirectUriAsync(new UserManagementCreateRedirectUriOptions {
    Uri = "https://example.com/callback",
});
```

```rust
use workos::Client;
use workos::user_management::CreateRedirectUriParams;

#[tokio::main]
async fn main() -> Result<(), workos::Error> {
    let client = Client::builder()
        .api_key("sk_example_123456789")
        .client_id("client_123456789")
        .build();

    let _result = client
        .user_management()
        .create_redirect_uri(
            CreateRedirectUriParams {
                uri: "https://example.com/callback".into(),
                ..Default::default()
            }
        )
        .await?;

    Ok(())
}
```

#### Response

```json
{
  "object": "redirect_uri",
  "id": "redir_01EHZNVPK3SFK441A1RGBFSHRT",
  "uri": "https://example.com/callback",
  "default": true,
  "created_at": "2026-01-15T12:00:00.000Z",
  "updated_at": "2026-01-15T12:00:00.000Z"
}
```

## Delete a redirect URI

Deletes a redirect URI from an application.

#### Request

```bash
curl --request DELETE \
  --url "https://api.workos.com/user_management/redirect_uris/redir_01EHZNVPK3SFK441A1RGBFSHRT" \
  --header "Authorization: Bearer sk_example_123456789"
```

```rb
require "workos"

WorkOS.configure do |config|
  config.api_key = "sk_example_123456789"
end

WorkOS.client.user_management.delete_redirect_uris(id: "redir_01EHZNVPK3SFK441A1RGBFSHRT")
```

```py
from workos import WorkOSClient

client = WorkOSClient(api_key="sk_example_123456789", client_id="client_123456789")

client.user_management.delete_redirect_uris(id_="redir_01EHZNVPK3SFK441A1RGBFSHRT")
```

```go
package main

import (
	"context"

	"github.com/workos/workos-go/v9"
)

func main() {
	client := workos.NewClient("sk_example_123456789")

	_, err := client.UserManagement().DeleteRedirectURIs(context.Background(), "redir_01EHZNVPK3SFK441A1RGBFSHRT")
	if err != nil {
		panic(err)
	}
}
```

```php
<?php

use WorkOS\WorkOS;

$workos = new WorkOS(
    apiKey: "sk_example_123456789",
    clientId: "client_123456789",
);

$workos
    ->userManagement()
    ->deleteRedirectUris(id: "redir_01EHZNVPK3SFK441A1RGBFSHRT");
```

```java
import com.workos.WorkOS;

WorkOS workos = new WorkOS("sk_example_123456789");

workos.userManagement.deleteRedirectUris("redir_01EHZNVPK3SFK441A1RGBFSHRT");
```

```cs
using WorkOS;

var client = new WorkOSClient(new WorkOSOptions {
    ApiKey = "sk_example_123456789",
    ClientId = "client_123456789",
});

await client.UserManagement.DeleteRedirectUrisAsync("redir_01EHZNVPK3SFK441A1RGBFSHRT");
```

```rust
use workos::Client;

#[tokio::main]
async fn main() -> Result<(), workos::Error> {
    let client = Client::builder()
        .api_key("sk_example_123456789")
        .client_id("client_123456789")
        .build();

    let _result = client
        .user_management()
        .delete_redirect_uris("redir_01EHZNVPK3SFK441A1RGBFSHRT")
        .await?;

    Ok(())
}
```

## List redirect URIs

Lists the redirect URIs for an environment.

#### Request

```bash
curl "https://api.workos.com/user_management/redirect_uris" \
  --header "Authorization: Bearer sk_example_123456789"
```

```rb
require "workos"

WorkOS.configure do |config|
  config.api_key = "sk_example_123456789"
end

WorkOS.client.user_management.list_redirect_uris
```

```py
from workos import WorkOSClient

client = WorkOSClient(api_key="sk_example_123456789", client_id="client_123456789")

client.user_management.list_redirect_uris()
```

```go
package main

import (
	"context"

	"github.com/workos/workos-go/v9"
)

func main() {
	client := workos.NewClient("sk_example_123456789")

	_, err := client.UserManagement().ListRedirectURIs(context.Background())
	if err != nil {
		panic(err)
	}
}
```

```php
<?php

use WorkOS\WorkOS;

$workos = new WorkOS(
    apiKey: "sk_example_123456789",
    clientId: "client_123456789",
);

$workos->userManagement()->listRedirectUris();
```

```java
import com.workos.WorkOS;

WorkOS workos = new WorkOS("sk_example_123456789");

workos.userManagement.listRedirectUris();
```

```cs
using WorkOS;

var client = new WorkOSClient(new WorkOSOptions {
    ApiKey = "sk_example_123456789",
    ClientId = "client_123456789",
});

await client.UserManagement.ListRedirectUrisAsync();
```

```rust
use workos::Client;

#[tokio::main]
async fn main() -> Result<(), workos::Error> {
    let client = Client::builder()
        .api_key("sk_example_123456789")
        .client_id("client_123456789")
        .build();

    let _result = client
        .user_management()
        .list_redirect_uris()
        .await?;

    Ok(())
}
```

#### Response

```json
{
  "object": "list",
  "data": [
    {
      "object": "redirect_uri",
      "id": "redir_01EHZNVPK3SFK441A1RGBFSHRT",
      "uri": "https://example.com/callback",
      "default": true,
      "created_at": "2026-01-15T12:00:00.000Z",
      "updated_at": "2026-01-15T12:00:00.000Z"
    }
  ],
  "list_metadata": {
    "before": "redir_01HXYZ123456789ABCDEFGHIJ",
    "after": "redir_01HXYZ987654321KJIHGFEDCBA"
  }
}
```

### redirect_uri

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `object` | "redirect_uri" | Yes | The object type. |
| `id` | string | Yes | The ID of the redirect URI. |
| `uri` | string | Yes | The redirect URI. |
| `default` | boolean | Yes | Whether this is the default redirect URI. |
| `created_at` | string | Yes | The timestamp when the redirect URI was created. |
| `updated_at` | string | Yes | The timestamp when the redirect URI was last updated. |

### /user_management/redirect_uris

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `uri` | string | Yes | The redirect URI to create. |

### DELETE /user_management/redirect_uris/{id}

#### Parameters

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | string | Yes | The ID of the redirect URI to delete. |

#### Returns

| Field | Type | Description |
| --- | --- | --- |
| `empty` | empty | Returns an empty response on success. |

### GET /user_management/redirect_uris

#### Parameters

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `before` | string | No | An object ID that defines your place in the list. When the ID is not present, you are at the end of the list. For example, if you make a list request and receive 100 objects, ending with `"obj_123"`, your subsequent call can include `before="obj_123"` to fetch a new batch of objects before `"obj_123"`. |
| `after` | string | No | An object ID that defines your place in the list. When the ID is not present, you are at the end of the list. For example, if you make a list request and receive 100 objects, ending with `"obj_123"`, your subsequent call can include `after="obj_123"` to fetch a new batch of objects after `"obj_123"`. |
| `limit` | integer | No | Upper limit on the number of objects to return, between `1` and `100`. Defaults to `10`. |
| `order` | "normal" \| "desc" \| "asc" | No | Order the results by the creation time. Supported values are `"asc"` (ascending), `"desc"` (descending), and `"normal"` (descending with reversed cursor semantics where `before` fetches older records and `after` fetches newer records). Defaults to `desc`. |