Organization routes: update, delete
The Organization Verbs update, delete as api.sb routes, with inputs, result, refusals and an example.
Reference for Organization, one group of Organization routes.
Organization.update
Changes the given properties of an Organization. Verb page.
PATCH /{namespace}/ organizations/ {id}Path: id. Body, as JSON: the other inputs. Emits Organization.updated.
Inputs
| Input | Type | Required | Description |
|---|---|---|---|
id | string | required | The id of the Organization. |
name | string | The name it trades under. | |
hostname | string | The web domain that keys it. |
Returns
| Output | Type | Required | Description |
|---|---|---|---|
organization | Organization | required | The Organization. |
Refuses when
| Check | Error | Fix | Then call |
|---|---|---|---|
| The key is valid, but its scopes do not allow this operation. | forbidden | Use a key whose scopes cover the operation, or ask an owner of the namespace to grant them. | None. |
Example
curl -X PATCH https: //api.sb/ leaseline.app/ organizations/ organization_v0SkRLrXCN \
-H "Authorization: Bearer $STARTUP_BUILDER_API_KEY" \
-H "Content-Type: application/ json" \
-d '{"name": "Leaseline"}'{
"api": "https: //api.sb/ leaseline.app",
"organization": {
"$id": "https: //api.sb/ leaseline.app/ organizations/ organization_v0SkRLrXCN",
"$type": "Organization",
"name": "Leaseline"
},
"action": {
"$id": "https: //api.sb/ leaseline.app/ actions/ act_br07HsG8MG",
"operation": "Organization.update",
"status": "done"
},
"links": {
"self": "https: //api.sb/ leaseline.app/ actions/ act_br07HsG8MG"
}
}Organization.delete
Deletes an Organization: a soft delete that keeps its history, undone by Thing.restore. Verb page.
DELETE /{namespace}/ organizations/ {id}Path: id. Emits Organization.deleted.
Inputs
| Input | Type | Required | Description |
|---|---|---|---|
id | string | required | The id of the Organization. |
Returns
| Output | Type | Required | Description |
|---|---|---|---|
organization | Organization | required | The Organization. |
Refuses when
| Check | Error | Fix | Then call |
|---|---|---|---|
| The key is valid, but its scopes do not allow this operation. | forbidden | Use a key whose scopes cover the operation, or ask an owner of the namespace to grant them. | None. |
Example
curl -X DELETE https: //api.sb/ leaseline.app/ organizations/ organization_v0SkRLrXCN \
-H "Authorization: Bearer $STARTUP_BUILDER_API_KEY"{
"api": "https: //api.sb/ leaseline.app",
"organization": {
"$id": "https: //api.sb/ leaseline.app/ organizations/ organization_v0SkRLrXCN",
"$type": "Organization",
"name": "Riverside Property"
},
"action": {
"$id": "https: //api.sb/ leaseline.app/ actions/ act_br07HsG8MG",
"operation": "Organization.delete",
"status": "done"
},
"links": {
"self": "https: //api.sb/ leaseline.app/ actions/ act_br07HsG8MG"
}
}