Create a host join token
import requests
url = "https://platform.ankra.app/api/v1/org/environments/{environment_name}/host-join-tokens"
payload = { "ttl_seconds": 3600 }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({ttl_seconds: 3600})
};
fetch('https://platform.ankra.app/api/v1/org/environments/{environment_name}/host-join-tokens', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://platform.ankra.app/api/v1/org/environments/{environment_name}/host-join-tokens \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"ttl_seconds": 3600
}
'{
"join_token": "<string>",
"expires_at": "2023-11-07T05:31:56Z",
"environment": "<string>"
}Deploy Targets
Create a host join token
Mints a single-use token a host registers with (ankra targets register), creating the environment when the organisation has none of that name. The token is in this answer exactly once and only its hash is stored. Requires pipelines.manage.
POST
/
api
/
v1
/
org
/
environments
/
{environment_name}
/
host-join-tokens
Create a host join token
import requests
url = "https://platform.ankra.app/api/v1/org/environments/{environment_name}/host-join-tokens"
payload = { "ttl_seconds": 3600 }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({ttl_seconds: 3600})
};
fetch('https://platform.ankra.app/api/v1/org/environments/{environment_name}/host-join-tokens', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://platform.ankra.app/api/v1/org/environments/{environment_name}/host-join-tokens \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"ttl_seconds": 3600
}
'{
"join_token": "<string>",
"expires_at": "2023-11-07T05:31:56Z",
"environment": "<string>"
}Authorizations
Body
application/json