Mint Access Token
curl --request POST \
--url https://api.kynasmith.dev/api/auth/access-tokens \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"api_key": "<string>",
"api_key_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"api_key_secret": "<string>",
"project_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"scopes": [
"<string>"
],
"service_account_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"service_account_secret": "<string>"
}
'import requests
url = "https://api.kynasmith.dev/api/auth/access-tokens"
payload = {
"api_key": "<string>",
"api_key_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"api_key_secret": "<string>",
"project_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"scopes": ["<string>"],
"service_account_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"service_account_secret": "<string>"
}
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({
api_key: '<string>',
api_key_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
api_key_secret: '<string>',
project_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
scopes: ['<string>'],
service_account_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
service_account_secret: '<string>'
})
};
fetch('https://api.kynasmith.dev/api/auth/access-tokens', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"access_token": "<string>",
"expires_in_seconds": 123,
"organization_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"project_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"token_type": "Bearer"
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"details": {}
}
}machine-auth
Mint Access Token
Exchange a long-lived machine credential for a short-lived access token.
POST
/
api
/
auth
/
access-tokens
Mint Access Token
curl --request POST \
--url https://api.kynasmith.dev/api/auth/access-tokens \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"api_key": "<string>",
"api_key_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"api_key_secret": "<string>",
"project_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"scopes": [
"<string>"
],
"service_account_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"service_account_secret": "<string>"
}
'import requests
url = "https://api.kynasmith.dev/api/auth/access-tokens"
payload = {
"api_key": "<string>",
"api_key_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"api_key_secret": "<string>",
"project_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"scopes": ["<string>"],
"service_account_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"service_account_secret": "<string>"
}
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({
api_key: '<string>',
api_key_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
api_key_secret: '<string>',
project_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
scopes: ['<string>'],
service_account_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
service_account_secret: '<string>'
})
};
fetch('https://api.kynasmith.dev/api/auth/access-tokens', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"access_token": "<string>",
"expires_in_seconds": 123,
"organization_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"project_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"token_type": "Bearer"
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"details": {}
}
}Authorizations
Body
application/json
Machine credential exchange request for POST /api/auth/access-tokens.
Migration path (#6, #53):
The preferred shape is evolving toward { api_key, scopes? } where the
project scope is inferred from the authenticated credential. During the
migration window both the legacy dual-credential shape and the simplified
api_key shorthand are accepted.
When project_id is omitted the API infers the project scope from the
authenticated credential. When provided, the API validates it matches.
Response
Successful Response
Access-token exchange response.