Leave a tenant
POST
/tenants/{id}/leave
const url = 'https://localhost:3000/api/v1/tenants/example/leave';const options = {method: 'POST', headers: {Authorization: '<Authorization>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://localhost:3000/api/v1/tenants/example/leave \ --header 'Authorization: <Authorization>'Allows the authenticated user to leave a tenant (owner cannot leave)
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”id
required
string
Tenant ID (UUID)
Responses
Section titled “Responses”Left successfully
Media typeapplication/json
object
message
string
success
required
boolean
Example
{ "message": "Operation completed successfully", "success": true}Invalid ID
Media typeapplication/json
object
error
required
string
message
string
Example
{ "error": "invalid_request", "message": "Invalid request body"}Unauthorized
Media typeapplication/json
object
error
required
string
message
string
Example
{ "error": "invalid_request", "message": "Invalid request body"}Owner cannot leave
Media typeapplication/json
object
error
required
string
message
string
Example
{ "error": "invalid_request", "message": "Invalid request body"}Tenant not found
Media typeapplication/json
object
error
required
string
message
string
Example
{ "error": "invalid_request", "message": "Invalid request body"}Internal error
Media typeapplication/json
object
error
required
string
message
string
Example
{ "error": "invalid_request", "message": "Invalid request body"}