# Get Services

GET https://services.leadconnectorhq.com/calendars/services/catalog

Get all services in a location.

## Authentication

Send `Authorization: Bearer <token>` using:

- **Sub-Account token: OAuth access token or Private Integration Token.** Scopes: `calendars.readonly`

## Parameters

### Header Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `Version` | string | Yes | API Version |

### Query Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `locationId` | string | Yes | Location ID |
| `serviceCategoryId` | string | No | Filter by service category ID |
| `isPrivate` | boolean | No | Filter services: true = private only, false = public only, unset = all services |

## OpenAPI Specification

```json
{
  "openapi": "3.0.0",
  "info": {
    "title": "HighLevel API",
    "version": "v3"
  },
  "servers": [
    {
      "url": "https://services.leadconnectorhq.com"
    }
  ],
  "paths": {
    "/calendars/services/catalog": {
      "get": {
        "summary": "Get Services",
        "operationId": "getServices",
        "description": "Get all services in a location.",
        "parameters": [
          {
            "name": "Version",
            "in": "header",
            "description": "API Version",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "v3"
              ]
            }
          },
          {
            "name": "locationId",
            "required": true,
            "in": "query",
            "description": "Location ID",
            "schema": {
              "example": "0007BWpSzSwfiuSl0tR2",
              "type": "string"
            }
          },
          {
            "name": "serviceCategoryId",
            "required": false,
            "in": "query",
            "description": "Filter by service category ID",
            "schema": {
              "example": "65e5f6dfacf123513228d384",
              "type": "string"
            }
          },
          {
            "name": "isPrivate",
            "required": false,
            "in": "query",
            "description": "Filter services: true = private only, false = public only, unset = all services",
            "schema": {
              "example": false,
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ServicesListResponseDTO"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request parameters",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestDTO"
                }
              }
            }
          },
          "401": {
            "description": "User not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedDTO"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": [
              "calendars.readonly"
            ]
          }
        ]
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearer": {
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "name": "Authorization",
        "in": "header",
        "description": "Use the Access Token generated with user type as Sub-Account (OR) Private Integration Token of Sub-Account.",
        "type": "http"
      },
      "Location-Access": {
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "name": "Authorization",
        "in": "header",
        "description": "Use the Access Token generated with user type as Sub-Account (OR) Private Integration Token of Sub-Account.",
        "type": "http"
      },
      "Location-Access-Only": {
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "name": "Authorization",
        "in": "header",
        "description": "Use the Access Token generated with user type as Sub-Account.",
        "type": "http"
      },
      "Agency-Access": {
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "name": "Authorization",
        "in": "header",
        "description": "Use the Access Token generated with user type as Agency (OR) Private Integration Token of Agency.",
        "type": "http"
      },
      "Agency-Access-Only": {
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "name": "Authorization",
        "in": "header",
        "description": "Use the Access Token generated with user type as Agency.",
        "type": "http"
      }
    },
    "schemas": {
      "ServicesListResponseDTO": {
        "type": "object",
        "properties": {
          "services": {
            "description": "List of services",
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "description": "Service ID",
                  "example": "65e5f6dfacf123513228d384"
                },
                "locationId": {
                  "type": "string",
                  "description": "Location ID",
                  "example": "0007BWpSzSwfiuSl0tR2"
                },
                "name": {
                  "type": "string",
                  "description": "Service name",
                  "example": "Hair Styling"
                },
                "description": {
                  "type": "string",
                  "description": "Service description",
                  "example": "Full hair styling session"
                },
                "slug": {
                  "type": "string",
                  "description": "Unique URL-friendly identifier",
                  "example": "hair-styling"
                },
                "eventColor": {
                  "type": "string",
                  "description": "Service event color (hex)",
                  "example": "#66C61C"
                },
                "coverImage": {
                  "type": "string",
                  "description": "Service cover image URL",
                  "example": "https://example.com/cover.jpg"
                },
                "serviceCategoryId": {
                  "type": "string",
                  "description": "Service category ID",
                  "example": "65e5f6dfacf123513228d381"
                },
                "payment": {
                  "description": "Payment details",
                  "allOf": [
                    {
                      "type": "object",
                      "properties": {
                        "amount": {
                          "type": "number",
                          "description": "Service price",
                          "example": 50
                        },
                        "deposit": {
                          "type": "number",
                          "description": "Deposit amount or percentage value",
                          "example": 20
                        },
                        "depositType": {
                          "type": "string",
                          "description": "Deposit type",
                          "example": "amount",
                          "enum": [
                            "percentage",
                            "amount"
                          ]
                        }
                      },
                      "title": "PaymentDTO"
                    }
                  ],
                  "example": {
                    "amount": 50,
                    "deposit": 20,
                    "depositType": "amount"
                  }
                },
                "serviceDuration": {
                  "type": "number",
                  "description": "This controls the duration of the appointment",
                  "example": 60
                },
                "serviceDurationUnit": {
                  "type": "string",
                  "description": "Duration unit",
                  "example": "mins",
                  "enum": [
                    "mins",
                    "hours"
                  ]
                },
                "preBuffer": {
                  "type": "number",
                  "description": "Pre-Buffer is additional time that can be added before an appointment, allowing for extra time to get ready",
                  "example": 10
                },
                "preBufferUnit": {
                  "type": "string",
                  "description": "Pre-buffer unit",
                  "example": "mins",
                  "enum": [
                    "mins",
                    "hours"
                  ]
                },
                "postBuffer": {
                  "type": "number",
                  "description": "Post-buffer: Additional time that can be added after an appointment, allowing for extra time to wrap up",
                  "example": 15
                },
                "postBufferUnit": {
                  "type": "string",
                  "description": "Post-buffer unit",
                  "example": "mins",
                  "enum": [
                    "mins",
                    "hours"
                  ]
                },
                "isPrivate": {
                  "type": "boolean",
                  "description": "Whether service is private (not shown publicly)",
                  "example": false,
                  "default": false
                },
                "formId": {
                  "type": "string",
                  "description": "Custom form ID (will be used to display the custom form on the booking page, if only one service is selected)",
                  "example": "65e5f6dfacf123513228d390"
                },
                "variations": {
                  "description": "Service variations",
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string",
                        "description": "Variation ID",
                        "example": "65e5f6dfacf123513228d384"
                      },
                      "name": {
                        "type": "string",
                        "description": "Variation name",
                        "example": "Standard Haircut"
                      },
                      "serviceDuration": {
                        "type": "number",
                        "description": "This controls the duration of the appointment",
                        "example": 30
                      },
                      "serviceDurationUnit": {
                        "type": "string",
                        "description": "Duration unit",
                        "example": "mins",
                        "enum": [
                          "mins",
                          "hours"
                        ]
                      },
                      "payment": {
                        "description": "Payment details",
                        "allOf": [
                          {
                            "type": "object",
                            "properties": {
                              "amount": {
                                "type": "number",
                                "description": "Service price",
                                "example": 50
                              },
                              "deposit": {
                                "type": "number",
                                "description": "Deposit amount or percentage value",
                                "example": 20
                              },
                              "depositType": {
                                "type": "string",
                                "description": "Deposit type",
                                "example": "amount",
                                "enum": [
                                  "percentage",
                                  "amount"
                                ]
                              }
                            },
                            "title": "PaymentDTO"
                          }
                        ],
                        "example": {
                          "amount": 50,
                          "deposit": 20,
                          "depositType": "amount"
                        }
                      },
                      "preBuffer": {
                        "type": "number",
                        "description": "Pre-Buffer is additional time that can be added before an appointment, allowing for extra time to get ready",
                        "example": 10
                      },
                      "preBufferUnit": {
                        "type": "string",
                        "description": "Pre-buffer unit",
                        "example": "mins",
                        "enum": [
                          "mins",
                          "hours"
                        ]
                      },
                      "postBuffer": {
                        "type": "number",
                        "description": "Post-buffer: Additional time that can be added after an appointment, allowing for extra time to wrap up",
                        "example": 15
                      },
                      "postBufferUnit": {
                        "type": "string",
                        "description": "Post-buffer unit",
                        "example": "mins",
                        "enum": [
                          "mins",
                          "hours"
                        ]
                      }
                    },
                    "required": [
                      "id",
                      "name"
                    ],
                    "title": "ServiceVariationDTO"
                  },
                  "example": [
                    {
                      "id": "65e5f6dfacf123513228d384",
                      "name": "Standard Haircut",
                      "serviceDuration": 30,
                      "payment": {
                        "amount": 50
                      }
                    }
                  ]
                },
                "staff": {
                  "description": "Assigned staff members",
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string",
                        "description": "Staff ID",
                        "example": "65e5f6dfacf123513228d384"
                      }
                    },
                    "required": [
                      "id"
                    ],
                    "title": "StaffDTO"
                  },
                  "example": [
                    {
                      "id": "65e5f6dfacf123513228d384"
                    }
                  ]
                }
              },
              "required": [
                "id",
                "locationId",
                "name"
              ],
              "title": "ServiceResponseDTO"
            },
            "example": [
              {
                "id": "65e5f6dfacf123513228d384",
                "locationId": "0007BWpSzSwfiuSl0tR2",
                "name": "Hair Styling"
              }
            ]
          }
        },
        "required": [
          "services"
        ],
        "title": "ServicesListResponseDTO"
      },
      "BadRequestDTO": {
        "type": "object",
        "properties": {
          "statusCode": {
            "type": "number",
            "example": 400
          },
          "message": {
            "type": "string",
            "example": "Bad Request"
          }
        },
        "title": "BadRequestDTO"
      },
      "UnauthorizedDTO": {
        "type": "object",
        "properties": {
          "statusCode": {
            "type": "number",
            "example": 401
          },
          "message": {
            "type": "string",
            "example": "Invalid token: access token is invalid"
          },
          "error": {
            "type": "string",
            "example": "Unauthorized"
          }
        },
        "title": "UnauthorizedDTO"
      }
    }
  }
}
```

## HighLevel SDK Examples

**Node.js** (`@gohighlevel/api-client`)

```javascript
import HighLevel from '@gohighlevel/api-client';

const ghl = new HighLevel({
  privateIntegrationToken: '<PRIVATE_INTEGRATION_TOKEN>'
});

const response = await ghl.calendars.getServices({ locationId: '<LOCATIONID>' });
console.log(response);
```

**Python** (`gohighlevel-api-client`)

```python
from highlevel import HighLevel

client = HighLevel(
    private_integration_token='<PRIVATE_INTEGRATION_TOKEN>'
)

response = await client.calendars.get_services(locationId='<LOCATIONID>')
print(response)
```

**PHP** (`gohighlevel/api-client`)

```php
<?php
require_once 'vendor/autoload.php';

use HighLevel\HighLevel;
use HighLevel\HighLevelConfig;

$config = new HighLevelConfig([
    'privateIntegrationToken' => '<PRIVATE_INTEGRATION_TOKEN>'
]);
$ghl = new HighLevel($config);

$response = $ghl->calendars->getServices(['locationId' => '<LOCATIONID>']);
echo json_encode($response, JSON_PRETTY_PRINT);
```

## Code Examples

**cURL**

```bash
curl -L -X GET 'https://services.leadconnectorhq.com/calendars/services/catalog?locationId=<LOCATIONID>' \
  -H 'Authorization: Bearer <TOKEN>' \
  -H 'Version: v3'
```

**Node.js**

```javascript
const options = {
  method: 'GET',
  headers: {
    Authorization: 'Bearer <TOKEN>',
    Version: 'v3'
  }
};

try {
  const response = await fetch('https://services.leadconnectorhq.com/calendars/services/catalog?locationId=<LOCATIONID>', options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

**Python**

```python
import requests

url = "https://services.leadconnectorhq.com/calendars/services/catalog"

headers = {
    "Authorization": "Bearer <TOKEN>",
    "Version": "v3"
}

params = {
    "locationId": "<LOCATIONID>"
}

response = requests.get(url, params=params, headers=headers)
print(response.json())
```

**PHP**

```php
<?php
$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => 'https://services.leadconnectorhq.com/calendars/services/catalog?locationId=<LOCATIONID>',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_CUSTOMREQUEST => 'GET',
  CURLOPT_HTTPHEADER => [
    'Authorization: Bearer <TOKEN>',
    'Version: v3',
  ],
]);

$response = curl_exec($curl);
curl_close($curl);
echo $response;
```

**Java**

```java
HttpResponse<String> response = Unirest
  .get("https://services.leadconnectorhq.com/calendars/services/catalog?locationId=<LOCATIONID>")
  .header("Authorization", "Bearer <TOKEN>")
  .header("Version", "v3")
  .asString();
```

**Go**

```go
package main

import (
  "fmt"
  "net/http"
  "io"
)

func main() {
  url := "https://services.leadconnectorhq.com/calendars/services/catalog?locationId=<LOCATIONID>"
  req, _ := http.NewRequest("GET", url, nil)
  req.Header.Add("Authorization", "Bearer <TOKEN>")
  req.Header.Add("Version", "v3")

  res, _ := http.DefaultClient.Do(req)
  defer res.Body.Close()
  body, _ := io.ReadAll(res.Body)
  fmt.Println(string(body))
}
```

**Ruby**

```ruby
require 'uri'
require 'net/http'

url = URI("https://services.leadconnectorhq.com/calendars/services/catalog?locationId=<LOCATIONID>")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = "Bearer <TOKEN>"
request["Version"] = "v3"

response = http.request(request)
puts response.read_body
```

**PowerShell**

```powershell
$headers = @{
  "Authorization" = "Bearer <TOKEN>"
  "Version" = "v3"
}

$response = Invoke-RestMethod -Uri 'https://services.leadconnectorhq.com/calendars/services/catalog?locationId=<LOCATIONID>' -Method 'GET' -Headers $headers
$response | ConvertTo-Json
```
