> ## Documentation Index
> Fetch the complete documentation index at: https://docs.radar.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Track API

> Reference for Radar's track endpoint, which sends a location update and returns the user and the events the update generated.

Use the Track API to send a location update for a user and get back the user's current state and any events the update generated.

| Operation | Endpoint | Authentication |
| - | - | - |
| [Track](#track) | `POST /v1/track` | Publishable key |

The base URL is `https://api.radar.io`. Send your API key in the `Authorization` header. For key types, the error format, and rate limits, see [Authentication, errors, and rate limits](https://docs.radar.com/api/fundamentals.md).

On iOS and Android, use the [SDK](https://docs.radar.com/sdk/sdk.md) to track users in the foreground or in the background. The SDK calls this endpoint for you and handles permissions, batching, and offline replay. Call the endpoint directly only when you can't use an SDK, for example from a device or backend that already has a location.

## Track

Tracks a location update. Returns the user and the events generated, depending on your project settings.

* **Endpoint**: `POST /v1/track`
* **Authentication**: Publishable key
* **Rate limit**: 1 request per second per device
* **Used by**: [Detect geofence events and place visits](https://docs.radar.com/geofencing/geofences-and-places.md), [Track pickups, deliveries, and workers](https://docs.radar.com/geofencing/trips.md)

`deviceId` identifies logged out users. `userId` and `deviceId` together identify logged in users. If a matching user exists, Radar updates it. If not, Radar creates a new user.

Don't send personally identifiable information, such as a name, an email address, or a publicly available ID, as `userId`.

### Body parameters

| Parameter | Type | Required | Description |
| - | - | - | - |
| `deviceId` | string | Yes | A device ID for the user. Identifies logged out users. |
| `userId` | string | No | A stable unique ID for the user. Used with `deviceId` to identify logged in users. |
| `latitude` | number | Yes | The user's current latitude. A number between -90 and 90. |
| `longitude` | number | Yes | The user's current longitude. A number between -180 and 180. |
| `accuracy` | number | Yes | The accuracy of the location in meters. A number greater than 0 and at most 1000000. Radar uses it to evaluate the confidence of geofence events. |
| `foreground` | boolean | No | `true` if the client is in the foreground, `false` if the client is in the background. |
| `stopped` | boolean | No | `true` if the user is stopped, `false` if the user is moving. |
| `description` | string | No | A description for the user, displayed in the Radar dashboard. 1 to 256 characters. |
| `metadata` | object | No | Custom metadata for the user. Up to 16 keys, with values of type string, boolean, or number. See [Metadata](https://docs.radar.com/api/fundamentals.md#metadata). |
| `deviceType` | string | No | The user's device type. One of `iOS`, `Android`, or `Web`. |
| `updatedAt` | ISO 8601 string | No | The client timestamp or historical timestamp of the location update. A date or valid ISO date string. Send historical data in chronological order. Defaults to the current server time if omitted or out of order. |
| `replayed` | boolean | No | `true` if the location is replayed after being stored on the device. Defaults to `false`. |
| `deviceOS` | string | No | The operating system of the device. |
| `deviceMake` | string | No | The manufacturer of the device. |
| `deviceModel` | string | No | The model of the device. |
| `altitude` | number | No | The altitude in meters. |
| `verticalAccuracy` | number | No | The vertical accuracy in meters. |

### Response

A `200` response contains:

| Field | Type | Description |
| - | - | - |
| `meta` | object | The response metadata, including `code`. |
| `user` | object | The updated [user](https://docs.radar.com/api/users.md#user-object), including location context such as `geofences`, `place`, `country`, `state`, `dma`, `postalCode`, `beacons`, `trip`, and `fraud` when the related features are enabled for your project. |
| `events` | array of objects | The [events](https://docs.radar.com/api/events.md#event-object) generated by this location update. Empty when the update didn't change the user's state. |

Which context fields and event types you receive depends on your project settings. Region fields require Regions, `place` requires Places, and `fraud` requires Fraud. When user insights are enabled and Radar has inferred a home or work location, `user.locationInsights` is included. See [User object](https://docs.radar.com/api/users.md#user-object).

To receive the same events on your backend without polling, use [webhooks](https://docs.radar.com/integrations/webhooks.md).

### Example

This request sends a location update for `user-123` on `device-456`.

```bash theme={null}
curl "https://api.radar.io/v1/track" \
  -H "Authorization: prj_live_pk_..." \
  -X POST \
  -d "deviceId=device-456" \
  -d "userId=user-123" \
  -d "latitude=40.78382" \
  -d "longitude=-73.97536" \
  -d "accuracy=65"
```

Radar returns this response:

```json theme={null}
{
  "meta": {
    "code": 200
  },
  "events": [
    {
      "_id": "56db1f4613012711002229f6",
      "type": "user.entered_geofence",
      "createdAt": "2026-06-12T13:44:10.535Z",
      "live": true,
      "user": {
        "_id": "56db1f4613012711002229f4",
        "userId": "user-123",
        "deviceId": "device-456",
        "metadata": {
          "loyaltyTier": "gold",
          "pushEnabled": false
        }
      },
      "geofence": {
        "_id": "56db1f4613012711002229f5",
        "tag": "store",
        "externalId": "store-42",
        "description": "Store 42",
        "metadata": {
          "parking": false
        }
      },
      "location": {
        "type": "Point",
        "coordinates": [-73.97536, 40.78382]
      },
      "locationAccuracy": 65,
      "confidence": 3
    }
  ],
  "user": {
    "_id": "56db1f4613012711002229f4",
    "live": true,
    "userId": "user-123",
    "deviceId": "device-456",
    "metadata": {
      "loyaltyTier": "gold",
      "pushEnabled": false
    },
    "createdAt": "2026-06-10T11:23:58.741Z",
    "updatedAt": "2026-06-12T13:44:10.535Z",
    "location": {
      "type": "Point",
      "coordinates": [-73.97536, 40.78382]
    },
    "locationAccuracy": 65,
    "stopped": true,
    "foreground": true,
    "deviceType": "iOS",
    "geofences": [
      {
        "_id": "56db1f4613012711002229f5",
        "tag": "store",
        "externalId": "store-42",
        "description": "Store 42",
        "metadata": {
          "parking": false
        }
      }
    ],
    "country": {
      "code": "US",
      "name": "United States"
    },
    "state": {
      "code": "NY",
      "name": "New York"
    },
    "dma": {
      "code": "501",
      "name": "New York"
    },
    "postalCode": {
      "code": "10024",
      "name": "10024"
    }
  }
}
```

### Errors

| Status | Meaning | What to do |
| - | - | - |
| `400` | A required parameter is missing or a value is out of range. `meta.param` names the parameter, for example `deviceId`, `latitude`, `longitude`, `accuracy`, or `metadata`. | Fix the parameter named in `meta.param`. |
| `401` | The API key is missing or invalid. | Send a valid API key in the `Authorization` header. |
| `429` | More than 1 request per second was sent for the same device, or the request was throttled. | Wait at least 1 second before you send the next update for that device. |
| `503` | Tracking is temporarily unavailable. | Retry with backoff. |

A `400` response looks like this:

```json theme={null}
{
  "meta": {
    "code": 400,
    "param": "accuracy",
    "message": "accuracy: Param is required."
  }
}
```

## See also

* To read or delete the users that tracking creates, see the [Users API](https://docs.radar.com/api/users.md).
* To log a conversion for a tracked user, see [Log a conversion](https://docs.radar.com/api/events.md#log-a-conversion).
* To start and update trips, see the [Trips API](https://docs.radar.com/api/trips.md).
* For what each context field on the user represents and the events it generates, see [context types](https://docs.radar.com/fundamentals/context-types.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.