Transfer Resource
const url = 'https://api.mengi.cloud/organizations/example/transfer-resource';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"resource_type":"example","resource_id":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0"}'};
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://api.mengi.cloud/organizations/example/transfer-resource \ --header 'Content-Type: application/json' \ --data '{ "resource_type": "example", "resource_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0" }'Transfer a cluster or a cloud/DNS credential to this organization.
The caller must be an ADMIN/OWNER of both the resource’s current organization and the target organization. Transferring a cluster cascades to everything it owns (deployments, databases, and their secrets) so the org-inheritance invariant is preserved.
Deployments, databases and secrets are not transferred on their own: that would only change the row’s organization while the workload keeps running on (and its secrets stay in) the old organization. They get a 400 that points to the route that moves them properly. The check depends on the request body only and runs before any lookup, so it discloses nothing.
The target org is addressed by slug and checked next, like every other /{slug} endpoint here (404 if missing, 403 if not an ADMIN member). The resource is addressed by id and follows require_resource: a caller with no relationship to it gets the same 404 as for a missing id, so its existence is not disclosed; a member of its org below ADMIN gets 403.
Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Request Bodyrequired
Section titled “Request Bodyrequired”object
Example generated
{ "resource_type": "example", "resource_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0"}Responses
Section titled “Responses”Successful Response
Example generated
exampleValidation Error
object
object
object
Example generated
{ "detail": [ { "loc": [ "example" ], "msg": "example", "type": "example", "input": "example", "ctx": {} } ]}