Rotate a saved scan account
curl --request PATCH \
--url https://api.trycomp.ai/v1/security-penetration-tests/accounts/{id} \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"value": "<string>"
}
'const options = {
method: 'PATCH',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({value: '<string>'})
};
fetch('https://api.trycomp.ai/v1/security-penetration-tests/accounts/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.trycomp.ai/v1/security-penetration-tests/accounts/{id}"
payload = { "value": "<string>" }
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text){
"id": "psa_abc123",
"label": "auditor",
"kind": "cookie",
"createdAt": "2023-11-07T05:31:56Z",
"role": "<string>",
"tenant": "<string>",
"lastVerifiedAt": "2023-11-07T05:31:56Z",
"revokedAt": "2023-11-07T05:31:56Z"
}Security Penetration Tests
Rotate a saved scan account | Comp AI API
Replaces a saved account credential or relabels it, probing the result against targetUrl first and recording lastVerifiedAt. Use it when a Cookie or token.
PATCH
/
v1
/
security-penetration-tests
/
accounts
/
{id}
Rotate a saved scan account
curl --request PATCH \
--url https://api.trycomp.ai/v1/security-penetration-tests/accounts/{id} \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"value": "<string>"
}
'const options = {
method: 'PATCH',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({value: '<string>'})
};
fetch('https://api.trycomp.ai/v1/security-penetration-tests/accounts/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.trycomp.ai/v1/security-penetration-tests/accounts/{id}"
payload = { "value": "<string>" }
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text){
"id": "psa_abc123",
"label": "auditor",
"kind": "cookie",
"createdAt": "2023-11-07T05:31:56Z",
"role": "<string>",
"tenant": "<string>",
"lastVerifiedAt": "2023-11-07T05:31:56Z",
"revokedAt": "2023-11-07T05:31:56Z"
}Headers
Body
application/json
Kind of the account already stored. Optional, and only an assertion: it must equal the kind the account was saved with, because changing an account's kind in place is not supported — save a new account instead. Material must match that kind: 'cookie' takes value, 'headers' takes headers.
Available options:
cookie, headers Response
Updated scan account
Was this page helpful?

