Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/alvarezlautaro/BancoAlimentos/llms.txt

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

The Institutions API handles the lifecycle of organizations — such as soup kitchens, snack bars, and schools — that receive food donations through the Banco Alimentos network. Institution records are identified by a UUID (externalId) rather than a numeric ID, and all mutating endpoints require the ROLE_USER_INSTITUCIONAL role. Read access is available to the deposit, treasury, and institutional roles.

Base URL

/api/instituciones
Path parameters and request-body IDs use UUID format (e.g. 3fa85f64-5717-4562-b3fc-2c963f66afa6), not a plain numeric Long.

Endpoints

List all institutions (paginated)

Authorization
string
required
Bearer token with one of: ROLE_USER_DEPOSITO, ROLE_USER_TESORERIA, or ROLE_USER_INSTITUCIONAL.
page
integer
Zero-based page index. Default: 0.
size
integer
Number of records per page. Default: 10.
sort
string
Field and direction, e.g. nombre,asc. Default: nombre.
GET /api/instituciones
Response — 200 OK — Spring Page<InstitucionDTO> envelope.
{
  "content": [
    {
      "externalId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
      "nombre": "Escuela Nuestra Señora de Fátima",
      "tipo": "ESCUELA",
      "telefono": "01112345678",
      "email": "contacto@example.com",
      "estado": "AL_DIA"
    }
  ],
  "pageable": { "pageNumber": 0, "pageSize": 10 },
  "totalElements": 42,
  "totalPages": 5
}

Get institution by ID

Authorization
string
required
Bearer token with one of: ROLE_USER_DEPOSITO, ROLE_USER_TESORERIA, or ROLE_USER_INSTITUCIONAL.
externalId
UUID
required
UUID of the institution.
GET /api/instituciones/{externalId}
Response — 200 OK — single InstitucionDTO object.

Get institution by name

Authorization
string
required
Bearer token with one of: ROLE_USER_DEPOSITO, ROLE_USER_TESORERIA, or ROLE_USER_INSTITUCIONAL.
nombre
string
required
Exact name of the institution.
GET /api/instituciones/nombre/{nombre}
Response — 200 OK — single InstitucionDTO object.

Filter by institution type (paginated)

Authorization
string
required
Bearer token with one of: ROLE_USER_DEPOSITO, ROLE_USER_TESORERIA, or ROLE_USER_INSTITUCIONAL.
tipo
tipoInstitucion
required
One of the tipoInstitucion enum values (see table below).
page
integer
Zero-based page index. Default: 0.
size
integer
Page size. Default: 10.
sort
string
Sort field and direction. Default: nombre.
GET /api/instituciones/tipo/{tipo}
Response — 200 OK — paginated Page<InstitucionDTO>.

Filter by payment status (paginated)

Authorization
string
required
Bearer token with one of: ROLE_USER_DEPOSITO, ROLE_USER_TESORERIA, or ROLE_USER_INSTITUCIONAL.
estado
estadoPago
required
One of the estadoPago enum values (see table below).
page
integer
Zero-based page index. Default: 0.
size
integer
Page size. Default: 10.
sort
string
Sort field and direction. Default: nombre.
GET /api/instituciones/estado-pago/{estado}
Response — 200 OK — paginated Page<InstitucionDTO>.

Create institution

Authorization
string
required
Bearer token with the ROLE_USER_INSTITUCIONAL role.
POST /api/instituciones
Request body — NuevaInstitucionDTO
nombre
string
required
Institution name. At least 3 characters.
tipo
tipoInstitucion
required
Institution type. Must be a valid tipoInstitucion enum value.
direccion
string
required
Physical address of the institution.
telefono
string
Contact phone number.
email
string
Contact email address. Must be a valid email format.
estado
estadoPago
required
Current payment/subscription status. Must be a valid estadoPago enum value.
Response — 201 Created — returns the newly created InstitucionDTO.

Full update

Authorization
string
required
Bearer token with the ROLE_USER_INSTITUCIONAL role.
externalId
UUID
required
UUID of the institution to update.
PUT /api/instituciones/{externalId}
Request body uses InstitucionDTO fields (see Data models below). Response — 200 OK — returns the updated InstitucionDTO.

Partial update

Authorization
string
required
Bearer token with ROLE_USER_INSTITUCIONAL or ROLE_USER_TESORERIA.
externalId
UUID
required
UUID of the institution to partially update.
PATCH /api/instituciones/{externalId}
Request body uses ActualizarInstitucionParcialDTO (all fields optional except externalId). Only supplied fields are updated. Response — 200 OK — returns the updated InstitucionDTO.

Delete institution

Authorization
string
required
Bearer token with the ROLE_USER_INSTITUCIONAL role.
externalId
UUID
required
UUID of the institution to delete.
DELETE /api/instituciones/{externalId}
Response — 204 No Content

Get audit history

Authorization
string
required
Valid Bearer token.
externalId
UUID
required
UUID of the institution whose history to retrieve.
GET /api/instituciones/{externalId}/historial
Returns a list of historical Institucion snapshots representing every revision stored for this institution. Response — 200 OK — JSON array of institution snapshots.

Data models

NuevaInstitucionDTO

FieldTypeRequiredConstraints
nombrestringNot blank; min 3 characters
tipotipoInstitucionValid enum value
direccionstringNot blank
telefonostringOptional contact phone
emailstringOptional; must be a valid email
estadoestadoPagoValid enum value

InstitucionDTO

externalId
UUID
Unique identifier of the institution.
nombre
string
Institution name (min 3 characters).
tipo
tipoInstitucion
Type of institution.
telefono
string
Contact phone number (10–11 digits when provided).
email
string
Contact email address.
estado
estadoPago
Current payment status of the institution’s subscription.

ActualizarInstitucionParcialDTO

FieldTypeRequiredConstraints
externalIdUUIDMust match the path parameter
nombrestringMin 3 characters if provided
tipotipoInstitucionValid enum value if provided
direccionstringOptional
telefonostring10–11 digits if provided
emailstringValid email format if provided
estadoestadoPagoValid enum value if provided

Enum: tipoInstitucion

ValueDescription
COMEDORCommunity soup kitchen
MERENDEROAfternoon snack bar
ESCUELASchool
OTROOther organization

Enum: estadoPago

ValueDescription
AL_DIASubscription payments are current
DEUDORInstitution has outstanding dues
EXCEPCIONALExceptional / waived payment arrangement

Pagination

All list endpoints use Spring’s Pageable mechanism. The response is a standard Spring Page<T> envelope containing:
FieldDescription
contentArray of items for the current page
pageablePagination metadata (pageNumber, pageSize)
totalElementsTotal number of matching records
totalPagesTotal number of pages
Query parameters:
ParamDefaultDescription
page0Zero-based page number
size10Number of items per page
sortnombreSort field and optional direction (asc/desc)

Build docs developers (and LLMs) love