Skip to content

Workplaces

Workplaces represent physical or logical work locations. This resource supports full CRUD operations. Include Content-Type: application/json on all requests that send a body.


Index Workplaces

GET https://api.mitrabajo.uy/workplaces

Returns a paginated list of all workplaces belonging to your account.

Request Headers

Header Value Required
X-Api-Key Your access token Yes

Request Body

None.

Example

curl https://api.mitrabajo.uy/workplaces \
  -H "X-Api-Key: EPZoeOHHDPz-ucc5HweJYt6xehe_1bV-"

Response

{
  "items": [
    {
      "id": 1,
      "name": "Oficina Central",
      "details": "Sede principal de operaciones",
      "status": "Active",
      "country": 1,
      "city": "Montevideo",
      "address": "Av. 18 de Julio 1234",
      "door_number": "1234",
      "floor": 3,
      "apartment": "301",
      "neighborhood": "Centro",
      "lng": -56.1882,
      "lat": -34.9011,
      "olson": "America/Montevideo",
      "phone": "+598 2 123 4567",
      "centro_costo": "CC001",
      "auxiliar": null,
      "postal_code": "11100",
      "id_externo": 42,
      "id_grupo": 5
    }
  ],
  "_links": {
    "self":  { "href": "https://api.mitrabajo.uy/workplaces?page=1" },
    "first": { "href": "https://api.mitrabajo.uy/workplaces?page=1" },
    "last":  { "href": "https://api.mitrabajo.uy/workplaces?page=1" }
  },
  "_meta": {
    "totalCount": 1,
    "pageCount": 1,
    "currentPage": 1,
    "perPage": 20
  }
}

View Workplace

GET https://api.mitrabajo.uy/workplaces/{id}

Returns detailed information about a single workplace.

Request Headers

Header Value Required
X-Api-Key Your access token Yes

Request Body

None.

Example

curl https://api.mitrabajo.uy/workplaces/1 \
  -H "X-Api-Key: EPZoeOHHDPz-ucc5HweJYt6xehe_1bV-"

Response

{
  "id": 1,
  "name": "Oficina Central",
  "details": "Sede principal de operaciones",
  "status": "Active",
  "country": 1,
  "city": "Montevideo",
  "address": "Av. 18 de Julio 1234",
  "door_number": "1234",
  "floor": 3,
  "apartment": "301",
  "neighborhood": "Centro",
  "lng": -56.1882,
  "lat": -34.9011,
  "olson": "America/Montevideo",
  "phone": "+598 2 123 4567",
  "centro_costo": "CC001",
  "auxiliar": null,
  "postal_code": "11100",
  "id_externo": 42,
  "id_grupo": 5
}

Create Workplace

POST https://api.mitrabajo.uy/workplaces

Creates a new workplace. Returns the created object with 201 Created.

Request Headers

Header Value Required
X-Api-Key Your access token Yes
Content-Type application/json Yes

Request Body

Field Type Required Constraints
name string Yes Max 100 characters
country integer Yes Country ID
details string No Free text
status string No One of: Active, On Hold, Completed, Dropped, Dia Franco, Domicilio Particular
city string No Max 100 characters
address string No Free text
door_number string No Max 6 characters
floor integer No
apartment string No Max 6 characters
neighborhood string No Max 100 characters
lat number No Latitude coordinate
lng number No Longitude coordinate
olson string No IANA timezone name, max 200 characters
phone string No Max 50 characters
centro_costo string No Max 50 characters
auxiliar string No Max 50 characters
postal_code string No Max 10 characters
id_externo integer No External system reference ID
id_grupo integer No Group ID

Example

curl -X POST https://api.mitrabajo.uy/workplaces \
  -H "X-Api-Key: EPZoeOHHDPz-ucc5HweJYt6xehe_1bV-" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Sucursal Norte",
    "country": 1,
    "status": "Active",
    "city": "Montevideo",
    "address": "Bulevar Artigas 2000",
    "neighborhood": "Pocitos",
    "olson": "America/Montevideo",
    "phone": "+598 2 987 6543",
    "centro_costo": "CC002",
    "postal_code": "11300",
    "id_externo": 55
  }'

Response

{
  "id": 2,
  "name": "Sucursal Norte",
  "details": null,
  "status": "Active",
  "country": 1,
  "city": "Montevideo",
  "address": "Bulevar Artigas 2000",
  "door_number": null,
  "floor": null,
  "apartment": null,
  "neighborhood": "Pocitos",
  "lng": null,
  "lat": null,
  "olson": "America/Montevideo",
  "phone": "+598 2 987 6543",
  "centro_costo": "CC002",
  "auxiliar": null,
  "postal_code": "11300",
  "id_externo": 55,
  "id_grupo": null
}

Update Workplace

PATCH https://api.mitrabajo.uy/workplaces/{id}

PUT https://api.mitrabajo.uy/workplaces/{id}

Updates an existing workplace. PATCH accepts a partial body (only the fields to change). PUT replaces the full record. Returns the updated object with 200 OK.

Request Headers

Header Value Required
X-Api-Key Your access token Yes
Content-Type application/json Yes

Request Body

Same fields as Create Workplace. With PATCH, only include the fields you want to change.

Example

curl -X PATCH https://api.mitrabajo.uy/workplaces/2 \
  -H "X-Api-Key: EPZoeOHHDPz-ucc5HweJYt6xehe_1bV-" \
  -H "Content-Type: application/json" \
  -d '{
    "status": "On Hold",
    "phone": "+598 2 111 2222"
  }'

Response

{
  "id": 2,
  "name": "Sucursal Norte",
  "status": "On Hold",
  "phone": "+598 2 111 2222",
  "city": "Montevideo",
  "..."
}

Delete Workplace

DELETE https://api.mitrabajo.uy/workplaces/{id}

Deletes a workplace. Returns 204 No Content on success. Deletion is blocked if the workplace has associated planning records.

Request Headers

Header Value Required
X-Api-Key Your access token Yes

Request Body

None.

Example

curl -X DELETE https://api.mitrabajo.uy/workplaces/2 \
  -H "X-Api-Key: EPZoeOHHDPz-ucc5HweJYt6xehe_1bV-"

Response

204 No Content — empty body on success.


Options

OPTIONS https://api.mitrabajo.uy/workplaces

OPTIONS https://api.mitrabajo.uy/workplaces/{id}

Returns the HTTP methods supported by the endpoint in the Allow response header.

Request Headers

Header Value Required
X-Api-Key Your access token Yes

Request Body

None.

Example

curl -X OPTIONS https://api.mitrabajo.uy/workplaces \
  -H "X-Api-Key: EPZoeOHHDPz-ucc5HweJYt6xehe_1bV-" \
  -v

Response

200 OK with the Allow header listing supported verbs:

Allow: GET, HEAD, POST, OPTIONS