POST
/admin/v1/organizations
Create an organization
Creates a new organization.
body parameters
The client defined unique identifier of the organization account.
It is restricted to letters, numbers, underscores, and hyphens, with the first character a letter or a number, and a 255 character maximum.
ID's starting with org_
are reserved.
The human-readable display name of the organization.
The maximum length is 200 characters.
The email address of the organization.
The maximum length is 320 characters.
Whether the organization's email address has been verified.
The E164 phone number for the organization (e.g. +12125550123
).
phoneNumberVerified
boolean
Whether the organization's phone number has been verified.
The photo/avatar URL of the organization.
The maximum length is 2000 characters.
The default ISO-4217 currency code for the organization (e.g. USD
).
The IETF BCP-47 language code for the organization (e.g. en
).
The country/region code for the organization (e.g. US
).
The IANA time zone for the organization (e.g. America/New_York
).
The billing address for the organization.
The city, district, suburb, town, or village.
The state, country, province, or region.
The 2-letter country code.
The sign-up time for the organization.
Whether the organization is disabled.
Returns
The system-assigned identifier of the organization.
The current state of the organization.
Possible values:ACTIVE
DISABLED
ARCHIVED
PENDING_DELETION
The code that best describes the reason for the state.
The client defined unique identifier of the organization account.
The human-readable display name of the organization.
The email address of the organization.
Whether the organization's email address has been verified.
The E164 phone number for the organization (e.g. +12125550123
).
phoneNumberVerified
boolean
Whether the organization's phone number has been verified.
The photo/avatar URL of the organization.
The default ISO-4217 currency code for the organization (e.g. USD
).
The IETF BCP-47 language code for the organization (e.g. en
).
The country/region code for the organization (e.g. US
).
The IANA time zone for the organization (e.g. America/New_York
).
The address for the organization.
The city, district, suburb, town, or village.
The state, country, province, or region.
The 2-letter country code.
accountConnections
AccountConnection[]
The system-assigned identifier of the connection.
The client defined unique identifier of the connection.
It is restricted to letters, numbers, underscores, and hyphens, with the first character a letter or a number, and a 255 character maximum.
ID's starting with conn_
are reserved.
The human-readable display name of the connection.
The maximum length is 200 characters.
The current status of the connection.
Possible values:PENDING_SETUP
ACTIVE
BROKEN
DISABLED
ARCHIVED
The code that best describes the reason for the state.
delegate
ConnectionDelegate
The delegated connection.
The delegated connection identifier.
The client defined unique identifier of the delegated connection.
The human-readable display name of the delegated connection.
The current status of the delegated connection.
Possible values:PENDING_SETUP
ACTIVE
BROKEN
DISABLED
ARCHIVED
The code that best describes the reason for the state.
The delegated connection type.
providers
ConnectionProvider[]
The connection providers.
Whether the connection is the default for the provider type.
The creation time of the connection.
The last update time of the connection.
The Auth0 connection data.
builtinEmail
BuiltinEmailConnection
The builtin email configuration data.
The Google Cloud Identity Platform (Firebase Auth) connection.
The service account key in JSON format.
The Google Cloud Identity Platform/Firebase project ID.
This will default to the project ID in the service account key if not specified.
postmark
PostmarkConnection
The Postmark configuration data.
The Postmark server token (e.g. 942faf79-bf10-4dc1-830a-dc7943f43f35
).
The Postmark server ID.
This is automatically populated when the server token is updated.
The from email address.
The Postmark account must be allowed to send from this email address.
The email name (e.g. Jane Doe
).
The reply to email address.
The email name (e.g. Jane Doe
).
The Stripe billing configuration data.
The Stripe account ID (e.g. acct_1LcUvxQYGbxD2SPK
)
The live vs test status for the Stripe account.
The webhooks configuration data.
The URL of the events webhook.
The headers sent with requests to the connection URL.
signingSecrets
SigningSecret[]
The signing secret value.
The time the signing secret is set to expire.
The external identifier of the connected account.
The external admin URL for the connected account.
The status of the connected account.
Possible values:ACTIVE
BROKEN
DISABLED
The code that best describes the reason for the state.
The balance amount for the account.
A negative value indicates an amount which will be subtracted from the next invoice (credit).
A positive value indicates an amount which will be added to the next invoice (debt).
The currency code for the account.
paymentMethods
PaymentMethod[]
The payment methods for connections that support it.
The system-assigned identifier of the payment method.
The external identifier of the connected payment method.
The status of the connected payment method.
Possible values:ACTIVE
BROKEN
ARCHIVED
The code that best describes the reason for the state.
A human-readable description of the payment method.
This can be used to show a description of the payment method when the type is UNKNOWN or not explicitly handled.
The full name of the owner of the payment method.
The address for the payment method.
The city, district, suburb, town, or village.
The state, country, province, or region.
The 2-letter country code.
Whether the payment method is the default for the connected account.
The last payment error.
This will be unset if the payment method is updated or if a payment succeeds.
The general error code (e.g. INVALID_ARGUMENT
).
Possible values:OK
CANCELLED
UNKNOWN
INVALID_ARGUMENT
DEADLINE_EXCEEDED
NOT_FOUND
ALREADY_EXISTS
PERMISSION_DENIED
UNAUTHENTICATED
RESOURCE_EXHAUSTED
FAILED_PRECONDITION
ABORTED
OUT_OF_RANGE
UNIMPLEMENTED
INTERNAL
UNAVAILABLE
DATA_LOSS
A developer-facing error message.
A reason code for the error (e.g. USER_PENDING_DELETION
).
The parameter path related to the error (e.g. member.userId
).
Additional metadata related to the error.
The last time the payment method was pulled from the connection.
The creation time of the payment method connection.
The last update time of the payment method connection.
Card payment method (e.g. Visa credit card).
The brand of the card (e.g. VISA
).
Possible values:AMERICAN_EXPRESS
DINERS_CLUB
DISCOVER
JCB
MASTERCARD
UNIONPAY
VISA
The last for digits of the card.
The funding method for the card (e.g. DEBIT
).
Possible values:CREDIT
DEBIT
PREPAID
The last time the account was pulled from the connection.
The last time the account was pushed to the connection.
The creation time of the account connection.
The last update time of the account connection.
subscription
AccountSubscription
The organization's default active subscription.
The system-assigned identifier of the subscription.
The state of the subscription.
Possible values:ACTIVE
TRIALING
PAST_DUE
PAUSED
The anchor time of the billing cycle.
plan
AccountSubscriptionPlan
The identifier of the plan.
The human-readable display name of the plan.
product
AccountSubscriptionProduct
The system-assigned identifier of the product.
The client defined unique identifier of the product.
The human-readable display name of the product.
The sign-up time for the organization.
The number of members in the organization.
This includes disabled users, but does not include user's marked for deletion.
Whether the organization is disabled.
The creation time of the organization.
The last update time of the organization.
The general error code (e.g. INVALID_ARGUMENT
).
Possible values:OK
CANCELLED
UNKNOWN
INVALID_ARGUMENT
DEADLINE_EXCEEDED
NOT_FOUND
ALREADY_EXISTS
PERMISSION_DENIED
UNAUTHENTICATED
RESOURCE_EXHAUSTED
FAILED_PRECONDITION
ABORTED
OUT_OF_RANGE
UNIMPLEMENTED
INTERNAL
UNAVAILABLE
DATA_LOSS
A developer-facing error message.
A reason code for the error (e.g. USER_PENDING_DELETION
).
The parameter path related to the error (e.g. member.userId
).
Additional metadata related to the error.
curl https://api.userhub.com/admin/v1/organizations \
-H "Authorization: Bearer $ADMIN_API_KEY" \
--json '{
"displayName": "Acme Inc"
}'
const res = await adminApi.organizations.create({
displayName: "Acme Inc",
});
res, err := adminApi.Organizations().Create(
context.Background(),
&adminapi.OrganizationCreateInput{
DisplayName: "Acme Inc",
},
)
$res = $adminApi->organizations->create(
displayName: 'Acme Inc',
);
res = admin_api.organizations.create(
display_name="Acme Inc",
)
Response bodyJSON
{
"id": "org_28seyVGVL1got6",
"state": "ACTIVE",
"displayName": "Acme Inc",
"address": null,
"accountConnections": [],
"subscription": null,
"signupTime": "2024-06-15T13:00:00Z",
"memberCount": 0,
"createTime": "2024-06-15T13:00:00Z",
"updateTime": "2024-06-15T13:00:00Z"
}