In Cole, a tenant represents a single school (or other educational institution). The multi-tenant architecture means every piece of data — academic periods, professors, students, courses — belongs to exactly one tenant. Two distinct role categories govern tenant management:Documentation Index
Fetch the complete documentation index at: https://mintlify.com/iamalexis689725/cole/llms.txt
Use this file to discover all available pages before exploring further.
super-admin has platform-wide visibility and can create or delete any tenant, while director has access only to the tenant they were assigned to when their account was created.
When a super-admin creates a tenant, Cole simultaneously creates a director user account for that school and attaches every available module to the tenant in an inactive state, ready to be individually enabled later.
Tenant CRUD (super-admin)
POST /api/tenants
Creates a new tenant, provisions adirector user for it, and attaches all existing modules in an inactive state — all within a single database transaction.
Authentication required: Authorization: Bearer <token> — role super-admin
Request body
The official name of the school. Example:
"Colegio Lincoln".A URL-safe unique identifier for the tenant. Must be unique across all tenants. Example:
"lincoln".Full name of the director user that will be created for this tenant.
Email address for the director account. Must be unique in the
users table.Initial password for the director account. Stored as a bcrypt hash.
Response 200 OK
The newly created tenant record.
Always
null on creation. Upload a logo separately via POST /api/tenants/logo.The newly created director user, with
tenant_id set and the director role assigned.Example
GET /api/tenants
Returns an array of all tenants in the system. Each item in the array includes an appendedlogo_url field pointing to the publicly accessible logo image.
Authentication required: Authorization: Bearer <token> — role super-admin
Example
GET /api/tenants/
Returns a single tenant by its numeric ID. Authentication required:Authorization: Bearer <token> — role super-admin
Path parameters
The numeric ID of the tenant to retrieve.
Response 200 OK
The tenant record.
Fully qualified URL to the tenant’s logo, or
null if no logo has been uploaded.Example
DELETE /api/tenants/
Permanently deletes a tenant. If the tenant has a logo stored on disk, it is removed from thepublic storage disk before the database record is deleted.
Authentication required: Authorization: Bearer <token> — role super-admin
Path parameters
The numeric ID of the tenant to delete.
Response 200 OK
true when the tenant was successfully deleted.Confirmation string. Example:
"Tenant eliminado correctamente".Example
Director Tenant Management
Directors cannot see or modify other tenants. They operate exclusively on the tenant they belong to, identified automatically from thetenant_id field on their user record.
GET /api/my-tenant
Returns the authenticated director’s own tenant record along with its logo URL. Authentication required:Authorization: Bearer <token> — role director
Response 200 OK
The director’s tenant record.
Fully qualified URL to the tenant’s logo file, or
null if no logo has been uploaded yet.Example
POST /api/tenants/logo
Uploads or replaces the logo for the authenticated director’s tenant. The file is stored on thepublic disk under tenants/tenant_{id}.{ext}. Any previously stored logo is deleted before the new file is saved.
Authentication required: Authorization: Bearer <token> — role director
This endpoint expects a
multipart/form-data request, not JSON. Set your Content-Type to multipart/form-data or use a form upload client.Request body (multipart/form-data)
Image file to use as the tenant logo. Accepted MIME types:
image/png, image/jpg, image/jpeg. Maximum size: 2 MB (2048 KB).Response 200 OK
true on a successful upload.The updated tenant record, including the new
logo path.Fully qualified URL to the newly uploaded logo.
Example
PUT /api/tenants
Updates thename and slug of the authenticated director’s tenant. The slug uniqueness check excludes the current tenant so a director can re-submit their existing slug without a conflict error.
Authentication required: Authorization: Bearer <token> — role director
Request body
New name for the tenant. Example:
"Colegio Lincoln Internacional".New URL-safe identifier. Must be unique across all tenants, excluding the current tenant’s existing slug.
Response 200 OK
true on a successful update.The updated tenant record.
Fully qualified logo URL, or
null if no logo has been uploaded.Example
Module Sub-endpoints (super-admin)
Modules represent optional feature sets that can be enabled or disabled per tenant. When a tenant is created, all available modules are attached automatically in an inactive state. The super-admin uses these endpoints to control which modules a given school can access. All module sub-endpoints require:Authorization: Bearer <token> — role super-admin
GET /api/tenants//modules
Returns all modules currently attached to a tenant, including the activation status for each.Path parameters
The ID of the tenant whose modules you want to list.
Response 200 OK
Returns an array of module objects, each with the following fields:
Module ID.
Short code for the module. Example:
"ACADEMICO".Human-readable module name.
Brief description of the module.
Whether the module is currently active for this tenant.
Example
POST /api/tenants//modules
Assigns a module to a tenant and sets it as active. UsessyncWithoutDetaching, so calling this on a module that is already attached will simply update its status to active.
Path parameters
The ID of the tenant to assign the module to.
Request body
The ID of the module to assign. Must exist in the
modules table.Response 200 OK
Confirmation string. Example:
"Módulo asignado correctamente.".Example
DELETE /api/tenants//modules/
Detaches a module from a tenant entirely, removing the pivot record.Path parameters
The ID of the tenant.
The ID of the module to remove.
Response 200 OK
Confirmation string. Example:
"Módulo removido correctamente.".Example
PATCH /api/tenants//modules//activate
Sets theactivo pivot flag to true for the specified module on the given tenant. The module must already be attached.
Path parameters
The ID of the tenant.
The ID of the module to activate.
Response 200 OK
Confirmation string. Example:
"Módulo activado correctamente.".Example
PATCH /api/tenants//modules//deactivate
Sets theactivo pivot flag to false for the specified module on the given tenant.
Path parameters
The ID of the tenant.
The ID of the module to deactivate.
Response 200 OK
Confirmation string. Example:
"Módulo desactivado correctamente.".