---
title: "Create OpalScript"
method: POST
path: "/opal-scripts"
tags: ["opal-scripts"]
---

# Create OpalScript

`POST /opal-scripts`

## Request

- Base URL: `https://api.opal.dev/v1`
- URL: `https://api.opal.dev/v1/opal-scripts`
- Auth: HTTP bearer

Creates a new `OpalScript`.

## Request body

- CreateOpalScriptInfo: Information for creating an OpalScript.
  - `name` string, required: The name of the OpalScript.
  - `script_type` 'REQUEST_REVIEW' | 'REQUEST_DELEGATION_CONDITION' | 'CONTEXT_PROVIDER' | 'REQUEST_CONFIGURATION_CONDITION', required: The kind of automation an OpalScript performs.
  - `script` string, required: The source of the OpalScript.
  - `owner_id` string, uuid: The owner of the service user Opal provisions for a `REQUEST_REVIEW` script. Required for that script type and ignored for the others, which have no reviewer identity.

## Response `200`

The created OpalScript.

- OpalScript: # OpalScript Object ### Description The `OpalScript` object represents an OpalScript: a Starlark script that automates part of Opal's access lifecycle.
  - `opal_script_id` string, uuid, required: The ID of the OpalScript.
  - `name` string, required: The name of the OpalScript.
  - `script_type` 'REQUEST_REVIEW' | 'REQUEST_DELEGATION_CONDITION' | 'CONTEXT_PROVIDER' | 'REQUEST_CONFIGURATION_CONDITION', required: The kind of automation an OpalScript performs.
  - `script` string, required: The source of the OpalScript's latest version.
  - `version` integer, required: The version number of the OpalScript's latest version.
  - `updated_at` string, date-time: The date the OpalScript was last updated.

## Changes

- **2026-10-21** `28c861b91406`: 1 warning, 1 info
  - added the new `REQUEST_CONFIGURATION_CONDITION` enum value to the `script_type` response property for the response status `200`
  - added the new `REQUEST_CONFIGURATION_CONDITION` enum value to the request property `script_type`
- **2026-10-08** `5d8d995bc79d`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/opal/apis/opal-api/changes/opal-scripts/post.md)

---

[API](https://skmtc.dev/opal/apis/opal-api.md) - [All operations](https://skmtc.dev/opal/apis/opal-api/llms.txt) - [OpenAPI document](https://skmtc.dev/opal/apis/opal-api/revisions/e7877ea96eab?raw)
