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

# LogoutUri

:::code-group{title="Example LogoutUri"}

```json language="curl"
{
  "object": "logout_uri",
  "id": "logout_uri_01EHZNVPK3SFK441A1RGBFSHRT",
  "uri": "https://example.com/signed-out",
  "default": true,
  "created_at": "2026-01-15T12:00:00.000Z",
  "updated_at": "2026-01-15T12:00:00.000Z"
}
```

:::

## Create a logout URI

Creates a new logout URI for the API key's application. The first logout URI of an application becomes its default.

:::code-group

```bash language="curl" title="Request" tab="1"
curl --request POST \
  --url "https://api.workos.com/user_management/logout_uris" \
  --header "Authorization: Bearer sk_example_123456789" \
  --header "Content-Type: application/json" \
  -d @- <<'BODY'
    {
        "uri": "https://example.com/signed-out"
    }
BODY
```

```rb language="ruby" title="Request" tab="1"
require "workos"

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

WorkOS.client.user_management.create_logout_uris(uri: "https://example.com/signed-out")
```

```py language="python" title="Request" tab="1"
from workos import WorkOSClient

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

client.user_management.create_logout_uris(uri="https://example.com/signed-out")
```

```go language="go" title="Request" tab="1"
package main

import (
	"context"

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

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

	_, err := client.UserManagement().CreateLogoutURIs(context.Background(), &workos.UserManagementCreateLogoutURIsParams{
		URI: "https://example.com/signed-out",
	})
	if err != nil {
		panic(err)
	}
}
```

```php language="php" title="Request" tab="1"
<?php

use WorkOS\WorkOS;

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

$workos
    ->userManagement()
    ->createLogoutUris(uri: "https://example.com/signed-out");
```

```java language="java" title="Request" tab="1"
import com.workos.WorkOS;

WorkOS workos = new WorkOS("sk_example_123456789");

workos.getUserManagement().createLogoutUris("https://example.com/signed-out");
```

```cs language="dotnet" title="Request" tab="1"
using WorkOS;

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

await client.UserManagement.CreateLogoutUrisAsync(new UserManagementCreateLogoutUrisOptions {
    Uri = "https://example.com/signed-out",
});
```

```rust language="rust" title="Request" tab="1"
use workos::Client;
use workos::LogoutUrisCreateRequest;
use workos::user_management::CreateLogoutUrisParams;

#[tokio::main]
async fn main() -> Result<(), workos::Error> {
    let client = Client::new("sk_example_123456789");

    let _result = client
        .user_management()
        .create_logout_uris(CreateLogoutUrisParams::new(LogoutUrisCreateRequest {
            uri: "https://example.com/signed-out".to_string(),
        }))
        .await?;

    Ok(())
}
```

```json language="json" title="Response" tab="2"
{
  "object": "logout_uri",
  "id": "logout_uri_01EHZNVPK3SFK441A1RGBFSHRT",
  "uri": "https://example.com/signed-out",
  "default": true,
  "created_at": "2026-01-15T12:00:00.000Z",
  "updated_at": "2026-01-15T12:00:00.000Z"
}
```

:::

## Delete a logout URI

Deletes a logout URI from the API key's application. If it was the default, the application's oldest remaining logout URI becomes the default.

:::code-group

```bash language="curl" title="Request" tab="1"
curl --request DELETE \
  --url "https://api.workos.com/user_management/logout_uris/logout_uri_01EHZNVPK3SFK441A1RGBFSHRT" \
  --header "Authorization: Bearer sk_example_123456789"
```

```rb language="ruby" title="Request" tab="1"
require "workos"

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

WorkOS.client.user_management.delete_logout_uris(id: "logout_uri_01EHZNVPK3SFK441A1RGBFSHRT")
```

```py language="python" title="Request" tab="1"
from workos import WorkOSClient

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

client.user_management.delete_logout_uris(id="logout_uri_01EHZNVPK3SFK441A1RGBFSHRT")
```

```go language="go" title="Request" tab="1"
package main

import (
	"context"

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

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

	err := client.UserManagement().DeleteLogoutURIs(context.Background(), "logout_uri_01EHZNVPK3SFK441A1RGBFSHRT")
	if err != nil {
		panic(err)
	}
}
```

```php language="php" title="Request" tab="1"
<?php

use WorkOS\WorkOS;

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

$workos
    ->userManagement()
    ->deleteLogoutUris(id: "logout_uri_01EHZNVPK3SFK441A1RGBFSHRT");
```

```java language="java" title="Request" tab="1"
import com.workos.WorkOS;

WorkOS workos = new WorkOS("sk_example_123456789");

workos.getUserManagement().deleteLogoutUris("logout_uri_01EHZNVPK3SFK441A1RGBFSHRT");
```

```cs language="dotnet" title="Request" tab="1"
using WorkOS;

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

await client.UserManagement.DeleteLogoutUrisAsync("logout_uri_01EHZNVPK3SFK441A1RGBFSHRT");
```

```rust language="rust" title="Request" tab="1"
use workos::Client;

#[tokio::main]
async fn main() -> Result<(), workos::Error> {
    let client = Client::new("sk_example_123456789");

    client.user_management().delete_logout_uris("logout_uri_01EHZNVPK3SFK441A1RGBFSHRT").await?;

    Ok(())
}
```

:::

## List logout URIs

Lists the logout URIs of the API key's application.

:::code-group

```bash language="curl" title="Request" tab="1"
curl "https://api.workos.com/user_management/logout_uris" \
  --header "Authorization: Bearer sk_example_123456789"
```

```rb language="ruby" title="Request" tab="1"
require "workos"

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

WorkOS.client.user_management.list_logout_uris
```

```py language="python" title="Request" tab="1"
from workos import WorkOSClient

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

client.user_management.list_logout_uris()
```

```go language="go" title="Request" tab="1"
package main

import (
	"context"
	"fmt"

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

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

	iter := client.UserManagement().ListLogoutURIs(context.Background(), &workos.UserManagementListLogoutURIsParams{})
	for iter.Next() {
		fmt.Println(iter.Current())
	}
	if err := iter.Err(); err != nil {
		panic(err)
	}
}
```

```php language="php" title="Request" tab="1"
<?php

use WorkOS\WorkOS;

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

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

```java language="java" title="Request" tab="1"
import com.workos.WorkOS;

WorkOS workos = new WorkOS("sk_example_123456789");

workos.getUserManagement().listLogoutUris();
```

```cs language="dotnet" title="Request" tab="1"
using WorkOS;

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

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

```rust language="rust" title="Request" tab="1"
use workos::Client;
use workos::user_management::ListLogoutUrisParams;

#[tokio::main]
async fn main() -> Result<(), workos::Error> {
    let client = Client::new("sk_example_123456789");

    let _result = client.user_management().list_logout_uris(ListLogoutUrisParams::default()).await?;

    Ok(())
}
```

```json language="json" title="Response" tab="2"
{
  "object": "list",
  "data": [
    {
      "object": "logout_uri",
      "id": "logout_uri_01EHZNVPK3SFK441A1RGBFSHRT",
      "uri": "https://example.com/signed-out",
      "default": true,
      "created_at": "2026-01-15T12:00:00.000Z",
      "updated_at": "2026-01-15T12:00:00.000Z"
    }
  ],
  "list_metadata": {
    "before": "logout_uri_01HXYZ123456789ABCDEFGHIJ",
    "after": "logout_uri_01HXYZ987654321KJIHGFEDCBA"
  }
}
```

:::

### logout_uri

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `object` | "logout_uri" | Yes | The object type. |
| `id` | string | Yes | The ID of the logout URI. |
| `uri` | string | Yes | The logout URI. |
| `default` | boolean | Yes | Whether this is the default logout URI. Users are redirected to the default when a logout request does not name another allowed logout URI. |
| `created_at` | string | Yes | The timestamp when the logout URI was created. |
| `updated_at` | string | Yes | The timestamp when the logout URI was last updated. |

### POST /user_management/logout_uris

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

#### Returns

| Field | Type | Description |
| --- | --- | --- |
| `logout_uri` | object | The object type. |

### DELETE /user_management/logout_uris/{id}

#### Parameters

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

#### Returns

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

### GET /user_management/logout_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 `normal`. |