Skip to content

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.

Text
PATCH /{namespace}/organizations/{id}

Path: id. Body, as JSON: the other inputs. Emits Organization.updated.

Inputs

InputTypeRequiredDescription
idstringrequiredThe id of the Organization.
namestringThe name it trades under.
hostnamestringThe web domain that keys it.

Returns

OutputTypeRequiredDescription
organizationOrganizationrequiredThe Organization.

Refuses when

CheckErrorFixThen call
The key is valid, but its scopes do not allow this operation.forbiddenUse a key whose scopes cover the operation, or ask an owner of the namespace to grant them.None.

Example

Terminal
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"}'
JSON
{
  "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.

Text
DELETE /{namespace}/organizations/{id}

Path: id. Emits Organization.deleted.

Inputs

InputTypeRequiredDescription
idstringrequiredThe id of the Organization.

Returns

OutputTypeRequiredDescription
organizationOrganizationrequiredThe Organization.

Refuses when

CheckErrorFixThen call
The key is valid, but its scopes do not allow this operation.forbiddenUse a key whose scopes cover the operation, or ask an owner of the namespace to grant them.None.

Example

Terminal
curl -X DELETE https://api.sb/leaseline.app/organizations/organization_v0SkRLrXCN \
  -H "Authorization: Bearer $STARTUP_BUILDER_API_KEY"
JSON
{
  "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"
  }
}