---
title: "Geocode a postal address"
method: POST
path: "/api/agent/geocode"
---

# Geocode a postal address

`POST /api/agent/geocode`

## Request

- Base URL: `https://sesapp.fr`
- URL: `https://sesapp.fr/api/agent/geocode`
- Auth: HTTP bearer

Returns formattedAddress + lat/lon for create. WiFi geofence uses these coordinates (150 m). Wrapper around Places with Nominatim fallback.

## Request body

- object
  - `query` string, required
  - `country` string: Optional ISO 3166-1 alpha-2 (e.g. fr)

## Response `200`

{ success, data: [{ formattedAddress, lat, lon, components }] }

## Other responses

- `400`: INVALID_PARAMS
- `401`: UNAUTHORIZED — missing or invalid Bearer
- `402`: x402 payment required (expired plan or overage). Body is not ApiError.

---

[API](https://skmtc.dev/sesapp/apis/sesapp-agent-api.md) · [All operations](https://skmtc.dev/sesapp/apis/sesapp-agent-api/llms.txt) · [OpenAPI document](https://skmtc.dev/sesapp/apis/sesapp-agent-api/revisions/8d819a96c5bf?raw)
