# Geofence Out Event

### Overview

Geofence out event gets triggered when the tracker exits a designated geofenced area.

### Create geofence in event

This endpoint allows you to add a geofence in event to a tracker. When the event is triggered, notifications are sent to recipients based on the event notification configuration.

<mark style="color:green;">`POST`</mark> `{baseUrl}/tracker/event`

#### Request Body

| Field                               | Type     | Required | Description                                                                                                                           |
| ----------------------------------- | -------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------- |
| `trackerId`                         | `string` | ✅        | The unique ID of the tracker.                                                                                                         |
| `eventType`                         | `string` | ✅        | The type of event to be created. (For geofence out event, use `"GEOFENCE_OUT"`                                                        |
| geofenceIds                         | `array`  | ✅        | Array of geofence ids. Instructions on how to create a geofence can be found [here](/live-tracking-apis/geofences/create-geofence.md) |
| `eventNotification`                 | `object` | ❌        | Optional notification settings for the event.                                                                                         |
| `eventNotification.acceptedMediums` | `array`  | ❌        | A list of notification channels and their settings.                                                                                   |
| `eventNotification.status`          | `string` | ❌        | Status of the notification configuration. Accepts either `"inactive"` or `"active"`                                                   |

#### Sample Success Data

```
//Sample Request Body
{
    "trackerId": "6780092e89b7bd4c6b0a82be",
    "eventType": "GEOFENCE_OUT",
    "geofenceIds": [ "67ceebdba95c9d18a4c39333" ],
    "eventNotification": { //optional
      "acceptedMediums": [
        {
          "channel": "email",
          "isEnabled": true,
          "defaultEmail": [ "test@gmail.com" ]
        },
        {
          "channel": "sms",
          "isEnabled": true,
          "defaultPhone": [ "+2349088888888" ]
        },
        {
          "channel": "inApp",
          "isEnabled": false
        }
      ],
      "status": "active"
    }
}
```

#### Sample Success Response

```
//Sample success response
{
    "status": true,
    "message": "Tracker event successfully created",
    "data": {}
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.sendstackhq.com/live-tracking-apis/events/create-events/geofence-out-event.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
