API ReferenceOrganizations
Create Organization
Create a new organization with name, registration mode, feature flags, and security policies.
Endpoint
POST /v1/organizationsBase URL: https://api-id.avnology.net
Authentication: API Key or OAuth token with admin:orgs:write scope
Request
curl -X POST https://api-id.avnology.net/v1/organizations \
-H
Body
| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | URL-safe name (2--64 chars, lowercase alphanumeric + hyphens) |
display_name | string | No | Human-readable name |
slug | string | No | URL slug for /org/{slug} login (immutable after creation) |
registration_mode | string | No | open, invite_only, sso_only, disabled (default: open) |
feature_flags | object | No | Toggle auth methods per org |
security_policies | object | No | Password, session, and MFA policies |
Response
Success (201 Created)
Returns the created organization object. See Get Organization for the full schema.
Errors
| Status | Code | Description |
|---|---|---|
| 400 | AVNOLOGY_AUTH_902 | Validation failed |
| 409 | AVNOLOGY_AUTH_903 | Organization name or slug already exists |
Code Examples
JavaScript (fetch)
async function createOrganization(apiKey, name, displayName) {
return fetch('https://api-id.avnology.net/v1/organizations', {
method: 'POST',
headers: { 'Authorization': `Bearer ${apiKey}`, 'Content-Type': 'application/json' },
Python (httpx)
import httpx
def create_organization(api_key: str, name: str, display_name: str) -> dict:
return httpx.post("https://api-id.avnology.net/v1/organizations",
headers={"Authorization"
Go (net/http)
func createOrganization(ctx context.Context, apiKey, name, displayName string) (*Organization, error) {
body, _
Related
- Get Organization -- retrieve the created organization
- Add Member -- add members to the organization
- SDK:
client.admin.createOrganization({ name, displayName })(TypeScript)