---
updatedAt: 2026-05-27T10:18:53.000Z
agentTools:
  projectIndex: https://gethapn.readme.io/llms.txt
---

# Get activity positions

Gets a list of positions generated for a given activity

# OpenAPI definition

```json
{
  "openapi": "3.0.3",
  "info": {
    "description": "The Hapn API is an HTTP interface for managing devices, accounts, and cloud data.",
    "version": "1.0.0",
    "title": "Hapn API",
    "termsOfService": "https://gethapn.com/terms",
    "contact": {
      "name": "Dev",
      "email": "developer@gethapn.com",
      "url": "http://gethapn.com"
    },
    "license": {
      "name": "Apache 2.0",
      "url": "http://www.apache.org/licenses/LICENSE-2.0.html"
    }
  },
  "servers": [
    {
      "url": "https://api.iotgps.io/v1",
      "description": "Prod"
    },
    {
      "url": "https://api-dev.iotgps.io/v1",
      "description": "Dev"
    }
  ],
  "paths": {
    "/insights/activities/positions/{activityId}": {
      "get": {
        "summary": "Get activity positions",
        "tags": [
          "Insights"
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "example": 1
            },
            "in": "path",
            "required": true,
            "name": "activityId",
            "description": "Activity id to obtain positions"
          }
        ],
        "responses": {
          "200": {
            "description": "Activity positions search result",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/PaginatedSuccessResponse"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "result": {
                          "type": "object",
                          "required": [
                            "positions"
                          ],
                          "properties": {
                            "tripId": {
                              "type": "string"
                            },
                            "positions": {
                              "type": "array",
                              "uniqueItems": true,
                              "items": {
                                "$ref": "#/components/schemas/PositionV2"
                              }
                            }
                          }
                        }
                      }
                    }
                  ]
                },
                "examples": {
                  "example-1": {
                    "value": {
                      "success": true,
                      "message": "ok",
                      "result": {
                        "activityId": "f9c650a6-0784-4b04-8c43-89bea13173aa",
                        "positions": [
                          {
                            "activityId": "f9c650a6-0784-4b04-8c43-89bea13173aa",
                            "imei": 865134050130039,
                            "created": "2022-07-29T23:43:28.000Z",
                            "actualDate": "2022-07-29T23:43:28.000Z",
                            "speed": 1.6,
                            "odometer": 861.5,
                            "batteryPercentage": 50,
                            "address": "5216 Green Way, Naples, FL 34110",
                            "coordinates": {
                              "latitude": 26.285952,
                              "longitude": -81.751346
                            }
                          },
                          {
                            "activityId": "f9c650a6-0784-4b04-8c43-89bea13173aa",
                            "imei": 865134050130039,
                            "created": "2022-07-29T23:43:43.000Z",
                            "actualDate": "2022-07-29T23:43:43.000Z",
                            "speed": 1.6,
                            "odometer": 861.5,
                            "batteryPercentage": 60,
                            "address": "5214 Green Way, Naples, FL 34110",
                            "coordinates": {
                              "latitude": 26.285988,
                              "longitude": -81.75134
                            }
                          }
                        ]
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        },
        "operationId": "get-activity-positions",
        "description": "Gets a list of positions generated for a given activity"
      }
    }
  },
  "components": {
    "schemas": {
      "PositionV2": {
        "description": "A position generated by a device",
        "type": "object",
        "x-examples": {
          "example-1": {
            "activityId": "f9c650a6-0784-4b04-8c43-89bea13173aa",
            "cliendId": 1234,
            "imei": 865134050130039,
            "created": "2022-08-25T13:01:15.388Z",
            "actualdate": "2022-08-25T12:22:05.000Z",
            "speed": 1.6,
            "odometer": 861.5,
            "batteryPercentage": 50,
            "address": "7800 Immokalee Rd, Naples, FL 34119",
            "coordinates": {
              "latitude": 26.27017,
              "longitude": -81.710058
            }
          }
        },
        "properties": {
          "activityId": {
            "type": "string",
            "description": "The activity id containing the position"
          },
          "clientId": {
            "type": "number",
            "description": "The client identifier"
          },
          "imei": {
            "type": "string",
            "minLength": 1,
            "description": "IMEI of the device"
          },
          "created": {
            "type": "string",
            "format": "date-time",
            "description": "The date-time the position was sent"
          },
          "actualDate": {
            "type": "string",
            "format": "date-time",
            "description": "The date-time the position was generated"
          },
          "speed": {
            "type": "number",
            "description": "The device's speed when the position was generated"
          },
          "odometer": {
            "type": "number",
            "description": "The device's traveled distance when the position was generated"
          },
          "batteryPercentage": {
            "type": "number",
            "description": "The device's battery percentage when the position was generated"
          },
          "address": {
            "type": "string",
            "description": "The device's adress when the position was generated"
          },
          "coordinates": {
            "type": "object",
            "description": "Coordinates of the position.",
            "properties": {
              "latitude": {
                "type": "number"
              },
              "longitude": {
                "type": "number"
              }
            }
          }
        }
      },
      "PaginatedSuccessResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "message": {
            "type": "string"
          },
          "result": {
            "type": "object",
            "properties": {
              "items": {
                "type": "array"
              },
              "nextToken": {
                "type": "string"
              }
            },
            "required": [
              "items"
            ]
          }
        },
        "required": [
          "message",
          "success",
          "result"
        ],
        "x-examples": {
          "example-1": {
            "value": {
              "success": true,
              "message": "string",
              "result": {
                "items": [
                  {
                    "imei": "12345"
                  }
                ],
                "nextToken": "eyJzZW5kVGltZSI6IjIwMjEtMDgtMThUMTU6MTc6NTAuMDAwWiIsImNsaWVudElkIjo2MDY2MDksIm1lc3NhZ2VfaWQiOiI2ZTMwYzczMS1iMGNhLTQwMzgtYjY1Zi1kM2Y1NGZlMWQ0ZjUifQ=="
              }
            }
          }
        }
      },
      "ErrorResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "message": {
            "type": "string"
          }
        },
        "required": [
          "success",
          "message"
        ],
        "x-examples": {
          "example-1": {
            "value": {
              "success": false,
              "message": "Unauthorized"
            }
          }
        }
      }
    },
    "responses": {
      "Unauthorized": {
        "description": "Unauthorized",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            },
            "examples": {
              "example-1": {
                "value": {
                  "success": false,
                  "message": "Unauthorized"
                }
              }
            }
          }
        }
      },
      "Error": {
        "description": "Server error",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            },
            "examples": {
              "example-1": {
                "value": {
                  "success": false,
                  "message": "Error"
                }
              }
            }
          }
        }
      }
    },
    "securitySchemes": {
      "OAuth2": {
        "type": "oauth2",
        "flows": {
          "clientCredentials": {
            "tokenUrl": "https://auth.usehapn.com/oauth2/token",
            "scopes": {}
          }
        }
      }
    }
  },
  "tags": [
    {
      "name": "Insights",
      "description": "Account insights"
    }
  ],
  "security": [
    {
      "OAuth2": []
    }
  ]
}
```