curl --request POST \
--url https://api.diversion.dev/v0/organizations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"name": "Example Organization"
}'
{
"id": "org_123456",
"name": "Example Organization",
"description": "This is an example organization.",
"owner_id": "user_123456",
"total_storage": 1000000,
"members": [
{
"id": "member_123456",
"user_id": "user_123456",
"organization_id": "org_123456",
"role": "READ"
}
],
"invites": [
{
"id": "invite_123456",
"organization_id": "org_123456",
"inviting_user_id": "user_123456",
"invited_email": "jsmith@example.com",
"status": "PENDING",
"created": "2023-01-01T00:00:00Z",
"expires": "2023-01-31T00:00:00Z"
}
],
"in_warning_group": true
}
Creates a new organization with the user as the owner If the user is already a member of an organization with the same name, the request will fail
curl --request POST \
--url https://api.diversion.dev/v0/organizations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"name": "Example Organization"
}'
{
"id": "org_123456",
"name": "Example Organization",
"description": "This is an example organization.",
"owner_id": "user_123456",
"total_storage": 1000000,
"members": [
{
"id": "member_123456",
"user_id": "user_123456",
"organization_id": "org_123456",
"role": "READ"
}
],
"invites": [
{
"id": "invite_123456",
"organization_id": "org_123456",
"inviting_user_id": "user_123456",
"invited_email": "jsmith@example.com",
"status": "PENDING",
"created": "2023-01-01T00:00:00Z",
"expires": "2023-01-31T00:00:00Z"
}
],
"in_warning_group": true
}
This API uses OAuth 2 with the implicit grant flow
Organization created
The response is of type object
.