URL:
https://<notebookserveradmin>/notebooks/secrets/create
Methods:
POST
Required Capability:
Administrator or Create and Edit
Version Introduced:
12.1

Description

The Create Secret operation creates a notebook secret that can be securely accessed from ArcGIS Notebook Server notebooks. Secrets can be used to store sensitive information, like API keys and connection strings, without exposing them directly in notebook code.

The operation creates a new secret in the Notebook Server secret store. The ArcGIS Notebooks editor provides a user interface for creating notebook secrets and is the recommended method for creating secrets. Once created, a secret can be accessed from a notebook using the get_secret method in the ArcGIS API for Python.

Request parameters

ParameterDetails

secretName

(Required)

The unique name of the secret. Secret names must be unique within the notebook secret store and can contain up to 255 characters.

secretValue

(Required)

The value stored in the secret. Secret values can contain up to 5000 characters.

f

(Optional)

The response format. The default response format is html .

Values: html | json | pjson

Example usage

Use dark colors for code blocksCopy
1
2
3
POST /notebookserver/admin/notebooks/secrets/create HTTP/1.1
Host: notebookserver.example.com
secretName=weatherApiKey&secretValue=abc123-example-api-key&f=json&token=<ACCESS_TOKEN>

JSON Response syntax

Use dark colors for code blocksCopy
1
{"status": "success"|"failure"}

JSON Response example

Use dark colors for code blocksCopy
1
{"status": "success"}

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.