### API Parameters

- **client_id**  
  The unique ID associated with your developer project.  
  Type: string, Required: true

- **oauth_token**  
  The access token generated via your web application as described [here](https://docs.foursquare.com/developer/reference/v2-authentication).  
  Type: string, Required: true

- **name**  
  A custom string that you can set to help you identify the set of geofences.  
  Type: string, Required: true

- **venueId**  
  A single Foursquare `venueId`. **Required** if adding a geofence around a FSQ venue & if either a `categoryId` or a `chainId` is not provided.  
  Type: string

- **categoryId**  
  A single Foursquare `categoryId`. **Required** if adding a geofence around a FSQ venue & if either a `venueId` or a `chainId` is not provided.  
  Type: string

- **chainId**  
  A single Foursquare `venueId`. **Required** if adding a geofence around a FSQ venue & if either a `venueId` or a `categoryId` is not provided.  
  Type: string

- **polygon**  
  A string of URL encoded lat/lng points separated by semicolon, with start and end as the same points. Must provide between 4 and 15 points in a clockwise fashion to successfully create the polygon. **Required** if adding a geofence using a custom polygon.  
  Type: string

- **center**  
  A comma separated lat/lng coordinate. **Required** if adding a lat/long coordinate based geofence.  
  Type: string

- **radius**  
  Area around the lat/lng that will trigger a geofence event. Default and minimum radius is 50 meters with a max of 5000. **Required** if adding a lat/long coordinate based geofence.  
  Type: int32

- **dwellTime**  
  Number of minutes user needs to be inside of a geofence to trigger a dwell event. Default is 1 minute. Applies only to polygon and lat/long coordinate-based geofences.  
  Type: int32

- **v**  
  The API version date as documented [here](https://developer.foursquare.com/reference/versioning)  
  Type: string, Required: true

---

### Example Request
```shell
curl --request POST \
     --url https://api.foursquare.com/v2/apps/client_id/geofences/add \
     --header 'accept: application/json'
```

### Example Response
```json
{
  "meta": {
    "code": 200,
    "requestId": "5caac6f5dd57977ccc9f0876"
  },
  "notifications": [
    {
      "type": "notificationTray",
      "item": {
        "unreadCount": 0
      }
    }
  ],
  "response": {
    "geofence": {
      "type": "Venue",
      "name": "My Deals and Offers",
      "id": "5caac6f56e69af002502df37",
      "venueIds": [
        "3fd66200f964a520d0e41ee3"
      ],
      "boundary": {
        "radius": 100
      },
      "dwellTime": 2
    }
  }
}
```
