# Pause location

POST https://services.leadconnectorhq.com/saas/pause/{locationId}

Pause Sub account for given locationId

## Authentication

Send `Authorization: Bearer <token>` using:

- **Agency token: OAuth access token or Private Integration Token.** No scopes required.

## Parameters

### Header Parameters

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

### Path Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `locationId` | string | Yes |  |

## OpenAPI Specification

```json
{
  "openapi": "3.0.0",
  "info": {
    "title": "HighLevel API",
    "version": "2021-07-28"
  },
  "servers": [
    {
      "url": "https://services.leadconnectorhq.com"
    }
  ],
  "paths": {
    "/saas/pause/{locationId}": {
      "post": {
        "summary": "Pause location",
        "operationId": "pauseLocation",
        "description": "Pause Sub account for given locationId",
        "parameters": [
          {
            "name": "Version",
            "in": "header",
            "description": "API Version",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "2021-07-28"
              ]
            }
          },
          {
            "name": "locationId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PauseLocationDto"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "Agency-Access": []
          }
        ]
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearer": {
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "name": "token-id",
        "in": "header",
        "description": "Use the Access Token generated by exchanging API Key for token id",
        "type": "http"
      },
      "Location-Access": {
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "name": "Authorization",
        "in": "header",
        "description": "Use the Access Token generated with user type as Location",
        "type": "http"
      },
      "Agency-Access": {
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "name": "Authorization",
        "in": "header",
        "description": "Use the Access Token generated with user type as Company",
        "type": "http"
      }
    },
    "schemas": {
      "PauseLocationDto": {
        "type": "object",
        "properties": {
          "paused": {
            "type": "boolean",
            "description": "Paused",
            "example": true
          },
          "companyId": {
            "type": "string",
            "description": "Company ID",
            "example": "companyId1"
          }
        },
        "required": [
          "paused",
          "companyId"
        ],
        "title": "PauseLocationDto"
      }
    }
  }
}
```

## Code Examples

**cURL**

```bash
curl -L -X POST 'https://services.leadconnectorhq.com/saas/pause/<locationId>' \
  -H 'Authorization: Bearer <TOKEN>' \
  -H 'Version: 2021-07-28' \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "paused": true,
  "companyId": "companyId1"
}'
```

**Node.js**

```javascript
const options = {
  method: 'POST',
  headers: {
    Authorization: 'Bearer <TOKEN>',
    Version: '2021-07-28',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
      "paused": true,
      "companyId": "companyId1"
  })
};

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

**Python**

```python
import requests

url = "https://services.leadconnectorhq.com/saas/pause/{locationId}"

headers = {
    "Authorization": "Bearer <TOKEN>",
    "Version": "2021-07-28"
}

payload = {
    "paused": true,
    "companyId": "companyId1"
}

response = requests.post(url, json=payload, headers=headers)
print(response.json())
```

**PHP**

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

curl_setopt_array($curl, [
  CURLOPT_URL => 'https://services.leadconnectorhq.com/saas/pause/<locationId>',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_HTTPHEADER => [
    'Authorization: Bearer <TOKEN>',
    'Version: 2021-07-28',
    'Content-Type: application/json',
  ],
  CURLOPT_POSTFIELDS => '{
  "paused": true,
  "companyId": "companyId1"
}',
]);

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

**Java**

```java
HttpResponse<String> response = Unirest
  .post("https://services.leadconnectorhq.com/saas/pause/<locationId>")
  .header("Authorization", "Bearer <TOKEN>")
  .header("Version", "2021-07-28")
  .header("Content-Type", "application/json")
  .body("{\"paused\":true,\"companyId\":\"companyId1\"}")
  .asString();
```

**Go**

```go
package main

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

func main() {
  url := "https://services.leadconnectorhq.com/saas/pause/<locationId>"
  payload := strings.NewReader(`{
  "paused": true,
  "companyId": "companyId1"
}`)
  req, _ := http.NewRequest("POST", url, payload)
  req.Header.Add("Authorization", "Bearer <TOKEN>")
  req.Header.Add("Version", "2021-07-28")

  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/saas/pause/<locationId>")

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

request = Net::HTTP::Post.new(url)
request["Authorization"] = "Bearer <TOKEN>"
request["Version"] = "2021-07-28"
request["Content-Type"] = "application/json"
request.body = '{
  "paused": true,
  "companyId": "companyId1"
}'

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

**PowerShell**

```powershell
$headers = @{
  "Authorization" = "Bearer <TOKEN>"
  "Version" = "2021-07-28"
}

$body = '{
  "paused": true,
  "companyId": "companyId1"
}'

$response = Invoke-RestMethod -Uri 'https://services.leadconnectorhq.com/saas/pause/<locationId>' -Method 'POST' -Headers $headers -Body $body -ContentType 'application/json'
$response | ConvertTo-Json
```
