---
title: How to Attach a Scope to an OAuth Application
url: https://docs.vultr.com/platform/iam/oauth/oauth-applications/how-to-attach-a-scope-to-an-oauth-application
description: Attach an IAM permission policy as a scope to a Vultr OAuth app to define requested access; one scope per app.
publish_date: 2026-07-14T20:48:51.489206Z
last_updated: 2026-10-23T20:34:31.968389Z
---

> Index of every Vultr Docs page in markdown: https://docs.vultr.com/llms.txt

A scope defines the permissions your OAuth application requests from the customers who authorize it. Each scope is an IAM permission policy from your own organization. When you attach a policy, Vultr saves a permanent copy that backs the scope. The copied policy is always read-only, and the original policy is also read-only while it is attached as a scope.

Follow this guide to attach a scope to an OAuth application using the Vultr Console and the Vultr API. An application must have at least one scope before you can submit it for review.

> [!NOTE]
> Attaching a scope requires the organization's root user. A non-root user receives an HTTP `403 Forbidden` response. An OAuth application supports one scope at a time. Detach the existing scope before attaching a different one. Create an [IAM policy](https://docs.vultr.com/platform/iam/policies/how-to-create-a-policy) first if you do not already have one. You can change the scope only while the application is in `Draft` or `Rejected` status. A `PendingReview` or `Active` application is locked.

=== "Vultr Console"

    1. Log in to the [Vultr Console](https://console.vultr.com/).
    1. Click the organization name in the top navigation bar.
    1. Click **Manage Organization**.
    1. Click **OAuth Applications**.
    1. Click the **Edit** icon next to the application, open its management page, or click **Create OAuth App** to set the scope during creation.
    1. Under **Permission Policy**, use the search field to find a policy and select it.
    1. Click **Save as Draft** to keep the application editable, or **Send for Review** to submit it for review.

        The selected policy is saved as a read-only copy that backs the application's permission scope. The copy is always read-only, and the original policy is read-only while it is attached.

=== "Vultr API"

    1. Send a `POST` request to the [**Attach OAuth Scope** endpoint](https://www.vultr.com/api/#tag/oauth/operation/attach-oauth-client-scope) to attach an IAM policy as a scope. Replace `{client-id}` with your application id and `SOURCE-POLICY-ID` with the IAM policy id.

        ```console
        $ curl "https://api.vultr.com/v2/oauth/clients/{client-id}/scopes" \
            -X POST \
            -H "Authorization: Bearer ${VULTR_API_KEY}" \
            -H "Content-Type: application/json" \
            -d '{
                "policy_id": "SOURCE-POLICY-ID"
            }'
        ```

        A successful request returns an HTTP `200 OK` response with the updated application object. Attaching the same policy again is a no-op, while attaching a different policy while one is already attached returns an HTTP `409 Conflict` response.

    1. Send a `GET` request to the [**List OAuth Scopes** endpoint](https://www.vultr.com/api/#tag/oauth/operation/list-oauth-client-scopes) to retrieve the attached scope. Replace `{client-id}` with your application id.

        ```console
        $ curl "https://api.vultr.com/v2/oauth/clients/{client-id}/scopes" \
            -X GET \
            -H "Authorization: Bearer ${VULTR_API_KEY}"
        ```

        The response contains an `attachments` array. Verify that the `policy.id` matches the source policy you attached.

    1. To remove a scope, send a `DELETE` request to the [**Detach OAuth Scope** endpoint](https://www.vultr.com/api/#tag/oauth/operation/detach-oauth-client-scope). Replace `{client-id}` with your application id and `{source-policy-id}` with the source policy id you attached.

        ```console
        $ curl "https://api.vultr.com/v2/oauth/clients/{client-id}/scopes/{source-policy-id}" \
            -X DELETE \
            -H "Authorization: Bearer ${VULTR_API_KEY}"
        ```

        A successful deletion returns an HTTP `204 No Content` response with no response body. The source policy remains unchanged.
