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

# Protected Resource

A Protected Resource is an MCP server or API in an environment that agents and clients are granted access to. Its `slug` is derived from its name when it is created, is unique within the environment, and does not change when the resource is renamed.

A Protected Resource cannot be deleted while resource indicators or templates are bound to it.

:::code-group{title="Example Protected Resource"}

```json language="curl"
{
  "object": "protected_resource",
  "id": "protected_resource_01JZ8X4N2R7Q9M3K5T6V8W0Y1A",
  "kind": "mcp",
  "name": "Acme MCP Server",
  "slug": "acme-mcp-server",
  "created_at": "2026-01-15T12:00:00.000Z",
  "updated_at": "2026-01-15T12:00:00.000Z"
}
```

:::

## Attach a resource indicator to a Protected Resource

Attaches an MCP resource indicator or template to a Protected Resource. A template takes the indicators created from it along. Attaching one that is already attached to this Protected Resource changes nothing.

:::code-group

```bash language="curl" title="Request" tab="1"
curl --request PUT \
  --url "https://api.workos.com/protected_resources/protected_resource_01JZ8X4N2R7Q9M3K5T6V8W0Y1A/indicators/authkit_oauth_resource_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.protected_resources.update_protected_resource_indicator(
  id: "protected_resource_01JZ8X4N2R7Q9M3K5T6V8W0Y1A",
  indicator_id: "authkit_oauth_resource_01EHZNVPK3SFK441A1RGBFSHRT"
)
```

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

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

client.protected_resources.update_protected_resource_indicator(
    id="protected_resource_01JZ8X4N2R7Q9M3K5T6V8W0Y1A",
    indicator_id="authkit_oauth_resource_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.ProtectedResources().UpdateIndicator(context.Background(), "protected_resource_01JZ8X4N2R7Q9M3K5T6V8W0Y1A", "authkit_oauth_resource_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
    ->protectedResources()
    ->updateProtectedResourceIndicator(
        id: "protected_resource_01JZ8X4N2R7Q9M3K5T6V8W0Y1A",
        indicatorId: "authkit_oauth_resource_01EHZNVPK3SFK441A1RGBFSHRT",
    );
```

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

WorkOS workos = new WorkOS("sk_example_123456789");

workos.getProtectedResources().updateIndicator(
    "protected_resource_01JZ8X4N2R7Q9M3K5T6V8W0Y1A",
    "authkit_oauth_resource_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.ProtectedResources.UpdateIndicatorAsync("protected_resource_01JZ8X4N2R7Q9M3K5T6V8W0Y1A",
                                                     "authkit_oauth_resource_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
        .protected_resources()
        .update_protected_resource_indicator(
            "protected_resource_01JZ8X4N2R7Q9M3K5T6V8W0Y1A",
            "authkit_oauth_resource_01EHZNVPK3SFK441A1RGBFSHRT",
        )
        .await?;

    Ok(())
}
```

:::

## Create a Protected Resource

Creates a Protected Resource in the environment. Its slug is derived from the name. Permissions listed in `permissions` are linked to it; if any cannot be, the Protected Resource is not created.

:::code-group

```bash language="curl" title="Request" tab="1"
curl --request POST \
  --url "https://api.workos.com/protected_resources" \
  --header "Authorization: Bearer sk_example_123456789" \
  --header "Content-Type: application/json" \
  -d @- <<'BODY'
    {
        "name": "Acme MCP Server",
        "kind": "mcp"
    }
BODY
```

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

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

WorkOS.client.protected_resources.create_protected_resource(
  name: "Acme MCP Server",
  kind: "mcp"
)
```

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

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

client.protected_resources.create_protected_resource(name="Acme MCP Server", kind="mcp")
```

```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.ProtectedResources().Create(context.Background(), &workos.ProtectedResourcesCreateParams{
		Name: "Acme MCP Server",
		Kind: workos.ProtectedResourcesCreateRequestKind("mcp"),
	})
	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
    ->protectedResources()
    ->createProtectedResource(name: "Acme MCP Server", kind: "mcp");
```

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

WorkOS workos = new WorkOS("sk_example_123456789");

workos.getProtectedResources().create("Acme MCP Server", ProtectedResourceKind.Mcp);
```

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

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

await client.ProtectedResources.CreateAsync(new ProtectedResourcesCreateOptions {
    Name = "Acme MCP Server",
    Kind = ProtectedResourceKind.Mcp,
});
```

```rust language="rust" title="Request" tab="1"
use workos::Client;
use workos::{ProtectedResourcesCreateRequest, ProtectedResourcesCreateRequestKind};
use workos::protected_resources::CreateProtectedResourceParams;

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

    let _result = client
        .protected_resources()
        .create_protected_resource(CreateProtectedResourceParams::new(ProtectedResourcesCreateRequest {
            name: "Acme MCP Server".to_string(),
            kind: ProtectedResourcesCreateRequestKind::Mcp,
            permissions: None,
        }))
        .await?;

    Ok(())
}
```

```json language="json" title="Response" tab="2"
{
  "object": "protected_resource",
  "id": "protected_resource_01JZ8X4N2R7Q9M3K5T6V8W0Y1A",
  "kind": "mcp",
  "name": "Acme MCP Server",
  "slug": "acme-mcp-server",
  "created_at": "2026-01-15T12:00:00.000Z",
  "updated_at": "2026-01-15T12:00:00.000Z"
}
```

:::

## Delete a Protected Resource

Deletes a Protected Resource. A Protected Resource that resource indicators or templates are still bound to cannot be deleted.

:::code-group

```bash language="curl" title="Request" tab="1"
curl --request DELETE \
  --url "https://api.workos.com/protected_resources/protected_resource_01JZ8X4N2R7Q9M3K5T6V8W0Y1A" \
  --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.protected_resources.delete_protected_resource(id: "protected_resource_01JZ8X4N2R7Q9M3K5T6V8W0Y1A")
```

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

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

client.protected_resources.delete_protected_resource(
    id="protected_resource_01JZ8X4N2R7Q9M3K5T6V8W0Y1A"
)
```

```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.ProtectedResources().Delete(context.Background(), "protected_resource_01JZ8X4N2R7Q9M3K5T6V8W0Y1A")
	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
    ->protectedResources()
    ->deleteProtectedResource(
        id: "protected_resource_01JZ8X4N2R7Q9M3K5T6V8W0Y1A",
    );
```

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

WorkOS workos = new WorkOS("sk_example_123456789");

workos.getProtectedResources().delete("protected_resource_01JZ8X4N2R7Q9M3K5T6V8W0Y1A");
```

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

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

await client.ProtectedResources.DeleteAsync("protected_resource_01JZ8X4N2R7Q9M3K5T6V8W0Y1A");
```

```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
        .protected_resources()
        .delete_protected_resource("protected_resource_01JZ8X4N2R7Q9M3K5T6V8W0Y1A")
        .await?;

    Ok(())
}
```

:::

## Detach a resource indicator from a Protected Resource

Detaches an MCP resource indicator or template from a Protected Resource. A template takes the indicators created from it along.

:::code-group

```bash language="curl" title="Request" tab="1"
curl --request DELETE \
  --url "https://api.workos.com/protected_resources/protected_resource_01JZ8X4N2R7Q9M3K5T6V8W0Y1A/indicators/authkit_oauth_resource_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.protected_resources.delete_protected_resource_indicator(
  id: "protected_resource_01JZ8X4N2R7Q9M3K5T6V8W0Y1A",
  indicator_id: "authkit_oauth_resource_01EHZNVPK3SFK441A1RGBFSHRT"
)
```

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

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

client.protected_resources.delete_protected_resource_indicator(
    id="protected_resource_01JZ8X4N2R7Q9M3K5T6V8W0Y1A",
    indicator_id="authkit_oauth_resource_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.ProtectedResources().DeleteIndicator(context.Background(), "protected_resource_01JZ8X4N2R7Q9M3K5T6V8W0Y1A", "authkit_oauth_resource_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
    ->protectedResources()
    ->deleteProtectedResourceIndicator(
        id: "protected_resource_01JZ8X4N2R7Q9M3K5T6V8W0Y1A",
        indicatorId: "authkit_oauth_resource_01EHZNVPK3SFK441A1RGBFSHRT",
    );
```

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

WorkOS workos = new WorkOS("sk_example_123456789");

workos.getProtectedResources().deleteIndicator(
    "protected_resource_01JZ8X4N2R7Q9M3K5T6V8W0Y1A",
    "authkit_oauth_resource_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.ProtectedResources.DeleteIndicatorAsync("protected_resource_01JZ8X4N2R7Q9M3K5T6V8W0Y1A",
                                                     "authkit_oauth_resource_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
        .protected_resources()
        .delete_protected_resource_indicator(
            "protected_resource_01JZ8X4N2R7Q9M3K5T6V8W0Y1A",
            "authkit_oauth_resource_01EHZNVPK3SFK441A1RGBFSHRT",
        )
        .await?;

    Ok(())
}
```

:::

## Get a Protected Resource

Gets a Protected Resource by its ID.

:::code-group

```bash language="curl" title="Request" tab="1"
curl "https://api.workos.com/protected_resources/protected_resource_01JZ8X4N2R7Q9M3K5T6V8W0Y1A" \
  --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.protected_resources.get_protected_resource(id: "protected_resource_01JZ8X4N2R7Q9M3K5T6V8W0Y1A")
```

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

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

client.protected_resources.get_protected_resource(
    id="protected_resource_01JZ8X4N2R7Q9M3K5T6V8W0Y1A"
)
```

```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.ProtectedResources().Get(context.Background(), "protected_resource_01JZ8X4N2R7Q9M3K5T6V8W0Y1A")
	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
    ->protectedResources()
    ->getProtectedResource(id: "protected_resource_01JZ8X4N2R7Q9M3K5T6V8W0Y1A");
```

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

WorkOS workos = new WorkOS("sk_example_123456789");

workos.getProtectedResources().get("protected_resource_01JZ8X4N2R7Q9M3K5T6V8W0Y1A");
```

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

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

await client.ProtectedResources.GetAsync("protected_resource_01JZ8X4N2R7Q9M3K5T6V8W0Y1A");
```

```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");

    let _result = client
        .protected_resources()
        .get_protected_resource("protected_resource_01JZ8X4N2R7Q9M3K5T6V8W0Y1A")
        .await?;

    Ok(())
}
```

```json language="json" title="Response" tab="2"
{
  "object": "protected_resource",
  "id": "protected_resource_01JZ8X4N2R7Q9M3K5T6V8W0Y1A",
  "kind": "mcp",
  "name": "Acme MCP Server",
  "slug": "acme-mcp-server",
  "created_at": "2026-01-15T12:00:00.000Z",
  "updated_at": "2026-01-15T12:00:00.000Z"
}
```

:::

## Link a permission to a Protected Resource

Links a Permission to a Protected Resource, or changes its kind if it is already linked. Linking it again with the same kind changes nothing.

:::code-group

```bash language="curl" title="Request" tab="1"
curl --request PUT \
  --url "https://api.workos.com/protected_resources/protected_resource_01JZ8X4N2R7Q9M3K5T6V8W0Y1A/permissions/documents:read" \
  --header "Authorization: Bearer sk_example_123456789" \
  --header "Content-Type: application/json" \
  -d @- <<'BODY'
    {
        "kind": "rbac"
    }
BODY
```

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

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

WorkOS.client.protected_resources.update_protected_resource_permission(
  id: "protected_resource_01JZ8X4N2R7Q9M3K5T6V8W0Y1A",
  permission_slug: "documents:read",
  kind: "rbac"
)
```

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

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

client.protected_resources.update_protected_resource_permission(
    id="protected_resource_01JZ8X4N2R7Q9M3K5T6V8W0Y1A",
    permission_slug="documents:read",
    kind="rbac",
)
```

```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.ProtectedResources().UpdatePermission(context.Background(), "protected_resource_01JZ8X4N2R7Q9M3K5T6V8W0Y1A", "documents:read", &workos.ProtectedResourcesUpdatePermissionParams{
		Kind: workos.ProtectedResourcesLinkPermissionRequestKind("rbac"),
	})
	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
    ->protectedResources()
    ->updateProtectedResourcePermission(
        id: "protected_resource_01JZ8X4N2R7Q9M3K5T6V8W0Y1A",
        permissionSlug: "documents:read",
        kind: "rbac",
    );
```

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

WorkOS workos = new WorkOS("sk_example_123456789");

workos.getProtectedResources().updatePermission(
    "protected_resource_01JZ8X4N2R7Q9M3K5T6V8W0Y1A",
    "documents:read",
    ProtectedResourcePermissionKind.Rbac);
```

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

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

await client.ProtectedResources.UpdatePermissionAsync("protected_resource_01JZ8X4N2R7Q9M3K5T6V8W0Y1A", "documents:read",
                                                      new ProtectedResourcesUpdatePermissionOptions {
                                                          Kind = ProtectedResourcePermissionKind.Rbac,
                                                      });
```

```rust language="rust" title="Request" tab="1"
use workos::Client;
use workos::{ProtectedResourcesLinkPermissionRequest, ProtectedResourcesLinkPermissionRequestKind};
use workos::protected_resources::UpdateProtectedResourcePermissionParams;

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

    client
        .protected_resources()
        .update_protected_resource_permission(
            "protected_resource_01JZ8X4N2R7Q9M3K5T6V8W0Y1A",
            "documents:read",
            UpdateProtectedResourcePermissionParams::new(ProtectedResourcesLinkPermissionRequest {
                kind: ProtectedResourcesLinkPermissionRequestKind::Rbac,
            }),
        )
        .await?;

    Ok(())
}
```

:::

## Link permissions to a Protected Resource

Links Permissions to a Protected Resource by slug, or changes the kind of ones already linked. Permissions that are not listed stay linked. Either every Permission is linked or none is.

:::code-group

```bash language="curl" title="Request" tab="1"
curl --request POST \
  --url "https://api.workos.com/protected_resources/protected_resource_01JZ8X4N2R7Q9M3K5T6V8W0Y1A/permissions" \
  --header "Authorization: Bearer sk_example_123456789" \
  --header "Content-Type: application/json" \
  -d @- <<'BODY'
    {
        "permissions": [
            {
                "slug": "documents:read",
                "kind": "rbac"
            }
        ]
    }
BODY
```

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

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

WorkOS.client.protected_resources.create_protected_resource_permission(
  id: "protected_resource_01JZ8X4N2R7Q9M3K5T6V8W0Y1A",
  permissions: [{ slug: "documents:read", kind: "rbac" }]
)
```

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

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

client.protected_resources.create_protected_resource_permission(
    id="protected_resource_01JZ8X4N2R7Q9M3K5T6V8W0Y1A",
    permissions=[{"slug": "documents:read", "kind": "rbac"}],
)
```

```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.ProtectedResources().CreatePermission(context.Background(), "protected_resource_01JZ8X4N2R7Q9M3K5T6V8W0Y1A", &workos.ProtectedResourcesCreatePermissionParams{
		Permissions: []*workos.ProtectedResourcesLinkPermissionsRequestPermission{
			{
				Slug: "documents:read",
				Kind: workos.ProtectedResourcesLinkPermissionsRequestPermissionKind("rbac"),
			},
		},
	})
	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
    ->protectedResources()
    ->createProtectedResourcePermission(
        id: "protected_resource_01JZ8X4N2R7Q9M3K5T6V8W0Y1A",
        permissions: [["slug" => "documents:read", "kind" => "rbac"]],
    );
```

```java language="java" title="Request" tab="1"
import com.workos.WorkOS;
import com.workos.models.ProtectedResourcesCreateRequestPermission;
import com.workos.types.ProtectedResourcePermissionKind;
import java.util.List;

WorkOS workos = new WorkOS("sk_example_123456789");

workos.getProtectedResources().createPermission(
    "protected_resource_01JZ8X4N2R7Q9M3K5T6V8W0Y1A",
    List.of(new ProtectedResourcesCreateRequestPermission(
        "documents:read", ProtectedResourcePermissionKind.Rbac)));
```

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

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

await client.ProtectedResources.CreatePermissionAsync("protected_resource_01JZ8X4N2R7Q9M3K5T6V8W0Y1A",
                                                      new ProtectedResourcesCreatePermissionOptions {
                                                          Permissions =
                                                              new List<ProtectedResourcesCreateRequestPermission> {
                                                                  new ProtectedResourcesCreateRequestPermission {
                                                                      Slug = "documents:read",
                                                                      Kind = ProtectedResourcePermissionKind.Rbac,
                                                                  },
                                                              },
                                                      });
```

```rust language="rust" title="Request" tab="1"
use workos::Client;
use workos::{ProtectedResourcesLinkPermissionsRequest, ProtectedResourcesLinkPermissionsRequestPermission, ProtectedResourcesLinkPermissionsRequestPermissionKind};
use workos::protected_resources::CreateProtectedResourcePermissionParams;

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

    client
        .protected_resources()
        .create_protected_resource_permission(
            "protected_resource_01JZ8X4N2R7Q9M3K5T6V8W0Y1A",
            CreateProtectedResourcePermissionParams::new(ProtectedResourcesLinkPermissionsRequest {
                permissions: vec![ProtectedResourcesLinkPermissionsRequestPermission {
                    slug: "documents:read".to_string(),
                    kind: ProtectedResourcesLinkPermissionsRequestPermissionKind::Rbac,
                }],
            }),
        )
        .await?;

    Ok(())
}
```

:::

## List permissions of a Protected Resource

Lists the Permissions linked to a Protected Resource, ordered by Permission ID. `before` and `after` take a Permission ID.

:::code-group

```bash language="curl" title="Request" tab="1"
curl "https://api.workos.com/protected_resources/protected_resource_01JZ8X4N2R7Q9M3K5T6V8W0Y1A/permissions" \
  --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.protected_resources.list_protected_resource_permissions(id: "protected_resource_01JZ8X4N2R7Q9M3K5T6V8W0Y1A")
```

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

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

client.protected_resources.list_protected_resource_permissions(
    id="protected_resource_01JZ8X4N2R7Q9M3K5T6V8W0Y1A"
)
```

```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.ProtectedResources().ListPermissions(context.Background(), "protected_resource_01JZ8X4N2R7Q9M3K5T6V8W0Y1A", &workos.ProtectedResourcesListPermissionsParams{})
	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
    ->protectedResources()
    ->listProtectedResourcePermissions(
        id: "protected_resource_01JZ8X4N2R7Q9M3K5T6V8W0Y1A",
    );
```

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

WorkOS workos = new WorkOS("sk_example_123456789");

workos.getProtectedResources().listPermissions(
    "protected_resource_01JZ8X4N2R7Q9M3K5T6V8W0Y1A");
```

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

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

await client.ProtectedResources.ListPermissionsAsync("protected_resource_01JZ8X4N2R7Q9M3K5T6V8W0Y1A");
```

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

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

    let _result = client
        .protected_resources()
        .list_protected_resource_permissions(
            "protected_resource_01JZ8X4N2R7Q9M3K5T6V8W0Y1A",
            ListProtectedResourcePermissionsParams::default(),
        )
        .await?;

    Ok(())
}
```

```json language="json" title="Response" tab="2"
{
  "object": "list",
  "data": [
    {
      "object": "protected_resource_permission",
      "permission_id": "permission_01HXYZ123456789ABCDEFGHIJ",
      "permission_slug": "documents:read",
      "kind": "rbac",
      "created_at": "2026-01-15T12:00:00.000Z",
      "updated_at": "2026-01-15T12:00:00.000Z"
    }
  ],
  "list_metadata": {
    "before": "permission_01HXYZ123456789ABCDEFGHIJ",
    "after": "permission_01HXYZ987654321KJIHGFEDCBA"
  }
}
```

:::

## List resource indicators of a Protected Resource

Lists the MCP resource indicators and templates attached to a Protected Resource. A template is listed as its wildcard registration, as `/user_management/authkit_oauth_resources` lists it.

:::code-group

```bash language="curl" title="Request" tab="1"
curl "https://api.workos.com/protected_resources/protected_resource_01JZ8X4N2R7Q9M3K5T6V8W0Y1A/indicators" \
  --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.protected_resources.list_protected_resource_indicators(id: "protected_resource_01JZ8X4N2R7Q9M3K5T6V8W0Y1A")
```

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

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

client.protected_resources.list_protected_resource_indicators(
    id="protected_resource_01JZ8X4N2R7Q9M3K5T6V8W0Y1A"
)
```

```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.ProtectedResources().ListIndicators(context.Background(), "protected_resource_01JZ8X4N2R7Q9M3K5T6V8W0Y1A", &workos.ProtectedResourcesListIndicatorsParams{})
	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
    ->protectedResources()
    ->listProtectedResourceIndicators(
        id: "protected_resource_01JZ8X4N2R7Q9M3K5T6V8W0Y1A",
    );
```

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

WorkOS workos = new WorkOS("sk_example_123456789");

workos.getProtectedResources().listIndicators(
    "protected_resource_01JZ8X4N2R7Q9M3K5T6V8W0Y1A");
```

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

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

await client.ProtectedResources.ListIndicatorsAsync("protected_resource_01JZ8X4N2R7Q9M3K5T6V8W0Y1A");
```

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

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

    let _result = client
        .protected_resources()
        .list_protected_resource_indicators(
            "protected_resource_01JZ8X4N2R7Q9M3K5T6V8W0Y1A",
            ListProtectedResourceIndicatorsParams::default(),
        )
        .await?;

    Ok(())
}
```

```json language="json" title="Response" tab="2"
{
  "object": "list",
  "data": [
    {
      "object": "authkit_oauth_resource",
      "id": "authkit_oauth_resource_01EHZNVPK3SFK441A1RGBFSHRT",
      "uri": "https://api.example.com",
      "default": false,
      "created_at": "2026-01-15T12:00:00.000Z",
      "updated_at": "2026-01-15T12:00:00.000Z"
    }
  ],
  "list_metadata": {
    "before": "authkit_oauth_resource_01HXYZ123456789ABCDEFGHIJ",
    "after": "authkit_oauth_resource_01HXYZ987654321KJIHGFEDCBA"
  }
}
```

:::

## List Protected Resources

Lists the Protected Resources in the environment.

:::code-group

```bash language="curl" title="Request" tab="1"
curl "https://api.workos.com/protected_resources" \
  --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.protected_resources.list_protected_resources
```

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

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

client.protected_resources.list_protected_resources()
```

```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.ProtectedResources().List(context.Background(), &workos.ProtectedResourcesListParams{})
	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->protectedResources()->listProtectedResources();
```

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

WorkOS workos = new WorkOS("sk_example_123456789");

workos.getProtectedResources().list();
```

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

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

await client.ProtectedResources.ListAsync();
```

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

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

    let _result = client
        .protected_resources()
        .list_protected_resources(ListProtectedResourcesParams::default())
        .await?;

    Ok(())
}
```

```json language="json" title="Response" tab="2"
{
  "object": "list",
  "data": [
    {
      "object": "protected_resource",
      "id": "protected_resource_01JZ8X4N2R7Q9M3K5T6V8W0Y1A",
      "kind": "mcp",
      "name": "Acme MCP Server",
      "slug": "acme-mcp-server",
      "created_at": "2026-01-15T12:00:00.000Z",
      "updated_at": "2026-01-15T12:00:00.000Z"
    }
  ],
  "list_metadata": {
    "before": "protected_resource_01HXYZ123456789ABCDEFGHIJ",
    "after": "protected_resource_01HXYZ987654321KJIHGFEDCBA"
  }
}
```

:::

## Unlink a permission from a Protected Resource

Unlinks a Permission from a Protected Resource.

:::code-group

```bash language="curl" title="Request" tab="1"
curl --request DELETE \
  --url "https://api.workos.com/protected_resources/protected_resource_01JZ8X4N2R7Q9M3K5T6V8W0Y1A/permissions/documents:read" \
  --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.protected_resources.delete_protected_resource_permission(
  id: "protected_resource_01JZ8X4N2R7Q9M3K5T6V8W0Y1A",
  permission_slug: "documents:read"
)
```

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

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

client.protected_resources.delete_protected_resource_permission(
    id="protected_resource_01JZ8X4N2R7Q9M3K5T6V8W0Y1A", permission_slug="documents:read"
)
```

```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.ProtectedResources().DeletePermission(context.Background(), "protected_resource_01JZ8X4N2R7Q9M3K5T6V8W0Y1A", "documents:read")
	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
    ->protectedResources()
    ->deleteProtectedResourcePermission(
        id: "protected_resource_01JZ8X4N2R7Q9M3K5T6V8W0Y1A",
        permissionSlug: "documents:read",
    );
```

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

WorkOS workos = new WorkOS("sk_example_123456789");

workos.getProtectedResources().deletePermission(
    "protected_resource_01JZ8X4N2R7Q9M3K5T6V8W0Y1A", "documents:read");
```

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

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

await client.ProtectedResources.DeletePermissionAsync("protected_resource_01JZ8X4N2R7Q9M3K5T6V8W0Y1A",
                                                      "documents:read");
```

```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
        .protected_resources()
        .delete_protected_resource_permission(
            "protected_resource_01JZ8X4N2R7Q9M3K5T6V8W0Y1A",
            "documents:read",
        )
        .await?;

    Ok(())
}
```

:::

## Update a Protected Resource

Renames a Protected Resource. The slug and kind do not change.

:::code-group

```bash language="curl" title="Request" tab="1"
curl --request PATCH \
  --url "https://api.workos.com/protected_resources/protected_resource_01JZ8X4N2R7Q9M3K5T6V8W0Y1A" \
  --header "Authorization: Bearer sk_example_123456789" \
  --header "Content-Type: application/json" \
  -d @- <<'BODY'
    {
        "name": "Acme MCP Server"
    }
BODY
```

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

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

WorkOS.client.protected_resources.update_protected_resource(
  id: "protected_resource_01JZ8X4N2R7Q9M3K5T6V8W0Y1A",
  name: "Acme MCP Server"
)
```

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

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

client.protected_resources.update_protected_resource(
    id="protected_resource_01JZ8X4N2R7Q9M3K5T6V8W0Y1A", name="Acme MCP Server"
)
```

```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.ProtectedResources().Update(context.Background(), "protected_resource_01JZ8X4N2R7Q9M3K5T6V8W0Y1A", &workos.ProtectedResourcesUpdateParams{
		Name: "Acme MCP Server",
	})
	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
    ->protectedResources()
    ->updateProtectedResource(
        id: "protected_resource_01JZ8X4N2R7Q9M3K5T6V8W0Y1A",
        name: "Acme MCP Server",
    );
```

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

WorkOS workos = new WorkOS("sk_example_123456789");

workos.getProtectedResources().update(
    "protected_resource_01JZ8X4N2R7Q9M3K5T6V8W0Y1A", "Acme MCP Server");
```

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

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

await client.ProtectedResources.UpdateAsync("protected_resource_01JZ8X4N2R7Q9M3K5T6V8W0Y1A",
                                            new ProtectedResourcesUpdateOptions {
                                                Name = "Acme MCP Server",
                                            });
```

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

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

    let _result = client
        .protected_resources()
        .update_protected_resource(
            "protected_resource_01JZ8X4N2R7Q9M3K5T6V8W0Y1A",
            UpdateProtectedResourceParams::new(ProtectedResourcesUpdateRequest {
                name: "Acme MCP Server".to_string(),
            }),
        )
        .await?;

    Ok(())
}
```

```json language="json" title="Response" tab="2"
{
  "object": "protected_resource",
  "id": "protected_resource_01JZ8X4N2R7Q9M3K5T6V8W0Y1A",
  "kind": "mcp",
  "name": "Acme MCP Server",
  "slug": "acme-mcp-server",
  "created_at": "2026-01-15T12:00:00.000Z",
  "updated_at": "2026-01-15T12:00:00.000Z"
}
```

:::

### protected_resource

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `object` | "protected_resource" | Yes | The Protected Resource object. |
| `id` | string | Yes | The unique ID of the Protected Resource. |
| `kind` | "mcp" \| "api" | Yes | The kind of resource being protected: an MCP server or an API. |
| `name` | string | Yes | The name of the Protected Resource. |
| `slug` | string | Yes | An identifier derived from the name when the Protected Resource is created, unique within the environment. It does not change when the Protected Resource is renamed. |
| `created_at` | string | Yes | An ISO 8601 timestamp. |
| `updated_at` | string | Yes | An ISO 8601 timestamp. |

### PUT /protected_resources/{id}/indicators/{indicator_id}

#### Parameters

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | string | Yes | The unique ID of the Protected Resource. |
| `indicator_id` | string | Yes | The ID of the MCP resource indicator or template, as listed by `/user_management/authkit_oauth_resources`. |

#### Returns

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

### POST /protected_resources

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `name` | string | Yes | The name of the Protected Resource. Its slug is derived from the name, so it must contain at least one letter or digit, and no other Protected Resource in the environment may have the same slug. |
| `kind` | "mcp" \| "api" | Yes | The kind of resource being protected: an MCP server or an API. |
| `permissions` | object[] | No | Permissions to link, by slug, at most 500. Each slug may be listed once. A Permission already linked with another kind has its kind changed. |

#### Returns

| Field | Type | Description |
| --- | --- | --- |
| `protected_resource` | object | The Protected Resource object. |

### DELETE /protected_resources/{id}

#### Parameters

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | string | Yes | The unique ID of the Protected Resource. |

#### Returns

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

### DELETE /protected_resources/{id}/indicators/{indicator_id}

#### Parameters

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | string | Yes | The unique ID of the Protected Resource. |
| `indicator_id` | string | Yes | The ID of the MCP resource indicator or template, as listed by `/user_management/authkit_oauth_resources`. |

#### Returns

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

### GET /protected_resources/{id}

#### Parameters

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | string | Yes | The unique ID of the Protected Resource. |

#### Returns

| Field | Type | Description |
| --- | --- | --- |
| `protected_resource` | object | The Protected Resource object. |

### PUT /protected_resources/{id}/permissions/{permission_slug}

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `kind` | "static" \| "rbac" | Yes | How the Permission is granted: `static` grants it to every caller of the Protected Resource; `rbac` grants it only to callers whose roles include it. |

#### Parameters

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | string | Yes | The unique ID of the Protected Resource. |
| `permission_slug` | string | Yes | The slug of a Permission in the environment. |

#### Returns

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

### POST /protected_resources/{id}/permissions

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `permissions` | object[] | Yes | Permissions to link, by slug, at most 500. Each slug may be listed once. A Permission already linked with another kind has its kind changed. |

#### Parameters

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | string | Yes | The unique ID of the Protected Resource. |

#### Returns

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

### GET /protected_resources/{id}/permissions

#### Parameters

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | string | Yes | The unique ID of the Protected Resource. |
| `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`. |

### GET /protected_resources/{id}/indicators

#### Parameters

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | string | Yes | The unique ID of the Protected Resource. |
| `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`. |

### GET /protected_resources

#### 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`. |

### DELETE /protected_resources/{id}/permissions/{permission_slug}

#### Parameters

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | string | Yes | The unique ID of the Protected Resource. |
| `permission_slug` | string | Yes | The slug of a Permission in the environment. |

#### Returns

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

### PATCH /protected_resources/{id}

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `name` | string | Yes | The new name of the Protected Resource. Renaming does not change its slug. |

#### Parameters

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | string | Yes | The unique ID of the Protected Resource. |

#### Returns

| Field | Type | Description |
| --- | --- | --- |
| `protected_resource` | object | The Protected Resource object. |