curl --request PATCH \
--url https://api.example.com/api/v1/teams/{team_id}/integrations/{credential_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"extra_data": {}
}
'import requests
url = "https://api.example.com/api/v1/teams/{team_id}/integrations/{credential_id}"
payload = { "extra_data": {} }
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({extra_data: {}})
};
fetch('https://api.example.com/api/v1/teams/{team_id}/integrations/{credential_id}', 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://api.example.com/api/v1/teams/{team_id}/integrations/{credential_id}",
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([
'extra_data' => [
]
]),
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://api.example.com/api/v1/teams/{team_id}/integrations/{credential_id}"
payload := strings.NewReader("{\n \"extra_data\": {}\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://api.example.com/api/v1/teams/{team_id}/integrations/{credential_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"extra_data\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v1/teams/{team_id}/integrations/{credential_id}")
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 \"extra_data\": {}\n}"
response = http.request(request)
puts response.read_body{
"provider": "<string>",
"status": "<string>",
"account_name": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Patch Credential
Edit a team’s stored integration credential post-onboarding.
Required for credential rotation (token expired), repo URL drift
(the 2026-06-05 bleshinsky → AITaskerCo GitHub org transfer
left 5 Keystatic credentials pointing at the old URL — the
operator workaround was 5 raw SQL UPDATEs), and
content_paths updates without re-creating the row.
On success, writes a TeamAuditLog row with
action_type='integration_credential_updated' and a sanitized
diff (field NAMES only — token VALUES are never logged). No-op
patches (every key equals stored) skip the audit write.
curl --request PATCH \
--url https://api.example.com/api/v1/teams/{team_id}/integrations/{credential_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"extra_data": {}
}
'import requests
url = "https://api.example.com/api/v1/teams/{team_id}/integrations/{credential_id}"
payload = { "extra_data": {} }
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({extra_data: {}})
};
fetch('https://api.example.com/api/v1/teams/{team_id}/integrations/{credential_id}', 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://api.example.com/api/v1/teams/{team_id}/integrations/{credential_id}",
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([
'extra_data' => [
]
]),
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://api.example.com/api/v1/teams/{team_id}/integrations/{credential_id}"
payload := strings.NewReader("{\n \"extra_data\": {}\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://api.example.com/api/v1/teams/{team_id}/integrations/{credential_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"extra_data\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v1/teams/{team_id}/integrations/{credential_id}")
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 \"extra_data\": {}\n}"
response = http.request(request)
puts response.read_body{
"provider": "<string>",
"status": "<string>",
"account_name": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
Partial update to a team's stored IntegrationCredential.
Wire format
All fields are optional. Omitted fields keep their stored value.
The shape mirrors RFC 7396 (JSON Merge Patch) at the
extra_data level with two AITasker-specific tweaks:
- Sensitive fields preserved on blank. If a sensitive field
(
github_tokenfor Keystatic,app_password/application_passwordfor WordPress) is sent as an empty string ornull, the stored ENCRYPTED value is kept (post- migratione8b3encsec01the secret lives inaccess_token_encrypted, notextra_data). This pairs with the masked-placeholder UX on the edit form: stored secrets render asplaceholder="••••"and only submit when the user retypes them. Non-blank sensitive values are AES-256-GCM encrypted and written to the encrypted column; they NEVER land inextra_data. - Top-level shallow merge. Nested structures (e.g.
Keystatic's
content_pathsdict) are REPLACED wholesale when the patch contains them. Edit-form convention: post the full nested dict for any structured field touched.
See team_integration_service.merge_credential_extra_data for
the merge rules + encryption side-channel and unit tests.
Auth
PATCH requires team ownership — same gate as POST /config.
A credential_id that doesn't belong to the caller's team
returns 404, not 403, to prevent enumeration of other teams'
credential ids.
Was this page helpful?