Update Organization
curl --request PUT \
--url https://api.example.com/app/v1/organizations/{organizationId} \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"description": "<string>"
}
'import requests
url = "https://api.example.com/app/v1/organizations/{organizationId}"
payload = {
"name": "<string>",
"description": "<string>"
}
headers = {"Content-Type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({name: '<string>', description: '<string>'})
};
fetch('https://api.example.com/app/v1/organizations/{organizationId}', 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.example.com/app/v1/organizations/{organizationId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'description' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"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.example.com/app/v1/organizations/{organizationId}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"description\": \"<string>\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
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.put("https://api.example.com/app/v1/organizations/{organizationId}")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"description\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/app/v1/organizations/{organizationId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"description\": \"<string>\"\n}"
response = http.request(request)
puts response.read_bodyOrganizations
Update Organization
Update an organization’s details
PUT
/
app
/
v1
/
organizations
/
{organizationId}
Update Organization
curl --request PUT \
--url https://api.example.com/app/v1/organizations/{organizationId} \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"description": "<string>"
}
'import requests
url = "https://api.example.com/app/v1/organizations/{organizationId}"
payload = {
"name": "<string>",
"description": "<string>"
}
headers = {"Content-Type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({name: '<string>', description: '<string>'})
};
fetch('https://api.example.com/app/v1/organizations/{organizationId}', 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.example.com/app/v1/organizations/{organizationId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'description' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"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.example.com/app/v1/organizations/{organizationId}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"description\": \"<string>\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
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.put("https://api.example.com/app/v1/organizations/{organizationId}")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"description\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/app/v1/organizations/{organizationId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"description\": \"<string>\"\n}"
response = http.request(request)
puts response.read_bodyUpdates an organization’s name or description. The authenticated user must be an organization admin.
Path Parameters
Organization ID
Request Body
Organization name (1-255 characters)
Organization description (max 1000 characters, can be null to clear)
Example Request
{
"name": "Acme Corporation",
"description": "Updated organization description"
}
Response
Returns the updated Organization object.{
"id": "org123",
"name": "Acme Corporation",
"slug": "acme-corp",
"description": "Updated organization description",
"status": "active",
"settings": {
"timezone": "America/Los_Angeles",
"locales": ["en-US", "es-ES", "fr-FR"],
"features": {
"assetOptimization": true,
"advancedPermissions": true
}
},
"roles": {
"role123": "Editor",
"role456": "Viewer"
},
"metadata": {
"createdBy": "user123",
"maxProjects": 10
},
"subscription": {
"tierId": "tier_pro",
"status": "active",
"currentPeriodStart": "2024-03-01T00:00:00Z",
"currentPeriodEnd": "2024-04-01T00:00:00Z"
},
"createdAt": "2024-01-15T10:00:00Z",
"updatedAt": "2024-03-21T10:00:00Z"
}
Error Responses
Organization Not Found
{
"error": {
"code": "NOT_FOUND",
"message": "Organization org123 was not found"
}
}
Forbidden
{
"error": {
"code": "FORBIDDEN",
"message": "This request is forbidden for your roles"
}
}
Code Examples
curl -X PUT "https://api.metabind.ai/app/v1/organizations/org123" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Acme Corporation",
"description": "Updated organization description"
}'
const response = await fetch(
'https://api.metabind.ai/app/v1/organizations/org123',
{
method: 'PUT',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: 'Acme Corporation',
description: 'Updated organization description'
})
}
);
const organization = await response.json();
console.log(`Updated organization: ${organization.name}`);
let url = URL(string: "https://api.metabind.ai/app/v1/organizations/org123")!
var request = URLRequest(url: url)
request.httpMethod = "PUT"
request.setValue("Bearer YOUR_API_KEY", forHTTPHeaderField: "Authorization")
request.setValue("application/json", forHTTPHeaderField: "Content-Type")
let body = ["name": "Acme Corporation", "description": "Updated organization description"]
request.httpBody = try JSONEncoder().encode(body)
let (data, _) = try await URLSession.shared.data(for: request)
let organization = try JSONDecoder().decode(Organization.self, from: data)
print("Updated organization: \(organization.name)")
val response = client.put("https://api.metabind.ai/app/v1/organizations/org123") {
header("Authorization", "Bearer YOUR_API_KEY")
contentType(ContentType.Application.Json)
setBody(OrganizationUpdate(
name = "Acme Corporation",
description = "Updated organization description"
))
}
val organization = response.body<Organization>()
println("Updated organization: ${organization.name}")
⌘I