# Create communication

Creates a new Communication record. Communication resource in the Animal Health Data Store

Endpoint: POST /site/{siteId}/ahds/v1/communication
Version: 1.0
Security: bearer

## Security:

  - `bearer` (unknown)
    http bearer JWT

## Path parameters:

  - `siteId` (number, required)
    Site identifier

## Request fields (application/json):

  - `associatedResourceId` (string, required)
    Identifier of the resource this communication is associated with.
    Example: 123e4567-e89b-12d3-a456-426614174000

  - `associatedResourceType` (string, required)
    Type of resource this communication is associated with (e.g. Contact, Animal, Consult).
    Example: example

  - `communicatingResourceId` (string)
    Identifier of the communicating party when different from associatedResourceId.
    Example: 123e4567-e89b-12d3-a456-426614174000

  - `communicatingResourceType` (string)
    Type of the communicating party (e.g. Contact, Animal) when different from associatedResourceType.
    Example: example

  - `communicationId` (string)
    Canonical identifier for the communication.
    Example: 123e4567-e89b-12d3-a456-426614174000

  - `contactDetailTypeId` (string, required)
    Identifier of the ContactDetailType used to send the communication.
    Example: 123e4567-e89b-12d3-a456-426614174000

  - `content` (string, required)
    Body/content of the communication.
    Example: example

  - `contentFormat` (string, required)
    Format of the communication content.
    Enum: "SMS", "PLAINTEXT", "HTML"

  - `destination` (string, required)
    Destination address/identifier for the communication, format defined by contactDetailTypeId.
    Example: 123e4567-e89b-12d3-a456-426614174000

  - `direction` (string, required)
    Direction of the communication relative to the practice.
    Enum: "OUTGOING", "INCOMING"

  - `extensions` (object)
    Vendor- or practice-specific extensions.

  - `isActive` (boolean, required)
    Whether the communication record is active.
    Example: true

  - `origin` (string)
    Origin address/identifier for the communication, if available.
    Example: 123e4567-e89b-12d3-a456-426614174000

  - `readAt` (string)
    When the communication was marked as read, if applicable.
    Example: 2025-01-01T00:00:00.000Z

  - `sentAsUser` (object)
    User on whose behalf the communication was sent.

  - `status` (string, required)
    Delivery or processing status of the communication.
    Enum: "PENDING", "DONE", "SENDING", "FAILED"

  - `subject` (string)
    Subject or title of the communication.
    Example: example

  - `template` (object)
    Template used to generate this communication, if any.

## Response 201:

  - `201` (unknown)
    Communication created successfully

## Response 201 fields (application/json):

  - `associatedResourceId` (string, required)
    Identifier of the resource this communication is associated with.
    Example: 123e4567-e89b-12d3-a456-426614174000

  - `associatedResourceType` (string, required)
    Type of resource this communication is associated with (e.g. Contact, Animal, Consult).
    Example: example

  - `communicatingResourceId` (string, required)
    Identifier of the communicating party when different from associatedResourceId.
    Example: 123e4567-e89b-12d3-a456-426614174000

  - `communicatingResourceType` (string, required)
    Type of the communicating party (e.g. Contact, Animal) when different from associatedResourceType.
    Example: example

  - `communicationId` (string, required)
    Canonical identifier for the communication.
    Example: 123e4567-e89b-12d3-a456-426614174000

  - `contactDetailTypeId` (string, required)
    Identifier of the ContactDetailType used to send the communication.
    Example: 123e4567-e89b-12d3-a456-426614174000

  - `content` (string, required)
    Body/content of the communication.
    Example: example

  - `contentFormat` (string, required)
    Format of the communication content.
    Enum: "SMS", "PLAINTEXT", "HTML"

  - `createdAt` (string, required)
    When the communication record was created.
    Example: 2025-01-01T00:00:00.000Z

  - `destination` (string, required)
    Destination address/identifier for the communication, format defined by contactDetailTypeId.
    Example: 123e4567-e89b-12d3-a456-426614174000

  - `direction` (string, required)
    Direction of the communication relative to the practice.
    Enum: "OUTGOING", "INCOMING"

  - `extensions` (object, required)
    Vendor- or practice-specific extensions.

  - `isActive` (boolean, required)
    Whether the communication record is active.
    Example: true

  - `origin` (string, required)
    Origin address/identifier for the communication, if available.
    Example: 123e4567-e89b-12d3-a456-426614174000

  - `readAt` (string, required)
    When the communication was marked as read, if applicable.
    Example: 2025-01-01T00:00:00.000Z

  - `sentAsUser` (object, required)
    User on whose behalf the communication was sent.

  - `status` (string, required)
    Delivery or processing status of the communication.
    Enum: "PENDING", "DONE", "SENDING", "FAILED"

  - `subject` (string, required)
    Subject or title of the communication.
    Example: example

  - `template` (object, required)
    Template used to generate this communication, if any.

  - `updatedAt` (string, required)
    When the communication record was last updated.
    Example: 2025-01-01T00:00:00.000Z

## Response 400:

  - `400` (unknown)
    Invalid request body

## Response 401:

  - `401` (unknown)
    Unauthorized

## Response 409:

  - `409` (unknown)
    Communication with this ID already exists

