Skip to main content
POST
Create OpalScript

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json

Information for creating an OpalScript.

name
string
required

The name of the OpalScript.

Example:

"MFA check"

script_type
enum<string>
required

The kind of automation an OpalScript performs.

Available options:
REQUEST_REVIEW,
REQUEST_DELEGATION_CONDITION,
CONTEXT_PROVIDER
Example:

"REQUEST_REVIEW"

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.

Example:

"7c86c85d-0651-43e2-a748-d69d658418e8"

Response

200 - application/json

The created 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.

Example:

"32acc112-21ff-4669-91c2-21e27683eaa1"

name
string
required

The name of the OpalScript.

Example:

"MFA check"

script_type
enum<string>
required

The kind of automation an OpalScript performs.

Available options:
REQUEST_REVIEW,
REQUEST_DELEGATION_CONDITION,
CONTEXT_PROVIDER
Example:

"REQUEST_REVIEW"

script
string
required

The source of the OpalScript's latest version.

version
integer
required

The version number of the OpalScript's latest version.

Example:

3

updated_at
string<date-time>

The date the OpalScript was last updated.

Last modified on October 8, 2026