Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/andrespaul123/micole-flutter/llms.txt

Use this file to discover all available pages before exploring further.

Mi Cole is a multi-tenant platform where each school is an isolated tenant. Super-admin users can provision new schools and view all existing ones. Directors log in to their own subdomain and interact only with their school via the /my-tenant route. Every endpoint below requires a valid Authorization: Bearer <token> header obtained from the Authentication API.

GET /api/tenants

List every school registered on the platform. Restricted to users with the super-admin role.
curl http://<your-server>/api/tenants \
  -H "Authorization: Bearer <token>"
Response — 200 OK Returns an array of Tenant objects (see Tenant Model below).
[
  {
    "id": 1,
    "name": "Colegio San José",
    "slug": "san-jose",
    "logo": "tenants/logos/1.png",
    "logo_url": "http://<your-server>/storage/tenants/logos/1.png"
  }
]

POST /api/tenants

Create a new school tenant and automatically provision a director account. Returns a TenantResponse that includes the new Tenant object plus the director’s initial credentials.
curl -X POST http://<your-server>/api/tenants \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Colegio San José",
    "slug": "san-jose",
    "director_name": "Luis Rodríguez",
    "director_email": "director@san-jose.edu",
    "password": "director_pass"
  }'
Request body
name
string
required
Human-readable name of the school (e.g. "Colegio San José").
slug
string
required
URL-friendly identifier for the tenant. Must be unique (e.g. "san-jose").
director_name
string
required
Full name of the director user that will be created alongside the tenant.
director_email
string
required
E-mail address for the new director account.
password
string
required
Initial password for the director account.
Response — 201 Created
{
  "tenant": {
    "id": 3,
    "name": "Colegio San José",
    "slug": "san-jose",
    "logo": null,
    "logo_url": null
  }
}
tenant
object
The newly created Tenant object. See Tenant Model.

GET /api/my-tenant

Retrieve the school that belongs to the currently authenticated director. The response includes a logo_url pointing to the publicly accessible logo image.
curl http://<your-server>/api/my-tenant \
  -H "Authorization: Bearer <token>"
Response — 200 OK
{
  "data": {
    "id": 3,
    "name": "Colegio San José",
    "slug": "san-jose",
    "logo": "tenants/logos/3.png"
  },
  "logo_url": "http://<your-server>/storage/tenants/logos/3.png"
}
Returns a Tenant object (with logo_url merged in) for the caller’s school.

PUT /api/tenants

Update the name and slug of the authenticated director’s school.
curl -X PUT http://<your-server>/api/tenants \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Colegio San José Actualizado",
    "slug": "san-jose-v2"
  }'
Request body
name
string
required
New display name for the school.
slug
string
required
New URL slug. Must remain unique across all tenants.
Response — 200 OK Returns the updated Tenant object inside data.

DELETE /api/tenants/:id

Permanently remove a school tenant. Super-admin access only.
curl -X DELETE http://<your-server>/api/tenants/3 \
  -H "Authorization: Bearer <token>"
Path parameters
id
integer
required
The numeric ID of the tenant to delete.
Response — 204 No Content
Upload or replace the school logo. Send the file as multipart/form-data with the field name logo.
curl -X POST http://<your-server>/api/tenants/logo \
  -H "Authorization: Bearer <token>" \
  -F "logo=@/path/to/school-logo.png"
Request body (multipart)
The image file to use as the school logo. Accepted formats: image/png, image/jpeg.
Response — 200 OK Returns a success indicator. The new logo is accessible via GET /api/my-tenant in the logo_url field.

Tenant Model

id
integer
Unique numeric identifier for the school.
name
string
Human-readable name of the school.
slug
string
URL-safe unique identifier used to scope tenant data.
logo
string | null
Relative storage path of the logo file, e.g. tenants/logos/3.png. Null if no logo has been uploaded.
logo_url
string | null
Absolute public URL to the logo image. Only present in GET /api/my-tenant responses.

TenantResponse Model

Returned by POST /api/tenants.
tenant
Tenant
The fully created Tenant object for the new school.

Build docs developers (and LLMs) love