Rename organization
curl --request PATCH \
--url https://api.diversion.dev/v0/organizations/{org_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "New Organization Name"
}
'import requests
url = "https://api.diversion.dev/v0/organizations/{org_id}"
payload = { "name": "New Organization Name" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: 'New Organization Name'})
};
fetch('https://api.diversion.dev/v0/organizations/{org_id}', 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.diversion.dev/v0/organizations/{org_id}",
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([
'name' => 'New Organization Name'
]),
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.diversion.dev/v0/organizations/{org_id}"
payload := strings.NewReader("{\n \"name\": \"New Organization Name\"\n}")
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.diversion.dev/v0/organizations/{org_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"New Organization Name\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.diversion.dev/v0/organizations/{org_id}")
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 = "{\n \"name\": \"New Organization Name\"\n}"
response = http.request(request)
puts response.read_body{
"id": "org_123456",
"name": "Example Organization",
"owner_id": "user_123456",
"total_storage": 1000000,
"description": "This is an example organization.",
"members": [
{
"id": "member_123456",
"user_id": "user_123456",
"organization_id": "org_123456"
}
],
"invites": [
{
"id": 123456,
"organization_id": "org_123456",
"organization_name": "Great Organization",
"inviting_user_id": "user_123456",
"inviting_user_name": "John Doe",
"invited_email": "john.doe@example.com",
"created": "2023-01-01T00:00:00Z",
"expires": "2023-01-31T00:00:00Z"
}
],
"in_warning_group": true
}{
"status": 123,
"detail": "<string>",
"title": "<string>",
"type": "<string>"
}{
"status": 123,
"detail": "<string>",
"title": "<string>",
"type": "<string>"
}Organization Management
Rename organization
Change the name of an organization. Only admins can perform this action.
PATCH
/
organizations
/
{org_id}
Rename organization
curl --request PATCH \
--url https://api.diversion.dev/v0/organizations/{org_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "New Organization Name"
}
'import requests
url = "https://api.diversion.dev/v0/organizations/{org_id}"
payload = { "name": "New Organization Name" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: 'New Organization Name'})
};
fetch('https://api.diversion.dev/v0/organizations/{org_id}', 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.diversion.dev/v0/organizations/{org_id}",
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([
'name' => 'New Organization Name'
]),
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.diversion.dev/v0/organizations/{org_id}"
payload := strings.NewReader("{\n \"name\": \"New Organization Name\"\n}")
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.diversion.dev/v0/organizations/{org_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"New Organization Name\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.diversion.dev/v0/organizations/{org_id}")
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 = "{\n \"name\": \"New Organization Name\"\n}"
response = http.request(request)
puts response.read_body{
"id": "org_123456",
"name": "Example Organization",
"owner_id": "user_123456",
"total_storage": 1000000,
"description": "This is an example organization.",
"members": [
{
"id": "member_123456",
"user_id": "user_123456",
"organization_id": "org_123456"
}
],
"invites": [
{
"id": 123456,
"organization_id": "org_123456",
"organization_name": "Great Organization",
"inviting_user_id": "user_123456",
"inviting_user_name": "John Doe",
"invited_email": "john.doe@example.com",
"created": "2023-01-01T00:00:00Z",
"expires": "2023-01-31T00:00:00Z"
}
],
"in_warning_group": true
}{
"status": 123,
"detail": "<string>",
"title": "<string>",
"type": "<string>"
}{
"status": 123,
"detail": "<string>",
"title": "<string>",
"type": "<string>"
}Authorizations
This API uses OAuth 2 with the implicit grant flow
Path Parameters
An ID of an organization
Body
application/json
New name for the organization
Required string length:
1 - 128Example:
"New Organization Name"
Response
Organization renamed successfully
Unique identifier for the organization
Example:
"org_123456"
Name of the organization
Example:
"Example Organization"
ID of the user who owns the organization
Example:
"user_123456"
Total storage allocated to the organization
Example:
1000000
Description of the organization
Example:
"This is an example organization."
List of members in the organization
Show child attributes
Show child attributes
List of invites sent by the organization
Show child attributes
Show child attributes
Whether the organization is in the warning group
Example:
true
⌘I

