Requests API
Create customer requests programmatically
The Requests API allows you to create customer requests in BlueSuite programmatically. This is typically used for integrations with external systems like WordPress plugins.
Create Request
POST /api/requestsAuthentication: Requires the internal WordPress API key.
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
workspace_id | number | Yes | Your workspace ID |
name | string | No | Full name (parsed into first/last) |
first_name | string | No | Customer's first name |
last_name | string | No | Customer's last name |
email | string | Conditional | Email (required if no phone) |
phone | string | Conditional | Phone (required if no email) |
message | string | No | Request details/message |
street | string | No | Street address |
street_2 | string | No | Unit/Suite number |
city | string | No | City |
state | string | No | State/Province |
postal_code | string | No | ZIP/Postal code |
country | string | No | Country |
Example Request
curl -X POST https://app.bluesuite.com/api/requests \
-H "Authorization: Bearer YOUR_WP_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"workspace_id": 123,
"first_name": "John",
"last_name": "Smith",
"email": "john@example.com",
"phone": "555-123-4567",
"message": "I need window cleaning service",
"street": "123 Main St",
"city": "San Francisco",
"state": "CA",
"postal_code": "94102"
}'Success Response
{
"id": 456,
"number": "REQ-2024-0042",
"contact_id": 789,
"property_id": 101,
"workspace_id": 123,
"details": "I need window cleaning service",
"status": "new",
"created_at": "2024-01-15T10:30:00.000Z"
}Error Responses
| Status | Description |
|---|---|
| 400 | Invalid request body |
| 401 | Unauthorized (missing/invalid API key) |
| 404 | Workspace not found |
| 500 | Server error |
Behavior
When a request is created:
- Contact handling: A contact is created or matched by email/phone
- Property creation: If address fields are provided, a property is created
- Linking: The property is linked to the contact
- Request creation: The request is created with an auto-generated number
- Webhooks: Any subscribed
new_requestwebhooks are triggered
Alternative: Embedded Forms
For website integrations, consider using the Embedded Forms API instead:
- Uses standard API key authentication
- Designed for client-side use
- Includes spam prevention
- Better suited for public-facing forms