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

# Get All Locations

> Retrieve a paginated list of the organization's centers/locations. Each location includes its publicId, title, type, timezone and flattened address. Patient/staff home-address records are always excluded; pass the 'type' parameter to return only a specific location type.

## Get All Locations

Retrieve a paginated list of your organization's centers/locations. Home-address
records for patients and staff are always excluded, so only real centers and
offices are returned.

### Headers

```
Authorization: Bearer <your-api-key>
```

### Query Parameters

* `page` (optional): Page number (1-indexed). Default: `1`. Minimum: `1`
* `pageSize` (optional): Number of items per page. Default: `25`. Minimum: `1`, Maximum: `100`
* `type` (optional): Filter by location type. When omitted, `HOUSE` locations are excluded and only real centers/offices are returned.
  * Available types: `HOUSE`, `SCHOOL`, `TEMPORARY_LODGING`, `COMMUNITY`, `OFFICE`, `PLACE_OF_EMPLOYMENT`, `OTHER`

### Success Response (200)

```json theme={null}
{
  "data": [
    {
      "publicId": "loc_1234567890_abc123def",
      "title": "Downtown Center",
      "type": "OFFICE",
      "timezone": "America/New_York",
      "addressLine1": "123 Main St",
      "addressLine2": "Suite 200",
      "city": "New York",
      "state": "NY",
      "postalCode": "10001"
    }
  ],
  "pagination": {
    "page": 1,
    "pageSize": 25,
    "totalCount": 5,
    "totalPages": 1
  }
}
```

### Error Responses

#### 400 - Validation Error

```json theme={null}
{
  "message": "Validation Error",
  "statusCode": 400,
  "validationErrors": [
    {
      "code": "invalid_enum_value",
      "message": "Invalid enum value",
      "path": ["type"]
    }
  ]
}
```

#### 401 - Unauthorized

```json theme={null}
{
  "error": "API key required",
  "statusCode": 401
}
```

## Examples

### cURL Example

```bash theme={null}
# Get all locations with pagination
curl -X GET "https://app.hipp.health/api/v1/locations?page=1&pageSize=25" \
  -H "Authorization: Bearer your-api-key"

# Get only office locations
curl -X GET "https://app.hipp.health/api/v1/locations?type=OFFICE" \
  -H "Authorization: Bearer your-api-key"
```

### JavaScript Example

```javascript theme={null}
const getLocations = async (params = {}) => {
  const queryParams = new URLSearchParams(params);
  const response = await fetch(`/api/v1/locations?${queryParams}`, {
    method: "GET",
    headers: {
      Authorization: "Bearer your-api-key",
    },
  });

  if (!response.ok) {
    const error = await response.json();
    throw new Error(error.error || "Failed to fetch locations");
  }

  return response.json();
};

// Usage
try {
  const result = await getLocations({ page: 1, pageSize: 25, type: "OFFICE" });
  console.log("Locations:", result.data);
  console.log("Pagination:", result.pagination);
} catch (error) {
  console.error("Error fetching locations:", error.message);
}
```


## OpenAPI

````yaml GET /v1/locations
openapi: 3.0.0
info:
  title: Hipp Health API
  version: 1.0.0
  description: API for managing users and resources within your Hipp Health organization
servers:
  - url: https://app.hipp.health/api
    description: Production Server
security: []
paths:
  /v1/locations:
    get:
      tags:
        - locations
      summary: Get paginated list of locations
      description: >-
        Retrieve a paginated list of the organization's centers/locations. Each
        location includes its publicId, title, type, timezone and flattened
        address. Patient/staff home-address records are always excluded; pass
        the 'type' parameter to return only a specific location type.
      operationId: getLocations
      parameters:
        - in: query
          name: page
          description: Page number (1-indexed)
          schema:
            type: integer
            minimum: 1
            default: 1
          required: false
        - in: query
          name: pageSize
          description: Number of items per page
          schema:
            type: integer
            minimum: 1
            maximum: 100
            default: 25
          required: false
        - name: type
          in: query
          description: >-
            Filter by location type. When omitted, HOUSE locations are excluded
            and only real centers/offices are returned.
          required: false
          schema:
            $ref: '#/components/schemas/LocationType'
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetLocationsResponse'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
      security:
        - BearerAuth: []
components:
  schemas:
    LocationType:
      type: string
      enum:
        - HOUSE
        - SCHOOL
        - TEMPORARY_LODGING
        - COMMUNITY
        - OFFICE
        - PLACE_OF_EMPLOYMENT
        - OTHER
      description: >-
        Type of location. HOUSE locations back patient/staff home addresses and
        are never returned by the list locations endpoint.
    GetLocationsResponse:
      type: object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/Location'
          description: Array of locations
        pagination:
          $ref: '#/components/schemas/Pagination'
      required:
        - data
        - pagination
    Location:
      type: object
      properties:
        publicId:
          type: string
          description: Unique public identifier for the location
          example: loc_1234567890_abc123def
        title:
          type: string
          description: Human-readable name of the center/location
          example: Downtown Center
        type:
          $ref: '#/components/schemas/LocationType'
        timezone:
          type: string
          description: IANA timezone of the location
          example: America/New_York
        addressLine1:
          type: string
          nullable: true
          description: First line of the location's street address
          example: 123 Main St
        addressLine2:
          type: string
          nullable: true
          description: Second line of the location's street address
          example: Suite 200
        city:
          type: string
          nullable: true
          example: New York
        state:
          type: string
          nullable: true
          example: NY
        postalCode:
          type: string
          nullable: true
          example: '10001'
      required:
        - publicId
        - title
        - type
        - timezone
        - addressLine1
        - addressLine2
        - city
        - state
        - postalCode
    Pagination:
      type: object
      properties:
        page:
          type: integer
          description: Current page number (1-indexed)
        pageSize:
          type: integer
          description: Number of items per page
        totalCount:
          type: integer
          description: Total number of items
        totalPages:
          type: integer
          description: Total number of pages
      required:
        - page
        - pageSize
        - totalCount
        - totalPages
    ValidationError:
      type: object
      required:
        - message
        - statusCode
        - validationErrors
      properties:
        message:
          type: string
          example: Validation Error
        statusCode:
          type: integer
          example: 400
        validationErrors:
          type: array
          description: Zod validation issues
          items:
            type: object
            properties:
              code:
                type: string
                example: invalid_type
              message:
                type: string
                example: Required
              path:
                type: array
                items:
                  oneOf:
                    - type: string
                    - type: integer
                example:
                  - email
    ApiErrorResponse:
      type: object
      properties:
        error:
          type: string
          description: Human-readable error message
          example: User not found
        statusCode:
          type: integer
          example: 404
      required:
        - error
        - statusCode
  responses:
    '400':
      description: Bad Request - Validation Error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ValidationError'
    '401':
      description: Unauthorized - API key required
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiErrorResponse'
          example:
            error: API key required
            statusCode: 401
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        API key authentication. Include your API key in the Authorization header
        as 'Bearer <your-api-key>'

````