---
title: "Add 1 or more Pois"
method: POST
path: "/pois"
tags: ["Pois"]
---

# Add 1 or more Pois

`POST /pois`

## Request

- Base URL: `https://flash-api.quadminds.com/api/v2`
- URL: `https://flash-api.quadminds.com/api/v2/pois`
- Auth: API key in header `x-saas-apikey`

># GEOLOCALIZATION
New Pois can be geocoded when being created. There are some considerations to take into account:
* If **latitude** and **longitude** are present, it won't geocode based on the **address**, **longAddress** or **geocodeByCep** object. *BUT* will try to fetch an address with that coordinates and if it's a valid one, it will be replace as the Poi address.
IE: if **latitude**:0 and **longitude**:0, it will not geocode and will try to fetch an address from [0,0] but won't get any result, so the address will not change.
* If **latitude** and **longitude** are not present, it will prioritize the addresses in this order
   1. geocodeByCep: if this objects is present and is valid, **address** and **longAddress** will be ignored
   2. address: if this objects is present, **longAddress** will be ignored. IE If you dont't want to use address object, remove it entirely so that **longAddress** can be used 
   3. longAddress: if this string is present, it will try to gecode based on this string.

## Request body

- Poi[]: Pois to add
  - `code` string, required: Poi code
  - `name` string, required: Poi name
  - `address` object: Address componentes, If these properties are not filled we will geocode with longAddress value
    - `street` string: Street name
    - `number` string: address number
    - `locality` string: Locality
    - `state` string: State
    - `country` string: Country
  - `longAddress` string: Poi address
  - `longitude` number: Poi longitude coordinate
  - `latitude` number: Poi latitude coordinate
  - `geocodeByCep` object: Object to geocode by CEP
    - `cep` string: CEP Number
    - `doorNumber` string: Door Number
  - `enabled` boolean, required: Poi status
  - `deliveryAreaCode` string: Poi delivery area code
  - `salesAreaCode` string: Poi sale area code
  - `poiType` string, required: Poi type code from /poi/types
  - `originalAddress` string: Poi first address entered
  - `phoneNumber` string, required: Poi phone
  - `taxId` string: Poi taxId
  - `radius` integer: Poi radius (meters)
  - `grouping` string: Poi grouping
  - `visitingFrequency` 'weekly' | 'biweekly' | 'monthly': Poi frequency
  - `deviceId1` string: ERP code
  - `visitingDaysDevice1` integer[]: Poi visiting day for deviceId1 "Monday -> 1, Sunday -> 7"
  - `deviceId2` string: ERP code
  - `visitingDaysDevice2` integer[]: Poi visiting day for deviceId2 "Monday -> 1, Sunday -> 7"
  - `deviceId3` string: ERP code
  - `visitingDaysDevice3` integer[]: Poi visiting day for deviceId3 "Monday -> 1, Sunday -> 7"
  - `deviceId4` string: ERP code
  - `visitingDaysDevice4` integer[]: Poi visiting day for deviceId4 "Monday -> 1, Sunday -> 7"
  - `comments` string: comments/observations
  - `visitingOrder` integer: Poi visiting order
  - `email` string: Poi Email (More than one separated by commas)
  - `timeWindow` object[]: Poi visiting time windows (use User TimeZone)
    - `from` string: Window Start time
    - `to` string: Window End time
  - `poiDelay` string: delay time in Poi
  - `poiDeliveryComments` string: Additional Comments when delivering to this Poi
  - `notificationConfig` object: Notifications configuration
    - `order` object
      - `planned` string[]
      - `routeStarted` string[]
      - `arriving` string[]
      - `delivered` string[]
      - `failed` string[]

## Response `200`

On Error, meta object will contain an error array with these posible values
### Error codes:
Code | Description | Field
----------------|-------------|-------------
1001 | Wrong time window object | timeWindow
2002 | Wrong time window values, must be string | timeWindow
2003 | Wrong time window, 'from' must be less than 'to' | timeWindow
2004 | Wrong time window, times are overlapped | timeWindow
2010 | Poi type not found or not allowed for this user | poiType
2020 | Poi code already present for this user | code
2021 | Poi code not found or not allowed for this user | code
2023 | Nothing to update |  
2024 | Visiting frequency invalid | visitingFrequency
2025 | Visiting days invalid | visitingDays
5001 | Area code not present or not allowed for this user | salesAreaCode, deliveryAreaCode

- object
  - `meta` object
    - `poisInserted` number: Number of pois inserted on poi POST
    - `geocodedPois` number: Number of pois geoCoded on poi POST
    - `errors` object[]
      - `error` number: Error number
      - `message` string: Error message
  - `data` object[]
    - `code` string: Poi code
    - `name` string: Poi name
    - `address` string: Poi address
    - `longitude` number: Poi longitude coordinate
    - `latitude` number: Poi latitude coordinate
    - `geocodeByCep` object: Object to geocode by CEP
      - `cep` string: CEP Number
      - `doorNumber` string: Door Number
    - `enabled` boolean: Poi status
    - `deliveryAreaCode` string: Poi delivery area code
    - `salesAreaCode` string: Poi sale area code
    - `poiType` string: Poi type code from /poi/types
    - `originalAddress` string: Poi first address entered
    - `phoneNumber` string: Poi phone
    - `taxId` string: Poi taxId
    - `radius` integer: Poi radius (meters)
    - `grouping` string: Poi grouping
    - `visitingFrequency` 'weekly' | 'biweekly' | 'monthly': Poi frequency
    - `deviceId1` string: ERP code
    - `visitingDaysDevice1` integer[]: Poi visiting day for deviceId1 "Monday -> 1, Sunday -> 7"
    - `deviceId2` string: ERP code
    - `visitingDaysDevice2` integer[]: Poi visiting day for deviceId2 "Monday -> 1, Sunday -> 7"
    - `deviceId3` string: ERP code
    - `visitingDaysDevice3` integer[]: Poi visiting day for deviceId3 "Monday -> 1, Sunday -> 7"
    - `deviceId4` string: ERP code
    - `visitingDaysDevice4` integer[]: Poi visiting day for deviceId4 "Monday -> 1, Sunday -> 7"
    - `comments` string: comments/observations
    - `visitingOrder` integer: Poi visiting order
    - `email` string: Poi Email (More than one separated by commas)
    - `timeWindow` object[]: Poi visiting time windows (use User TimeZone)
      - `from` string: Window Start time
      - `to` string: Window End time
    - `poiDelay` string: delay time in Poi
    - `poiDeliveryComments` string: Additional Comments when delivering to this Poi
    - `notificationConfig` object: Notifications configuration
      - `order` object
        - `planned` string[]
        - `routeStarted` string[]
        - `arriving` string[]
        - `delivered` string[]
        - `failed` string[]
    - `lastVisitedAt` string, date-time: Poi last time visited
    - `updatedAt` string, date-time: Poi last updated time
    - `skippedGeocodeAt` string, date-time
    - `area` object: Poi area geoJson
    - `geocodedByAppAt` string, date-time: Time in which was geocoded by App

## Other responses

- `403`: Not authorized access

---

[API](https://skmtc.dev/quadminds/apis/cloudflash-api.md) - [All operations](https://skmtc.dev/quadminds/apis/cloudflash-api/llms.txt) - [OpenAPI document](https://skmtc.dev/quadminds/apis/cloudflash-api/revisions/7731f1076b80?raw)
