Tenants (visibility endpoints)
List visibilities
GET /tenants — lists visibility entries scoped to your X-Tenant-ID.
fetch('https://auth.magicrunez.com/tenants', {
method: 'GET',
headers: { 'X-Tenant-ID': 'your-tenant-id' }
})
.then(r => r.json())
.then(console.log)
.catch(console.error);
Create visibility
POST /tenants — create a new visibility record.
fetch('https://auth.magicrunez.com/tenants', {
method: 'POST',
headers: { 'Content-Type': 'application/json', 'X-Tenant-ID': 'your-tenant-id' },
body: JSON.stringify({ name: 'example-tenant', visibility: 'public' })
})
.then(r => r.json())
.then(console.log)
.catch(console.error);
Get by id
GET /tenants/:id — retrieve a single visibility by id.
fetch('https://auth.magicrunez.com/tenants/{id}', {
method: 'GET',
headers: { 'X-Tenant-ID': 'your-tenant-id' }
})
.then(r => r.json())
.then(console.log)
.catch(console.error);
Delete
DELETE /tenants/:id — delete a visibility by id.
fetch('https://auth.magicrunez.com/tenants/{id}', {
method: 'DELETE',
headers: { 'X-Tenant-ID': 'your-tenant-id' }
})
.then(r => r.json())
.then(console.log)
.catch(console.error);