Saltar al contenido principal

Update Contact Request

Update an existing contact request. Only the fields included in the request body are modified; omitted fields retain their current values.

🔹 Endpoint Details​

PUT /api/v1/contact-requests/{id}

🔒 Authentication​

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

📝 Path Parameters​

ParameterTypeRequiredDescription
idstring (UUID)YesID of the contact request to update

📝 Updatable Fields​

All fields are optional on update (the body is validated with PartialType of the create DTO).

FieldTypeDescription
organizationIdstring (UUID)Organization the request belongs to
typeenumcontactmeback | keepmeinformed
statusenumpending | accepted | rejected
preferredContactenumemail | phone | whatsapp
namestringContact name
emailstringContact email
phonestringContact phone
messagestringFree-form message
relatedServicestring (UUID)Related service ID
extraFieldsobjectCustom metadata bag
agentIdstring (UUID)Assigned agent
agentCommentstringComment from the agent
userGroupIdstring (UUID)Assigned user group
taxonomiesarray of stringsTaxonomy tags
externalIdstringExternal identifier
createdAtdate (ISO 8601)Client-supplied creation timestamp

🧩 Request Example​

curl -X PUT "https://openapi.onlive.site/api/v1/contact-requests/123e4567-e89b-12d3-a456-426614174000" \
-H "Content-Type: application/json" \
-H "Authorization: ONLIVESITE Credential:ONLIVEAccessKeyId, Signature=CalculatedSignature" \
-d '{
"status": "accepted",
"agentId": "e4567-e89b-12d3-a456-426614174000",
"agentComment": "Contacted the lead; sent brochure."
}'

📥 Response​

Success Response (200 OK)​

Returns the full updated Contact Request entity.

Response Example​

{
"id": "123e4567-e89b-12d3-a456-426614174000",
"organizationId": "123e4567-e89b-12d3-a456-426614174001",
"organizationName": "Acme Inc.",
"type": "contactmeback",
"status": "accepted",
"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" },
"agentId": "e4567-e89b-12d3-a456-426614174000",
"agentComment": "Contacted the lead; sent brochure.",
"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-13T16:42:11Z"
}

❌ Error Responses​

StatusDescription
404Contact request not found

This endpoint follows the standard error format.

🔍 Validation Rules​

  1. Partial update
    • Any subset of the create DTO fields may be sent; omitted fields are preserved
  2. Format
    • UUIDs must be valid when provided
    • email must be a valid email when provided
  3. Enum values (when provided)
    • type ∈ keepmeinformed
    • status ∈ rejected
    • preferredContact ∈ whatsapp

💡 Best Practices​

  1. Status transitions
    • pending → accepted / rejected once an agent triages the request
  2. Assignment
    • Update agentId and agentComment together to record ownership context
  3. Classification
    • Use taxonomies and extraFields to enrich requests over time
  4. Audit
    • Prefer small, focused updates — each one updates updatedAt

📘 Notes​

  • Only the fields you include are updated
  • The updatedAt timestamp is refreshed automatically
  • communicationLogs and countCommunicationLogs are server-managed
  • You must have access to the owning organization

✅ Common Use Cases​

  • ✅ Triage: Move a request from pending to accepted / rejected
  • 👤 Assignment: Assign an agent and leave a comment
  • 🏷️ Tagging: Add taxonomies as a request is categorized
  • 📝 Follow-up: Append agentComment after contacting the lead