Update plan
Partial update. Immutable fields not exposed: currency, billingType, billingIntervalMonths (Stripe doesn’t allow changing a Price). Changing priceCents while the plan has active subscriptions fails with 400.
curl --request PATCH \
--url https://api.gennia.ai/public/api/v1/billing/plans/{planPublicId} \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <api-key>' \
--data '
{
"content": {
"agents": [
{
"agentPublicId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
],
"externalLinkPublicIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"pages": [],
"sectionOrdering": [
{
"displayOrder": 123
}
]
},
"creditPackagePublicId": "1b2c3d4e-5f60-4a7b-8c9d-0e1f2a3b4c5d",
"description": "Best for growing teams.",
"extraCreditsEnabled": true,
"extraCreditsPriceCents": 500,
"name": "Pro",
"packagePublicId": "9c3a4d22-1a8d-4b3f-9b1e-7a0f0c4f3e21",
"priceCents": 4990,
"seatsIncluded": 5,
"unlimitedCredits": false,
"widgetCtaText": "Get started",
"widgetDescription": "Best for growing teams.",
"widgetFeatures": [
{
"included": true,
"text": "<string>"
}
],
"widgetHighlighted": true,
"widgetTitle": "Pro"
}
'import requests
url = "https://api.gennia.ai/public/api/v1/billing/plans/{planPublicId}"
payload = {
"content": {
"agents": [{ "agentPublicId": "3c90c3cc-0d44-4b50-8888-8dd25736052a" }],
"externalLinkPublicIds": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"],
"pages": [],
"sectionOrdering": [{ "displayOrder": 123 }]
},
"creditPackagePublicId": "1b2c3d4e-5f60-4a7b-8c9d-0e1f2a3b4c5d",
"description": "Best for growing teams.",
"extraCreditsEnabled": True,
"extraCreditsPriceCents": 500,
"name": "Pro",
"packagePublicId": "9c3a4d22-1a8d-4b3f-9b1e-7a0f0c4f3e21",
"priceCents": 4990,
"seatsIncluded": 5,
"unlimitedCredits": False,
"widgetCtaText": "Get started",
"widgetDescription": "Best for growing teams.",
"widgetFeatures": [
{
"included": True,
"text": "<string>"
}
],
"widgetHighlighted": True,
"widgetTitle": "Pro"
}
headers = {
"X-Api-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'X-Api-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
content: {
agents: [{agentPublicId: '3c90c3cc-0d44-4b50-8888-8dd25736052a'}],
externalLinkPublicIds: ['3c90c3cc-0d44-4b50-8888-8dd25736052a'],
pages: [],
sectionOrdering: [{displayOrder: 123}]
},
creditPackagePublicId: '1b2c3d4e-5f60-4a7b-8c9d-0e1f2a3b4c5d',
description: 'Best for growing teams.',
extraCreditsEnabled: true,
extraCreditsPriceCents: 500,
name: 'Pro',
packagePublicId: '9c3a4d22-1a8d-4b3f-9b1e-7a0f0c4f3e21',
priceCents: 4990,
seatsIncluded: 5,
unlimitedCredits: false,
widgetCtaText: 'Get started',
widgetDescription: 'Best for growing teams.',
widgetFeatures: [{included: true, text: '<string>'}],
widgetHighlighted: true,
widgetTitle: 'Pro'
})
};
fetch('https://api.gennia.ai/public/api/v1/billing/plans/{planPublicId}', 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.gennia.ai/public/api/v1/billing/plans/{planPublicId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'content' => [
'agents' => [
[
'agentPublicId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a'
]
],
'externalLinkPublicIds' => [
'3c90c3cc-0d44-4b50-8888-8dd25736052a'
],
'pages' => [
],
'sectionOrdering' => [
[
'displayOrder' => 123
]
]
],
'creditPackagePublicId' => '1b2c3d4e-5f60-4a7b-8c9d-0e1f2a3b4c5d',
'description' => 'Best for growing teams.',
'extraCreditsEnabled' => true,
'extraCreditsPriceCents' => 500,
'name' => 'Pro',
'packagePublicId' => '9c3a4d22-1a8d-4b3f-9b1e-7a0f0c4f3e21',
'priceCents' => 4990,
'seatsIncluded' => 5,
'unlimitedCredits' => false,
'widgetCtaText' => 'Get started',
'widgetDescription' => 'Best for growing teams.',
'widgetFeatures' => [
[
'included' => true,
'text' => '<string>'
]
],
'widgetHighlighted' => true,
'widgetTitle' => 'Pro'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Api-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.gennia.ai/public/api/v1/billing/plans/{planPublicId}"
payload := strings.NewReader("{\n \"content\": {\n \"agents\": [\n {\n \"agentPublicId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n }\n ],\n \"externalLinkPublicIds\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"pages\": [],\n \"sectionOrdering\": [\n {\n \"displayOrder\": 123\n }\n ]\n },\n \"creditPackagePublicId\": \"1b2c3d4e-5f60-4a7b-8c9d-0e1f2a3b4c5d\",\n \"description\": \"Best for growing teams.\",\n \"extraCreditsEnabled\": true,\n \"extraCreditsPriceCents\": 500,\n \"name\": \"Pro\",\n \"packagePublicId\": \"9c3a4d22-1a8d-4b3f-9b1e-7a0f0c4f3e21\",\n \"priceCents\": 4990,\n \"seatsIncluded\": 5,\n \"unlimitedCredits\": false,\n \"widgetCtaText\": \"Get started\",\n \"widgetDescription\": \"Best for growing teams.\",\n \"widgetFeatures\": [\n {\n \"included\": true,\n \"text\": \"<string>\"\n }\n ],\n \"widgetHighlighted\": true,\n \"widgetTitle\": \"Pro\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("X-Api-Key", "<api-key>")
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))
}HttpResponse<String> response = Unirest.patch("https://api.gennia.ai/public/api/v1/billing/plans/{planPublicId}")
.header("X-Api-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"content\": {\n \"agents\": [\n {\n \"agentPublicId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n }\n ],\n \"externalLinkPublicIds\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"pages\": [],\n \"sectionOrdering\": [\n {\n \"displayOrder\": 123\n }\n ]\n },\n \"creditPackagePublicId\": \"1b2c3d4e-5f60-4a7b-8c9d-0e1f2a3b4c5d\",\n \"description\": \"Best for growing teams.\",\n \"extraCreditsEnabled\": true,\n \"extraCreditsPriceCents\": 500,\n \"name\": \"Pro\",\n \"packagePublicId\": \"9c3a4d22-1a8d-4b3f-9b1e-7a0f0c4f3e21\",\n \"priceCents\": 4990,\n \"seatsIncluded\": 5,\n \"unlimitedCredits\": false,\n \"widgetCtaText\": \"Get started\",\n \"widgetDescription\": \"Best for growing teams.\",\n \"widgetFeatures\": [\n {\n \"included\": true,\n \"text\": \"<string>\"\n }\n ],\n \"widgetHighlighted\": true,\n \"widgetTitle\": \"Pro\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gennia.ai/public/api/v1/billing/plans/{planPublicId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["X-Api-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"content\": {\n \"agents\": [\n {\n \"agentPublicId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n }\n ],\n \"externalLinkPublicIds\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"pages\": [],\n \"sectionOrdering\": [\n {\n \"displayOrder\": 123\n }\n ]\n },\n \"creditPackagePublicId\": \"1b2c3d4e-5f60-4a7b-8c9d-0e1f2a3b4c5d\",\n \"description\": \"Best for growing teams.\",\n \"extraCreditsEnabled\": true,\n \"extraCreditsPriceCents\": 500,\n \"name\": \"Pro\",\n \"packagePublicId\": \"9c3a4d22-1a8d-4b3f-9b1e-7a0f0c4f3e21\",\n \"priceCents\": 4990,\n \"seatsIncluded\": 5,\n \"unlimitedCredits\": false,\n \"widgetCtaText\": \"Get started\",\n \"widgetDescription\": \"Best for growing teams.\",\n \"widgetFeatures\": [\n {\n \"included\": true,\n \"text\": \"<string>\"\n }\n ],\n \"widgetHighlighted\": true,\n \"widgetTitle\": \"Pro\"\n}"
response = http.request(request)
puts response.read_body{
"activeSubscriptions": 123,
"billingIntervalMonths": 123,
"checkoutUrl": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"creditPackage": {
"creditValueCents": 123,
"creditsAmount": 123,
"extraCreditsAmount": 123,
"name": "<string>",
"publicId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"renewalIntervalMonths": 123
},
"currency": "<string>",
"description": "<string>",
"extraCreditsEnabled": true,
"extraCreditsPriceCents": 123,
"formattedPrice": "<string>",
"hubPackage": {
"name": "<string>",
"publicId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"name": "<string>",
"priceCents": 123,
"publicId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"seatsIncluded": 123,
"unlimitedCredits": true,
"visible": true,
"widgetCtaText": "<string>",
"widgetDescription": "<string>",
"widgetFeatures": [
{
"included": true,
"text": "<string>"
}
],
"widgetHighlighted": true,
"widgetTitle": "<string>"
}{
"activeSubscriptions": 123,
"billingIntervalMonths": 123,
"checkoutUrl": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"creditPackage": {
"creditValueCents": 123,
"creditsAmount": 123,
"extraCreditsAmount": 123,
"name": "<string>",
"publicId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"renewalIntervalMonths": 123
},
"currency": "<string>",
"description": "<string>",
"extraCreditsEnabled": true,
"extraCreditsPriceCents": 123,
"formattedPrice": "<string>",
"hubPackage": {
"name": "<string>",
"publicId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"name": "<string>",
"priceCents": 123,
"publicId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"seatsIncluded": 123,
"unlimitedCredits": true,
"visible": true,
"widgetCtaText": "<string>",
"widgetDescription": "<string>",
"widgetFeatures": [
{
"included": true,
"text": "<string>"
}
],
"widgetHighlighted": true,
"widgetTitle": "<string>"
}{
"activeSubscriptions": 123,
"billingIntervalMonths": 123,
"checkoutUrl": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"creditPackage": {
"creditValueCents": 123,
"creditsAmount": 123,
"extraCreditsAmount": 123,
"name": "<string>",
"publicId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"renewalIntervalMonths": 123
},
"currency": "<string>",
"description": "<string>",
"extraCreditsEnabled": true,
"extraCreditsPriceCents": 123,
"formattedPrice": "<string>",
"hubPackage": {
"name": "<string>",
"publicId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"name": "<string>",
"priceCents": 123,
"publicId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"seatsIncluded": 123,
"unlimitedCredits": true,
"visible": true,
"widgetCtaText": "<string>",
"widgetDescription": "<string>",
"widgetFeatures": [
{
"included": true,
"text": "<string>"
}
],
"widgetHighlighted": true,
"widgetTitle": "<string>"
}{
"activeSubscriptions": 123,
"billingIntervalMonths": 123,
"checkoutUrl": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"creditPackage": {
"creditValueCents": 123,
"creditsAmount": 123,
"extraCreditsAmount": 123,
"name": "<string>",
"publicId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"renewalIntervalMonths": 123
},
"currency": "<string>",
"description": "<string>",
"extraCreditsEnabled": true,
"extraCreditsPriceCents": 123,
"formattedPrice": "<string>",
"hubPackage": {
"name": "<string>",
"publicId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"name": "<string>",
"priceCents": 123,
"publicId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"seatsIncluded": 123,
"unlimitedCredits": true,
"visible": true,
"widgetCtaText": "<string>",
"widgetDescription": "<string>",
"widgetFeatures": [
{
"included": true,
"text": "<string>"
}
],
"widgetHighlighted": true,
"widgetTitle": "<string>"
}Autorizações
Parâmetros de caminho
Corpo
Body for updating an existing plan. All fields are optional. Immutable fields (currency, billingType, billingIntervalMonths) require delete+recreate due to Stripe constraints.
Inline plan content definition. Mutually exclusive with packagePublicId.
Show child attributes
Show child attributes
Public ID of the credit package bundled with the plan.
"1b2c3d4e-5f60-4a7b-8c9d-0e1f2a3b4c5d"
New short description of the plan.
500"Best for growing teams."
Whether customers can purchase extra credits beyond the included amount.
true
Price of an extra credit pack in the smallest currency unit (cents).
x >= 1500
New display name of the plan.
3 - 100"Pro"
Public ID of the agent/feature package backing this plan. Mutually exclusive with content.
"9c3a4d22-1a8d-4b3f-9b1e-7a0f0c4f3e21"
New plan price in the smallest currency unit (cents).
x >= 04990
Number of workspace seats included in the plan.
x >= 15
New plan lifecycle status.
active, inactive Whether the plan offers unlimited credits (overrides the credit package).
false
Call-to-action text on the plan widget.
30"Get started"
Short description shown on the plan widget.
100"Best for growing teams."
Bullet-point features shown on the plan widget.
Show child attributes
Show child attributes
Whether to visually highlight this plan in the pricing widget.
true
Title shown on the plan widget.
50"Pro"
Resposta
OK
one_time, recurring Show child attributes
Show child attributes
Show child attributes
Show child attributes
active, inactive Show child attributes
Show child attributes
Esta página foi útil?
curl --request PATCH \
--url https://api.gennia.ai/public/api/v1/billing/plans/{planPublicId} \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <api-key>' \
--data '
{
"content": {
"agents": [
{
"agentPublicId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
],
"externalLinkPublicIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"pages": [],
"sectionOrdering": [
{
"displayOrder": 123
}
]
},
"creditPackagePublicId": "1b2c3d4e-5f60-4a7b-8c9d-0e1f2a3b4c5d",
"description": "Best for growing teams.",
"extraCreditsEnabled": true,
"extraCreditsPriceCents": 500,
"name": "Pro",
"packagePublicId": "9c3a4d22-1a8d-4b3f-9b1e-7a0f0c4f3e21",
"priceCents": 4990,
"seatsIncluded": 5,
"unlimitedCredits": false,
"widgetCtaText": "Get started",
"widgetDescription": "Best for growing teams.",
"widgetFeatures": [
{
"included": true,
"text": "<string>"
}
],
"widgetHighlighted": true,
"widgetTitle": "Pro"
}
'import requests
url = "https://api.gennia.ai/public/api/v1/billing/plans/{planPublicId}"
payload = {
"content": {
"agents": [{ "agentPublicId": "3c90c3cc-0d44-4b50-8888-8dd25736052a" }],
"externalLinkPublicIds": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"],
"pages": [],
"sectionOrdering": [{ "displayOrder": 123 }]
},
"creditPackagePublicId": "1b2c3d4e-5f60-4a7b-8c9d-0e1f2a3b4c5d",
"description": "Best for growing teams.",
"extraCreditsEnabled": True,
"extraCreditsPriceCents": 500,
"name": "Pro",
"packagePublicId": "9c3a4d22-1a8d-4b3f-9b1e-7a0f0c4f3e21",
"priceCents": 4990,
"seatsIncluded": 5,
"unlimitedCredits": False,
"widgetCtaText": "Get started",
"widgetDescription": "Best for growing teams.",
"widgetFeatures": [
{
"included": True,
"text": "<string>"
}
],
"widgetHighlighted": True,
"widgetTitle": "Pro"
}
headers = {
"X-Api-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'X-Api-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
content: {
agents: [{agentPublicId: '3c90c3cc-0d44-4b50-8888-8dd25736052a'}],
externalLinkPublicIds: ['3c90c3cc-0d44-4b50-8888-8dd25736052a'],
pages: [],
sectionOrdering: [{displayOrder: 123}]
},
creditPackagePublicId: '1b2c3d4e-5f60-4a7b-8c9d-0e1f2a3b4c5d',
description: 'Best for growing teams.',
extraCreditsEnabled: true,
extraCreditsPriceCents: 500,
name: 'Pro',
packagePublicId: '9c3a4d22-1a8d-4b3f-9b1e-7a0f0c4f3e21',
priceCents: 4990,
seatsIncluded: 5,
unlimitedCredits: false,
widgetCtaText: 'Get started',
widgetDescription: 'Best for growing teams.',
widgetFeatures: [{included: true, text: '<string>'}],
widgetHighlighted: true,
widgetTitle: 'Pro'
})
};
fetch('https://api.gennia.ai/public/api/v1/billing/plans/{planPublicId}', 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.gennia.ai/public/api/v1/billing/plans/{planPublicId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'content' => [
'agents' => [
[
'agentPublicId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a'
]
],
'externalLinkPublicIds' => [
'3c90c3cc-0d44-4b50-8888-8dd25736052a'
],
'pages' => [
],
'sectionOrdering' => [
[
'displayOrder' => 123
]
]
],
'creditPackagePublicId' => '1b2c3d4e-5f60-4a7b-8c9d-0e1f2a3b4c5d',
'description' => 'Best for growing teams.',
'extraCreditsEnabled' => true,
'extraCreditsPriceCents' => 500,
'name' => 'Pro',
'packagePublicId' => '9c3a4d22-1a8d-4b3f-9b1e-7a0f0c4f3e21',
'priceCents' => 4990,
'seatsIncluded' => 5,
'unlimitedCredits' => false,
'widgetCtaText' => 'Get started',
'widgetDescription' => 'Best for growing teams.',
'widgetFeatures' => [
[
'included' => true,
'text' => '<string>'
]
],
'widgetHighlighted' => true,
'widgetTitle' => 'Pro'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Api-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.gennia.ai/public/api/v1/billing/plans/{planPublicId}"
payload := strings.NewReader("{\n \"content\": {\n \"agents\": [\n {\n \"agentPublicId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n }\n ],\n \"externalLinkPublicIds\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"pages\": [],\n \"sectionOrdering\": [\n {\n \"displayOrder\": 123\n }\n ]\n },\n \"creditPackagePublicId\": \"1b2c3d4e-5f60-4a7b-8c9d-0e1f2a3b4c5d\",\n \"description\": \"Best for growing teams.\",\n \"extraCreditsEnabled\": true,\n \"extraCreditsPriceCents\": 500,\n \"name\": \"Pro\",\n \"packagePublicId\": \"9c3a4d22-1a8d-4b3f-9b1e-7a0f0c4f3e21\",\n \"priceCents\": 4990,\n \"seatsIncluded\": 5,\n \"unlimitedCredits\": false,\n \"widgetCtaText\": \"Get started\",\n \"widgetDescription\": \"Best for growing teams.\",\n \"widgetFeatures\": [\n {\n \"included\": true,\n \"text\": \"<string>\"\n }\n ],\n \"widgetHighlighted\": true,\n \"widgetTitle\": \"Pro\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("X-Api-Key", "<api-key>")
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))
}HttpResponse<String> response = Unirest.patch("https://api.gennia.ai/public/api/v1/billing/plans/{planPublicId}")
.header("X-Api-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"content\": {\n \"agents\": [\n {\n \"agentPublicId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n }\n ],\n \"externalLinkPublicIds\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"pages\": [],\n \"sectionOrdering\": [\n {\n \"displayOrder\": 123\n }\n ]\n },\n \"creditPackagePublicId\": \"1b2c3d4e-5f60-4a7b-8c9d-0e1f2a3b4c5d\",\n \"description\": \"Best for growing teams.\",\n \"extraCreditsEnabled\": true,\n \"extraCreditsPriceCents\": 500,\n \"name\": \"Pro\",\n \"packagePublicId\": \"9c3a4d22-1a8d-4b3f-9b1e-7a0f0c4f3e21\",\n \"priceCents\": 4990,\n \"seatsIncluded\": 5,\n \"unlimitedCredits\": false,\n \"widgetCtaText\": \"Get started\",\n \"widgetDescription\": \"Best for growing teams.\",\n \"widgetFeatures\": [\n {\n \"included\": true,\n \"text\": \"<string>\"\n }\n ],\n \"widgetHighlighted\": true,\n \"widgetTitle\": \"Pro\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gennia.ai/public/api/v1/billing/plans/{planPublicId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["X-Api-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"content\": {\n \"agents\": [\n {\n \"agentPublicId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n }\n ],\n \"externalLinkPublicIds\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"pages\": [],\n \"sectionOrdering\": [\n {\n \"displayOrder\": 123\n }\n ]\n },\n \"creditPackagePublicId\": \"1b2c3d4e-5f60-4a7b-8c9d-0e1f2a3b4c5d\",\n \"description\": \"Best for growing teams.\",\n \"extraCreditsEnabled\": true,\n \"extraCreditsPriceCents\": 500,\n \"name\": \"Pro\",\n \"packagePublicId\": \"9c3a4d22-1a8d-4b3f-9b1e-7a0f0c4f3e21\",\n \"priceCents\": 4990,\n \"seatsIncluded\": 5,\n \"unlimitedCredits\": false,\n \"widgetCtaText\": \"Get started\",\n \"widgetDescription\": \"Best for growing teams.\",\n \"widgetFeatures\": [\n {\n \"included\": true,\n \"text\": \"<string>\"\n }\n ],\n \"widgetHighlighted\": true,\n \"widgetTitle\": \"Pro\"\n}"
response = http.request(request)
puts response.read_body{
"activeSubscriptions": 123,
"billingIntervalMonths": 123,
"checkoutUrl": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"creditPackage": {
"creditValueCents": 123,
"creditsAmount": 123,
"extraCreditsAmount": 123,
"name": "<string>",
"publicId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"renewalIntervalMonths": 123
},
"currency": "<string>",
"description": "<string>",
"extraCreditsEnabled": true,
"extraCreditsPriceCents": 123,
"formattedPrice": "<string>",
"hubPackage": {
"name": "<string>",
"publicId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"name": "<string>",
"priceCents": 123,
"publicId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"seatsIncluded": 123,
"unlimitedCredits": true,
"visible": true,
"widgetCtaText": "<string>",
"widgetDescription": "<string>",
"widgetFeatures": [
{
"included": true,
"text": "<string>"
}
],
"widgetHighlighted": true,
"widgetTitle": "<string>"
}{
"activeSubscriptions": 123,
"billingIntervalMonths": 123,
"checkoutUrl": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"creditPackage": {
"creditValueCents": 123,
"creditsAmount": 123,
"extraCreditsAmount": 123,
"name": "<string>",
"publicId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"renewalIntervalMonths": 123
},
"currency": "<string>",
"description": "<string>",
"extraCreditsEnabled": true,
"extraCreditsPriceCents": 123,
"formattedPrice": "<string>",
"hubPackage": {
"name": "<string>",
"publicId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"name": "<string>",
"priceCents": 123,
"publicId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"seatsIncluded": 123,
"unlimitedCredits": true,
"visible": true,
"widgetCtaText": "<string>",
"widgetDescription": "<string>",
"widgetFeatures": [
{
"included": true,
"text": "<string>"
}
],
"widgetHighlighted": true,
"widgetTitle": "<string>"
}{
"activeSubscriptions": 123,
"billingIntervalMonths": 123,
"checkoutUrl": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"creditPackage": {
"creditValueCents": 123,
"creditsAmount": 123,
"extraCreditsAmount": 123,
"name": "<string>",
"publicId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"renewalIntervalMonths": 123
},
"currency": "<string>",
"description": "<string>",
"extraCreditsEnabled": true,
"extraCreditsPriceCents": 123,
"formattedPrice": "<string>",
"hubPackage": {
"name": "<string>",
"publicId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"name": "<string>",
"priceCents": 123,
"publicId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"seatsIncluded": 123,
"unlimitedCredits": true,
"visible": true,
"widgetCtaText": "<string>",
"widgetDescription": "<string>",
"widgetFeatures": [
{
"included": true,
"text": "<string>"
}
],
"widgetHighlighted": true,
"widgetTitle": "<string>"
}{
"activeSubscriptions": 123,
"billingIntervalMonths": 123,
"checkoutUrl": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"creditPackage": {
"creditValueCents": 123,
"creditsAmount": 123,
"extraCreditsAmount": 123,
"name": "<string>",
"publicId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"renewalIntervalMonths": 123
},
"currency": "<string>",
"description": "<string>",
"extraCreditsEnabled": true,
"extraCreditsPriceCents": 123,
"formattedPrice": "<string>",
"hubPackage": {
"name": "<string>",
"publicId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"name": "<string>",
"priceCents": 123,
"publicId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"seatsIncluded": 123,
"unlimitedCredits": true,
"visible": true,
"widgetCtaText": "<string>",
"widgetDescription": "<string>",
"widgetFeatures": [
{
"included": true,
"text": "<string>"
}
],
"widgetHighlighted": true,
"widgetTitle": "<string>"
}
