Merran documentation API & integrations
Switch households
const url = 'http://localhost:3000/api/auth/organization/set-active';const options = { method: 'POST', headers: { cookie: 'merran.session_token=<merran.session_token>', 'Content-Type': 'application/json' }, body: '{"organizationId":"0199e8b0-5a10-7a01-8b00-000000000003"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url http://localhost:3000/api/auth/organization/set-active \ --header 'Content-Type: application/json' \ --cookie merran.session_token=<merran.session_token> \ --data '{ "organizationId": "0199e8b0-5a10-7a01-8b00-000000000003" }'Makes another of your households the one in use on this device. Better Auth calls households organizations, so it’s named by organizationId. An API key always works in its own household.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”object
The organization id to set as active. It can be null to unset the active organization. Eg: “org-id”
The organization slug to set as active. It can be null to unset the active organization if organizationId is not provided. Eg: “org-slug”
Example
{ "organizationId": "0199e8b0-5a10-7a01-8b00-000000000003"}Responses
Section titled “Responses”Success
The organization
object
Example
{ "id": "0199e8b0-5a10-7a01-8b00-000000000003", "name": "The Riveras", "slug": "the-riveras", "logo": null, "createdAt": "2026-10-01T17:30:00.000Z", "metadata": null}Bad Request. Usually due to missing parameters, or invalid parameters.
object
Example generated
{ "message": "example"}Unauthorized. Due to missing or invalid authentication.
object
Example generated
{ "message": "example"}Forbidden. You do not have permission to access this resource or to perform this action.
object
Example generated
{ "message": "example"}Not Found. The requested resource was not found.
object
Example generated
{ "message": "example"}Too Many Requests. You have exceeded the rate limit. Try again later.
object
Example generated
{ "message": "example"}Internal Server Error. This is a problem with the server that you cannot fix.
object
Example generated
{ "message": "example"}© 2026 Kyle Johnson. Documentation: CC BY 4.0. Merran: AGPL-3.0-or-later.