curl --request POST \
--url https://api.anchorage-staging.com/v4/approvers/keys \
--header 'Api-Access-Key: <api-key>' \
--header 'Api-Signature: <api-signature>' \
--header 'Api-Timestamp: <api-timestamp>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"class": "api_key",
"apiKeyId": "<string>",
"publicKey": "<string>",
"label": "<string>",
"approvalGroupId": "3486b413-93d3-4447-afce-2b9c9dc34a32"
}
'import requests
url = "https://api.anchorage-staging.com/v4/approvers/keys"
payload = {
"class": "api_key",
"apiKeyId": "<string>",
"publicKey": "<string>",
"label": "<string>",
"approvalGroupId": "3486b413-93d3-4447-afce-2b9c9dc34a32"
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"Api-Signature": "<api-signature>",
"Api-Timestamp": "<api-timestamp>",
"Api-Access-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
'Api-Signature': '<api-signature>',
'Api-Timestamp': '<api-timestamp>',
'Api-Access-Key': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
class: 'api_key',
apiKeyId: '<string>',
publicKey: '<string>',
label: '<string>',
approvalGroupId: '3486b413-93d3-4447-afce-2b9c9dc34a32'
})
};
fetch('https://api.anchorage-staging.com/v4/approvers/keys', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"data": {
"id": "3486b413-93d3-4447-afce-2b9c9dc34a32",
"status": "ACTIVE",
"action": {
"id": "3486b413-93d3-4447-afce-2b9c9dc34a32",
"reason": "<string>"
},
"createdAt": "2019-01-02T12:34:56.000Z"
}
}{
"message": "Missing required field 'amount'."
}{
"message": "Missing required field 'amount'."
}{
"message": "Missing required field 'amount'."
}{
"message": "Missing required field 'amount'."
}{
"message": "Missing required field 'amount'."
}{
"message": "Missing required field 'amount'."
}Register an approval key
Nominate an existing Anchorage Digital API key as an approver for the caller’s organization, into the
ACTIVE approval group named by approvalGroupId when one is given; the caller’s key must hold
MANAGE_IAAS_POLICY_ENGINE. Registration is ungoverned: the key is ACTIVE at once and counts
toward its group from then on. A key belongs to one group for its whole life, and a key registered
without a group never joins one.
curl --request POST \
--url https://api.anchorage-staging.com/v4/approvers/keys \
--header 'Api-Access-Key: <api-key>' \
--header 'Api-Signature: <api-signature>' \
--header 'Api-Timestamp: <api-timestamp>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"class": "api_key",
"apiKeyId": "<string>",
"publicKey": "<string>",
"label": "<string>",
"approvalGroupId": "3486b413-93d3-4447-afce-2b9c9dc34a32"
}
'import requests
url = "https://api.anchorage-staging.com/v4/approvers/keys"
payload = {
"class": "api_key",
"apiKeyId": "<string>",
"publicKey": "<string>",
"label": "<string>",
"approvalGroupId": "3486b413-93d3-4447-afce-2b9c9dc34a32"
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"Api-Signature": "<api-signature>",
"Api-Timestamp": "<api-timestamp>",
"Api-Access-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
'Api-Signature': '<api-signature>',
'Api-Timestamp': '<api-timestamp>',
'Api-Access-Key': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
class: 'api_key',
apiKeyId: '<string>',
publicKey: '<string>',
label: '<string>',
approvalGroupId: '3486b413-93d3-4447-afce-2b9c9dc34a32'
})
};
fetch('https://api.anchorage-staging.com/v4/approvers/keys', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"data": {
"id": "3486b413-93d3-4447-afce-2b9c9dc34a32",
"status": "ACTIVE",
"action": {
"id": "3486b413-93d3-4447-afce-2b9c9dc34a32",
"reason": "<string>"
},
"createdAt": "2019-01-02T12:34:56.000Z"
}
}{
"message": "Missing required field 'amount'."
}{
"message": "Missing required field 'amount'."
}{
"message": "Missing required field 'amount'."
}{
"message": "Missing required field 'amount'."
}{
"message": "Missing required field 'amount'."
}{
"message": "Missing required field 'amount'."
}Headers
Body
The approver's API key id: hex-encoded SHA-256 of its access key, as shown when the key was issued. A key is nominated at most once per organization, for all time: once registered it cannot be nominated again, even after it is archived. The key must be an ACTIVE API key of the caller's organization.
^[0-9a-fA-F]{64}$The key's Ed25519 public key, hex-encoded (32 bytes). Must be the canonical encoding of a point on the curve outside the small-order subgroup; a key from any standard generator is. Must be the public key Anchorage Digital holds for apiKeyId; a nomination whose key does not match is refused.
^[0-9a-fA-F]{64}$The approval group the key joins, in canonical lowercase hyphenated form. Must be an ACTIVE approval group of the caller's organization; the key belongs to it for its whole life and cannot be moved to another group. Optional until approval groups can be created through this API; it becomes required then, and a key registered without one belongs to no group.
^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"3486b413-93d3-4447-afce-2b9c9dc34a32"
Was this page helpful?