Skip to main content

Overview

The Establishments API allows authenticated users to register and manage their dairy farm establishments. Each user can have one establishment associated with their account.

Base URL

/establecimiento
Authentication Required: All endpoints require authentication via cookie-based JWT token.

Create Establishment

curl -X POST https://api.tambo360.com/establecimiento/registrar \
  -H "Content-Type: application/json" \
  -H "Cookie: token=<jwt_token>" \
  -d '{
    "nombre": "Establecimiento Norte",
    "localidad": "Rafaela",
    "provincia": "Santa Fe"
  }'
Registers a new dairy farm establishment for the authenticated user.

Request Body

nombre
string
required
Name of the establishment. Must contain at least 2 characters and at least one letter or number.
localidad
string
required
City or locality where the establishment is located. Minimum 2 characters.
provincia
string
required
Province or state where the establishment is located. Minimum 2 characters.

Response

statusCode
integer
HTTP status code (201 for success)
message
string
“Establecimiento creado correctamente”
data
object
Created establishment object:
idEstablecimiento
string
UUID of the establishment
nombre
string
Establishment name
localidad
string
Locality/city
provincia
string
Province/state
idUsuario
string
UUID of the owner user
success
boolean
Indicates success (true)
{
  "statusCode": 201,
  "message": "Establecimiento creado correctamente",
  "data": {
    "idEstablecimiento": "c2b8e8a2-4f92-4f3f-b0c5-1a2b3c4d5e6f",
    "nombre": "Establecimiento Norte",
    "localidad": "Rafaela",
    "provincia": "Santa Fe",
    "idUsuario": "a1b2c3d4-5678-90ab-cdef-1234567890ab"
  },
  "success": true
}

List Establishments

curl -X GET https://api.tambo360.com/establecimiento/listar \
  -H "Cookie: token=<jwt_token>"
Retrieves the establishment(s) registered for the authenticated user.

Response

statusCode
integer
HTTP status code (200 for success)
message
string
“Establecimientos obtenidos correctamente”
data
object
Establishment data:
idEstablecimiento
string
UUID of the establishment
nombre
string
Establishment name
localidad
string
Locality/city
provincia
string
Province/state
idUsuario
string
UUID of the owner user
success
boolean
Indicates success (true)
{
  "statusCode": 200,
  "message": "Establecimientos obtenidos correctamente",
  "data": {
    "idEstablecimiento": "c2b8e8a2-4f92-4f3f-b0c5-1a2b3c4d5e6f",
    "nombre": "Establecimiento Norte",
    "localidad": "Rafaela",
    "provincia": "Santa Fe",
    "idUsuario": "a1b2c3d4-5678-90ab-cdef-1234567890ab"
  },
  "success": true
}

Error Responses

All endpoints may return the following error responses:

400 Bad Request

  • Invalid input data
  • Validation errors
  • User already has an establishment

401 Unauthorized

  • Missing authentication token
  • Invalid or expired JWT token

500 Internal Server Error

  • Unexpected server error
  • Database connection issues

Build docs developers (and LLMs) love