---
title: "Set Scope Config"
method: PUT
path: "/v2/projects/{proj_id}/{env_id}/opal_scope"
tags: ["Scope Configurations"]
---

# Set Scope Config

`PUT /v2/projects/{proj_id}/{env_id}/opal_scope`

Set or update the custom OPAL Scope config for a given environment.

## Path parameters

- `proj_id` string, required — Either the unique id of the project, or the URL-friendly key of the project (i.e: the "slug").
- `env_id` string, required — Either the unique id of the environment, or the URL-friendly key of the environment (i.e: the "slug").

## Request body

- ScopeConfigSet
  - `data` DataSourceConfig — Static list of Data Source Entries returned to client. Answers this question for the client: from where should i get the full picture of data i need? (as opposed to incremental data updates)
    - `entries` DataSourceEntryWithPollingInterval[] — list of data sources and how to fetch from them
      - `url` string, required — Url source to query for data
      - `config` object — Suggested fetcher configuration (e.g. auth or method) to fetch data with
      - `topics` string[] — topics the data applies to
      - `dst_path` string — OPA data api path to store the document at
      - `save_method` string — Method used to write into OPA - PUT/PATCH, when using the PATCH method the data field should conform to the JSON patch schema defined in RFC 6902(https://datatracker.ietf.org/doc/html/rfc6902#section-3)
      - `data` union — Data payload to embed within the data update (instead of having the client fetch it from the url).
        - JSONPatchAction[]
          - `op` string, required — patch action to perform
          - `path` string, required — target location in modified json
          - `value` unknown
          - `from` string — source location in json
        - unknown[]
          - unknown
        - object
      - `periodic_update_interval` number — Polling interval to refresh data from data source

## Response `200`

Successful Response

- ScopeConfigRead
  - `data` DataSourceConfig — Static list of Data Source Entries returned to client. Answers this question for the client: from where should i get the full picture of data i need? (as opposed to incremental data updates)
    - `entries` DataSourceEntryWithPollingInterval[] — list of data sources and how to fetch from them
      - `url` string, required — Url source to query for data
      - `config` object — Suggested fetcher configuration (e.g. auth or method) to fetch data with
      - `topics` string[] — topics the data applies to
      - `dst_path` string — OPA data api path to store the document at
      - `save_method` string — Method used to write into OPA - PUT/PATCH, when using the PATCH method the data field should conform to the JSON patch schema defined in RFC 6902(https://datatracker.ietf.org/doc/html/rfc6902#section-3)
      - `data` union — Data payload to embed within the data update (instead of having the client fetch it from the url).
        - JSONPatchAction[]
          - `op` string, required — patch action to perform
          - `path` string, required — target location in modified json
          - `value` unknown
          - `from` string — source location in json
        - unknown[]
          - unknown
        - object
      - `periodic_update_interval` number — Polling interval to refresh data from data source
  - `id` string, uuid, required — Unique id of the ScopeConfig
  - `organization_id` string, uuid, required — Unique id of the organization that the ScopeConfig belongs to.
  - `project_id` string, uuid, required — Unique id of the project that the ScopeConfig belongs to.
  - `environment_id` string, uuid, required — Unique id of the environment that the ScopeConfig belongs to.
  - `created_at` string, date-time, required — Date and time when the ScopeConfig was created (ISO_8601 format).
  - `updated_at` string, date-time, required — Date and time when the ScopeConfig was last updated/modified (ISO_8601 format).

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.dev/permit/apis/permit-io-api.md) · [All operations](https://skmtc.dev/permit/apis/permit-io-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/permit/permit-io-api/revisions/853e35d93523/schema)
