TypeScript client
import { OctosparkClient } from '@octospark/sdk'
const client = new OctosparkClient({
token: process.env.OCTOSPARK_TOKEN
})
const response = await client.organizations.updateOrganization({
organizationId: process.env.OCTOSPARK_ORGANIZATION_ID ?? "organizationId",
body: {},
})import os
from octospark_sdk import OctosparkClient
client = OctosparkClient(token=os.environ["OCTOSPARK_TOKEN"])
response = client.organizations.update_organization(
organizationId=os.environ.get("OCTOSPARK_ORGANIZATION_ID", "organizationId"),
body={}
)octospark organizations update-organization \
--request '{"path":{"organizationId":"organizationId"},"body":{}}'use reqwest::Client;
use std::env;
#[tokio::main]
async fn main() -> Result<(), reqwest::Error> {
let client = Client::new();
let base_url = env::var("OCTOSPARK_API_URL").unwrap_or_else(|_| "https://api.octospark.ai".to_string());
let organization_id = env::var("OCTOSPARK_ORGANIZATION_ID").unwrap_or_else(|_| "organizationId".to_string());
let url = format!("{}/v1/organizations/{}", base_url.trim_end_matches('/'), organization_id);
let token = env::var("OCTOSPARK_TOKEN").expect("OCTOSPARK_TOKEN");
let mut request = client.patch(url).bearer_auth(token);
request = request.json(&serde_json::json!({}));
let response = request.send().await?;
println!("{}", response.text().await?);
Ok(())
}import 'dart:convert';
import 'dart:io';
import 'package:http/http.dart' as http;
Future<void> main() async {
final baseUrl = Platform.environment['OCTOSPARK_API_URL'] ?? 'https://api.octospark.ai';
final token = Platform.environment['OCTOSPARK_TOKEN'];
final organizationId = Platform.environment['OCTOSPARK_ORGANIZATION_ID'] ?? 'organizationId';
final url = '${baseUrl.replaceFirst(RegExp(r'/$'), '')}/v1/organizations/$organizationId';
final uri = Uri.parse(url);
final headers = {
'Authorization': 'Bearer $token',
'Content-Type': 'application/json',
};
final response = await http.patch(
uri,
headers: headers,
body: jsonEncode({}),
);
print(response.body);
}curl --request PATCH \
--url https://api.octospark.ai/v1/organizations/{organizationId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{}'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.octospark.ai/v1/organizations/{organizationId}",
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([
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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.octospark.ai/v1/organizations/{organizationId}"
payload := strings.NewReader("{}")
req, _ := http.NewRequest("PATCH", 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))
}HttpResponse<String> response = Unirest.patch("https://api.octospark.ai/v1/organizations/{organizationId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.octospark.ai/v1/organizations/{organizationId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{}"
response = http.request(request)
puts response.read_body$headers=@{}
$headers.Add("Authorization", "Bearer <token>")
$headers.Add("Content-Type", "application/json")
$response = Invoke-WebRequest -Uri 'https://api.octospark.ai/v1/organizations/{organizationId}' -Method PATCH -Headers $headers -ContentType 'application/json' -Body '{}'import Foundation
let parameters = [] as [String : Any?]
let postData = try JSONSerialization.data(withJSONObject: parameters, options: [])
let url = URL(string: "https://api.octospark.ai/v1/organizations/{organizationId}")!
var request = URLRequest(url: url)
request.httpMethod = "PATCH"
request.timeoutInterval = 10
request.allHTTPHeaderFields = [
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
]
request.httpBody = postData
let (data, _) = try await URLSession.shared.data(for: request)
print(String(decoding: data, as: UTF8.self))using RestSharp;
var options = new RestClientOptions("https://api.octospark.ai/v1/organizations/{organizationId}");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("Authorization", "Bearer <token>");
request.AddJsonBody("{}", false);
var response = await client.PatchAsync(request);
Console.WriteLine("{0}", response.Content);using RestSharp;
var options = new RestClientOptions("https://api.octospark.ai/v1/organizations/{organizationId}");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("Authorization", "Bearer <token>");
request.AddJsonBody("{}", false);
var response = await client.PatchAsync(request);
Console.WriteLine("{0}", response.Content);CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PATCH");
curl_easy_setopt(hnd, CURLOPT_WRITEDATA, stdout);
curl_easy_setopt(hnd, CURLOPT_URL, "https://api.octospark.ai/v1/organizations/{organizationId}");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "Authorization: Bearer <token>");
headers = curl_slist_append(headers, "Content-Type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{}");
CURLcode ret = curl_easy_perform(hnd);CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PATCH");
curl_easy_setopt(hnd, CURLOPT_WRITEDATA, stdout);
curl_easy_setopt(hnd, CURLOPT_URL, "https://api.octospark.ai/v1/organizations/{organizationId}");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "Authorization: Bearer <token>");
headers = curl_slist_append(headers, "Content-Type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{}");
CURLcode ret = curl_easy_perform(hnd);val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{}")
val request = Request.Builder()
.url("https://api.octospark.ai/v1/organizations/{organizationId}")
.patch(body)
.addHeader("Authorization", "Bearer <token>")
.addHeader("Content-Type", "application/json")
.build()
val response = client.newCall(request).execute(){
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"billingEmail": "<string>",
"onboardingData": {
"version": 1,
"completedSteps": [],
"organizationProfile": {
"displayName": "<string>"
},
"workspaceProfile": {
"teamName": "<string>",
"website": "<string>"
},
"goals": {},
"completedAt": "<string>"
},
"stripeCustomerId": "<string>",
"stripeSubscriptionId": "<string>",
"stripePaymentMethodId": "<string>",
"stripeMeteredSubscriptionItemId": "<string>",
"creditsBalance": 123,
"reservedCredits": 123,
"autoRechargeEnabled": true,
"autoRechargeThreshold": 123,
"autoRechargeAmount": 123,
"isSubscribed": true,
"subscriptionPlan": "<string>",
"subscriptionStartedAt": "<string>",
"subscriptionEndsAt": "<string>",
"subscriptionCurrentPeriodEnd": "<string>",
"createdAt": "<string>",
"updatedAt": "<string>"
}{
"issues": [
{
"path": [
"<string>"
],
"message": "<string>"
}
],
"message": "<string>",
"_tag": "HttpApiDecodeError"
}{
"message": "<string>",
"_tag": "Unauthorized"
}{
"message": "<string>",
"_tag": "PaymentRequired"
}{
"message": "<string>",
"_tag": "Forbidden"
}{
"message": "<string>",
"_tag": "NotFound"
}{
"message": "<string>",
"_tag": "Conflict"
}{
"message": "<string>",
"_tag": "TooManyRequests"
}{
"message": "<string>",
"_tag": "InternalError"
}Organizations
Update organization
Update an organization’s settings, such as its name. Only an organization admin or owner can do this. Membership changes go through the member endpoints, and organization deletion is not exposed on the public agent surface.
PATCH
/
v1
/
organizations
/
{organizationId}
TypeScript client
import { OctosparkClient } from '@octospark/sdk'
const client = new OctosparkClient({
token: process.env.OCTOSPARK_TOKEN
})
const response = await client.organizations.updateOrganization({
organizationId: process.env.OCTOSPARK_ORGANIZATION_ID ?? "organizationId",
body: {},
})import os
from octospark_sdk import OctosparkClient
client = OctosparkClient(token=os.environ["OCTOSPARK_TOKEN"])
response = client.organizations.update_organization(
organizationId=os.environ.get("OCTOSPARK_ORGANIZATION_ID", "organizationId"),
body={}
)octospark organizations update-organization \
--request '{"path":{"organizationId":"organizationId"},"body":{}}'use reqwest::Client;
use std::env;
#[tokio::main]
async fn main() -> Result<(), reqwest::Error> {
let client = Client::new();
let base_url = env::var("OCTOSPARK_API_URL").unwrap_or_else(|_| "https://api.octospark.ai".to_string());
let organization_id = env::var("OCTOSPARK_ORGANIZATION_ID").unwrap_or_else(|_| "organizationId".to_string());
let url = format!("{}/v1/organizations/{}", base_url.trim_end_matches('/'), organization_id);
let token = env::var("OCTOSPARK_TOKEN").expect("OCTOSPARK_TOKEN");
let mut request = client.patch(url).bearer_auth(token);
request = request.json(&serde_json::json!({}));
let response = request.send().await?;
println!("{}", response.text().await?);
Ok(())
}import 'dart:convert';
import 'dart:io';
import 'package:http/http.dart' as http;
Future<void> main() async {
final baseUrl = Platform.environment['OCTOSPARK_API_URL'] ?? 'https://api.octospark.ai';
final token = Platform.environment['OCTOSPARK_TOKEN'];
final organizationId = Platform.environment['OCTOSPARK_ORGANIZATION_ID'] ?? 'organizationId';
final url = '${baseUrl.replaceFirst(RegExp(r'/$'), '')}/v1/organizations/$organizationId';
final uri = Uri.parse(url);
final headers = {
'Authorization': 'Bearer $token',
'Content-Type': 'application/json',
};
final response = await http.patch(
uri,
headers: headers,
body: jsonEncode({}),
);
print(response.body);
}curl --request PATCH \
--url https://api.octospark.ai/v1/organizations/{organizationId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{}'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.octospark.ai/v1/organizations/{organizationId}",
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([
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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.octospark.ai/v1/organizations/{organizationId}"
payload := strings.NewReader("{}")
req, _ := http.NewRequest("PATCH", 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))
}HttpResponse<String> response = Unirest.patch("https://api.octospark.ai/v1/organizations/{organizationId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.octospark.ai/v1/organizations/{organizationId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{}"
response = http.request(request)
puts response.read_body$headers=@{}
$headers.Add("Authorization", "Bearer <token>")
$headers.Add("Content-Type", "application/json")
$response = Invoke-WebRequest -Uri 'https://api.octospark.ai/v1/organizations/{organizationId}' -Method PATCH -Headers $headers -ContentType 'application/json' -Body '{}'import Foundation
let parameters = [] as [String : Any?]
let postData = try JSONSerialization.data(withJSONObject: parameters, options: [])
let url = URL(string: "https://api.octospark.ai/v1/organizations/{organizationId}")!
var request = URLRequest(url: url)
request.httpMethod = "PATCH"
request.timeoutInterval = 10
request.allHTTPHeaderFields = [
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
]
request.httpBody = postData
let (data, _) = try await URLSession.shared.data(for: request)
print(String(decoding: data, as: UTF8.self))using RestSharp;
var options = new RestClientOptions("https://api.octospark.ai/v1/organizations/{organizationId}");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("Authorization", "Bearer <token>");
request.AddJsonBody("{}", false);
var response = await client.PatchAsync(request);
Console.WriteLine("{0}", response.Content);using RestSharp;
var options = new RestClientOptions("https://api.octospark.ai/v1/organizations/{organizationId}");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("Authorization", "Bearer <token>");
request.AddJsonBody("{}", false);
var response = await client.PatchAsync(request);
Console.WriteLine("{0}", response.Content);CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PATCH");
curl_easy_setopt(hnd, CURLOPT_WRITEDATA, stdout);
curl_easy_setopt(hnd, CURLOPT_URL, "https://api.octospark.ai/v1/organizations/{organizationId}");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "Authorization: Bearer <token>");
headers = curl_slist_append(headers, "Content-Type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{}");
CURLcode ret = curl_easy_perform(hnd);CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PATCH");
curl_easy_setopt(hnd, CURLOPT_WRITEDATA, stdout);
curl_easy_setopt(hnd, CURLOPT_URL, "https://api.octospark.ai/v1/organizations/{organizationId}");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "Authorization: Bearer <token>");
headers = curl_slist_append(headers, "Content-Type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{}");
CURLcode ret = curl_easy_perform(hnd);val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{}")
val request = Request.Builder()
.url("https://api.octospark.ai/v1/organizations/{organizationId}")
.patch(body)
.addHeader("Authorization", "Bearer <token>")
.addHeader("Content-Type", "application/json")
.build()
val response = client.newCall(request).execute(){
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"billingEmail": "<string>",
"onboardingData": {
"version": 1,
"completedSteps": [],
"organizationProfile": {
"displayName": "<string>"
},
"workspaceProfile": {
"teamName": "<string>",
"website": "<string>"
},
"goals": {},
"completedAt": "<string>"
},
"stripeCustomerId": "<string>",
"stripeSubscriptionId": "<string>",
"stripePaymentMethodId": "<string>",
"stripeMeteredSubscriptionItemId": "<string>",
"creditsBalance": 123,
"reservedCredits": 123,
"autoRechargeEnabled": true,
"autoRechargeThreshold": 123,
"autoRechargeAmount": 123,
"isSubscribed": true,
"subscriptionPlan": "<string>",
"subscriptionStartedAt": "<string>",
"subscriptionEndsAt": "<string>",
"subscriptionCurrentPeriodEnd": "<string>",
"createdAt": "<string>",
"updatedAt": "<string>"
}{
"issues": [
{
"path": [
"<string>"
],
"message": "<string>"
}
],
"message": "<string>",
"_tag": "HttpApiDecodeError"
}{
"message": "<string>",
"_tag": "Unauthorized"
}{
"message": "<string>",
"_tag": "PaymentRequired"
}{
"message": "<string>",
"_tag": "Forbidden"
}{
"message": "<string>",
"_tag": "NotFound"
}{
"message": "<string>",
"_tag": "Conflict"
}{
"message": "<string>",
"_tag": "TooManyRequests"
}{
"message": "<string>",
"_tag": "InternalError"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Organization id (UUID). Discover ids via the list organizations endpoint or the agent context.
Body
application/json
Response
Success
a Universally Unique Identifier
Pattern:
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$Show child attributes
Show child attributes
Available options:
active, inactive, trialing, past_due, canceled, paused, unpaid ⌘I