---
title: Log a new Client Communication history
slug: log-a-new-client-communication-history
docTags: 
createdAt: 2026-04-21T15:22:49.957Z
---

{
  "id": "ualPAFeZx7Oq3JKHsPivy",
  "type": "api-oas-v2",
  "data": {
    "method": "POST",
    "url": "https://developer.digitail.io/api/v1/client-communications",
    "servers": [
      {
        "url": "https://developer.digitail.io/api/v1/client-communications",
        "description": "Sandbox server (uses test data)"
      },
      {
        "url": "https://vet.digitail.io/api/v1/client-communications",
        "description": "Production server (uses live data)"
      }
    ],
    "name": "Log a new Client Communication history",
    "description": "Manually register a new communication between a Clinic and a PetParent",
    "contentType": "application/json",
    "request": {
      "pathParameters": [],
      "headerParameters": [
        {
          "name": "accept",
          "type": "string",
          "kind": "optional",
          "description": "Generated from available response content types",
          "enum": [
            "application/json"
          ],
          "default": "application/json"
        }
      ],
      "queryParameters": [],
      "bodyDataParameters": [
        {
          "kind": "required",
          "name": "body",
          "type": "object",
          "description": "",
          "schema": [
            {
              "name": "user_id",
              "kind": "optional",
              "type": "integer",
              "description": "<p>Id of the PetParent the communication was with. Must be a parent of every patient in patient_ids. Mutually exclusive with contact_person_id. Set when the communication is recorded and not editable afterwards.</p>"
            },
            {
              "name": "contact_person_id",
              "kind": "optional",
              "type": "integer",
              "description": "<p>Id of the contact person the communication was with, when it was not the PetParent. Must be linked to every patient in patient_ids. Mutually exclusive with user_id. Set when the communication is recorded and not editable afterwards.</p>"
            },
            {
              "name": "patient_ids",
              "kind": "optional",
              "type": "array",
              "description": "Id of the patients related to the communication.",
              "example": "",
              "itemType": "integer",
              "customType": "integer[]",
              "itemExample": "",
              "itemDefault": ""
            },
            {
              "name": "clinic_id",
              "kind": "optional",
              "type": "integer",
              "description": "Id of the Clinic from where the communication is made from."
            },
            {
              "name": "channel",
              "kind": "optional",
              "type": "string<phone | other>",
              "description": "<p>The channel of the communication. Enum. One of phone, other, sms, email. API limited only to phone &#x26; other.</p>",
              "enum": [
                "phone",
                "other"
              ]
            },
            {
              "name": "subject",
              "kind": "optional",
              "type": "string",
              "description": "The subject of communication."
            },
            {
              "name": "content",
              "kind": "optional",
              "type": "string",
              "description": "<p>The content of communication. (required for email)</p>"
            },
            {
              "name": "destination",
              "kind": "optional",
              "type": "string",
              "description": "<p>Where the communication is sent to ( only for sms/email/phone ).</p>"
            },
            {
              "name": "communicated_at",
              "kind": "optional",
              "type": "string",
              "description": "<p>The communicated_at when the communication was made.</p>"
            },
            {
              "name": "message_id",
              "kind": "optional",
              "type": "string",
              "description": "The id used for identifying attachments when channel is mail."
            }
          ],
          "isExpanded": true
        }
      ],
      "formDataParameters": [],
      "oAuthParameters": [
        {
          "id": "passport",
          "name": "passport",
          "kind": "optional",
          "type": "oauth2",
          "description": "Laravel passport oauth2 security.",
          "oauth2Flows": {
            "authorizationCode": {
              "authorizationUrl": "https://digitail.test/oauth/authorize",
              "tokenUrl": "https://digitail.test/oauth/token",
              "refreshUrl": "https://digitail.test/oauth/token"
            }
          }
        },
        {
          "id": "Bearer",
          "name": "Bearer",
          "kind": "optional",
          "type": "http",
          "scheme": "bearer"
        }
      ],
      "cookieParameters": []
    },
    "responses": [
      {
        "statusCode": "201",
        "description": "successful operation",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "",
            "schema": [
              {
                "name": "data",
                "kind": "optional",
                "type": "object",
                "description": "",
                "example": "",
                "schema": [
                  {
                    "name": "type",
                    "kind": "optional",
                    "type": "string",
                    "description": "",
                    "example": "Phone"
                  },
                  {
                    "name": "subject",
                    "kind": "optional",
                    "type": "string",
                    "description": "",
                    "example": "Subject"
                  },
                  {
                    "name": "content",
                    "kind": "optional",
                    "type": "string",
                    "nullable": true,
                    "description": "",
                    "example": "Longer content related to the communication"
                  },
                  {
                    "name": "communicated_at",
                    "kind": "optional",
                    "type": "string",
                    "description": "",
                    "example": "2022-07-21T14:18:33.258907Z"
                  },
                  {
                    "name": "failure_code",
                    "kind": "optional",
                    "type": "string",
                    "nullable": true,
                    "description": "<p>The delivery provider's own machine code for a failed delivery, stored verbatim. Vocabularies differ per provider: a Twilio error code (<code>30003</code>), a SendGrid enhanced SMTP status (<code>5.1.1</code>) falling back to the event type (<code>dropped</code>), a Sinch delivery-report code (<code>412</code>), or a Twilio Voice dial outcome (<code>busy</code>). Codes prefixed <code>digitail-</code> mean the message never reached a provider. Null when the delivery did not fail.</p>",
                    "example": "30003"
                  },
                  {
                    "name": "failure_reason",
                    "kind": "optional",
                    "type": "string",
                    "nullable": true,
                    "description": "<p>The provider's own human-readable explanation for a failed delivery, stored verbatim and untranslated. Frequently null even when <code>failure_code</code> is set — most providers send a code without accompanying text.</p>",
                    "example": "Unreachable destination handset"
                  },
                  {
                    "name": "replied_to_id",
                    "kind": "optional",
                    "type": "integer",
                    "nullable": true,
                    "description": "Id of the root communication this is a reply to.",
                    "example": 123
                  },
                  {
                    "name": "last_reply_at",
                    "kind": "optional",
                    "type": "string",
                    "nullable": true,
                    "description": "<p>Timestamp of the last reply in the thread (only on root communications).</p>",
                    "example": "2022-07-21T15:30:00.000000Z"
                  },
                  {
                    "name": "is_seen",
                    "kind": "optional",
                    "type": "boolean",
                    "description": "<p>Whether the clinic has opened this message on the pet timeline. Only inbound email replies are ever created unseen; everything else is seen from the start.</p>",
                    "example": true
                  },
                  {
                    "name": "unseen_replies_count",
                    "kind": "optional",
                    "type": "integer",
                    "description": "<p>Number of unseen replies in this thread (only when the replies relation is included).</p>",
                    "example": 2
                  },
                  {
                    "name": "record_id",
                    "kind": "optional",
                    "type": "integer",
                    "nullable": true,
                    "description": "<p>Id of the record this communication is linked to, if any.</p>",
                    "example": 77
                  },
                  {
                    "name": "record",
                    "kind": "optional",
                    "type": "object",
                    "nullable": true,
                    "description": "<p>The linked record itself (when included).</p>",
                    "complexType": "allOf",
                    "complexItems": [
                      {
                        "name": "object",
                        "description": "",
                        "schema": [
                          {
                            "name": "id",
                            "kind": "optional",
                            "type": "integer",
                            "description": "",
                            "example": 77
                          },
                          {
                            "name": "number",
                            "kind": "optional",
                            "type": "integer",
                            "description": "0 while the record is still an unnumbered draft.",
                            "example": 1234
                          },
                          {
                            "name": "status",
                            "kind": "optional",
                            "type": "integer",
                            "description": "<p>0 draft, 1 saved, 2 closed, 3 hospitalized.</p>",
                            "example": 1
                          },
                          {
                            "name": "date",
                            "kind": "optional",
                            "type": "string",
                            "description": "",
                            "example": "2026-07-12"
                          },
                          {
                            "name": "pet_id",
                            "kind": "optional",
                            "type": "integer",
                            "description": "",
                            "example": 55
                          },
                          {
                            "name": "sale_id",
                            "kind": "optional",
                            "type": "integer",
                            "description": "0 when the record has no sale.",
                            "example": 811
                          },
                          {
                            "name": "responsible_id",
                            "kind": "optional",
                            "type": "integer",
                            "nullable": true,
                            "description": "",
                            "example": 24
                          },
                          {
                            "name": "visit_types",
                            "kind": "optional",
                            "type": "array",
                            "description": "",
                            "example": "",
                            "itemType": "object",
                            "customType": "object[]",
                            "schema": [
                              {
                                "name": "id",
                                "kind": "optional",
                                "type": "integer",
                                "description": "",
                                "example": 3
                              },
                              {
                                "name": "name",
                                "kind": "optional",
                                "type": "string",
                                "description": "",
                                "example": "Wellness"
                              }
                            ]
                          }
                        ]
                      }
                    ],
                    "schema": []
                  },
                  {
                    "name": "replies",
                    "kind": "optional",
                    "type": "array",
                    "description": "<p>List of replies to this communication (when included).</p>",
                    "modelRef": "#/paths/~1api~1v1~1client-communications/post/responses/201/content/application~1json/schema/properties/data",
                    "customType": "data[]",
                    "schema": []
                  }
                ]
              }
            ],
            "isExpanded": true
          }
        ]
      }
    ],
    "hasXCodeSamples": false,
    "examples": {
      "languages": [
        {
          "id": "GZaZtph7J37oOqt5xM3-S",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request POST \\\n     --url https://developer.digitail.io/api/v1/client-communications \\\n     --header 'accept: application/json'"
        },
        {
          "id": "yFmqgcOXzZspEk3hz5OvB",
          "language": "javascript",
          "label": "javascript",
          "code": "var myHeaders = new Headers();\nmyHeaders.append(\"accept\", \"application/json\");\nmyHeaders.append(\"content-type\", \"application/json\");\n\nvar requestOptions = {\n   method: 'POST',\n   headers: myHeaders,\n   redirect: 'follow'\n};\n\nfetch(\"https://developer.digitail.io/api/v1/client-communications\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "0j5UhPCEEmQZG4vm4Q6Ji",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"https://developer.digitail.io/api/v1/client-communications\")\n\nhttps = Net::HTTP.new(url.host, url.port)\nhttps.use_ssl = true\n\nrequest = Net::HTTP::Post.new(url)\nrequest[\"accept\"] = \"application/json\"\nrequest[\"content-type\"] = \"application/json\"\n\nresponse = https.request(request)\nputs response.read_body\n"
        },
        {
          "id": "D2jIHN4G-0mItXTn91nq0",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"https://developer.digitail.io/api/v1/client-communications\"\n\npayload = {}\nheaders = {\n   'accept': 'application/json',\n   'content-type': 'application/json'\n}\n\nresponse = requests.request(\"POST\", url, headers=headers, data=payload)\n\nprint(response.text)\n"
        }
      ],
      "selectedLanguageId": "GZaZtph7J37oOqt5xM3-S"
    },
    "results": {
      "languages": [
        {
          "id": "-LM60OgyY-AUf_Z6lp6Jp",
          "language": "201",
          "code": "// successful operation\n{\n  \"data\": {\n    \"type\": \"Phone\",\n    \"subject\": \"Subject\",\n    \"content\": \"Longer content related to the communication\",\n    \"communicated_at\": \"2022-07-21T14:18:33.258907Z\",\n    \"failure_code\": \"30003\",\n    \"failure_reason\": \"Unreachable destination handset\",\n    \"replied_to_id\": 123,\n    \"last_reply_at\": \"2022-07-21T15:30:00.000000Z\",\n    \"is_seen\": true,\n    \"unseen_replies_count\": 2,\n    \"record_id\": 77,\n    \"record\": {},\n    \"replies\": [\n      \"\"\n    ]\n  }\n}"
        }
      ],
      "selectedLanguageId": "-LM60OgyY-AUf_Z6lp6Jp"
    }
  },
  "children": [
    {
      "text": ""
    }
  ]
}