Create an organization
POST
/user/v1/organizations
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.
The flow identifier associated with the creation of the organization.
The flow type must be SIGNUP
and associated with the user creating the organization.
Returns
The system-assigned identifier of the organization.
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 photo/avatar URL of 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 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.
A user-facing error message.
curl https://api.userhub.com/user/v1/organizations \
-H "UserHub-Api-Key: $USERHUB_USER_KEY" \
-H "Authorization: Bearer $USER_ACCESS_TOKEN" \
--json '{
"displayName": "Acme Inc"
}'
const res = await userApi.organizations.create({
displayName: "Acme Inc",
});
res, err := userApi.Organizations().Create(
context.Background(),
&userapi.OrganizationCreateInput{
DisplayName: "Acme Inc",
},
)
$res = $userApi->organizations->create(
displayName: 'Acme Inc',
);
res = user_api.organizations.create(
display_name="Acme Inc",
)
Response bodyJSON
{
"id": "org_28seyVGVL1got6",
"displayName": "Acme Inc",
"memberCount": 1
}