POST
/user/v1/flows:createJoinOrganization
Send a join organization invitation
Creates a join organization flow.
This invites a person to join an organization.
body parameters
organizationId
string
RequiredThe identifier of the organization.
The identifier of the user.
This is required if email is not specified.
The email address of the person to invite.
This is required if user is not specified or the user does not have an email address.
The display name of the person to invite.
Returns
The system-assigned identifier of the flow.
The current state of the flow.
Possible values:START_PENDING
STARTED
COMPLETED
CANCELED
EXPIRED
The code that best describes the reason for the state.
Possible values:JOIN_ORGANIZATION
SIGNUP
The target organization for the flow.
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 target user for the flow.
The system-assigned identifier of the user.
The client defined unique identifier of the user account.
The human-readable display name of the user.
The email address of the user.
Whether the user's email address has been verified.
The photo/avatar URL of the user.
Whether the user is disabled.
The user who created the flow.
The system-assigned identifier of the user.
The client defined unique identifier of the user account.
The human-readable display name of the user.
The email address of the user.
Whether the user's email address has been verified.
The photo/avatar URL of the user.
Whether the user is disabled.
joinOrganization
JoinOrganizationFlow
The join organization flow type specific data.
The display name of the invitee.
The email address of the invitee.
This is required if a user isn't provided or the user's email address is empty.
The role to be assigned to the invitee.
The system-assigned identifier of the role.
The client defined unique identifier of the role.
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 role_
are reserved.
The human-readable display name of the role.
Possible values:OWNER
MEMBER
GUEST
The description of the role.
The maximum length is 1000 characters.
The additional permissions allowed by the role.
Whether the role is the default for the tenant.
The signup flow type specific data.
The email address of the invitee.
The display name of the invitee.
createOrganization
boolean
Whether to create an organization as part of the signup flow.
The time the flow will expire.
The creation time of the flow.
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/flows:createJoinOrganization \
-H "UserHub-Api-Key: $USERHUB_USER_KEY" \
-H "Authorization: Bearer $USER_ACCESS_TOKEN" \
--json '{
"organizationId": "org_28seyVGVL1got6",
"email": "[email protected]"
}'
const res = await userApi.flows.createJoinOrganization({
email: "[email protected]",
organizationId: "org_28seyVGVL1got6",
});
res, err := userApi.Flows().CreateJoinOrganization(
context.Background(),
&userapi.FlowCreateJoinOrganizationInput{
Email: "[email protected]",
OrganizationId: "org_28seyVGVL1got6",
},
)
$res = $userApi->flows->createJoinOrganization(
email: '[email protected]',
organizationId: 'org_28seyVGVL1got6',
);
res = user_api.flows.createJoinOrganization(
email="[email protected]",
organization_id="org_28seyVGVL1got6",
)
Response bodyJSON
{
"id": "flow_3on5rHNG5aMGao",
"state": "START_PENDING",
"type": "JOIN_ORGANIZATION",
"organization": {
"id": "org_28seyVGVL1got6",
"displayName": "Acme Inc",
"email": "[email protected]",
"emailVerified": true,
"imageUrl": "https://example.com/acme.jpg",
"memberCount": 0
},
"user": null,
"creator": {
"id": "usr_EHTXpuz9rs8TCU",
"displayName": "Jane Doe",
"email": "[email protected]",
"emailVerified": true,
"imageUrl": "https://example.com/jane.jpg"
},
"joinOrganization": {
"email": "[email protected]",
"role": null
},
"expireTime": "2024-12-15T13:00:00Z",
"createTime": "2024-11-15T13:00:00Z"
}