Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/Edfermachado/proyectoSistemas/llms.txt

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

Spaces represent the physical venues — classrooms, auditoriums, labs, and meeting rooms — that belong to a specific faculty tenant. Every event in UniEvents must be assigned to a space, and a space is always scoped to the tenant that owns it. Spaces cannot be shared across faculties: each tenantId is fixed at creation time and cannot be changed via PUT. All CRUD operations are handled by SpacesService, which queries the spaces table through Drizzle ORM.

GET /api/spaces

Returns all spaces that belong to a given tenant, ordered by creation date (newest first).

Query Parameters

tenantId
string
required
The UUID of the tenant (faculty) whose spaces you want to retrieve. Returns 400 if omitted.

Response 200

Returns a JSON array of space objects. An empty array is returned when the tenant has no spaces yet.
id
string
UUID of the space.
name
string
Human-readable name of the venue (e.g. "Auditorium A", "Lab 302").
capacity
integer
Maximum number of attendees the space can hold.
tenantId
string
UUID of the owning tenant. Spaces are never shared across tenants.
createdAt
string
ISO 8601 timestamp of when the space was created.
curl "https://your-domain.com/api/spaces?tenantId=f47ac10b-58cc-4372-a567-0e02b2c3d479"
[
  {
    "id": "3b1e8c2a-1234-4abc-8def-000000000001",
    "name": "Auditorium A",
    "capacity": 300,
    "tenantId": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
    "createdAt": "2024-09-15T10:23:00.000Z"
  },
  {
    "id": "3b1e8c2a-1234-4abc-8def-000000000002",
    "name": "Lab 302",
    "capacity": 40,
    "tenantId": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
    "createdAt": "2024-08-01T08:00:00.000Z"
  }
]

Error Responses

StatusBodyReason
400{ "error": "Missing tenantId param" }tenantId query parameter was not provided.
500{ "error": "Internal Server Error" }Unexpected database or server error.

POST /api/spaces

Creates a new space and associates it with the specified tenant.

Request Body

name
string
required
The display name for the venue. Must be non-empty.
capacity
integer
required
The maximum number of attendees the space can hold. Must be a positive integer.
tenantId
string
required
UUID of the tenant (faculty) that owns this space. This value is set at creation and cannot be updated later.

Response 201

Returns the newly created space object.
id
string
Auto-generated UUID for the new space.
name
string
Name of the space as provided.
capacity
integer
Capacity as provided.
tenantId
string
UUID of the owning tenant.
createdAt
string
ISO 8601 timestamp set by the database on insert.
curl -X POST "https://your-domain.com/api/spaces" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Seminar Room B",
    "capacity": 80,
    "tenantId": "f47ac10b-58cc-4372-a567-0e02b2c3d479"
  }'
{
  "id": "3b1e8c2a-1234-4abc-8def-000000000099",
  "name": "Seminar Room B",
  "capacity": 80,
  "tenantId": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
  "createdAt": "2024-11-20T14:05:00.000Z"
}

Error Responses

StatusBodyReason
500{ "error": "Internal Server Error" }Unexpected database or server error.

GET /api/spaces/{id}

Returns a single space by its UUID.

Path Parameters

id
string
required
UUID of the space to retrieve.

Response 200

id
string
UUID of the space.
name
string
Display name of the venue.
capacity
integer
Maximum attendee capacity.
tenantId
string
UUID of the owning tenant.
createdAt
string
ISO 8601 creation timestamp.
curl "https://your-domain.com/api/spaces/3b1e8c2a-1234-4abc-8def-000000000001"
{
  "id": "3b1e8c2a-1234-4abc-8def-000000000001",
  "name": "Auditorium A",
  "capacity": 300,
  "tenantId": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
  "createdAt": "2024-09-15T10:23:00.000Z"
}

Error Responses

StatusBodyReason
404{ "error": "Not found" }No space exists with the given id.
500{ "error": "Internal Server Error" }Unexpected server error.

PUT /api/spaces/{id}

Partially updates a space’s name and/or capacity. The tenantId is immutable and cannot be changed through this endpoint.

Path Parameters

id
string
required
UUID of the space to update.

Request Body

name
string
New display name for the venue. Omit to leave unchanged.
capacity
integer
New capacity value. Omit to leave unchanged.

Response 200

Returns the updated space object.
id
string
UUID of the space.
name
string
Updated (or unchanged) display name.
capacity
integer
Updated (or unchanged) capacity.
tenantId
string
UUID of the owning tenant (unchanged).
createdAt
string
Original ISO 8601 creation timestamp.
curl -X PUT "https://your-domain.com/api/spaces/3b1e8c2a-1234-4abc-8def-000000000001" \
  -H "Content-Type: application/json" \
  -d '{
    "capacity": 350
  }'
{
  "id": "3b1e8c2a-1234-4abc-8def-000000000001",
  "name": "Auditorium A",
  "capacity": 350,
  "tenantId": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
  "createdAt": "2024-09-15T10:23:00.000Z"
}

Error Responses

StatusBodyReason
500{ "error": "Internal Server Error" }Unexpected server error.

DELETE /api/spaces/{id}

Permanently deletes a space. This operation is irreversible. Deleting a space that is still referenced by active events will cause a database foreign-key constraint error.

Path Parameters

id
string
required
UUID of the space to delete.

Response 204

Empty body. The space has been deleted.
curl -X DELETE "https://your-domain.com/api/spaces/3b1e8c2a-1234-4abc-8def-000000000001"

Error Responses

StatusBodyReason
500{ "error": "Internal Server Error" }Unexpected server error or FK constraint violation.
Spaces belong to a single tenant and cannot be shared across faculties. The tenantId is set at creation time (via POST) and is not exposed as an editable field on PUT. Attempting to move a space to a different tenant requires deleting and recreating it.

Build docs developers (and LLMs) love