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

# Create a point of interest

> Creates a circle (default) or polygon POI for your organization. The fleet must be owned by or assigned to your org. For circles, `latitude`, `longitude` and `geofence_radius_meters` (10-1000) are required. For polygons, `polygon_coordinates` with at least 3 `[lat, lng]` vertices is required; `latitude`/`longitude` will be set to the polygon centroid automatically.



## OpenAPI

````yaml /openapi.json post /pois
openapi: 3.1.0
info:
  title: United Logistics API
  version: 0.1.0
  description: >-
    Industry-grade public API for fleet, fuel, and toll operations. Every
    endpoint is scoped to the organization owning the API key. Authentication:
    bearer API key (`ulk_<prefix>_<secret>`). Rate limit: 60 requests/minute/key
    by default (override per key via the dashboard).
  contact:
    name: United Logistics Engineering
    email: sfuentes@assetmg.tech
servers:
  - url: https://app.unitedlogistics.com.do/api/v1
    description: Production
  - url: http://localhost:3000/api/v1
    description: Local development
security:
  - ApiKeyAuth: []
paths:
  /pois:
    post:
      tags:
        - POIs
      summary: Create a point of interest
      description: >-
        Creates a circle (default) or polygon POI for your organization. The
        fleet must be owned by or assigned to your org. For circles, `latitude`,
        `longitude` and `geofence_radius_meters` (10-1000) are required. For
        polygons, `polygon_coordinates` with at least 3 `[lat, lng]` vertices is
        required; `latitude`/`longitude` will be set to the polygon centroid
        automatically.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreatePOIRequest'
            examples:
              circle:
                summary: Circle POI (radius geofence)
                value:
                  fleet_id: 1029
                  name: Cliente Altice – Bávaro
                  description: Punto de entrega cliente Altice zona este
                  geometry_type: circle
                  latitude: 18.6792
                  longitude: -68.4014
                  geofence_radius_meters: 250
                  tags:
                    - cliente
                    - distribución-este
              polygon:
                summary: Polygon POI (arbitrary shape)
                value:
                  fleet_id: 1029
                  name: Patio operativo Santo Domingo
                  geometry_type: polygon
                  polygon_coordinates:
                    - - 18.5012
                      - -69.9305
                    - - 18.5012
                      - -69.929
                    - - 18.5
                      - -69.929
                    - - 18.5
                      - -69.9305
                  tags:
                    - patio
                    - operaciones
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreatePOIResponse'
              example:
                data:
                  id: 481
                  org_id: d87f7281-ea19-45cd-b6fd-d8eb9e310da1
                  fleet_id: 1029
                  name: Cliente Altice – Bávaro
                  description: Punto de entrega cliente Altice zona este
                  latitude: 18.6792
                  longitude: -68.4014
                  image_url: null
                  geometry_type: circle
                  geofence_radius_meters: 250
                  polygon_coordinates: null
                  tags:
                    - cliente
                    - distribución-este
                  created_at: '2025-09-15T13:00:00.000Z'
                  updated_at: '2026-04-22T18:45:11.221Z'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorObject'
              example:
                error:
                  code: bad_request
                  message: Invalid POI payload.
                  details:
                    fieldErrors:
                      geofence_radius_meters:
                        - >-
                          geofence_radius_meters es requerido para geocercas
                          circulares
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorObject'
              example:
                error:
                  code: unauthorized
                  message: API key missing or invalid.
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorObject'
              example:
                error:
                  code: forbidden
                  message: La flota no está asignada a tu organización.
        '404':
          description: Fleet not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorObject'
              example:
                error:
                  code: not_found
                  message: La flota especificada no existe.
        '429':
          description: Rate limited
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorObject'
              example:
                error:
                  code: too_many_requests
                  message: Rate limit exceeded.
      security:
        - ApiKeyAuth: []
components:
  schemas:
    CreatePOIRequest:
      type: object
      properties:
        fleet_id:
          type: integer
          exclusiveMinimum: 0
          description: Fleet (provider account) this POI is scoped to.
          example: 1029
        name:
          type: string
          minLength: 1
          maxLength: 255
          description: Human-readable name.
          example: Cliente Altice – Bávaro
        description:
          type:
            - string
            - 'null'
          maxLength: 2000
          description: Free-form description.
          example: Punto de entrega cliente Altice zona este
        image_url:
          type:
            - string
            - 'null'
          format: uri
          description: Public image URL (typically Supabase storage `poi-images` bucket).
          example: null
        geometry_type:
          type: string
          enum:
            - circle
            - polygon
          default: circle
          description: '`circle` for radius-based geofences, `polygon` for arbitrary shapes.'
          example: circle
        latitude:
          type: number
          minimum: -90
          maximum: 90
          description: >-
            Required for `circle`. For `polygon`, derived from centroid if
            omitted.
          example: 18.6792
        longitude:
          type: number
          minimum: -180
          maximum: 180
          description: >-
            Required for `circle`. For `polygon`, derived from centroid if
            omitted.
          example: -68.4014
        geofence_radius_meters:
          type:
            - integer
            - 'null'
          minimum: 10
          maximum: 1000
          description: Required for `circle`. 10–1000 meters. `null` for polygons.
          example: 250
        polygon_coordinates:
          type:
            - array
            - 'null'
          items:
            type: array
            prefixItems:
              - type: number
                minimum: -90
                maximum: 90
              - type: number
                minimum: -180
                maximum: 180
          minItems: 3
          maxItems: 500
          description: >-
            Required for `polygon`. At least 3 `[lat, lng]` vertices; the
            polygon is closed automatically.
          example:
            - - 18.5012
              - -69.9305
            - - 18.5012
              - -69.929
            - - 18.5
              - -69.929
            - - 18.5
              - -69.9305
        tags:
          type: array
          items:
            type: string
            minLength: 1
            maxLength: 64
          maxItems: 32
          description: User-defined tags for filtering and reports.
          example:
            - cliente
            - distribución-este
      required:
        - fleet_id
        - name
    CreatePOIResponse:
      type: object
      properties:
        data:
          $ref: '#/components/schemas/POI'
      required:
        - data
    ErrorObject:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              example: unauthorized
            message:
              type: string
              example: Missing Authorization header.
            details: {}
          required:
            - code
            - message
      required:
        - error
    POI:
      type: object
      properties:
        id:
          type: integer
          description: Internal numeric POI id. Stable for the lifetime of the POI.
          example: 42
        org_id:
          type: string
          format: uuid
        fleet_id:
          type:
            - integer
            - 'null'
          description: Fleet (provider account) this POI is scoped to.
          example: 1029
        name:
          type: string
          example: Estación La Vega
        description:
          type:
            - string
            - 'null'
        latitude:
          type: number
          example: 19.221
        longitude:
          type: number
          example: -70.529
        image_url:
          type:
            - string
            - 'null'
        geometry_type:
          type: string
          enum:
            - circle
            - polygon
          description: '`circle` for radius-based geofences, `polygon` for arbitrary shapes.'
          example: circle
        geofence_radius_meters:
          type:
            - integer
            - 'null'
          description: >-
            Radius in meters for circle geofences (10-1000). `null` for
            polygons.
          example: 50
        polygon_coordinates:
          type:
            - array
            - 'null'
          items:
            type: array
            prefixItems:
              - type: number
              - type: number
          description: >-
            Polygon vertices as `[latitude, longitude]` tuples. Closed
            automatically (no need to repeat the first point).
          example:
            - - 18.5
              - -69.9
            - - 18.51
              - -69.9
            - - 18.51
              - -69.89
            - - 18.5
              - -69.89
        tags:
          type: array
          items:
            type: string
          description: User-defined tags used for filtering and reports.
          example:
            - estacion
            - gasolinera
        created_at:
          type: string
        updated_at:
          type: string
      required:
        - id
        - org_id
        - fleet_id
        - name
        - description
        - latitude
        - longitude
        - image_url
        - geometry_type
        - geofence_radius_meters
        - polygon_coordinates
        - tags
        - created_at
        - updated_at
  securitySchemes:
    ApiKeyAuth:
      type: http
      scheme: bearer
      bearerFormat: ulk_<prefix>_<secret>
      description: >-
        Authorization: Bearer ulk_<prefix>_<secret>. Cree la clave en
        Configuración → API.

````