Skip to main content

Create Contact Request

This endpoint creates a new contact request associated with your organization. It is typically invoked by a flow stage, a form submission, or directly by your integration.

πŸ”Ή Endpoint Details​

POST /api/v1/contact-requests

πŸ”’ Authentication​

HeaderRequiredDescription
Content-TypeYesMust be application/json
AuthorizationYesFormat: ONLIVESITE Credential:ONLIVEAccessKeyId, Signature=CalculatedSignature

πŸ“ Request Body​

FieldTypeRequiredDescription
organizationIdstring (UUID)YesUUID of the organization the request belongs to
typeenumYesOne of: contactmeback, keepmeinformed
statusenumYesOne of: pending, accepted, rejected
preferredContactenumYesOne of: email, phone, whatsapp
namestringNoName associated with the request
emailstringNoEmail address (validated against RFC format when present)
phonestringNoPhone number (free-form, E.164 recommended)
messagestringNoFree-form message
relatedServicestring (UUID)NoService the request relates to
extraFieldsobjectNoCustom metadata bag for integration-specific data
agentIdstring (UUID)NoAgent assigned to the request
agentCommentstringNoComment from the agent
userGroupIdstring (UUID)NoUser group this request is assigned to
taxonomiesarray of stringsNoFree-form taxonomy tags (e.g. ["/model/contact-request"])
externalIdstringNoExternal identifier from the upstream integration (e.g. Dilema form id)
createdAtdate (ISO 8601)NoOptional client-supplied creation timestamp

πŸ“€ Request Example​

curl -X POST "https://openapi.onlive.site/api/v1/contact-requests" \
-H "Content-Type: application/json" \
-H "Authorization: ONLIVESITE Credential:ONLIVEAccessKeyId, Signature=CalculatedSignature" \
-d '{
"organizationId": "123e4567-e89b-12d3-a456-426614174001",
"type": "contactmeback",
"status": "pending",
"preferredContact": "email",
"name": "John Doe",
"email": "[email protected]",
"phone": "+33612345678",
"message": "Please send me a copy of the contract",
"relatedService": "7a96c97a-bcf9-42df-984a-051c0fb8487e",
"userGroupId": "550e8400-e29b-41d4-a716-446655440000",
"agentId": "e4567-e89b-12d3-a456-426614174000",
"agentComment": "Forwarded to sales team",
"taxonomies": [
"/model/contact-request"
],
"extraFields": {
"department": "Sales",
"location": "New York"
},
"externalId": "frm_abc123"
}'

πŸ“₯ Response​

Success Response (201 Created)​

FieldTypeDescription
idstring (UUID)Unique identifier for the newly created request
organizationIdstring (UUID)Organization ID
organizationNamestringDenormalized organization name
typeenumContact request type
statusenumContact request status
preferredContactenumPreferred contact method
namestringContact name
emailstringContact email
phonestringContact phone
messagestringFree-form message
relatedServicestring (UUID)Related service ID
extraFieldsobjectCustom metadata
agentIdstring (UUID)Assigned agent ID
agentCommentstringComment from the agent
userGroupIdstring (UUID)Assigned user group ID
userGroupstringDenormalized user group name
taxonomiesarray of stringsTaxonomy tags
externalIdstringExternal identifier
communicationLogsarray of objectsCommunication log entries (empty on create)
countCommunicationLogsnumberNumber of communication logs
createdAtstring (ISO 8601)Creation timestamp
updatedAtstring (ISO 8601)Last update timestamp

Response Example​

{
"id": "123e4567-e89b-12d3-a456-426614174000",
"organizationId": "123e4567-e89b-12d3-a456-426614174001",
"organizationName": "Acme Inc.",
"type": "contactmeback",
"status": "pending",
"preferredContact": "email",
"name": "John Doe",
"email": "[email protected]",
"phone": "+33612345678",
"message": "Please send me a copy of the contract",
"relatedService": "7a96c97a-bcf9-42df-984a-051c0fb8487e",
"extraFields": {
"department": "Sales",
"location": "New York"
},
"agentId": "e4567-e89b-12d3-a456-426614174000",
"agentComment": "Forwarded to sales team",
"userGroupId": "550e8400-e29b-41d4-a716-446655440000",
"userGroup": "Sales Team",
"taxonomies": ["/model/contact-request"],
"externalId": "frm_abc123",
"communicationLogs": [],
"countCommunicationLogs": 0,
"createdAt": "2025-05-13T15:00:00Z",
"updatedAt": "2025-05-13T15:00:00Z"
}

❌ Error Responses​

This endpoint follows the standard error format.

πŸ” Validation Rules​

  1. Required fields
    • organizationId, type, status, preferredContact must be provided
  2. Enum values
    • type ∈ keepmeinformed
    • status ∈ rejected
    • preferredContact ∈ whatsapp
  3. Format
    • organizationId, userGroupId, agentId, relatedService must be valid UUIDs
    • email must be a valid email address (when provided)
    • createdAt accepts ISO 8601 strings and is converted to a Date

πŸ’‘ Best Practices​

  1. Capture
    • Always send organizationId and at least one contact channel (email or phone)
    • Use externalId to link to your upstream form system
  2. Classification
    • Set taxonomies (e.g. ["/model/contact-request"]) so flows can filter by source
    • Use extraFields for integration-specific data you need to round-trip
  3. Routing
    • Pre-assign userGroupId / agentId when the source already knows the owner

πŸ“˜ Notes​

  • The organizationId must match an organization accessible by your credentials
  • communicationLogs and countCommunicationLogs are server-managed and returned empty on create
  • The server enforces ownership β€” requests cannot be created on behalf of other organizations

βœ… Common Use Cases​

  • πŸ“ Form Submissions: Capture leads from a "Contact me" form
  • πŸ” Flow Integrations: Persist requests generated by an Onlive flow stage
  • 🧩 CRM Sync: Forward requests to an external CRM via externalId
  • πŸ“¨ Newsletter Signup: Use type: keepmeinformed for opt-in subscriptions