MENU navbar-image

Introduction

Sweep&Go - Open API description

This documentation aims to provide all the information you need to work with our API.

Base URL

https://openapi.sweepandgo.com

Authenticating requests

To authenticate requests, include an Authorization header with the value "Bearer {YOUR_AUTH_KEY}".

All authenticated endpoints are marked with a requires authentication badge in the documentation below.

You can retrieve your token by visiting your dashboard and clicking Generate API token.

Access token

API endpoints for generating and getting authentication token

Get Webhook URLs

This endpoint returns API token and urls.

Example request:
curl --request GET \
    --get "https://openapi.sweepandgo.com/api/token_generate/access_tokens" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer YOUR_TOKEN" \
    --data "{
    \"organization_id\": \"2\"
}"
const url = new URL(
    "https://openapi.sweepandgo.com/api/token_generate/access_tokens"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer YOUR_TOKEN",
};

let body = {
    "organization_id": "2"
};

fetch(url, {
    method: "GET",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://openapi.sweepandgo.com/api/token_generate/access_tokens',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer YOUR_TOKEN',
        ],
        'json' => [
            'organization_id' => '2',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://openapi.sweepandgo.com/api/token_generate/access_tokens'
payload = {
    "organization_id": "2"
}
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer YOUR_TOKEN'
}

response = requests.request('GET', url, headers=headers, json=payload)
response.json()

Example response (200):


{{
             "token":"************************************************************XLtm",
             "webhooks_url":"https:\/\/console.log"
             "enabled_events":"client:client_onboarding_onetime,client:client_recurring_employee_portal"
             }}
 

Request      

GET api/token_generate/access_tokens

Body Parameters

organization_id  required optional  

integer Selected organization.

Generate API token

This endpoint is use for generate API token.

Example request:
curl --request POST \
    "https://openapi.sweepandgo.com/api/token_generate/access_token" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer YOUR_TOKEN" \
    --data "{
    \"organization_id\": 2,
    \"webhooks_url\": \"https:\\/\\/console.log\",
    \"enabled_events\": \"odio\",
    \"description\": \"You can enter here description for endpoint\",
    \"events\": [
        \"corporis\"
    ]
}"
const url = new URL(
    "https://openapi.sweepandgo.com/api/token_generate/access_token"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer YOUR_TOKEN",
};

let body = {
    "organization_id": 2,
    "webhooks_url": "https:\/\/console.log",
    "enabled_events": "odio",
    "description": "You can enter here description for endpoint",
    "events": [
        "corporis"
    ]
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->post(
    'https://openapi.sweepandgo.com/api/token_generate/access_token',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer YOUR_TOKEN',
        ],
        'json' => [
            'organization_id' => 2,
            'webhooks_url' => 'https://console.log',
            'enabled_events' => 'odio',
            'description' => 'You can enter here description for endpoint',
            'events' => [
                'corporis',
            ],
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://openapi.sweepandgo.com/api/token_generate/access_token'
payload = {
    "organization_id": 2,
    "webhooks_url": "https:\/\/console.log",
    "enabled_events": "odio",
    "description": "You can enter here description for endpoint",
    "events": [
        "corporis"
    ]
}
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer YOUR_TOKEN'
}

response = requests.request('POST', url, headers=headers, json=payload)
response.json()

Example response (200):


{
    "token": "lrLxIj3PmNkSKdsFdTYYrfLFSungwVl4vXUk9alQo3Zu6cCGpslCGfHI9k2wXLtm"
}
 

Request      

POST api/token_generate/access_token

Body Parameters

organization_id  integer  

Selected organization.

webhooks_url  string  

Entered URL where will be get webhooks.

enabled_events  string  

description  string optional  

Description for webhooks.

events  string[]  

Entered URL where will be get webhooks.

Get API token after generated

This endpoint returns API token and events.

Example request:
curl --request GET \
    --get "https://openapi.sweepandgo.com/api/token_generate/access_token/in" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer YOUR_TOKEN" \
    --data "{
    \"organization_id\": \"2\",
    \"id\": \"1\"
}"
const url = new URL(
    "https://openapi.sweepandgo.com/api/token_generate/access_token/in"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer YOUR_TOKEN",
};

let body = {
    "organization_id": "2",
    "id": "1"
};

fetch(url, {
    method: "GET",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://openapi.sweepandgo.com/api/token_generate/access_token/in',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer YOUR_TOKEN',
        ],
        'json' => [
            'organization_id' => '2',
            'id' => '1',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://openapi.sweepandgo.com/api/token_generate/access_token/in'
payload = {
    "organization_id": "2",
    "id": "1"
}
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer YOUR_TOKEN'
}

response = requests.request('GET', url, headers=headers, json=payload)
response.json()

Example response (200):


{
             "token":lrLxIj3PmNkSKdsFdTYYrfLFSungwVl4vXUk9alQo3Zu6cCGpslCGfHI9k2wXLtm"
             }
 

Request      

GET api/token_generate/access_token/{id}

URL Parameters

id  string  

The ID of the access token.

Body Parameters

organization_id  required optional  

integer Selected organization.

id  required optional  

integer Selected organization.

Delete API token endpoint

Example request:
curl --request GET \
    --get "https://openapi.sweepandgo.com/api/token_generate/access_token/reprehenderit/delete" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer YOUR_TOKEN" \
    --data "{
    \"organization_id\": \"2\",
    \"id\": \"1\"
}"
const url = new URL(
    "https://openapi.sweepandgo.com/api/token_generate/access_token/reprehenderit/delete"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer YOUR_TOKEN",
};

let body = {
    "organization_id": "2",
    "id": "1"
};

fetch(url, {
    method: "GET",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://openapi.sweepandgo.com/api/token_generate/access_token/reprehenderit/delete',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer YOUR_TOKEN',
        ],
        'json' => [
            'organization_id' => '2',
            'id' => '1',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://openapi.sweepandgo.com/api/token_generate/access_token/reprehenderit/delete'
payload = {
    "organization_id": "2",
    "id": "1"
}
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer YOUR_TOKEN'
}

response = requests.request('GET', url, headers=headers, json=payload)
response.json()

Example response (200):


{
    "success": "success"
}
 

Request      

GET api/token_generate/access_token/{id}/delete

URL Parameters

id  string  

The ID of the access token.

Body Parameters

organization_id  required optional  

integer Selected organization.

id  required optional  

integer Selected organization.

Clients list

API endpoints for getting clients

Get active clients

requires authentication

This endpoint retuns all active clients with pagination.

Example request:
curl --request GET \
    --get "https://openapi.sweepandgo.com/api/v1/clients/active?page=2" \
    --header "Authorization: Bearer YOUR_TOKEN" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://openapi.sweepandgo.com/api/v1/clients/active"
);

const params = {
    "page": "2",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Authorization": "Bearer YOUR_TOKEN",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://openapi.sweepandgo.com/api/v1/clients/active',
    [
        'headers' => [
            'Authorization' => 'Bearer YOUR_TOKEN',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'query' => [
            'page'=> '2',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://openapi.sweepandgo.com/api/v1/clients/active'
params = {
  'page': '2',
}
headers = {
  'Authorization': 'Bearer YOUR_TOKEN',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('GET', url, headers=headers, params=params)
response.json()

Example response (200):


{
    "data": [
        {
            "client": "rcl_MTPQPRUUUY7G",
            "status": "active",
            "type": "employee_portal",
            "email": "demo@mail.com",
            "first_name": "John",
            "last_name": "Doe",
            "address": "3289 Summit Street",
            "zip_code": "52801",
            "home_phone": null,
            "cell_phone": 2344328676,
            "subscription_status": "active",
            "subscription_name": "2w-3d",
            "one_time_client": false,
            "channel": "sms",
            "on_the_way": true,
            "completed": true,
            "off_schedule": false
        }
    ],
    "paginate": {
        "total": 1,
        "count": 1,
        "per_page": 10,
        "current_page": 1,
        "total_pages": 1
    }
}
 

Request      

GET api/v1/clients/active

Query Parameters

page  integer optional  

Get results for specific page.

Get active clients with no active subscription

requires authentication

This endpoint returns all active clients with no active subscription and pagination.

Example request:
curl --request GET \
    --get "https://openapi.sweepandgo.com/api/v1/clients/active_no_subscription?page=2&min_date=2022-03-28&from_date=2022-03-28&to_date=2022-03-28" \
    --header "Authorization: Bearer YOUR_TOKEN" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"min_date\": \"2022-07-01\",
    \"from_date\": \"2022-07-01\",
    \"to_date\": \"2022-07-01\"
}"
const url = new URL(
    "https://openapi.sweepandgo.com/api/v1/clients/active_no_subscription"
);

const params = {
    "page": "2",
    "min_date": "2022-03-28",
    "from_date": "2022-03-28",
    "to_date": "2022-03-28",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Authorization": "Bearer YOUR_TOKEN",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "min_date": "2022-07-01",
    "from_date": "2022-07-01",
    "to_date": "2022-07-01"
};

fetch(url, {
    method: "GET",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://openapi.sweepandgo.com/api/v1/clients/active_no_subscription',
    [
        'headers' => [
            'Authorization' => 'Bearer YOUR_TOKEN',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'query' => [
            'page'=> '2',
            'min_date'=> '2022-03-28',
            'from_date'=> '2022-03-28',
            'to_date'=> '2022-03-28',
        ],
        'json' => [
            'min_date' => '2022-07-01',
            'from_date' => '2022-07-01',
            'to_date' => '2022-07-01',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://openapi.sweepandgo.com/api/v1/clients/active_no_subscription'
payload = {
    "min_date": "2022-07-01",
    "from_date": "2022-07-01",
    "to_date": "2022-07-01"
}
params = {
  'page': '2',
  'min_date': '2022-03-28',
  'from_date': '2022-03-28',
  'to_date': '2022-03-28',
}
headers = {
  'Authorization': 'Bearer YOUR_TOKEN',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('GET', url, headers=headers, json=payload, params=params)
response.json()

Example response (200):


{
"data": [
{
"client": "rcl_MTPQPRUUUY7G",
"status": "active",
"type": "employee_portal",
"email": "demo@mail.com",
"first_name": "John",
"last_name": "Doe",
"address": "3289 Summit Street",
"zip_code": "52801",
"home_phone": null,
"cell_phone": 2344328676,
"channel": "sms",
"on_the_way": true,
"completed": true,
"off_schedule": false,
"subscription_status": "active",
"subscription_name": "2w-3d",
"one_time_client": false,
}
],
"paginate": {
"total": 1,
"count": 1,
"per_page": 10,
"current_page": 1,
"total_pages": 1
}
}
 

Request      

GET api/v1/clients/active_no_subscription

Query Parameters

page  integer optional  

Get results for specific page.

min_date  string optional  

Get results where subscription canceled at list this selected date if you send this param, do not send from_date and to_date. Format must be YYYY-MM-DD.

from_date  string optional  

Get results where subscription canceled between this date and to_date. Format must be YYYY-MM-DD.

to_date  string optional  

Get results where subscription canceled between this date and from_date. Format must be YYYY-MM-DD.

Body Parameters

min_date  string optional  

Must be a valid date in the format Y-m-d.

from_date  string optional  

Must be a valid date in the format Y-m-d.

to_date  string optional  

This field is required when from_date is present. Must be a valid date in the format Y-m-d.

Get inactive clients

requires authentication

This endpoint returns all inactive clients for specific page of results.

Example request:
curl --request GET \
    --get "https://openapi.sweepandgo.com/api/v1/clients/inactive?page=2" \
    --header "Authorization: Bearer YOUR_TOKEN" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://openapi.sweepandgo.com/api/v1/clients/inactive"
);

const params = {
    "page": "2",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Authorization": "Bearer YOUR_TOKEN",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://openapi.sweepandgo.com/api/v1/clients/inactive',
    [
        'headers' => [
            'Authorization' => 'Bearer YOUR_TOKEN',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'query' => [
            'page'=> '2',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://openapi.sweepandgo.com/api/v1/clients/inactive'
params = {
  'page': '2',
}
headers = {
  'Authorization': 'Bearer YOUR_TOKEN',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('GET', url, headers=headers, params=params)
response.json()

Example response (200):


{
"data": [
{
"client": "rcl_MTPQPRUUUY7G",
"status": "inactive",
"type": "employee_portal",
"email": "demo@mail.com",
"first_name": "John",
"last_name": "Doe",
"address": "3289 Summit Street",
"zip_code": "52801",
"home_phone": null,
"cell_phone": 2344328676,
"channel": "sms",
"on_the_way": true,
"completed": true,
"off_schedule": false,
"subscription_status": "active",
"subscription_name": "2w-3d",
"one_time_client": false,
}
],
"paginate": {
"total": 1,
"count": 1,
"per_page": 10,
"current_page": 1,
"total_pages": 1
}
}
 

Request      

GET api/v1/clients/inactive

Query Parameters

page  integer optional  

Get results for specific page.

Dispatch Board

API endpoints for getting list of jobs

Dispatch Board

requires authentication

This endpoint returns jobs list for a selected date - Dispatch Board for selected date.

If returned id is bigger than zero that means that the job is already dispatched. If it’s zero, it means that job is not dispatched.

Job status can be: pending(1), completed(2), skipped(3), missed(4), started(5) and dispatched(6)

Job type can be: custom, initial, one_time, reclean and recurring

Example request:
curl --request GET \
    --get "https://openapi.sweepandgo.com/api/v1/dispatch_board/jobs_for_date?date=2022-03-28" \
    --header "Authorization: Bearer YOUR_TOKEN" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"date\": \"2022-07-01\"
}"
const url = new URL(
    "https://openapi.sweepandgo.com/api/v1/dispatch_board/jobs_for_date"
);

const params = {
    "date": "2022-03-28",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Authorization": "Bearer YOUR_TOKEN",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "date": "2022-07-01"
};

fetch(url, {
    method: "GET",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://openapi.sweepandgo.com/api/v1/dispatch_board/jobs_for_date',
    [
        'headers' => [
            'Authorization' => 'Bearer YOUR_TOKEN',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'query' => [
            'date'=> '2022-03-28',
        ],
        'json' => [
            'date' => '2022-07-01',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://openapi.sweepandgo.com/api/v1/dispatch_board/jobs_for_date'
payload = {
    "date": "2022-07-01"
}
params = {
  'date': '2022-03-28',
}
headers = {
  'Authorization': 'Bearer YOUR_TOKEN',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('GET', url, headers=headers, json=payload, params=params)
response.json()

Example response (200):


{
"data": [
{
"id": 0,
"client_location_id": 2603,
"client_id": null,
"commercial_location_id": 142,
"commercial_client_id": 84,
"pricing_plan_name": "Pet waste stations",
"commercial": 1,
"full_name": "Little Lambs Foundation for Kids",
"address": "1011 W 400 N",
"city": "Logan",
"zip": "84321",
"state_name": "Utah",
"clean_up_frequency": "1xW",
"count_cross_sells": 1,
"assigned_to_name": "Bart Cage",
"assigned_to_id": 265,
"estimate_time": "00:15",
"type": "recurring",
"end_time": null,
"start_time": null,
"status_id": 1,
"status_name": "pending",
"duration": "-",
"gate_code": null,
"gated_community": null,
"lat": 41.7389868,
"lng": -111.860119,
"number_of_dogs": null,
"safe_dogs": null
},
{
"id": 0,
"client_location_id": 2726,
"client_id": 1580,
"commercial_location_id": null,
"commercial_client_id": null,
"pricing_plan_name": "Regular Plan",
"commercial": 0,
"full_name": "Cara Deen",
"address": "625 South 100 West",
"city": "Garland",
"zip": "84312",
"state_name": "Utah",
"clean_up_frequency": "two_times_a_week",
"count_cross_sells": 0,
"assigned_to_name": "Richard Dawson",
"assigned_to_id": 258,
"estimate_time": "00:15",
"type": "recurring",
"end_time": null,
"start_time": null,
"status_id": 1,
"status_name": "pending",
"duration": "-",
"gate_code": null,
"gated_community": null,
"lat": 41.7344582,
"lng": -112.1634671,
"number_of_dogs": 2,
"safe_dogs": ""
},
{
"id": 156608,
"client_location_id": 2325,
"type": "recurring",
"organization_id": 158,
"client_id": null,
"full_name": "Community Garden",
"address": "468 1/2 S 200 W",
"city": "Logan",
"zip": "84321",
"state_name": "Utah",
"assigned_to_id": 265,
"assigned_to_name": "Bart Cage",
"end_time": null,
"start_time": null,
"status_id": 6,
"lat": 41.7228185,
"lng": -111.8397648,
"estimate_time": "00:15",
"job_image": null,
"image_for_client": null,
"note": null,
"note_for_client": null,
"order": 1,
"arrival": 4,
"distance": "3.00",
"skip_reason_title": null,
"gate_code": null,
"count_cross_sells": 1,
"number_of_dogs": null,
"safe_dogs": null,
"gated_community": null,
"commercial": 1,
"work_areas": null,
"commercial_client_id": 76,
"commercial_location_id": 127,
"start_lat": null,
"start_lng": null,
"start_distance": null,
"clean_up_frequency": null,
"end_lat": null,
"end_lng": null,
"end_distance": null,
"skip_lat": null,
"skip_lng": null,
"skip_distance": null,
"status_name": "dispatched",
"duration": "-"
},
{
"id": 156890,
"client_location_id": 2578,
"type": "custom",
"organization_id": 158,
"client_id": 1567,
"full_name": "Carolina Wozniacki",
"address": "149 W 300 N",
"city": "Logan",
"zip": "84321",
"state_name": "Utah - UT",
"assigned_to_id": 246,
"assigned_to_name": "Ena Adamz",
"end_time": "2022-03-29 08:24:07",
"start_time": "2022-03-29 08:22:08",
"status_id": 2,
"lat": 41.7374576,
"lng": -111.8385534,
"estimate_time": "00:15",
"job_image": null,
"image_for_client": null,
"note": "",
"note_for_client": "",
"order": 5,
"arrival": null,
"distance": null,
"skip_reason_title": null,
"gate_code": null,
"count_cross_sells": 0,
"number_of_dogs": 1,
"safe_dogs": "",
"gated_community": null,
"commercial": 0,
"work_areas": null,
"commercial_client_id": null,
"commercial_location_id": null,
"start_lat": null,
"start_lng": null,
"start_distance": null,
"clean_up_frequency": "bi_weekly",
"end_lat": null,
"end_lng": null,
"end_distance": null,
"skip_lat": null,
"skip_lng": null,
"skip_distance": null,
"status_name": "completed",
"duration": "00:21"
}
]
}
}
 

Request      

GET api/v1/dispatch_board/jobs_for_date

Query Parameters

date  string  

Get clients that have a cleanup on the selected date. Format must be YYYY-MM-DD.

Body Parameters

date  string  

Must be a valid date in the format Y-m-d.

Leads list

API endpoints for getting leads

Get all Leads

requires authentication

This endpoint returns all leads with pagination.

Example request:
curl --request GET \
    --get "https://openapi.sweepandgo.com/api/v1/leads/list?page=2" \
    --header "Authorization: Bearer YOUR_TOKEN" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://openapi.sweepandgo.com/api/v1/leads/list"
);

const params = {
    "page": "2",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Authorization": "Bearer YOUR_TOKEN",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://openapi.sweepandgo.com/api/v1/leads/list',
    [
        'headers' => [
            'Authorization' => 'Bearer YOUR_TOKEN',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'query' => [
            'page'=> '2',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://openapi.sweepandgo.com/api/v1/leads/list'
params = {
  'page': '2',
}
headers = {
  'Authorization': 'Bearer YOUR_TOKEN',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('GET', url, headers=headers, params=params)
response.json()

Example response (200):


{
"data": [
{
"lead": "rld_MTPQPRUUUY7G",
"status": "active",
"type": "onboarding_form",
"email": "demo@mail.com",
"name": "John Doe",
"address": "3289 Summit Street",
"zip_code": "52801",
"home_phone": null,
"cell_phone": 2344328676,
}
],
"paginate": {
"total": 1,
"count": 1,
"per_page": 10,
"current_page": 1,
"total_pages": 1
}
}
 

Request      

GET api/v1/leads/list

Query Parameters

page  integer optional  

Get results for specific page.

Get Out of area leads

requires authentication

This endpoint returns all leads who are Out of area with pagination

Example request:
curl --request GET \
    --get "https://openapi.sweepandgo.com/api/v1/leads/out_of_service?page=2" \
    --header "Authorization: Bearer YOUR_TOKEN" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://openapi.sweepandgo.com/api/v1/leads/out_of_service"
);

const params = {
    "page": "2",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Authorization": "Bearer YOUR_TOKEN",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://openapi.sweepandgo.com/api/v1/leads/out_of_service',
    [
        'headers' => [
            'Authorization' => 'Bearer YOUR_TOKEN',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'query' => [
            'page'=> '2',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://openapi.sweepandgo.com/api/v1/leads/out_of_service'
params = {
  'page': '2',
}
headers = {
  'Authorization': 'Bearer YOUR_TOKEN',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('GET', url, headers=headers, params=params)
response.json()

Example response (200):


{
"data": [
{
"lead": "rld_MTPQPRUUUY7G",
"status": "lead",
"type": "out_of_area",
"email": "demo@mail.com",
"name": "John Doe",
"address": "3289 Summit Street",
"zip_code": "52801",
"home_phone": null,
"cell_phone": 2344328676,
}
],
"paginate": {
"total": 1,
"count": 1,
"per_page": 10,
"current_page": 1,
"total_pages": 1
}
}
 

Request      

GET api/v1/leads/out_of_service

Query Parameters

page  integer optional  

Get results for specific page.

Onboarding new clients

API endpoints for onboarding new clients

Onboarding new client within Sweep&Go application

requires authentication

This endpoint is used for new client registration within Sweep&Go application

Example request:
curl --request PUT \
    "https://openapi.sweepandgo.com/api/v1/residential/onboarding" \
    --header "Authorization: Bearer YOUR_TOKEN" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"zip_code\": 12110,
    \"number_of_dogs\": 2,
    \"last_time_yard_was_thoroughly_cleaned\": \"one_week\",
    \"clean_up_frequency\": \"once_a_week\",
    \"first_name\": \"John\",
    \"last_name\": \"Doe\",
    \"email\": \"mail@email.com\",
    \"home_address\": \"1494 Ben Street\",
    \"city\": \"Latham\",
    \"state\": \"TX\",
    \"home_phone_number\": \"7897666790\",
    \"cell_phone_number\": \"9897633690\",
    \"initial_cleanup_required\": true,
    \"cleanup_notification_type\": \"completed\",
    \"cleanup_notification_channel\": \"sms\",
    \"how_heard_about_us\": \"social_media\",
    \"how_heard_answer\": \"Facebook\",
    \"additional_comment\": \"Please clean my yard.\",
    \"credit_card_token\": \"tok_5678967890678 or 678987678909876\",
    \"name_on_card\": \"John Doe\",
    \"cvv\": \"112\",
    \"postal\": \"28301\",
    \"expiry\": \"0924\"
}"
const url = new URL(
    "https://openapi.sweepandgo.com/api/v1/residential/onboarding"
);

const headers = {
    "Authorization": "Bearer YOUR_TOKEN",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "zip_code": 12110,
    "number_of_dogs": 2,
    "last_time_yard_was_thoroughly_cleaned": "one_week",
    "clean_up_frequency": "once_a_week",
    "first_name": "John",
    "last_name": "Doe",
    "email": "mail@email.com",
    "home_address": "1494 Ben Street",
    "city": "Latham",
    "state": "TX",
    "home_phone_number": "7897666790",
    "cell_phone_number": "9897633690",
    "initial_cleanup_required": true,
    "cleanup_notification_type": "completed",
    "cleanup_notification_channel": "sms",
    "how_heard_about_us": "social_media",
    "how_heard_answer": "Facebook",
    "additional_comment": "Please clean my yard.",
    "credit_card_token": "tok_5678967890678 or 678987678909876",
    "name_on_card": "John Doe",
    "cvv": "112",
    "postal": "28301",
    "expiry": "0924"
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->put(
    'https://openapi.sweepandgo.com/api/v1/residential/onboarding',
    [
        'headers' => [
            'Authorization' => 'Bearer YOUR_TOKEN',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'zip_code' => 12110,
            'number_of_dogs' => 2,
            'last_time_yard_was_thoroughly_cleaned' => 'one_week',
            'clean_up_frequency' => 'once_a_week',
            'first_name' => 'John',
            'last_name' => 'Doe',
            'email' => 'mail@email.com',
            'home_address' => '1494 Ben Street',
            'city' => 'Latham',
            'state' => 'TX',
            'home_phone_number' => '7897666790',
            'cell_phone_number' => '9897633690',
            'initial_cleanup_required' => true,
            'cleanup_notification_type' => 'completed',
            'cleanup_notification_channel' => 'sms',
            'how_heard_about_us' => 'social_media',
            'how_heard_answer' => 'Facebook',
            'additional_comment' => 'Please clean my yard.',
            'credit_card_token' => 'tok_5678967890678 or 678987678909876',
            'name_on_card' => 'John Doe',
            'cvv' => '112',
            'postal' => '28301',
            'expiry' => '0924',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://openapi.sweepandgo.com/api/v1/residential/onboarding'
payload = {
    "zip_code": 12110,
    "number_of_dogs": 2,
    "last_time_yard_was_thoroughly_cleaned": "one_week",
    "clean_up_frequency": "once_a_week",
    "first_name": "John",
    "last_name": "Doe",
    "email": "mail@email.com",
    "home_address": "1494 Ben Street",
    "city": "Latham",
    "state": "TX",
    "home_phone_number": "7897666790",
    "cell_phone_number": "9897633690",
    "initial_cleanup_required": true,
    "cleanup_notification_type": "completed",
    "cleanup_notification_channel": "sms",
    "how_heard_about_us": "social_media",
    "how_heard_answer": "Facebook",
    "additional_comment": "Please clean my yard.",
    "credit_card_token": "tok_5678967890678 or 678987678909876",
    "name_on_card": "John Doe",
    "cvv": "112",
    "postal": "28301",
    "expiry": "0924"
}
headers = {
  'Authorization': 'Bearer YOUR_TOKEN',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('PUT', url, headers=headers, json=payload)
response.json()

Example response (200):


{
    "success": "success"
}
 

Request      

PUT api/v1/residential/onboarding

Body Parameters

zip_code  integer  

Zip code.

number_of_dogs  integer  

Number of dogs.

last_time_yard_was_thoroughly_cleaned  string  

When was yard last time cleaned. Available options are: one_week, two_weeks, three_weeks, one_month, two_months, 3-4_months, 5-6_months, 7-9_months, 10+_months.

clean_up_frequency  string  

What is cleanup frequency. Available options are: seven_times_a_week, six_times_a_week, five_times_a_week, four_times_a_week, three_times_a_week, two_times_a_week, once_a_week, bi_weekly, twice_per_month, once_per_month, one_time.

first_name  string  

Client first name.

last_name  string  

Client last name.

email  string  

Client email.

home_address  string  

Client address.

city  string  

Client city.

state  string  

Client state - two letters abbreviation.

home_phone_number  string optional  

Client home phone number.

cell_phone_number  string optional  

Client cell phone number.

initial_cleanup_required  boolean optional  

Did client ask for initial cleanup.

cleanup_notification_type  string optional  

Cleanup Notification type. Available options are: off_schedule, on_the_way and completed.

cleanup_notification_channel  string optional  

The way your client get notifications. Available options are: sms, email or call.

how_heard_about_us  string optional  

How client heard about you. Available options are: search_engine, previous_client, referred_by_family_or_friend, flier_from_business, directory_listing, social_media, vehicle_signage, radio_ad, local_event, gift_certificate, other.

how_heard_answer  string optional  

How client heard about you details.

additional_comment  string optional  

Additional client comment.

credit_card_token  string optional  

Token from Card connect or Stripe for Credit card on file.

name_on_card  string optional  

Name on Card.

cvv  string optional  

CVV for Credit card on file if use Card connect cards.

postal  string optional  

Postal for Card connect credit card on file.

expiry  string optional  

Expiry for Card connect credit card on file.

One time charges

API endpoints for one-time charges

One time payment

requires authentication

This endpoint is used for recording one time payment

Example request:
curl --request PUT \
    "https://openapi.sweepandgo.com/api/v1/invoice/one_time" \
    --header "Authorization: Bearer YOUR_TOKEN" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"invoice_number\": \"3-3-190207-2-4\",
    \"reference_number\": \"ref_8798yhjasa\",
    \"amount\": \"67.98\",
    \"status\": \"successful or failed\",
    \"billing_address\": \"635 Go Man Go Dr\",
    \"billing_city\": \"Stafford\",
    \"billing_state\": \"Texas\",
    \"billing_zip\": \"77477\",
    \"name\": \"John Doe\",
    \"email\": \"mail@mail.com\"
}"
const url = new URL(
    "https://openapi.sweepandgo.com/api/v1/invoice/one_time"
);

const headers = {
    "Authorization": "Bearer YOUR_TOKEN",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "invoice_number": "3-3-190207-2-4",
    "reference_number": "ref_8798yhjasa",
    "amount": "67.98",
    "status": "successful or failed",
    "billing_address": "635 Go Man Go Dr",
    "billing_city": "Stafford",
    "billing_state": "Texas",
    "billing_zip": "77477",
    "name": "John Doe",
    "email": "mail@mail.com"
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->put(
    'https://openapi.sweepandgo.com/api/v1/invoice/one_time',
    [
        'headers' => [
            'Authorization' => 'Bearer YOUR_TOKEN',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'invoice_number' => '3-3-190207-2-4',
            'reference_number' => 'ref_8798yhjasa',
            'amount' => '67.98',
            'status' => 'successful or failed',
            'billing_address' => '635 Go Man Go Dr',
            'billing_city' => 'Stafford',
            'billing_state' => 'Texas',
            'billing_zip' => '77477',
            'name' => 'John Doe',
            'email' => 'mail@mail.com',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://openapi.sweepandgo.com/api/v1/invoice/one_time'
payload = {
    "invoice_number": "3-3-190207-2-4",
    "reference_number": "ref_8798yhjasa",
    "amount": "67.98",
    "status": "successful or failed",
    "billing_address": "635 Go Man Go Dr",
    "billing_city": "Stafford",
    "billing_state": "Texas",
    "billing_zip": "77477",
    "name": "John Doe",
    "email": "mail@mail.com"
}
headers = {
  'Authorization': 'Bearer YOUR_TOKEN',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('PUT', url, headers=headers, json=payload)
response.json()

Example response (200):


{
    "success": "success"
}
 

Request      

PUT api/v1/invoice/one_time

Body Parameters

invoice_number  string  

Invoice number.

reference_number  string  

Reference number.

amount  string  

Amount.

status  string  

Status.

billing_address  string optional  

Billing address.

billing_city  string optional  

Billing city.

billing_state  string optional  

Billing state.

billing_zip  string optional  

Billing zip.

name  string optional  

Client name.

email  string optional  

Client email.

Tests

API endpoints for health check of API

Health check for API

This endpoint is api status health check

Example request:
curl --request GET \
    --get "https://openapi.sweepandgo.com/api/health" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer YOUR_TOKEN"
const url = new URL(
    "https://openapi.sweepandgo.com/api/health"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer YOUR_TOKEN",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://openapi.sweepandgo.com/api/health',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer YOUR_TOKEN',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://openapi.sweepandgo.com/api/health'
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer YOUR_TOKEN'
}

response = requests.request('GET', url, headers=headers)
response.json()

Example response (200):


{
    "status": "OK",
    "version": "v1"
}
 

Request      

GET api/health

Test webhooks locally

requires authentication

Example request:
curl --request POST \
    "https://openapi.sweepandgo.com/api/test" \
    --header "Authorization: Bearer YOUR_TOKEN" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://openapi.sweepandgo.com/api/test"
);

const headers = {
    "Authorization": "Bearer YOUR_TOKEN",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "POST",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->post(
    'https://openapi.sweepandgo.com/api/test',
    [
        'headers' => [
            'Authorization' => 'Bearer YOUR_TOKEN',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://openapi.sweepandgo.com/api/test'
headers = {
  'Authorization': 'Bearer YOUR_TOKEN',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('POST', url, headers=headers)
response.json()

Request      

POST api/test

Test API method for v1 endpoints - does not do anything, just returns what it received and triggers test webhooks.

requires authentication

Example request:
curl --request GET \
    --get "https://openapi.sweepandgo.com/api/v1/welcome" \
    --header "Authorization: Bearer YOUR_TOKEN" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://openapi.sweepandgo.com/api/v1/welcome"
);

const headers = {
    "Authorization": "Bearer YOUR_TOKEN",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://openapi.sweepandgo.com/api/v1/welcome',
    [
        'headers' => [
            'Authorization' => 'Bearer YOUR_TOKEN',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://openapi.sweepandgo.com/api/v1/welcome'
headers = {
  'Authorization': 'Bearer YOUR_TOKEN',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('GET', url, headers=headers)
response.json()

Example response (403):

Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
 

{
    "errors": [
        "API key is not valid"
    ]
}
 

Request      

GET api/v1/welcome

Test API method for v2 endpoints - didn't do anything, just returns what it received.

requires authentication

Example request:
curl --request GET \
    --get "https://openapi.sweepandgo.com/api/v2/welcome" \
    --header "Authorization: Bearer YOUR_TOKEN" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://openapi.sweepandgo.com/api/v2/welcome"
);

const headers = {
    "Authorization": "Bearer YOUR_TOKEN",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://openapi.sweepandgo.com/api/v2/welcome',
    [
        'headers' => [
            'Authorization' => 'Bearer YOUR_TOKEN',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://openapi.sweepandgo.com/api/v2/welcome'
headers = {
  'Authorization': 'Bearer YOUR_TOKEN',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('GET', url, headers=headers)
response.json()

Example response (403):

Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
 

{
    "errors": [
        "API key is not valid"
    ]
}
 

Request      

GET api/v2/welcome

Webhooks

Webhooks for organization. Here is the list of all webhooks for one organization. You may trigger it at any time to receive a list of all webhook types. Type list of webhooks:

List of all webhooks for one organization

requires authentication

Example request:
curl --request GET \
    --get "https://openapi.sweepandgo.com/api/v1/webhooks/list?page=2" \
    --header "Authorization: Bearer YOUR_TOKEN" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://openapi.sweepandgo.com/api/v1/webhooks/list"
);

const params = {
    "page": "2",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Authorization": "Bearer YOUR_TOKEN",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://openapi.sweepandgo.com/api/v1/webhooks/list',
    [
        'headers' => [
            'Authorization' => 'Bearer YOUR_TOKEN',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'query' => [
            'page'=> '2',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://openapi.sweepandgo.com/api/v1/webhooks/list'
params = {
  'page': '2',
}
headers = {
  'Authorization': 'Bearer YOUR_TOKEN',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('GET', url, headers=headers, params=params)
response.json()

Example response (403):

Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
 

{
    "errors": [
        "API key is not valid"
    ]
}
 

Request      

GET api/v1/webhooks/list

Query Parameters

page  integer optional  

Get results for specific page.

Retry one webhook

requires authentication

Example request:
curl --request PUT \
    "https://openapi.sweepandgo.com/api/v1/webhooks/retry" \
    --header "Authorization: Bearer YOUR_TOKEN" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"id\": \"e0e03073-a1a3-4f6e-82ff-81dab3772534\"
}"
const url = new URL(
    "https://openapi.sweepandgo.com/api/v1/webhooks/retry"
);

const headers = {
    "Authorization": "Bearer YOUR_TOKEN",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "id": "e0e03073-a1a3-4f6e-82ff-81dab3772534"
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->put(
    'https://openapi.sweepandgo.com/api/v1/webhooks/retry',
    [
        'headers' => [
            'Authorization' => 'Bearer YOUR_TOKEN',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'id' => 'e0e03073-a1a3-4f6e-82ff-81dab3772534',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://openapi.sweepandgo.com/api/v1/webhooks/retry'
payload = {
    "id": "e0e03073-a1a3-4f6e-82ff-81dab3772534"
}
headers = {
  'Authorization': 'Bearer YOUR_TOKEN',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('PUT', url, headers=headers, json=payload)
response.json()

Example response (403):

Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
 

{
    "errors": [
        "API key is not valid"
    ]
}
 

Request      

PUT api/v1/webhooks/retry

Body Parameters

id  string  

Retry specific webhook.