Provision or reconcile the authenticated user's managed gateway key
curl --request POST \
--url https://harness.example.com/gateway/key/ensure \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"manual": false
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({manual: false})
};
fetch('https://harness.example.com/gateway/key/ensure', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://harness.example.com/gateway/key/ensure"
payload = { "manual": False }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"enabled": true,
"email": "jsmith@example.com",
"status": "ready",
"alias": "<string>",
"external_id": "<string>",
"expires_at": "2023-11-07T05:31:56Z",
"last_reconciled_at": "2023-11-07T05:31:56Z",
"error": "<string>",
"invalidated_at": "2023-11-07T05:31:56Z",
"invalidation_reason": "<string>",
"next_retry_at": "2023-11-07T05:31:56Z"
}Gateway
Provision or reconcile the authenticated user's managed gateway key
Invokes the configured built-in or executable provisioner when the credential is missing, stale, failed previously, or its configuration or policy revision changed. Manual retries bypass provisioning backoff.
POST
/
gateway
/
key
/
ensure
Provision or reconcile the authenticated user's managed gateway key
curl --request POST \
--url https://harness.example.com/gateway/key/ensure \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"manual": false
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({manual: false})
};
fetch('https://harness.example.com/gateway/key/ensure', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://harness.example.com/gateway/key/ensure"
payload = { "manual": False }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"enabled": true,
"email": "jsmith@example.com",
"status": "ready",
"alias": "<string>",
"external_id": "<string>",
"expires_at": "2023-11-07T05:31:56Z",
"last_reconciled_at": "2023-11-07T05:31:56Z",
"error": "<string>",
"invalidated_at": "2023-11-07T05:31:56Z",
"invalidation_reason": "<string>",
"next_retry_at": "2023-11-07T05:31:56Z"
}Authorizations
OAuth 2.0 access token obtained through RFC 8628 at /api/auth/device/code and /api/auth/oauth2/token. The API enforces governance:read, session:write, and client-status:write as appropriate.
Body
application/json
Explicitly retry an errored or invalid credential and bypass recovery cooldown.
Response
Current managed gateway-key status
Available options:
ready, missing, invalid, recovering, error Opaque gateway identifier, never the credential value.
