Skip to main content

Delete Workspace

Delete an existing workspace by ID or name. Only system admins are allowed to perform this operation. The workspace must not contain any repositories in order to be deleted.

  • Endpoint: https://api.repoflow.io/workspace
  • Method: DELETE
  • Authorization: System admin only

Request Parameters

ParameterTypeRequiredDescription
workspaceIdstringConditionalThe ID of the workspace to delete. Required if workspaceName is not provided.
workspaceNamestringConditionalThe name of the workspace to delete. Required if workspaceId is not provided.

Example Request Using workspaceId

DELETE https://api.repoflow.io/workspace
Content-Type: application/json
Authorization: Bearer <admin-token>

{
"workspaceId": "92bbfdcf-78e9-43ac-be77-0076c718b295"
}

Example Request Using workspaceName

DELETE https://api.repoflow.io/workspace
Content-Type: application/json
Authorization: Bearer <admin-token>

{
"workspaceName": "example-workspace"
}

Example Response

200 OK

Error Responses

  • Status Code: 400 BAD REQUEST

    • Description: Workspace cannot be deleted because it still contains repositories.
  • Status Code: 401 UNAUTHORIZED

    • Description: Unauthorized access. Only system admins are allowed to delete workspaces.
  • Status Code: 404 NOT FOUND

    • Description: Workspace not found.
  • Status Code: 500 INTERNAL SERVER ERROR

    • Description: An unexpected error occurred on the server.