Apply the default plan to a customer
curl --request POST \
--url https://api.hyperline.co/v1/agents/customers/{customer_id}/apply-default-plan \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.hyperline.co/v1/agents/customers/{customer_id}/apply-default-plan"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.hyperline.co/v1/agents/customers/{customer_id}/apply-default-plan', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.hyperline.co/v1/agents/customers/{customer_id}/apply-default-plan",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.hyperline.co/v1/agents/customers/{customer_id}/apply-default-plan"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.hyperline.co/v1/agents/customers/{customer_id}/apply-default-plan")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.hyperline.co/v1/agents/customers/{customer_id}/apply-default-plan")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"applied": true,
"policy": {
"id": "<string>",
"customer_id": "<string>",
"internal_description": "<string>",
"created_at": "2024-12-20T16:04:11Z",
"updated_at": "2024-12-20T16:04:11Z",
"agent_slug": "<string>",
"is_default": true,
"mode": "wallet",
"wallet_id": "<string>",
"credit_product_id": "<string>",
"markup_percent": "<string>",
"overage_mode": "refuse",
"overage_markup_percent": "<string>",
"overage_rate_card_id": "<string>",
"overage_rate_card_source": "policy",
"overage_wallet_id": "<string>",
"floor": "<string>",
"credit_rates": {
"llm": [
{
"credits_per_1m_input": "<string>",
"credits_per_1m_output": "<string>",
"provider": "<string>",
"model": "<string>",
"credits_per_1m_cached_input": "<string>",
"credits_per_1m_cache_write": "<string>",
"dimensions": [
{
"key": "<string>",
"rate": "<string>",
"per": "1m"
}
]
}
],
"items": [
{
"vendor": "<string>",
"item": "<string>",
"credits_per_unit": "<string>",
"dimensions": [
{
"key": "<string>",
"rate": "<string>",
"per": "1m"
}
]
}
],
"fallback_credits_per_usd": "<string>"
},
"window_rates": {
"unit_rates": {
"llm": [
{
"units_per_1m_input": "<string>",
"units_per_1m_output": "<string>",
"provider": "<string>",
"model": "<string>",
"units_per_1m_cached_input": "<string>",
"units_per_1m_cache_write": "<string>",
"dimensions": [
{
"key": "<string>",
"rate": "<string>",
"per": "1m"
}
]
}
],
"items": [
{
"vendor": "<string>",
"item": "<string>",
"units_per_unit": "<string>",
"dimensions": [
{
"key": "<string>",
"rate": "<string>",
"per": "1m"
}
]
}
],
"fallback_units_per_usd": "<string>"
},
"windows": [
{
"key": "<string>",
"duration_minutes": 263520,
"included_units": "<string>"
}
]
},
"rate_card_id": "<string>",
"rate_card_source": "policy",
"plan": {
"id": "<string>",
"name": "<string>"
},
"settlement_interval_minutes": 123,
"settlement_schedule": "calendar_month",
"resolved_rate_card": {
"fallback_per_usd": "<string>",
"layer_count": 123,
"llm_rows": 123,
"item_rows": 123,
"has_default_llm_row": true
},
"blocked": true
}
}{
"message": "<string>"
}Agents
Apply the default plan to a customer
Puts an unpriced customer on the workspace’s default plan through the ordinary policy write — mode pinning, wallet provisioning (an empty wallet is opened on demand in wallet mode) and the plan’s invoice container attach all hold exactly as on the policy PUT. Idempotent and never destructive: a customer already on the default plan comes back applied: false, a customer on any OTHER arrangement is a 409 — an applied default must never overwrite a choice somebody made. 404 when no default plan is marked. A credits-mode default draws down the pot of the product that adopted its rate card; 400 when no product has adopted it, or several have, since the pot then has to be picked on the policy surface.
POST
/
v1
/
agents
/
customers
/
{customer_id}
/
apply-default-plan
Apply the default plan to a customer
curl --request POST \
--url https://api.hyperline.co/v1/agents/customers/{customer_id}/apply-default-plan \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.hyperline.co/v1/agents/customers/{customer_id}/apply-default-plan"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.hyperline.co/v1/agents/customers/{customer_id}/apply-default-plan', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.hyperline.co/v1/agents/customers/{customer_id}/apply-default-plan",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.hyperline.co/v1/agents/customers/{customer_id}/apply-default-plan"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.hyperline.co/v1/agents/customers/{customer_id}/apply-default-plan")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.hyperline.co/v1/agents/customers/{customer_id}/apply-default-plan")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"applied": true,
"policy": {
"id": "<string>",
"customer_id": "<string>",
"internal_description": "<string>",
"created_at": "2024-12-20T16:04:11Z",
"updated_at": "2024-12-20T16:04:11Z",
"agent_slug": "<string>",
"is_default": true,
"mode": "wallet",
"wallet_id": "<string>",
"credit_product_id": "<string>",
"markup_percent": "<string>",
"overage_mode": "refuse",
"overage_markup_percent": "<string>",
"overage_rate_card_id": "<string>",
"overage_rate_card_source": "policy",
"overage_wallet_id": "<string>",
"floor": "<string>",
"credit_rates": {
"llm": [
{
"credits_per_1m_input": "<string>",
"credits_per_1m_output": "<string>",
"provider": "<string>",
"model": "<string>",
"credits_per_1m_cached_input": "<string>",
"credits_per_1m_cache_write": "<string>",
"dimensions": [
{
"key": "<string>",
"rate": "<string>",
"per": "1m"
}
]
}
],
"items": [
{
"vendor": "<string>",
"item": "<string>",
"credits_per_unit": "<string>",
"dimensions": [
{
"key": "<string>",
"rate": "<string>",
"per": "1m"
}
]
}
],
"fallback_credits_per_usd": "<string>"
},
"window_rates": {
"unit_rates": {
"llm": [
{
"units_per_1m_input": "<string>",
"units_per_1m_output": "<string>",
"provider": "<string>",
"model": "<string>",
"units_per_1m_cached_input": "<string>",
"units_per_1m_cache_write": "<string>",
"dimensions": [
{
"key": "<string>",
"rate": "<string>",
"per": "1m"
}
]
}
],
"items": [
{
"vendor": "<string>",
"item": "<string>",
"units_per_unit": "<string>",
"dimensions": [
{
"key": "<string>",
"rate": "<string>",
"per": "1m"
}
]
}
],
"fallback_units_per_usd": "<string>"
},
"windows": [
{
"key": "<string>",
"duration_minutes": 263520,
"included_units": "<string>"
}
]
},
"rate_card_id": "<string>",
"rate_card_source": "policy",
"plan": {
"id": "<string>",
"name": "<string>"
},
"settlement_interval_minutes": 123,
"settlement_schedule": "calendar_month",
"resolved_rate_card": {
"fallback_per_usd": "<string>",
"layer_count": 123,
"llm_rows": 123,
"item_rows": 123,
"has_default_llm_row": true
},
"blocked": true
}
}{
"message": "<string>"
}Was this page helpful?
⌘I

