Deletes a workspace. All of its live projects are deleted with it, pending invitations are revoked, and the workspace's slug is released so it can be used again.
Note
Requires the owner role and a session JWT. API keys are rejected with 401. An admin or member gets 403 forbidden with details.requiredRole: "owner" — see Role errors. Any plan.
Warning
A workspace on a paid plan can't be deleted while its subscription still renews — the request returns 409 active_subscription. Cancel the subscription in the billing portal first; deleting the workspace does not cancel it for you.
Each project's doc site goes offline and its custom domains are released, the same as when you delete a project: any of those domains can then be added to a project in another workspace.
Path Parameters
NameDescription
orgId:stringpathRequired
The organization ID.
Response — 200 OK
The deletion is recorded in the audit log as org.deleted.
Warnings
If a project's GitHub push webhook can't be removed, the workspace is still deleted, the leftover webhook is recorded for retry, and the response adds a top-level warnings array — the same webhook_teardown_pending warning that Update Project returns:
warnings is omitted when there is nothing to report.
Error Responses
401 Unauthorized
unauthorized for a missing, invalid or expired token (or an API key); session_revoked when the session has been signed out.
403 Forbidden
Returned when you are an admin or member:
json
{
"error": {
"code": "forbidden",
"message": "Only the workspace owner can delete the workspace.",
"message": "The GitHub webhook on the previous repository could not be removed because GitHub returned an error. It has been recorded and will be retried; connect GitHub or remove it in the repository settings.",
"details": {
"repoUrl": "https://github.com/acme/docs",
"webhookId": 123456789,
"reason": "github_error"
}
}
]
}
curl--request DELETE \
--url'https://api.syntext.dev/v1/orgs/{orgId}' \
--header'Authorization: Bearer <jwt>' \
--header'Content-Type: application/json' \
--data '{
"data": {
"deleted": true
},
"warnings": [
{
"code": "webhook_teardown_pending",
"message": "The GitHub webhook on the previous repository could not be removed because GitHub returned an error. It has been recorded and will be retried; connect GitHub or remove it in the repository settings.",
"message": "The GitHub webhook on the previous repository could not be removed because GitHub returned an error. It has been recorded and will be retried; connect GitHub or remove it in the repository settings.",
"details": {
"repoUrl": "https://github.com/acme/docs",
"webhookId": 123456789,
"reason": "github_error"
}
}
]
}),
});
const data = await response.json();
console.log(response.status, data);
import requests
url = "https://api.syntext.dev/v1/orgs/{orgId}"
headers = {
"Authorization": "Bearer <jwt>",
}
payload = {
"data": {
"deleted": True,
},
"warnings": [
{
"code": "webhook_teardown_pending",
"message": "The GitHub webhook on the previous repository could not be removed because GitHub returned an error. It has been recorded and will be retried; connect GitHub or remove it in the repository settings.",
"message": "The GitHub webhook on the previous repository could not be removed because GitHub returned an error. It has been recorded and will be retried; connect GitHub or remove it in the repository settings.",
uri = URI("https://api.syntext.dev/v1/orgs/{orgId}")
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = uri.scheme == "https"
request = Net::HTTP::Delete.new(uri)
request["Authorization"] = "Bearer <jwt>"
request["Content-Type"] = "application/json"
request.body = JSON.generate({
"data" => {
"deleted" => true,
},
"warnings" => [
{
"code" => "webhook_teardown_pending",
"message" => "The GitHub webhook on the previous repository could not be removed because GitHub returned an error. It has been recorded and will be retried; connect GitHub or remove it in the repository settings.",
"details" => {
"repoUrl" => "https://github.com/acme/docs",
"webhookId" => 123456789,
"reason" => "github_error",
},
},
],
})
response = http.request(request)
puts response.code
puts response.body
<?php
$payload = [
'data' => [
'deleted' => true,
],
'warnings' => [
[
'code' => 'webhook_teardown_pending',
'message' => 'The GitHub webhook on the previous repository could not be removed because GitHub returned an error. It has been recorded and will be retried; connect GitHub or remove it in the repository settings.',
"message": "The GitHub webhook on the previous repository could not be removed because GitHub returned an error. It has been recorded and will be retried; connect GitHub or remove it in the repository settings.",
"message": "The GitHub webhook on the previous repository could not be removed because GitHub returned an error. It has been recorded and will be retried; connect GitHub or remove it in the repository settings.",