TypeScript
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
user_email: 'jsmith@example.com',
name: '<string>',
slug: '<string>',
env: 'both'
})
};
fetch('https://api.useautumn.com/v1/platform/organizations', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.useautumn.com/v1/platform/organizations"
payload = {
"user_email": "jsmith@example.com",
"name": "<string>",
"slug": "<string>",
"env": "both"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)curl -X POST 'https://api.useautumn.com/v1/platform/organizations' \
-H 'Authorization: Bearer am_sk_test_...' \
-H 'Content-Type: application/json' \
-d '{
"user_email": "tenant@example.com",
"name": "Tenant Organization",
"slug": "tenant-org",
"env": "both"
}'
{
"test_secret_key": "<string>",
"live_secret_key": "<string>"
}{
"message": "<string>",
"code": "not_found"
}{
"message": "<string>",
"code": "not_found"
}Platform (Beta)
Create Organization
Creates a new organization for a platform tenant. Reuses existing users and organizations if they already exist.
POST
/
platform
/
organizations
TypeScript
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
user_email: 'jsmith@example.com',
name: '<string>',
slug: '<string>',
env: 'both'
})
};
fetch('https://api.useautumn.com/v1/platform/organizations', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.useautumn.com/v1/platform/organizations"
payload = {
"user_email": "jsmith@example.com",
"name": "<string>",
"slug": "<string>",
"env": "both"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)curl -X POST 'https://api.useautumn.com/v1/platform/organizations' \
-H 'Authorization: Bearer am_sk_test_...' \
-H 'Content-Type: application/json' \
-d '{
"user_email": "tenant@example.com",
"name": "Tenant Organization",
"slug": "tenant-org",
"env": "both"
}'
{
"test_secret_key": "<string>",
"live_secret_key": "<string>"
}{
"message": "<string>",
"code": "not_found"
}{
"message": "<string>",
"code": "not_found"
}Creates a new organization for a platform tenant. If a user with the provided email already exists, it will be reused. If an organization with the slug already exists for this user, it will be reused.
Body
application/json