Skip to content

Move a secret to a different folder

Request

OPA roles:
  • end_user

Moves a single secret to a different folder. The destination folder can be in the same project, in a different project within the same resource group, or in a different resource group.

The user must have the following permissions to move a secret:

  • secret_reveal and secret_delete on the source secret
  • secret_create on the destination folder

Notes: If a folder requires unmet conditions such as MFA or access requests, an HTTP 403 error is returned and the response body includes the required access methods. Bulk moves aren't yet supported.

Security
bearerAuth
Path
team_namestringrequired

The name of your team

Bodyapplication/jsonrequired
secretsArray of objects, = 1 items(MoveSecretRequestItem)required

The details of the secret to move. Only one secret can be moved at a time.

POST
/v1/teams/{team_name}/secrets/move
curl -i -X POST \
  'https://{org_name}.pam.okta.com/v1/teams/{team_name}/secrets/move' \
  -H 'Authorization: Bearer <YOUR_JWT_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "secrets": [
      {
        "id": "a3f1c2d4-5e6b-7890-abcd-ef1234567890",
        "destination_folder_id": "b4e2d3c5-6f7a-8901-bcde-fa2345678901"
      }
    ]
  }'

Responses

Secret moved successfully

Bodyapplication/json
idstring, (uuid)read-onlyrequired

Unique identifier of the moved secret in its new location

Response
{ "id": "a3f1c2d4-5e6b-7890-abcd-ef1234567890" }