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

# Generate GeofenceTriggers for Equipment

> Generate `GeofenceTriggers` for `Equipment` based on the provided `NextBillionGeofences`. 

The `GeofenceTriggers` are not persisted.



## OpenAPI

````yaml /api-reference/openapi.json post /v1/companies/{company-id}/equipment/geofence_triggers
openapi: 3.0.3
info:
  title: Horizon API V1
  version: '1.0'
  contact:
    name: Tread
    url: https://tread.io
    email: developers@tread.io
  description: >-
    This is the Version 1 implementation.


    When in doubt we default to the practices outlined
    [here](https://www.vinaysahni.com/best-practices-for-a-pragmatic-restful-api#advanced-queries)
  license:
    name: Private
    url: https://tread.io
servers:
  - description: production
    url: https://api.tread-horizon.com
security:
  - bearerAuth: []
tags:
  - name: Projects
  - name: Orders
  - name: Loads
  - name: Jobs
  - name: JobAssignments
  - name: ApprovalAssignments
  - name: Equipment
  - name: FuelSurcharges
  - name: Materials
  - name: Accounts
  - name: Tickets
  - name: Users
  - name: Sites
  - name: Companies
  - name: Departments
  - name: Rates
  - name: Services
  - name: EquipmentType
  - name: FileAttachments
  - name: MaterialType
  - name: LineItemType
  - name: DriverStateEvent
  - name: Authentication
  - name: IamRoles
  - name: Typeaheads
  - name: Integrations
  - name: Reflection
  - name: LoadCycles
  - name: AddOns
  - name: ServiceClass
  - name: Invoices
  - name: JobSummaries
  - name: LoadSummaries
  - name: CompanyShares
  - name: UserDevicePermission
  - name: Drivers
  - name: Settlements
  - name: LocationHistories
  - name: Telematics
  - name: OmniReports
  - name: DriverDays
  - name: Agave
  - name: AddOnCharges
  - name: ResourceUsageLogs
  - name: ResourceScopes
  - name: TravelledDistances
  - name: MaterialRates
  - name: CompanyDayJobStats
  - name: KMLFiles
  - name: AutoAddOnAssignments
  - name: SiteRateSchedules
  - name: TwilioIntegrations
  - name: Foremen
  - name: AccountExternalTruckIdentifier
  - name: GeofenceTriggers
  - name: Labels
  - name: Compliance
  - name: ComplianceDocuments
paths:
  /v1/companies/{company-id}/equipment/geofence_triggers:
    parameters:
      - schema:
          type: string
          format: uuid
        name: company-id
        in: path
        required: true
        description: Company ID
      - $ref: '#/components/parameters/Accept-Language'
    post:
      tags:
        - GeofenceTriggers
      summary: Generate GeofenceTriggers for Equipment
      description: >-
        Generate `GeofenceTriggers` for `Equipment` based on the provided
        `NextBillionGeofences`. 


        The `GeofenceTriggers` are not persisted.
      operationId: post-v1-companies-company-id-equipment-geofence_triggers
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GeofenceTrigger-Create'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    type: array
                    x-stoplight:
                      id: lz7svdxbwcapw
                    items:
                      $ref: '#/components/schemas/GeofenceTrigger-Read'
        '401':
          $ref: '#/components/responses/UnauthenticatedError'
        '404':
          $ref: '#/components/responses/Error'
        '406':
          $ref: '#/components/responses/Error'
        '415':
          $ref: '#/components/responses/Error'
        '422':
          $ref: '#/components/responses/ModelError'
components:
  parameters:
    Accept-Language:
      name: Accept-Language
      in: header
      schema:
        type: string
        default: en
        example: en
      description: >-
        The Accept-Language request HTTP header indicates the natural language
        and locale that the client prefers. 
  schemas:
    GeofenceTrigger-Create:
      title: GeofenceTrigger-Create
      x-stoplight:
        id: eno1vsjpxuisc
      type: object
      required:
        - start_at
        - end_at
        - geofences
      properties:
        start_at:
          type: string
          x-stoplight:
            id: 3ydgzv1jer1xl
          format: date-time
        end_at:
          type: string
          x-stoplight:
            id: a5l3vmiykl1wm
          format: date-time
        geofences:
          type: array
          x-stoplight:
            id: nx7ajzteskf3d
          items:
            $ref: '#/components/schemas/NextBillionGeofence-Create'
      additionalProperties: false
    GeofenceTrigger-Read:
      title: GeofenceTrigger-Read
      x-stoplight:
        id: cyjkjb1roiwj8
      type: object
      required:
        - geofence_trigger_type
        - triggered_location
        - geofence
      properties:
        geofence_trigger_type:
          $ref: '#/components/schemas/GeofenceTriggerType'
        triggered_location:
          $ref: '#/components/schemas/GeofenceTrigger-LocationHistory-Read-Nested'
        geofence:
          $ref: '#/components/schemas/Geofence-Data'
      additionalProperties: false
    NextBillionGeofence-Create:
      $ref: '#/components/schemas/Geofence-Data'
      x-stoplight:
        id: 8b9d859e5388e
    GeofenceTriggerType:
      title: GeofenceTriggerType
      x-stoplight:
        id: vmzafgjn6h2y7
      enum:
        - enter
        - exit
    GeofenceTrigger-LocationHistory-Read-Nested:
      title: GeofenceTrigger-LocationHistory-Read-Nested
      x-stoplight:
        id: f5bejqkavpkj1
      allOf:
        - $ref: '#/components/schemas/Identifier'
        - type: object
          required:
            - lat
            - lon
            - occurred_at
          properties:
            driver:
              $ref: '#/components/schemas/Driver-Read-Minimal'
            equipment:
              $ref: '#/components/schemas/Equipment-Read-Minimal'
            order:
              $ref: '#/components/schemas/Order-Read-Minimal'
            job:
              $ref: '#/components/schemas/Job-Read-Minimal'
            lat:
              type: string
              x-stoplight:
                id: e7el87y9ml6ae
            lon:
              type: string
              x-stoplight:
                id: d2gnq6p76fkr6
            occurred_at:
              type: string
              x-stoplight:
                id: oj1vsapa4j117
              format: date-time
    Geofence-Data:
      title: Geofence-Data
      x-stoplight:
        id: ay73k76oae8gm
      type: object
      properties:
        id:
          type: string
          format: uuid
          x-stoplight:
            id: m9n8p7q6r5s4t
          description: NextBillionGeofence ID
        geofence:
          type: object
          x-stoplight:
            id: bo67u046r1ibk
          required:
            - name
            - type
          properties:
            id:
              type: string
              x-stoplight:
                id: nm2o97jli2zqm
              format: uuid
              description: NextBillion Geofence ID
            name:
              type: string
              x-stoplight:
                id: x5sp8wq8d2ack
            type:
              type: string
              x-stoplight:
                id: d91rv1gbtfkm0
              description: '`circle` or `polygon`'
            geojson:
              type: object
              x-stoplight:
                id: vk7dx7ipdbuxa
              required:
                - type
                - coordinates
              properties:
                type:
                  type: string
                  x-stoplight:
                    id: 65qatpxdox3e9
                  description: type should be `Polygon`
                coordinates:
                  type: array
                  x-stoplight:
                    id: 3an8g587wblcs
                  description: >-
                    This should be an enclosed polygon.


                    Example format:

                    [[[-118.226140484,34.048200454],[-118.22616052,34.046872766],[-118.226198738,34.04952736],[-118.226140484,34.048200454]]]
                  items:
                    x-stoplight:
                      id: 2kltvjxl5xks6
                    type: array
                    items:
                      x-stoplight:
                        id: k93dt39dghru4
                      type: array
                      items: {}
            circle_center:
              type: object
              x-stoplight:
                id: 6xr3h683f7cl9
              required:
                - lat
                - lon
              properties:
                lat:
                  type: number
                  x-stoplight:
                    id: y70xc1ptapv1g
                lon:
                  type: number
                  x-stoplight:
                    id: uy3twrpcueq9m
            circle_radius:
              type: number
              x-stoplight:
                id: qrnq301sqfl3d
            tag:
              x-stoplight:
                id: debfy3x1l48zc
              enum:
                - pickup
                - loading
                - drop_off
                - unloading
                - check_in
                - scaling
                - ticketing
              deprecated: true
        moving_geofence:
          type: boolean
          x-stoplight:
            id: y15533dbr62js
          default: false
        tag:
          $ref: '#/components/schemas/GeofenceTag'
        geofence_type:
          $ref: '#/components/schemas/NullableGeofenceType'
      additionalProperties: false
    UnauthenticatedError-Response:
      title: UnauthenticatedError-Response
      x-stoplight:
        id: o477eph7ttbzt
      type: object
      required:
        - error
      properties:
        error:
          $ref: '#/components/schemas/UnauthenticatedError'
      additionalProperties: false
    Error-Response:
      title: Error-Response
      x-stoplight:
        id: 52cydhphee3qe
      type: object
      required:
        - error
      properties:
        error:
          $ref: '#/components/schemas/Error'
      additionalProperties: false
    ModelError-Response:
      title: ModelError-Response
      x-stoplight:
        id: payf9ndh3l6np
      type: object
      required:
        - error
      properties:
        error:
          $ref: '#/components/schemas/ModelError'
      additionalProperties: false
    Identifier:
      title: Identifier
      x-stoplight:
        id: gnd39lue5v7ol
      type: object
      required:
        - id
      properties:
        id:
          type: string
          x-stoplight:
            id: 2e38hjk4zd58m
          format: uuid
      additionalProperties: false
    Driver-Read-Minimal:
      title: Driver-Read-Minimal
      x-stoplight:
        id: f1d1he04n4yjs
      allOf:
        - $ref: '#/components/schemas/Identifier'
        - type: object
          x-stoplight:
            id: x918p1q0av9nk
          required:
            - first_name
            - last_name
          properties:
            first_name:
              type: string
              x-stoplight:
                id: pvqq6tp23r5eq
            last_name:
              type: string
              x-stoplight:
                id: 74tvy3qy47xc0
    Equipment-Read-Minimal:
      title: Equipment-Read-Minimal
      x-stoplight:
        id: m3uxip3u2g73e
      allOf:
        - $ref: '#/components/schemas/Identifier'
        - type: object
          required:
            - name
            - external_id
          properties:
            name:
              type: string
              x-stoplight:
                id: 8j8x3f9jezxeq
            external_id:
              type: string
              x-stoplight:
                id: y33jc1a9rphsf
              nullable: true
    Order-Read-Minimal:
      title: Order-Read-Minimal
      x-stoplight:
        id: wpgfl9nff3zhz
      allOf:
        - $ref: '#/components/schemas/Identifier'
        - type: object
          x-stoplight:
            id: crmvgzs6hb81e
          required:
            - order_id
          properties:
            order_id:
              type: string
              x-stoplight:
                id: 7ac5dtqqp7juv
    Job-Read-Minimal:
      title: Job-Read-Minimal
      x-stoplight:
        id: phqsqzej6mcm3
      allOf:
        - $ref: '#/components/schemas/Identifier'
        - type: object
          x-stoplight:
            id: ic6xdggfjavde
          required:
            - job_id
          properties:
            job_id:
              type: string
              x-stoplight:
                id: pcseir7z97s0x
    GeofenceTag:
      title: GeofenceTag
      x-stoplight:
        id: anytkmb3ydi6c
      enum:
        - scaling
        - site
        - loading
        - unloading
        - check_in
        - ticketing
    NullableGeofenceType:
      title: NullableGeofenceType
      x-stoplight:
        id: ii94t82oqh5xo
      allOf:
        - $ref: '#/components/schemas/GeofenceType'
      nullable: true
      type: string
    UnauthenticatedError:
      title: UnauthenticatedError
      x-stoplight:
        id: 202o69l0fs40h
      allOf:
        - $ref: '#/components/schemas/Error'
        - type: object
          x-stoplight:
            id: tg10dt7s0l6bw
          properties:
            error_type:
              type: string
              x-stoplight:
                id: wvq8c0qsym4hz
          required:
            - error_type
    Error:
      title: Error
      x-stoplight:
        id: 3g57kkik3l464
      type: object
      description: An Error.
      required:
        - code
      properties:
        code:
          type: string
          x-stoplight:
            id: 7o9x1t8v0bgfo
      additionalProperties: false
    ModelError:
      title: ModelError
      x-stoplight:
        id: nhp6714o4j1qt
      description: A Model-specific error
      allOf:
        - $ref: '#/components/schemas/Error'
        - type: object
          required:
            - errors
          properties:
            errors:
              type: array
              x-stoplight:
                id: m4ul9vcq2deh6
              items:
                $ref: '#/components/schemas/ModelError-Item'
    GeofenceType:
      title: GeofenceType
      x-stoplight:
        id: geahowr9r8ly1
      nullable: true
      enum:
        - moving
        - circle
        - polygon
      readOnly: true
    ModelError-Item:
      title: ModelError-Item
      x-stoplight:
        id: b93chwval2t8d
      type: object
      required:
        - model
        - field
        - message
      properties:
        model:
          type: string
          x-stoplight:
            id: 30myfyjkno8ao
          description: The Model associated with this Error
        field:
          type: string
          x-stoplight:
            id: 8gl4ed3uxhdws
          description: The field associated with this Error
        message:
          type: string
          x-stoplight:
            id: bmgbrtmw17qsj
          description: The Error message
      additionalProperties: false
  responses:
    UnauthenticatedError:
      description: Example response
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/UnauthenticatedError-Response'
            type: object
    Error:
      description: Error response
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error-Response'
            type: object
    ModelError:
      description: ''
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ModelError-Response'
            type: object
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````