Goatlab API Docs

Delete a space

DELETE
/v1/spaces/{spaceId}

Deletes a specific space and all its associated files.

Access Control:

Deletion of a space depends on your permissions:

  • Private Spaces: Only the space owner can delete the space
  • Public Spaces: Only users with appropriate permissions can delete public spaces

You must provide valid authentication credentials (API key, tenant ID, and user ID) to delete any space.

Important:

  • This action is irreversible
  • All files within the space will be permanently deleted
  • Any RAG indexes associated with the space will be removed

Authorization

ApiTokenAuth PRODUCT, GEN_AI
x-api-key<token>

API Key with role based permission

In: header

Scope: PRODUCT, GEN_AI

Path Parameters

spaceId*string

The unique identifier of the space to delete

Header Parameters

x-user-id?string

The ID of the user requesting the deletion

x-tenant-id*string

The ID of the tenant

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

curl -X DELETE "https://example.com/v1/spaces/497f6eca-6276-4993-bfeb-53cbbbba6f08" \  -H "x-tenant-id: string"
{
  "message": "Space 550e8400-e29b-41d4-a716-446655440000 deleted successfully."
}

{
  "message": "x-user-id is required"
}

{
  "message": "Invalid API Key"
}

{
  "message": "Invalid API Key"
}

{
  "message": "Space not found."
}

{
  "message": "Internal Server Error"
}