curl --request PATCH \
--url https://eu1.api.matillion.com/dpc/v1/agents/{agentId}/secrets \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "my-secret",
"value": {
"password": "P@ssw0rd123"
}
}
'import requests
url = "https://eu1.api.matillion.com/dpc/v1/agents/{agentId}/secrets"
payload = {
"name": "my-secret",
"value": { "password": "P@ssw0rd123" }
}
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({name: 'my-secret', value: {password: 'P@ssw0rd123'}})
};
fetch('https://eu1.api.matillion.com/dpc/v1/agents/{agentId}/secrets', 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://eu1.api.matillion.com/dpc/v1/agents/{agentId}/secrets",
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([
'name' => 'my-secret',
'value' => [
'password' => 'P@ssw0rd123'
]
]),
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://eu1.api.matillion.com/dpc/v1/agents/{agentId}/secrets"
payload := strings.NewReader("{\n \"name\": \"my-secret\",\n \"value\": {\n \"password\": \"P@ssw0rd123\"\n }\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://eu1.api.matillion.com/dpc/v1/agents/{agentId}/secrets")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"my-secret\",\n \"value\": {\n \"password\": \"P@ssw0rd123\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://eu1.api.matillion.com/dpc/v1/agents/{agentId}/secrets")
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 \"name\": \"my-secret\",\n \"value\": {\n \"password\": \"P@ssw0rd123\"\n }\n}"
response = http.request(request)
puts response.read_body{
"detail": "<string>",
"instance": "<string>",
"status": 123,
"title": "<string>",
"type": "<string>",
"violations": [
"<string>"
]
}{
"detail": "<string>",
"instance": "<string>",
"status": 123,
"title": "<string>",
"type": "<string>",
"violations": [
"<string>"
]
}{
"detail": "<string>",
"instance": "<string>",
"status": 123,
"title": "<string>",
"type": "<string>",
"violations": [
"<string>"
]
}{
"detail": "<string>",
"instance": "<string>",
"status": 123,
"title": "<string>",
"type": "<string>",
"violations": [
"<string>"
]
}{
"detail": "<string>",
"instance": "<string>",
"status": 123,
"title": "<string>",
"type": "<string>",
"violations": [
"<string>"
]
}{
"detail": "<string>",
"instance": "<string>",
"status": 123,
"title": "<string>",
"type": "<string>",
"violations": [
"<string>"
]
}Update an agent secret's value
Replaces the value of an existing secret in the Matillion Hosted Customer Vault (MHCV) associated with the given Agent, in place. The secret is identified by name in the request body. The secret must already exist: an unknown name returns 404 and nothing is created. The new value replaces the whole stored value, fields are not merged. Resolver references and the connections that use the secret are unaffected, so a rotated value is picked up without modifying them.
Supported only for Maia Hosted Runners. Matillion does not change secrets held in customer-hosted secret managers (AWS, Azure, Snowflake, GCP), so if agentId identifies a customer-hosted runner the request is not supported: rotate the secret directly in your own secret manager instead.
curl --request PATCH \
--url https://eu1.api.matillion.com/dpc/v1/agents/{agentId}/secrets \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "my-secret",
"value": {
"password": "P@ssw0rd123"
}
}
'import requests
url = "https://eu1.api.matillion.com/dpc/v1/agents/{agentId}/secrets"
payload = {
"name": "my-secret",
"value": { "password": "P@ssw0rd123" }
}
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({name: 'my-secret', value: {password: 'P@ssw0rd123'}})
};
fetch('https://eu1.api.matillion.com/dpc/v1/agents/{agentId}/secrets', 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://eu1.api.matillion.com/dpc/v1/agents/{agentId}/secrets",
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([
'name' => 'my-secret',
'value' => [
'password' => 'P@ssw0rd123'
]
]),
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://eu1.api.matillion.com/dpc/v1/agents/{agentId}/secrets"
payload := strings.NewReader("{\n \"name\": \"my-secret\",\n \"value\": {\n \"password\": \"P@ssw0rd123\"\n }\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://eu1.api.matillion.com/dpc/v1/agents/{agentId}/secrets")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"my-secret\",\n \"value\": {\n \"password\": \"P@ssw0rd123\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://eu1.api.matillion.com/dpc/v1/agents/{agentId}/secrets")
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 \"name\": \"my-secret\",\n \"value\": {\n \"password\": \"P@ssw0rd123\"\n }\n}"
response = http.request(request)
puts response.read_body{
"detail": "<string>",
"instance": "<string>",
"status": 123,
"title": "<string>",
"type": "<string>",
"violations": [
"<string>"
]
}{
"detail": "<string>",
"instance": "<string>",
"status": 123,
"title": "<string>",
"type": "<string>",
"violations": [
"<string>"
]
}{
"detail": "<string>",
"instance": "<string>",
"status": 123,
"title": "<string>",
"type": "<string>",
"violations": [
"<string>"
]
}{
"detail": "<string>",
"instance": "<string>",
"status": 123,
"title": "<string>",
"type": "<string>",
"violations": [
"<string>"
]
}{
"detail": "<string>",
"instance": "<string>",
"status": 123,
"title": "<string>",
"type": "<string>",
"violations": [
"<string>"
]
}{
"detail": "<string>",
"instance": "<string>",
"status": 123,
"title": "<string>",
"type": "<string>",
"violations": [
"<string>"
]
}Body
Response
The secret's value was replaced.
Was this page helpful?