Skip to main content
POST
/
oauth
/
create-org
Create organization during OAuth onboarding
curl --request POST \
  --url https://app.usechar.ai/api/oauth/create-org \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "session": "<string>",
  "csrf_token": "<string>",
  "name": "<string>"
}
'
{
  "user": {
    "email": "<string>",
    "name": "<string>",
    "organizationName": "<string>"
  },
  "domains": [
    "<string>"
  ],
  "csrfToken": "<string>",
  "needsOrgCreation": true,
  "suggestedOrgName": "<string>",
  "warning": "<string>"
}

Documentation Index

Fetch the complete documentation index at: https://docs.usechar.com/llms.txt

Use this file to discover all available pages before exploring further.

Authorizations

Authorization
string
header
required

WorkOS JWT token. Obtain via WorkOS AuthKit authentication flow. The token must include organization_id claim for organization-scoped endpoints.

Body

application/json
session
string
required

Session UUID from OAuth callback

csrf_token
string
required

CSRF token for validation

name
string
required

Organization name

Required string length: 1 - 100

Response

OK

user
object
required
domains
string[]
required

List of authorized domains

csrfToken
string
required

CSRF token for consent form submission

needsOrgCreation
boolean
required

Whether user needs to create an organization before continuing

suggestedOrgName
string | null
required

Suggested organization name from email domain

warning
string

Warning message (e.g., org context failed to load)