Skip to content

Commit 0824e81

Browse files
committed
docs[API]: adding invite user to org
1 parent 9bf2820 commit 0824e81

File tree

1 file changed

+64
-0
lines changed

1 file changed

+64
-0
lines changed

docs/API.md

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1130,6 +1130,70 @@ curl -XDELETE https://shuffler.io/api/v1/orgs/{org_id} -H "Authorization: Bearer
11301130
{"success": true}
11311131
```
11321132

1133+
### Invite user to organization
1134+
Invites a user to join your organization. If the user doesn't exist, they will be created with a temporary password and invited via email. Only organization admins can invite users.
1135+
1136+
Methods: POST
1137+
1138+
```bash
1139+
curl -XPOST https://shuffler.io/api/v1/register_org -H "Authorization: Bearer APIKEY" -d '{
1140+
"username": "[email protected]"
1141+
}'
1142+
```
1143+
1144+
Alternative endpoint:
1145+
```bash
1146+
curl -XPOST https://shuffler.io/api/v1/users/register_org -H "Authorization: Bearer APIKEY" -d '{
1147+
"username": "[email protected]"
1148+
}'
1149+
```
1150+
1151+
**Requirements:**
1152+
- You must be an admin of the organization to invite users
1153+
- The username must be a valid email address
1154+
1155+
**What happens:**
1156+
1. If the user doesn't exist in Shuffle:
1157+
- A new user account is created with a temporary password
1158+
- The user is marked as unverified with `first_setup=true`
1159+
- An invitation email is sent to the user with a link to join the organization
1160+
- The user is added to SendGrid mailing lists
1161+
1162+
2. If the user already exists in Shuffle but not in your org:
1163+
- The organization is added to the user's list of organizations
1164+
- An invitation email is sent to the user with a link to join the organization
1165+
1166+
3. If the user already exists in your organization:
1167+
- The user is already a member - no action is taken
1168+
1169+
**Success response**
1170+
```json
1171+
{"success": true}
1172+
```
1173+
1174+
**Error responses**
1175+
1176+
Admin permission required:
1177+
```json
1178+
{"success": false, "reason": "You don't have access to invite users to this organization"}
1179+
```
1180+
1181+
User already exists in organization:
1182+
```json
1183+
{"success": false, "reason": "User already exist in this organization"}
1184+
```
1185+
1186+
Invalid email:
1187+
```json
1188+
{"success": false, "reason": "Email is invalid"}
1189+
```
1190+
1191+
**Important notes:**
1192+
- The invite link format is: `https://shuffler.io/invite?invite_id={userId}_{inviteId}&org_id={orgId}`
1193+
- If the organization has SSO enabled, `&sso=enabled` is added to the invite link
1194+
- The invitation ID is stored in the organization's `invites` array
1195+
- For new users, the region is automatically set to the organization's region (defaults to europe-west2)
1196+
11331197

11341198
## Integration Layer
11351199
The Integration Layer of Shuffle is a way to interact with apps a new way. It utilizes Apps that are Categorized and Labeled, and gives access to API's for specific actions for each of those labels. Behind the scenes there is always a workflow for each of these, and Shuffle wants to give granular control of each individual Workflow if wanted. The integration layer is based on [Shuffle's Schemaless translation technology](https://github.com/frikky/schemaless), built on top of LLMs, with the goal of making Shuffle be able to act as a Large **Action** Model (LAM).

0 commit comments

Comments
 (0)