Store Routes
Contents
Mobile_API »Create Route
Base URL
https://apimobile.callproof.com
Endpoint
/api/routes
Purpose
Creates a new route for the authenticated user, including the route name and the contacts assigned to that route. Optionally records who assigned the route.
HTTP Method
POST
Headers
| Header | Required | Description |
|---|---|---|
| Authorization | Yes | Bearer access token |
Security
- Yes – Requires Bearer Token authentication.
Parameters
Path Parameters
None.
Query Parameters
None.
Request Body
| Parameter | Type | Required | Description |
|---|---|---|---|
| route_name | string | Yes | Name of the route (must be unique for the authenticated user) |
| contact_ids | string | Yes | Contact IDs to include on the route (must not be empty) |
| assigned_by | integer | No | User ID of the person who assigned the route |
cURL Example for Android
curl --location --request POST 'https://apimobile.callproof.com/api/routes' \ --header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \ --form 'route_name=YOUR_ROUTE_NAME' \ --form 'contact_ids=12345,67890'
cURL Example for iOS
curl --location --request POST 'https://apimobile.callproof.com/api/routes' \ --header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \ --form 'route_name=YOUR_ROUTE_NAME' \ --form 'contact_ids=12345,67890'
Successful Response (200)
Indicates that the route was created successfully.
| Field | Type | Description |
|---|---|---|
| clientStatusCode | integer | Status indicator for the client (for example, 200) |
| user_id | integer | Identifier of the authenticated user |
| company_id | integer | Identifier of the authenticated user’s company |
| message | string | Confirmation message (for example, "Routes added successfully") |
| route_id | integer | Unique identifier of the newly created route |
| uri | string | Requested resource URI |
Error Responses
| Status Code | Meaning |
|---|---|
| 400 | Bad Request – the route could not be created |
| 401 | Unauthorized – missing, invalid, or expired Bearer token |
- 400 – Route name already exists ("Route Name Already Exists"), contacts missing ("Route Contacts Required"), or another create error (for example, "Error while Adding Routes").
- 401 – Authentication failed or the access token is missing/expired.