package example
import (
context "context"
management "github.com/auth0/go-auth0/management/management"
client "github.com/auth0/go-auth0/management/management/client"
option "github.com/auth0/go-auth0/management/management/option"
)
func do() {
client := client.NewClient(
option.WithToken(
"<token>",
),
)
request := &management.CreateOrganizationRequestContent{
Name: "name",
}
client.Organizations.Create(
context.TODO(),
request,
)
}import { ManagementClient } from "auth0";
async function main() {
const client = new ManagementClient({
token: "<token>",
});
await client.organizations.create({
name: "name",
});
}
main();import { ManagementClient } from "auth0";
async function main() {
const client = new ManagementClient({
token: "<token>",
});
await client.organizations.create({
name: "name",
});
}
main();curl --request POST \
--url https://{tenantDomain}/api/v2/organizations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "organization-1",
"display_name": "Acme Users",
"branding": {
"logo_url": "<string>"
},
"metadata": {},
"enabled_connections": [
{
"connection_id": "<string>",
"assign_membership_on_login": true,
"show_as_button": true,
"is_signup_enabled": true
}
]
}
'import requests
url = "https://{tenantDomain}/api/v2/organizations"
payload = {
"name": "organization-1",
"display_name": "Acme Users",
"branding": { "logo_url": "<string>" },
"metadata": {},
"enabled_connections": [
{
"connection_id": "<string>",
"assign_membership_on_login": True,
"show_as_button": True,
"is_signup_enabled": True
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{tenantDomain}/api/v2/organizations",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'organization-1',
'display_name' => 'Acme Users',
'branding' => [
'logo_url' => '<string>'
],
'metadata' => [
],
'enabled_connections' => [
[
'connection_id' => '<string>',
'assign_membership_on_login' => true,
'show_as_button' => true,
'is_signup_enabled' => true
]
]
]),
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;
}HttpResponse<String> response = Unirest.post("https://{tenantDomain}/api/v2/organizations")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"organization-1\",\n \"display_name\": \"Acme Users\",\n \"branding\": {\n \"logo_url\": \"<string>\"\n },\n \"metadata\": {},\n \"enabled_connections\": [\n {\n \"connection_id\": \"<string>\",\n \"assign_membership_on_login\": true,\n \"show_as_button\": true,\n \"is_signup_enabled\": true\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{tenantDomain}/api/v2/organizations")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"organization-1\",\n \"display_name\": \"Acme Users\",\n \"branding\": {\n \"logo_url\": \"<string>\"\n },\n \"metadata\": {},\n \"enabled_connections\": [\n {\n \"connection_id\": \"<string>\",\n \"assign_membership_on_login\": true,\n \"show_as_button\": true,\n \"is_signup_enabled\": true\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"name": "organization-1",
"display_name": "Acme Users",
"branding": {
"logo_url": "<string>",
"colors": {
"primary": "<string>",
"page_background": "<string>"
}
},
"metadata": {},
"token_quota": {
"client_credentials": {
"enforce": true,
"per_day": 1073741824,
"per_hour": 1073741824
}
},
"enabled_connections": [
{
"connection_id": "<string>",
"assign_membership_on_login": true,
"show_as_button": true,
"is_signup_enabled": true,
"connection": {
"name": "<string>",
"strategy": "<string>"
}
}
]
}Create an Organization
Create a new Organization within your tenant. To learn more about Organization settings, behavior, and configuration options, review Create Your First Organization.
package example
import (
context "context"
management "github.com/auth0/go-auth0/management/management"
client "github.com/auth0/go-auth0/management/management/client"
option "github.com/auth0/go-auth0/management/management/option"
)
func do() {
client := client.NewClient(
option.WithToken(
"<token>",
),
)
request := &management.CreateOrganizationRequestContent{
Name: "name",
}
client.Organizations.Create(
context.TODO(),
request,
)
}import { ManagementClient } from "auth0";
async function main() {
const client = new ManagementClient({
token: "<token>",
});
await client.organizations.create({
name: "name",
});
}
main();import { ManagementClient } from "auth0";
async function main() {
const client = new ManagementClient({
token: "<token>",
});
await client.organizations.create({
name: "name",
});
}
main();curl --request POST \
--url https://{tenantDomain}/api/v2/organizations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "organization-1",
"display_name": "Acme Users",
"branding": {
"logo_url": "<string>"
},
"metadata": {},
"enabled_connections": [
{
"connection_id": "<string>",
"assign_membership_on_login": true,
"show_as_button": true,
"is_signup_enabled": true
}
]
}
'import requests
url = "https://{tenantDomain}/api/v2/organizations"
payload = {
"name": "organization-1",
"display_name": "Acme Users",
"branding": { "logo_url": "<string>" },
"metadata": {},
"enabled_connections": [
{
"connection_id": "<string>",
"assign_membership_on_login": True,
"show_as_button": True,
"is_signup_enabled": True
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{tenantDomain}/api/v2/organizations",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'organization-1',
'display_name' => 'Acme Users',
'branding' => [
'logo_url' => '<string>'
],
'metadata' => [
],
'enabled_connections' => [
[
'connection_id' => '<string>',
'assign_membership_on_login' => true,
'show_as_button' => true,
'is_signup_enabled' => true
]
]
]),
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;
}HttpResponse<String> response = Unirest.post("https://{tenantDomain}/api/v2/organizations")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"organization-1\",\n \"display_name\": \"Acme Users\",\n \"branding\": {\n \"logo_url\": \"<string>\"\n },\n \"metadata\": {},\n \"enabled_connections\": [\n {\n \"connection_id\": \"<string>\",\n \"assign_membership_on_login\": true,\n \"show_as_button\": true,\n \"is_signup_enabled\": true\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{tenantDomain}/api/v2/organizations")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"organization-1\",\n \"display_name\": \"Acme Users\",\n \"branding\": {\n \"logo_url\": \"<string>\"\n },\n \"metadata\": {},\n \"enabled_connections\": [\n {\n \"connection_id\": \"<string>\",\n \"assign_membership_on_login\": true,\n \"show_as_button\": true,\n \"is_signup_enabled\": true\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"name": "organization-1",
"display_name": "Acme Users",
"branding": {
"logo_url": "<string>",
"colors": {
"primary": "<string>",
"page_background": "<string>"
}
},
"metadata": {},
"token_quota": {
"client_credentials": {
"enforce": true,
"per_day": 1073741824,
"per_hour": 1073741824
}
},
"enabled_connections": [
{
"connection_id": "<string>",
"assign_membership_on_login": true,
"show_as_button": true,
"is_signup_enabled": true,
"connection": {
"name": "<string>",
"strategy": "<string>"
}
}
]
}Autorisations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Corps
The name of this organization.
1 - 50Friendly name of this organization.
1 - 255Theme defines how to style the login pages.
Show child attributes
Show child attributes
Metadata associated with the organization, in the form of an object with string values (max 255 chars). Maximum of 25 metadata properties allowed.
Show child attributes
Show child attributes
Connections that will be enabled for this organization. See POST enabled_connections endpoint for the object format. (Max of 10 connections allowed)
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Réponse
Organization successfully created.
Organization identifier.
50The name of this organization.
1 - 50Friendly name of this organization.
1 - 255Theme defines how to style the login pages.
Show child attributes
Show child attributes
Metadata associated with the organization, in the form of an object with string values (max 255 chars). Maximum of 25 metadata properties allowed.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes