POST
/user/v1/flows/{flowId}:consume
Consume a flow
Consume the flow.
This accepts the flow (e.g. for a join organization flow it will
accept the invitation and add the member to the organization).
path parameters
The identifier of the flow or the flow secret.
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.
The time the flow will expire.
The creation time of the flow.
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 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/user/v1/flows/flow_3on5rHNG5aMGao:consume \
-H "UserHub-Api-Key: $USER_API_KEY" \
-H "Authorization: Bearer $USER_ACCESS_TOKEN" \
-X POST
const res = await userApi.flows.consume(
"flow_3on5rHNG5aMGao",
);
res, err := userApi.Flows().Consume(
context.Background(),
"flow_3on5rHNG5aMGao",
nil,
)
$res = $userApi->flows->consume(
flowId: 'flow_3on5rHNG5aMGao',
);
res = user_api.flows.consume(
flow_id="flow_3on5rHNG5aMGao",
)
Response bodyJSON
{
"id": "flow_3on5rHNG5aMGao",
"state": "COMPLETED",
"type": "JOIN_ORGANIZATION",
"organization": {
"id": "org_28seyVGVL1got6",
"displayName": "Acme Inc",
"email": "[email protected]",
"emailVerified": true,
"imageUrl": "https://example.com/acme.jpg",
"memberCount": 0
},
"user": {
"id": "usr_MKFxzgJaAH8JQ4",
"displayName": "Jane Doe",
"email": "[email protected]",
"emailVerified": true,
"imageUrl": "https://example.com/jane.jpg"
},
"creator": {
"id": "usr_EHTXpuz9rs8TCU",
"displayName": "John Doe",
"email": "[email protected]",
"emailVerified": false,
"imageUrl": "https://example.com/john.jpg"
},
"expireTime": "2024-06-15T13:00:00Z",
"createTime": "2024-06-15T13:00:00Z",
"joinOrganization": {
"email": "[email protected]",
"role": null
}
}