Create Secret V2

Create Secret V2

Creates a secret

Request
URI
POST
https://vra-interop-222-139.lvn.broadcom.net/platform/api/secrets
COPY
Query Parameters
string
apiVersion
Optional

The version of the API in yyyy-MM-dd format. For versioning information refer to /platform/api/about.

apiVersion example
2023-01-01

Request Body

The variable to create

SecretsV2Specification of type(s) application/json
Required

Show optional properties

{
    "name": "my-name",
    "value": "my-value"
}
{
    "name": "my-name",
    "description": "string",
    "value": "my-value",
    "projectIdsToAdd": [
        "string"
    ],
    "orgScoped": false
}
string
name
Required
Constraints: minLength: 0 maxLength: 255

A human-friendly name used as an identifier for a secret. Secret name should not contain special characters.

string
description
Optional

A human-friendly description.

string
value
Required
Constraints: minLength: 0 maxLength: 131072

The value of secret.

array of string
projectIdsToAdd
Optional

A list of project IDs to add this secret to.

boolean
orgScoped
Optional

This boolean checks if the secret is org scope or project scope

Authentication
This operation uses the following authentication methods.
Responses
201

'Created' with the newly created secret

Returns Secret of type(s) application/json
"Secret Object"
string
orgId
Optional

The id of organization the secret belongs to. Can not be modified, only available in response.

string
projectId
Optional

The id of project the secret belongs to. Provided during create, can not be updated.

array of string
projectIds
Optional

IDs of projects, associated with the secret. This is not a full list and is limited to 10 projects.

string
projectName
Optional

The name of project the secret belongs to.

string
id
Optional

The unique identifier of a secret.

string
name
Required
Constraints: minLength: 0 maxLength: 255

A human-friendly name used as an identifier for a secret.

string
description
Optional

A human-friendly description.

string
value
Required
Constraints: minLength: 0 maxLength: 131072

The value of secret.

boolean
orgScoped
Optional

To check if the secret is a org scope or project scope

string
createdBy
Optional

The user that created this secret. Can not be modified. only available in response.

string
updatedBy
Optional

The user that last updated this secret. Can not be modified. only available in response.

string
createdAt
Optional

Date when the secret was created. The date is in ISO 8601 with time zone Can not be modified. only available in response.

string
updatedAt
Optional

Date when the secret was last updated. The date is in ISO 8601 with time zone. Can not be modified. only available in response.


401

Unauthorized, the user is not authenticated

Operation doesn't return any data structure

403

Forbidden, the user lacks permissions

Operation doesn't return any data structure

409

'Conflict' if secret already exists

Operation doesn't return any data structure

Code Samples
COPY
                    curl -X POST -H 'Authorization: <value>' -H 'Content-Type: application/json' -d '{"name:"string","value:"string"}' https://{api_host}/platform/api/secrets