Agent key only: lease part of the current minute's workspace request quota
POST
/
api
/
v1
/
agent
/
quota-leases
Agent key only: lease part of the current minute's workspace request quota
curl --request POST \
--url http://127.0.0.1:18000/api/v1/agent/quota-leases \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"requested": 500,
"window": "2023-11-07T05:31:56Z"
}
'import requests
url = "http://127.0.0.1:18000/api/v1/agent/quota-leases"
payload = {
"requested": 500,
"window": "2023-11-07T05:31:56Z"
}
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({requested: 500, window: '2023-11-07T05:31:56Z'})
};
fetch('http://127.0.0.1:18000/api/v1/agent/quota-leases', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "http://127.0.0.1:18000/api/v1/agent/quota-leases"
payload := strings.NewReader("{\n \"requested\": 500,\n \"window\": \"2023-11-07T05:31:56Z\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"granted": 1,
"window": "2023-11-07T05:31:56Z",
"unlimited": true
}{
"error": {
"code": "<string>",
"message": "<string>",
"category": "<string>",
"remediation": "<string>",
"request_id": "<string>",
"retryable": true
}
}Authorizations
Body
application/json
⌘I
Agent key only: lease part of the current minute's workspace request quota
curl --request POST \
--url http://127.0.0.1:18000/api/v1/agent/quota-leases \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"requested": 500,
"window": "2023-11-07T05:31:56Z"
}
'import requests
url = "http://127.0.0.1:18000/api/v1/agent/quota-leases"
payload = {
"requested": 500,
"window": "2023-11-07T05:31:56Z"
}
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({requested: 500, window: '2023-11-07T05:31:56Z'})
};
fetch('http://127.0.0.1:18000/api/v1/agent/quota-leases', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "http://127.0.0.1:18000/api/v1/agent/quota-leases"
payload := strings.NewReader("{\n \"requested\": 500,\n \"window\": \"2023-11-07T05:31:56Z\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"granted": 1,
"window": "2023-11-07T05:31:56Z",
"unlimited": true
}{
"error": {
"code": "<string>",
"message": "<string>",
"category": "<string>",
"remediation": "<string>",
"request_id": "<string>",
"retryable": true
}
}