curl --request PATCH \
--url https://us.infisical.com/api/v3/secrets/raw/{secretName} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"environment": "<string>",
"workspaceId": "<string>",
"projectSlug": "<string>",
"secretValue": "<string>",
"secretPath": "/",
"skipMultilineEncoding": true,
"type": "shared",
"tagIds": [
"<string>"
],
"metadata": {},
"secretMetadata": [
{
"key": "<string>",
"value": "",
"isEncrypted": false
}
],
"secretReminderNote": "<string>",
"secretReminderRepeatDays": 123,
"secretReminderRecipients": [
"<string>"
],
"newSecretName": "<string>",
"secretComment": "<string>"
}
'import requests
url = "https://us.infisical.com/api/v3/secrets/raw/{secretName}"
payload = {
"environment": "<string>",
"workspaceId": "<string>",
"projectSlug": "<string>",
"secretValue": "<string>",
"secretPath": "/",
"skipMultilineEncoding": True,
"type": "shared",
"tagIds": ["<string>"],
"metadata": {},
"secretMetadata": [
{
"key": "<string>",
"value": "",
"isEncrypted": False
}
],
"secretReminderNote": "<string>",
"secretReminderRepeatDays": 123,
"secretReminderRecipients": ["<string>"],
"newSecretName": "<string>",
"secretComment": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
environment: '<string>',
workspaceId: '<string>',
projectSlug: '<string>',
secretValue: '<string>',
secretPath: '/',
skipMultilineEncoding: true,
type: 'shared',
tagIds: ['<string>'],
metadata: {},
secretMetadata: [{key: '<string>', value: '', isEncrypted: false}],
secretReminderNote: '<string>',
secretReminderRepeatDays: 123,
secretReminderRecipients: ['<string>'],
newSecretName: '<string>',
secretComment: '<string>'
})
};
fetch('https://us.infisical.com/api/v3/secrets/raw/{secretName}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://us.infisical.com/api/v3/secrets/raw/{secretName}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'environment' => '<string>',
'workspaceId' => '<string>',
'projectSlug' => '<string>',
'secretValue' => '<string>',
'secretPath' => '/',
'skipMultilineEncoding' => true,
'type' => 'shared',
'tagIds' => [
'<string>'
],
'metadata' => [
],
'secretMetadata' => [
[
'key' => '<string>',
'value' => '',
'isEncrypted' => false
]
],
'secretReminderNote' => '<string>',
'secretReminderRepeatDays' => 123,
'secretReminderRecipients' => [
'<string>'
],
'newSecretName' => '<string>',
'secretComment' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://us.infisical.com/api/v3/secrets/raw/{secretName}"
payload := strings.NewReader("{\n \"environment\": \"<string>\",\n \"workspaceId\": \"<string>\",\n \"projectSlug\": \"<string>\",\n \"secretValue\": \"<string>\",\n \"secretPath\": \"/\",\n \"skipMultilineEncoding\": true,\n \"type\": \"shared\",\n \"tagIds\": [\n \"<string>\"\n ],\n \"metadata\": {},\n \"secretMetadata\": [\n {\n \"key\": \"<string>\",\n \"value\": \"\",\n \"isEncrypted\": false\n }\n ],\n \"secretReminderNote\": \"<string>\",\n \"secretReminderRepeatDays\": 123,\n \"secretReminderRecipients\": [\n \"<string>\"\n ],\n \"newSecretName\": \"<string>\",\n \"secretComment\": \"<string>\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://us.infisical.com/api/v3/secrets/raw/{secretName}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"environment\": \"<string>\",\n \"workspaceId\": \"<string>\",\n \"projectSlug\": \"<string>\",\n \"secretValue\": \"<string>\",\n \"secretPath\": \"/\",\n \"skipMultilineEncoding\": true,\n \"type\": \"shared\",\n \"tagIds\": [\n \"<string>\"\n ],\n \"metadata\": {},\n \"secretMetadata\": [\n {\n \"key\": \"<string>\",\n \"value\": \"\",\n \"isEncrypted\": false\n }\n ],\n \"secretReminderNote\": \"<string>\",\n \"secretReminderRepeatDays\": 123,\n \"secretReminderRecipients\": [\n \"<string>\"\n ],\n \"newSecretName\": \"<string>\",\n \"secretComment\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://us.infisical.com/api/v3/secrets/raw/{secretName}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"environment\": \"<string>\",\n \"workspaceId\": \"<string>\",\n \"projectSlug\": \"<string>\",\n \"secretValue\": \"<string>\",\n \"secretPath\": \"/\",\n \"skipMultilineEncoding\": true,\n \"type\": \"shared\",\n \"tagIds\": [\n \"<string>\"\n ],\n \"metadata\": {},\n \"secretMetadata\": [\n {\n \"key\": \"<string>\",\n \"value\": \"\",\n \"isEncrypted\": false\n }\n ],\n \"secretReminderNote\": \"<string>\",\n \"secretReminderRepeatDays\": 123,\n \"secretReminderRecipients\": [\n \"<string>\"\n ],\n \"newSecretName\": \"<string>\",\n \"secretComment\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"secret": {
"id": "<string>",
"_id": "<string>",
"workspace": "<string>",
"environment": "<string>",
"version": 123,
"type": "<string>",
"secretKey": "<string>",
"secretValue": "<string>",
"secretComment": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"secretValueHidden": true,
"secretReminderNote": "<string>",
"secretReminderRepeatDays": 123,
"skipMultilineEncoding": false,
"actor": {
"actorId": "<string>",
"actorType": "<string>",
"name": "<string>",
"membershipId": "<string>",
"groupId": "<string>"
},
"isRotatedSecret": true,
"rotationId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
}{
"reqId": "<string>",
"statusCode": 400,
"message": "<string>",
"error": "<string>",
"details": "<unknown>"
}{
"reqId": "<string>",
"statusCode": 401,
"message": "<string>",
"error": "<string>"
}{
"reqId": "<string>",
"statusCode": 403,
"message": "<string>",
"error": "<string>",
"details": "<unknown>"
}{
"reqId": "<string>",
"statusCode": 404,
"message": "<string>",
"error": "<string>"
}{
"reqId": "<string>",
"statusCode": 422,
"error": "<string>",
"message": "<unknown>"
}{
"reqId": "<string>",
"statusCode": 500,
"message": "<string>",
"error": "<string>"
}Update
Update secret
curl --request PATCH \
--url https://us.infisical.com/api/v3/secrets/raw/{secretName} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"environment": "<string>",
"workspaceId": "<string>",
"projectSlug": "<string>",
"secretValue": "<string>",
"secretPath": "/",
"skipMultilineEncoding": true,
"type": "shared",
"tagIds": [
"<string>"
],
"metadata": {},
"secretMetadata": [
{
"key": "<string>",
"value": "",
"isEncrypted": false
}
],
"secretReminderNote": "<string>",
"secretReminderRepeatDays": 123,
"secretReminderRecipients": [
"<string>"
],
"newSecretName": "<string>",
"secretComment": "<string>"
}
'import requests
url = "https://us.infisical.com/api/v3/secrets/raw/{secretName}"
payload = {
"environment": "<string>",
"workspaceId": "<string>",
"projectSlug": "<string>",
"secretValue": "<string>",
"secretPath": "/",
"skipMultilineEncoding": True,
"type": "shared",
"tagIds": ["<string>"],
"metadata": {},
"secretMetadata": [
{
"key": "<string>",
"value": "",
"isEncrypted": False
}
],
"secretReminderNote": "<string>",
"secretReminderRepeatDays": 123,
"secretReminderRecipients": ["<string>"],
"newSecretName": "<string>",
"secretComment": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
environment: '<string>',
workspaceId: '<string>',
projectSlug: '<string>',
secretValue: '<string>',
secretPath: '/',
skipMultilineEncoding: true,
type: 'shared',
tagIds: ['<string>'],
metadata: {},
secretMetadata: [{key: '<string>', value: '', isEncrypted: false}],
secretReminderNote: '<string>',
secretReminderRepeatDays: 123,
secretReminderRecipients: ['<string>'],
newSecretName: '<string>',
secretComment: '<string>'
})
};
fetch('https://us.infisical.com/api/v3/secrets/raw/{secretName}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://us.infisical.com/api/v3/secrets/raw/{secretName}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'environment' => '<string>',
'workspaceId' => '<string>',
'projectSlug' => '<string>',
'secretValue' => '<string>',
'secretPath' => '/',
'skipMultilineEncoding' => true,
'type' => 'shared',
'tagIds' => [
'<string>'
],
'metadata' => [
],
'secretMetadata' => [
[
'key' => '<string>',
'value' => '',
'isEncrypted' => false
]
],
'secretReminderNote' => '<string>',
'secretReminderRepeatDays' => 123,
'secretReminderRecipients' => [
'<string>'
],
'newSecretName' => '<string>',
'secretComment' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://us.infisical.com/api/v3/secrets/raw/{secretName}"
payload := strings.NewReader("{\n \"environment\": \"<string>\",\n \"workspaceId\": \"<string>\",\n \"projectSlug\": \"<string>\",\n \"secretValue\": \"<string>\",\n \"secretPath\": \"/\",\n \"skipMultilineEncoding\": true,\n \"type\": \"shared\",\n \"tagIds\": [\n \"<string>\"\n ],\n \"metadata\": {},\n \"secretMetadata\": [\n {\n \"key\": \"<string>\",\n \"value\": \"\",\n \"isEncrypted\": false\n }\n ],\n \"secretReminderNote\": \"<string>\",\n \"secretReminderRepeatDays\": 123,\n \"secretReminderRecipients\": [\n \"<string>\"\n ],\n \"newSecretName\": \"<string>\",\n \"secretComment\": \"<string>\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://us.infisical.com/api/v3/secrets/raw/{secretName}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"environment\": \"<string>\",\n \"workspaceId\": \"<string>\",\n \"projectSlug\": \"<string>\",\n \"secretValue\": \"<string>\",\n \"secretPath\": \"/\",\n \"skipMultilineEncoding\": true,\n \"type\": \"shared\",\n \"tagIds\": [\n \"<string>\"\n ],\n \"metadata\": {},\n \"secretMetadata\": [\n {\n \"key\": \"<string>\",\n \"value\": \"\",\n \"isEncrypted\": false\n }\n ],\n \"secretReminderNote\": \"<string>\",\n \"secretReminderRepeatDays\": 123,\n \"secretReminderRecipients\": [\n \"<string>\"\n ],\n \"newSecretName\": \"<string>\",\n \"secretComment\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://us.infisical.com/api/v3/secrets/raw/{secretName}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"environment\": \"<string>\",\n \"workspaceId\": \"<string>\",\n \"projectSlug\": \"<string>\",\n \"secretValue\": \"<string>\",\n \"secretPath\": \"/\",\n \"skipMultilineEncoding\": true,\n \"type\": \"shared\",\n \"tagIds\": [\n \"<string>\"\n ],\n \"metadata\": {},\n \"secretMetadata\": [\n {\n \"key\": \"<string>\",\n \"value\": \"\",\n \"isEncrypted\": false\n }\n ],\n \"secretReminderNote\": \"<string>\",\n \"secretReminderRepeatDays\": 123,\n \"secretReminderRecipients\": [\n \"<string>\"\n ],\n \"newSecretName\": \"<string>\",\n \"secretComment\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"secret": {
"id": "<string>",
"_id": "<string>",
"workspace": "<string>",
"environment": "<string>",
"version": 123,
"type": "<string>",
"secretKey": "<string>",
"secretValue": "<string>",
"secretComment": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"secretValueHidden": true,
"secretReminderNote": "<string>",
"secretReminderRepeatDays": 123,
"skipMultilineEncoding": false,
"actor": {
"actorId": "<string>",
"actorType": "<string>",
"name": "<string>",
"membershipId": "<string>",
"groupId": "<string>"
},
"isRotatedSecret": true,
"rotationId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
}{
"reqId": "<string>",
"statusCode": 400,
"message": "<string>",
"error": "<string>",
"details": "<unknown>"
}{
"reqId": "<string>",
"statusCode": 401,
"message": "<string>",
"error": "<string>"
}{
"reqId": "<string>",
"statusCode": 403,
"message": "<string>",
"error": "<string>",
"details": "<unknown>"
}{
"reqId": "<string>",
"statusCode": 404,
"message": "<string>",
"error": "<string>"
}{
"reqId": "<string>",
"statusCode": 422,
"error": "<string>",
"message": "<unknown>"
}{
"reqId": "<string>",
"statusCode": 500,
"message": "<string>",
"error": "<string>"
}Authorizations
An access token in Infisical
Path Parameters
The name of the secret to update.
1Body
The slug of the environment where the secret is located.
The ID of the project to update the secret in.
The slug of the project to update the secret in.
The new value of the secret.
The default path for secrets to update or upsert, if not provided in the secret details.
Skip multiline encoding for the secret value.
The type of the secret to update.
shared, personal The ID of the tags to be attached to the updated secret.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Note to be attached in notification email.
1024Interval for secret rotation notifications, measured in days.
An array of user IDs that will receive the reminder email. If not specified, all project members will receive the reminder email.
The new name for the secret.
1Update comment to the secret.
Response
Default Response
- Option 1
- Option 2
Show child attributes
Show child attributes
Was this page helpful?