Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion docs/API.md
Original file line number Diff line number Diff line change
Expand Up @@ -1052,11 +1052,20 @@ curl https://shuffler.io/api/v1/orgs -H "Authorization: Bearer APIKEY"
Deletes an organization. Only possible for sub-organizations.

**This requires you to have already removed all workflows, and will NOT clean up all the data in the database until it expires (3 months~)**
**Only **admins of the parent organization** can delete a sub-organization.**

Methods: DELETE

```bash
curl -XDELETE https://shuffler.io/api/v1/orgs/{org_id} -H "Authorization: Bearer APIKEY"
curl -XDELETE https://shuffler.io/api/v1/orgs/{parent_org_id} -H "Authorization: Bearer APIKEY"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wait, this is scary af. Why don't we just send the delete request directly to the suborg ID?

How didn't I catch this lol

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because we need to verify whether user who is sending request for suborg deletion is admin in parent org or not.

But we do have check for whether org which is being deleted is suborg or not.

https://github.com/Shuffle/shuffle-shared/blob/e4c2f47d187934f6230076e76ffc82e4d33075c4/shared.go#L28789C5-L28789C11

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@frikky, I have changed the docs. Now Only with suborg id user can delete that suborg

```

### Request Body

```json
{
"suborg_id": "YOUR_SUBORG_ID_TO_DELETE"
}
```

**Success response**
Expand Down
Loading