> For the complete documentation index, see [llms.txt](https://docs.mdintegrations.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.mdintegrations.com/partner-api-reference/patients/messages/creates-a-patients-message-with-the-given-data.md).

# Creates a patient's message with the given data

Creates a new message for the patient, attaching any provided files as part of the same operation. If the message or any file attachment fails, the whole operation is rolled back so no partial message is created; when sent by a medical assistant, the message is recorded as sent on behalf of their supervising clinician.

```json
{"openapi":"3.1.0","info":{"title":"MD Integrations","version":"1.0.0"},"tags":[{"name":"Patients/Messages"}],"servers":[{"url":"https://api.mdintegrations.dev/v1","description":"Development"}],"security":[{"oauth2":[]}],"components":{"securitySchemes":{"oauth2":{"type":"oauth2","flows":{"clientCredentials":{"tokenUrl":"https://api.mdintegrations.dev/v1/partner/auth/token","scopes":{"*":"Full partner account access"}}}}},"schemas":{"PostPatientMessageRequest":{"type":"object","properties":{"notified_model_type":{"type":"string","description":"Notification payload;"},"notified_model_id":{"type":["string","null"],"format":"uuid"},"files":{"type":"array","description":"Payload;","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"}}}}},"title":"PostPatientMessageRequest"},"MessageResource":{"type":"object","properties":{"id":{"type":"string","description":"Attributes;"},"patient_id":{"type":"string"},"channel":{"type":"string"},"text":{"type":["string","null"]},"text_length":{"type":["integer","null"]},"user_type":{"anyOf":[{"type":"string"},{"type":"null"},{"type":"string","enum":["system"]}]},"user_id":{"type":["string","null"]},"user_name":{"type":["string","null"]},"reference_message_id":{"type":["string","null"]},"replied_at":{"type":["string","null"],"format":"date-time"},"reply_message_id":{"type":["string","null"]},"dismissed_at":{"type":["string","null"],"format":"date-time"},"dismissed_by_user_type":{"type":["string","null"]},"dismissed_by_user_id":{"type":["string","null"]},"dismissed_by_user_name":{"type":["string","null"]},"on_behalf_user_type":{"type":["string","null"]},"on_behalf_user_id":{"type":["string","null"]},"on_behalf_user_name":{"type":["string","null"]},"metadata":{"type":["array","null"],"items":{}},"ai_mood":{"type":["string","null"]},"ai_category":{"type":["string","null"]},"emailed_at":{"type":["string","null"],"format":"date-time"},"created_at":{"type":["string","null"],"format":"date-time"},"updated_at":{"type":["string","null"],"format":"date-time"},"deleted_at":{"type":["string","null"],"format":"date-time"},"read_message_info":{"type":"string","description":"Appended Attributes;"},"partner_id":{"type":"string"},"recent_encounter_id":{"type":"string"},"reference_message":{"description":"Relationships; Circular reference to MessageResource flattened to avoid an unbounded self-referential schema; see components.schemas.MessageResource for the full shape.","type":"object"},"user":{"type":"string","description":"When loaded;"},"dismissed_by_user":{"type":"string","description":"When loaded, dynamicaly resolves the propper user's resource (with the user's resource class);"},"files":{"type":"array","description":"When loaded, dynamicaly resolves the propper dismissed by user's resource (with the user's resource class);","items":{"$ref":"#/components/schemas/App.Http.Resources.FileResource"}},"patient":{"description":"When loaded;","$ref":"#/components/schemas/App.Http.Resources.PatientResource"},"readings":{"type":"array","description":"When loaded;","items":{"$ref":"#/components/schemas/MessageReadingResource"}},"partner":{"type":"array","description":"When loaded;","items":{"$ref":"#/components/schemas/App.Http.Resources.PartnerResource"}},"on_behalf_user":{"type":"string","description":"When loaded;"}},"required":["id","patient_id","channel","text","text_length","user_type","user_id","user_name","reference_message_id","replied_at","reply_message_id","dismissed_at","dismissed_by_user_type","dismissed_by_user_id","dismissed_by_user_name","on_behalf_user_type","on_behalf_user_id","on_behalf_user_name","metadata","ai_mood","ai_category","emailed_at","created_at","updated_at","deleted_at","read_message_info","partner_id","recent_encounter_id"],"title":"MessageResource"},"App.Http.Resources.FileResource":{"type":"object","properties":{"id":{"type":"string","description":"Attributes;"},"name":{"type":"string"},"type":{"type":["string","null"]},"mime_type":{"type":"string"},"path":{"type":"string"},"metadata":{"type":["array","null"],"items":{}},"created_at":{"type":["string","null"],"format":"date-time"},"updated_at":{"type":["string","null"],"format":"date-time"},"deleted_at":{"type":["string","null"],"format":"date-time"},"url":{"type":"string","description":"Appended Attributes;"},"url_thumbnail":{"type":"string"},"pivot":{"type":"object","description":"Pivot Attributes (Partner);","properties":{"file_id":{"type":"string","description":"When loaded;"},"partner_id":{"type":"string"},"title":{"type":"string"},"type":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["file_id","partner_id","title","type","created_at","updated_at"]},"file_id":{"type":"string","description":"Keep compatibility;"}},"required":["id","name","type","mime_type","path","metadata","created_at","updated_at","deleted_at","url","url_thumbnail","file_id"],"title":"App.Http.Resources.FileResource"},"App.Http.Resources.PatientResource":{"type":"object","properties":{"id":{"type":"string","description":"Attributes;"},"first_name":{"type":"string"},"middle_name":{"type":["string","null"]},"last_name":{"type":"string"},"email":{"type":"string"},"ssn":{"type":["string","null"]},"active":{"type":"string"},"prefix":{"type":["string","null"]},"weight":{"type":"string"},"height":{"type":"string"},"blood_pressure":{"type":"string"},"body_temperature":{"type":"string"},"oxygen_saturation":{"type":"string"},"special_necessities":{"type":"string"},"date_of_birth":{"type":"string"},"gender":{"type":"integer"},"gender_label":{"type":"string"},"phone_number":{"type":["string","null"]},"phone_type":{"type":"string"},"address_id":{"type":"string"},"driver_license_id":{"type":["string","null"]},"allergies":{"type":"string"},"current_medications":{"type":"string"},"medical_conditions":{"type":"string"},"pregnancy":{"type":"string"},"partner_id":{"type":"string"},"environment_id":{"type":"string"},"clinician_id":{"type":["string","null"]},"metadata":{"type":["string","null"]},"intro_video_file_id":{"type":["string","null"]},"recent_encounter_id":{"type":["string","null"]},"important_offering_case_id":{"type":["string","null"]},"created_at":{"type":["string","null"],"format":"date-time"},"updated_at":{"type":["string","null"],"format":"date-time"},"deleted_at":{"type":["string","null"],"format":"date-time"},"is_sms_enabled":{"type":"string"},"is_email_enabled":{"type":"string"},"original_patient_id":{"type":["string","null"]},"status":{"type":["string","null"]},"patient_id":{"type":"string","description":"Appended Attributes;"},"full_name":{"type":"string"},"abbreviated_name":{"type":"string"},"is_live":{"type":"string"},"intro_video_id":{"type":"string"},"exam_id":{"type":"string"},"dosespot":{"type":"string"},"metafields":{"type":"array","items":{"$ref":"#/components/schemas/MetafieldResource"}},"shopify_customer_id":{"type":"string"},"address":{"description":"Relationships;","$ref":"#/components/schemas/App.Http.Resources.AddressResource"},"clinician":{"description":"When loaded;","$ref":"#/components/schemas/App.Http.Resources.ClinicianResource"},"driver_license":{"description":"When loaded;","$ref":"#/components/schemas/App.Http.Resources.FileResource"},"environment":{"description":"When loaded;","$ref":"#/components/schemas/EnvironmentResource"},"intro_video":{"description":"When loaded;","$ref":"#/components/schemas/App.Http.Resources.FileResource"},"tags":{"type":"array","description":"When loaded;","items":{"$ref":"#/components/schemas/App.Http.Resources.TagResource"}}},"required":["id","first_name","middle_name","last_name","email","ssn","active","prefix","weight","height","blood_pressure","body_temperature","oxygen_saturation","special_necessities","date_of_birth","gender","gender_label","phone_number","phone_type","address_id","driver_license_id","allergies","current_medications","medical_conditions","pregnancy","partner_id","environment_id","clinician_id","metadata","intro_video_file_id","recent_encounter_id","important_offering_case_id","created_at","updated_at","deleted_at","is_sms_enabled","is_email_enabled","original_patient_id","status","patient_id","full_name","abbreviated_name","is_live","intro_video_id","exam_id","dosespot","metafields","shopify_customer_id"],"title":"App.Http.Resources.PatientResource"},"MetafieldResource":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","description":"Attributes;"},"model_type":{"type":"string"},"model_id":{"type":"string"},"key":{"type":"string"},"value":{"type":["string","null"]},"scope":{"type":"string"},"type":{"type":["string","null"]},"title":{"type":["string","null"]},"metadata":{"type":["string","null"]},"emailed_at":{"type":"string"},"created_at":{"type":["string","null"],"format":"date-time"},"updated_at":{"type":["string","null"],"format":"date-time"},"deleted_at":{"type":["string","null"],"format":"date-time"}},"required":["id","model_type","model_id","key","value","scope","type","title","metadata","emailed_at","created_at","updated_at","deleted_at"]},{"type":"array","items":{"type":"string"},"minItems":0,"maxItems":0,"additionalItems":false}],"title":"MetafieldResource"},"App.Http.Resources.AddressResource":{"type":"object","properties":{"id":{"type":"string","description":"Attributes;"},"address":{"type":"string"},"address2":{"type":["string","null"]},"zip_code":{"type":"string"},"city_name":{"type":["string","null"]},"state_id":{"type":"string"},"created_at":{"type":["string","null"],"format":"date-time"},"updated_at":{"type":["string","null"],"format":"date-time"},"deleted_at":{"type":["string","null"],"format":"date-time"},"state":{"description":"Relationships;","$ref":"#/components/schemas/App.Http.Resources.StateResource"}},"required":["id","address","address2","zip_code","city_name","state_id","created_at","updated_at","deleted_at"],"title":"App.Http.Resources.AddressResource"},"App.Http.Resources.StateResource":{"type":"object","properties":{"id":{"type":"string","description":"Attributes;"},"name":{"type":"string"},"abbreviation":{"type":"string"},"country_id":{"type":"string"},"is_av_flow":{"type":"string"},"created_at":{"type":["string","null"],"format":"date-time"},"updated_at":{"type":["string","null"],"format":"date-time"},"deleted_at":{"type":["string","null"],"format":"date-time"},"expires_at":{"type":"string","description":"Appended Attributes;"},"is_expired":{"type":"string"},"is_sync":{"type":"string"},"epcs_support":{"type":"string"},"license_number":{"type":"string"},"pivot":{"type":"object","description":"Pivot Attributes (Clinician);","properties":{"state_id":{"type":"string","description":"When loaded;"},"clinician_id":{"type":"string"},"expires_at":{"type":"string"},"license_number":{"type":"string"},"is_sync":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["state_id","clinician_id","expires_at","license_number","is_sync","created_at","updated_at"]},"country":{"description":"Relationships;","$ref":"#/components/schemas/App.Http.Resources.CountryResource"}},"required":["id","name","abbreviation","country_id","is_av_flow","created_at","updated_at","deleted_at","expires_at","is_expired","is_sync","epcs_support","license_number"],"title":"App.Http.Resources.StateResource"},"App.Http.Resources.CountryResource":{"type":"object","properties":{"id":{"type":"string","description":"Attributes;"},"name":{"type":"string"},"abbreviation":{"type":"string"},"created_at":{"type":["string","null"],"format":"date-time"},"updated_at":{"type":["string","null"],"format":"date-time"},"deleted_at":{"type":["string","null"],"format":"date-time"}},"required":["id","name","abbreviation","created_at","updated_at","deleted_at"],"title":"App.Http.Resources.CountryResource"},"App.Http.Resources.ClinicianResource":{"type":"object","properties":{"id":{"type":"string","description":"Attributes;"},"first_name":{"type":"string"},"last_name":{"type":"string"},"suffix":{"type":["string","null"]},"email":{"type":"string"},"phone_number":{"type":["string","null"]},"phone_type":{"type":["string","null"]},"photo_id":{"type":["string","null"]},"url_thumbnail":{"type":["string","null"]},"active":{"type":"string"},"bio_details":{"type":["string","null"]},"date_of_birth":{"type":["string","null"]},"address_id":{"type":["string","null"]},"specialty":{"type":["string","null"]},"fax_number":{"type":["string","null"]},"profile_url":{"type":["string","null"]},"signature_id":{"type":["string","null"]},"npdb_id":{"type":["string","null"]},"case_assignment_availability":{"type":"string"},"is_video_call_available":{"type":"boolean"},"is_message_availability":{"type":"string"},"timezone_id":{"type":["string","null"]},"passcode_id":{"type":["string","null"]},"is_out_of_office":{"type":"string"},"out_of_office_message":{"type":["string","null"]},"out_of_office_at":{"type":["string","null"]},"out_of_office_return_at":{"type":["string","null"]},"automatic_sync_message":{"type":["string","null"]},"automatic_sync_video_file_id":{"type":["string","null"]},"thank_you_video_file_id":{"type":["string","null"]},"w9form_file_id":{"type":["string","null"]},"managed_by_partner":{"type":"string"},"epcs_requested":{"type":["string","null"]},"created_at":{"type":["string","null"],"format":"date-time"},"updated_at":{"type":["string","null"],"format":"date-time"},"deleted_at":{"type":["string","null"],"format":"date-time"},"full_name":{"type":"string","description":"Appended Attributes;"},"is_online":{"type":"string"},"priority":{"type":"string"},"dosespot":{"type":"string"},"mfa_status":{"type":"string"},"licenses":{"type":"array","description":"Relationships;","items":{"$ref":"#/components/schemas/LicenseResource"}},"practice_areas":{"type":"array","items":{"$ref":"#/components/schemas/PracticeAreaResource"}},"address":{"description":"TODO improve this resource later moving it to microservice structure;","$ref":"#/components/schemas/App.Http.Resources.AddressResource"},"permissions":{"type":"array","description":"When loaded;","items":{"$ref":"#/components/schemas/App.Http.Resources.PermissionResource"}},"photo":{"description":"When loaded;","$ref":"#/components/schemas/App.Http.Resources.FileResource"},"roles":{"type":"array","description":"When loaded;","items":{"$ref":"#/components/schemas/App.Http.Resources.RoleResource"}},"signature":{"description":"When loaded;","$ref":"#/components/schemas/App.Http.Resources.FileResource"},"npdb":{"description":"When loaded;","$ref":"#/components/schemas/App.Http.Resources.FileResource"},"automatic_sync_video_file":{"description":"When loaded;","$ref":"#/components/schemas/App.Http.Resources.FileResource"},"thank_you_video_file":{"description":"When loaded;","$ref":"#/components/schemas/App.Http.Resources.FileResource"},"w9form_file":{"$ref":"#/components/schemas/App.Http.Resources.FileResource"},"offerings":{"type":"array","items":{"type":"object","description":"Circular reference to OfferingResource flattened to avoid an unbounded self-referential schema; see components.schemas.OfferingResource for the full shape."}},"metafields":{"type":"array","items":{"$ref":"#/components/schemas/MetafieldResource"}},"pivot":{"type":"object","description":"Pivot Attributes (Offering);","properties":{"offering_id":{"type":"string"},"clinician_id":{"type":"string"},"type":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["offering_id","clinician_id","type","created_at","updated_at"]},"clinician_id":{"type":"string","description":"Keep compatibility;"}},"required":["id","first_name","last_name","suffix","email","phone_number","phone_type","photo_id","url_thumbnail","active","bio_details","date_of_birth","address_id","specialty","fax_number","profile_url","signature_id","npdb_id","case_assignment_availability","is_video_call_available","is_message_availability","timezone_id","passcode_id","is_out_of_office","out_of_office_message","out_of_office_at","out_of_office_return_at","automatic_sync_message","automatic_sync_video_file_id","thank_you_video_file_id","w9form_file_id","managed_by_partner","epcs_requested","created_at","updated_at","deleted_at","full_name","is_online","priority","mfa_status","metafields","clinician_id"],"title":"App.Http.Resources.ClinicianResource"},"LicenseResource":{"type":"object","properties":{"id":{"type":"string","description":"Attributes;"},"clinician_id":{"type":"string"},"state_id":{"type":["string","null"]},"type":{"type":"string"},"value":{"type":"string"},"created_at":{"type":["string","null"],"format":"date-time"},"updated_at":{"type":["string","null"],"format":"date-time"},"deleted_at":{"type":["string","null"],"format":"date-time"},"state":{"description":"Relationships;","$ref":"#/components/schemas/StateResource"},"license_id":{"type":"string","description":"keep compatibility;"}},"required":["id","clinician_id","state_id","type","value","created_at","updated_at","deleted_at","license_id"],"title":"LicenseResource"},"StateResource":{"type":"object","properties":{"name":{"type":"string"},"abbreviation":{"type":"string"},"state_id":{"type":"string"},"is_sync":{"type":"string"},"country":{"$ref":"#/components/schemas/CountryResource"},"is_av_flow":{"type":"string"}},"required":["name","abbreviation","state_id","is_sync","country","is_av_flow"],"title":"StateResource"},"CountryResource":{"type":"object","properties":{"country_id":{"type":"string"},"name":{"type":"string"},"abbreviation":{"type":"string"}},"required":["country_id","name","abbreviation"],"title":"CountryResource"},"PracticeAreaResource":{"type":"object","properties":{"expires_at":{"type":["string","null"]},"is_expired":{"type":"string"},"is_sync":{"type":"string"},"license_number":{"type":"string"},"state":{"$ref":"#/components/schemas/StateResource"}},"required":["expires_at","is_expired","is_sync","license_number","state"],"title":"PracticeAreaResource"},"App.Http.Resources.PermissionResource":{"type":"object","properties":{"id":{"type":"string","description":"Attributes;"},"name":{"type":"string"},"created_at":{"type":["string","null"],"format":"date-time"},"updated_at":{"type":["string","null"],"format":"date-time"},"pivot":{"type":"object","description":"Pivot Attributes (User);","properties":{"permission_id":{"type":"string","description":"When loaded;"},"model_id":{"type":"string"},"model_type":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["permission_id","model_id","model_type","created_at","updated_at"]}},"required":["id","name","created_at","updated_at"],"title":"App.Http.Resources.PermissionResource"},"App.Http.Resources.RoleResource":{"type":"object","properties":{"id":{"type":"string","description":"Attributes;"},"name":{"type":"string"},"created_at":{"type":["string","null"],"format":"date-time"},"updated_at":{"type":["string","null"],"format":"date-time"},"pivot":{"type":"object","description":"Pivot Attributes (User);","properties":{"role_id":{"type":"string","description":"When loaded;"},"model_id":{"type":"string"},"model_type":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["role_id","model_id","model_type","created_at","updated_at"]}},"required":["id","name","created_at","updated_at"],"title":"App.Http.Resources.RoleResource"},"EnvironmentResource":{"type":"object","properties":{"id":{"type":"string","description":"Attributes;"},"identifier":{"type":"string"},"created_at":{"type":["string","null"],"format":"date-time"},"updated_at":{"type":["string","null"],"format":"date-time"},"deleted_at":{"type":["string","null"],"format":"date-time"}},"required":["id","identifier","created_at","updated_at","deleted_at"],"title":"EnvironmentResource"},"App.Http.Resources.TagResource":{"type":"object","properties":{"id":{"type":"string","description":"Attributes;"},"name":{"type":"string"},"key":{"type":"string"},"description":{"type":["string","null"]},"color":{"type":"string"},"type":{"type":"string"},"removable_role":{"type":["string","null"]},"auto_detach_status":{"type":["array","null"],"items":{}},"created_at":{"type":["string","null"],"format":"date-time"},"updated_at":{"type":["string","null"],"format":"date-time"},"deleted_at":{"type":["string","null"],"format":"date-time"},"notes":{"type":"string","description":"Appended Attributes;"},"pivot":{"type":"object","description":"Pivot Attributes (Model Tag);","properties":{"tag_id":{"type":"string","description":"When loaded;"},"model_type":{"type":"string"},"model_id":{"type":"string"},"notes":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["tag_id","model_type","model_id","notes","created_at","updated_at"]}},"required":["id","name","key","description","color","type","removable_role","auto_detach_status","created_at","updated_at","deleted_at","notes"],"title":"App.Http.Resources.TagResource"},"MessageReadingResource":{"type":"object","properties":{"id":{"type":"string","description":"Attributes;"},"message_id":{"type":"string"},"user_type":{"type":"string"},"user_id":{"type":"string"},"created_at":{"type":["string","null"],"format":"date-time"},"updated_at":{"type":["string","null"],"format":"date-time"},"deleted_at":{"type":["string","null"],"format":"date-time"},"user":{"type":"string","description":"Relationships;"}},"required":["id","message_id","user_type","user_id","created_at","updated_at","deleted_at"],"title":"MessageReadingResource"},"App.Http.Resources.PartnerResource":{"type":"object","properties":{"id":{"type":"string","description":"Attributes;"},"is_patient_identity_verified":{"type":"string"},"name":{"type":"string"},"active":{"type":"string"},"logo_file_id":{"type":["string","null"]},"operation_country_id":{"type":"string"},"about":{"type":["string","null"]},"address_id":{"type":["string","null"]},"website_url":{"type":["string","null"]},"status":{"type":["string","null"]},"is_expedited":{"type":"string"},"customer_support_email":{"type":["string","null"]},"operations_support_email":{"type":["string","null"]},"escalation_support_email":{"type":["string","null"]},"patient_message_capability":{"type":["string","null"]},"support_message_capability":{"type":["string","null"]},"support_hours":{"type":["string","null"]},"support_location":{"type":["string","null"]},"enable_av_flow":{"type":"string"},"is_auto_dl_flow":{"type":"string"},"is_review_required":{"type":"string"},"is_statistics_enabled":{"type":"string"},"is_global_statistics_enabled":{"type":"string"},"is_patient_allowed_choose_notification_inbox":{"type":"string"},"is_sending_tracking_number_enabled":{"type":"string"},"is_ai_auto_summary_enabled":{"type":"string"},"enable_icd_bmi":{"type":"string"},"business_model":{"type":"string"},"use_intake_form":{"type":"string"},"is_voucher_reminder":{"type":"string"},"reassignment_interval":{"type":"integer"},"invoice_due_days":{"type":"integer"},"invoice_minimum_charge":{"type":["string","null"]},"enable_automatic_sync_flow":{"type":"string"},"force_hold_status":{"type":"string"},"force_is_additional_approval_needed":{"type":"string"},"use_messaging":{"type":"string"},"messaging_app_primary_color":{"type":["string","null"]},"messaging_app_secondary_color":{"type":["string","null"]},"messaging_app_background_color":{"type":["string","null"]},"notification_priority":{"type":["string","null"]},"notification_schedule":{"type":["integer","null"]},"partner_notes":{"type":["string","null"]},"parent_partner_id":{"type":["string","null"]},"parent_partner":{"type":["string","null"]},"thank_you_note_header":{"type":["string","null"]},"thank_you_note_footer":{"type":["string","null"]},"charge_sync_new_case":{"type":"string"},"charge_async_new_case":{"type":"string"},"charge_sync_follow_up_case":{"type":"string"},"charge_async_follow_up_case":{"type":"string"},"vouched_integration_type":{"type":"string"},"vouched_integration_charge":{"type":"string"},"text_message_integration_type":{"type":"string"},"text_message_integration_charge":{"type":"string"},"accepted_at":{"type":"string","format":"date-time"},"slack_channel_id":{"type":["string","null"]},"clinician_due_sync_case":{"type":"string"},"clinician_due_async_case":{"type":"string"},"clinician_due_sync_followup_encounter":{"type":"string"},"clinician_due_async_followup_encounter":{"type":"string"},"shopify_id":{"type":"string"},"shopify_url":{"type":"string","description":"Keep for front-end compatibility"},"is_shopify_active":{"type":"boolean","description":"Keep for front-end compatibility"},"custom_theme":{"type":["string","null"],"description":"Keep for front-end compatibility"},"custom_style":{"type":["string","null"]},"review_notes":{"type":["string","null"]},"contract_file_id":{"type":["string","null"]},"insurance_file_id":{"type":["string","null"]},"is_receiving_patient_transfers":{"type":"string"},"is_sending_patient_transfers":{"type":"string"},"is_patient_workflow_notification_enabled":{"type":"string"},"is_workflow_email_sms_enabled":{"type":"string"},"integration_type":{"type":["string","null"]},"recommendation_pageview_charge_amount":{"type":["string","null"]},"recommendation_encounter_charge_amount":{"type":["string","null"]},"onboarding_status":{"type":["string","null"]},"onboarding_progress":{"type":["string","null"]},"is_auto_patient_status_enabled":{"type":"string"},"created_at":{"type":["string","null"],"format":"date-time","description":"Timestamps;"},"updated_at":{"type":["string","null"],"format":"date-time"},"deleted_at":{"type":["string","null"],"format":"date-time"},"integrations":{"type":"object","description":"external integrations","properties":{"woocommerce":{"type":["object","null"],"properties":{"id":{"type":"string"},"store_name":{"type":"string"},"store_url":{"type":"string"},"intake_flow":{"type":"string"}},"required":["id","store_name","store_url","intake_flow"]},"boothwyn":{"type":["object","null"],"properties":{"api_key":{"type":"string"}},"required":["api_key"]},"shopify":{"type":["object","null"],"properties":{"id":{"type":"string"},"store_url":{"type":"string"},"environment":{"type":"string"},"intake_flow":{"type":"string"}},"required":["id","store_url","environment","intake_flow"]}},"required":["woocommerce","boothwyn","shopify"]},"is_support_auto_archive_email_enabled":{"type":"string"},"ai":{"type":"object","properties":{"tone":{"type":"string"}},"required":["tone"]},"partner_id":{"type":"string","description":"Appended Attributes;"},"parent_partner_name":{"type":["string","null"]},"contract_file":{"$ref":"#/components/schemas/App.Http.Resources.FileResource"},"insurance_file":{"description":"When loaded;","$ref":"#/components/schemas/App.Http.Resources.FileResource"},"logo":{"description":"When loaded;","$ref":"#/components/schemas/App.Http.Resources.FileResource"},"specialties":{"type":"array","description":"When loaded;","items":{"type":"object","description":"Circular reference to SpecialtyResource flattened to avoid an unbounded self-referential schema; see components.schemas.SpecialtyResource for the full shape."}},"pricing_tiers":{"type":"array","description":"When loaded;","items":{"type":"object","description":"Circular reference to PricingTierResource flattened to avoid an unbounded self-referential schema; see components.schemas.PricingTierResource for the full shape."}},"pivot":{"type":"object","description":"Pivot Attributes (Panel User);","properties":{"partner_id":{"type":"string","description":"When loaded;"},"panel_user_id":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"deleted_at":{"type":"string"}},"required":["partner_id","panel_user_id","created_at","updated_at","deleted_at"]},"tags":{"type":"array","items":{"$ref":"#/components/schemas/App.Http.Resources.TagResource"}}},"required":["id","is_patient_identity_verified","name","active","logo_file_id","operation_country_id","about","address_id","website_url","status","is_expedited","customer_support_email","operations_support_email","escalation_support_email","patient_message_capability","support_message_capability","support_hours","support_location","enable_av_flow","is_auto_dl_flow","is_review_required","is_global_statistics_enabled","is_patient_allowed_choose_notification_inbox","is_sending_tracking_number_enabled","is_ai_auto_summary_enabled","enable_icd_bmi","business_model","use_intake_form","is_voucher_reminder","reassignment_interval","enable_automatic_sync_flow","force_hold_status","force_is_additional_approval_needed","use_messaging","messaging_app_primary_color","messaging_app_secondary_color","messaging_app_background_color","notification_priority","notification_schedule","partner_notes","parent_partner_id","parent_partner","thank_you_note_header","thank_you_note_footer","charge_sync_new_case","charge_async_new_case","charge_sync_follow_up_case","charge_async_follow_up_case","vouched_integration_type","vouched_integration_charge","text_message_integration_type","text_message_integration_charge","accepted_at","contract_file_id","insurance_file_id","is_receiving_patient_transfers","is_sending_patient_transfers","is_patient_workflow_notification_enabled","is_workflow_email_sms_enabled","integration_type","onboarding_status","onboarding_progress","is_auto_patient_status_enabled","created_at","updated_at","deleted_at","integrations","is_support_auto_archive_email_enabled","ai","partner_id","parent_partner_name"],"title":"App.Http.Resources.PartnerResource"}},"responses":{"ValidationException":{"description":"Validation error","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Errors overview."},"errors":{"type":"object","description":"A detailed description of each field that failed validation.","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["message","errors"]}}}}}},"paths":{"/partner/patients/{patient}/messages":{"post":{"operationId":"v1.partner.patients.messages.post","description":"Creates a new message for the patient, attaching any provided files as part of the same\noperation. If the message or any file attachment fails, the whole operation is rolled back\nso no partial message is created; when sent by a medical assistant, the message is recorded\nas sent on behalf of their supervising clinician.","summary":"Creates a patient's message with the given data","tags":["Patients/Messages"],"parameters":[{"name":"patient","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PostPatientMessageRequest"}}}},"responses":{"200":{"description":"`MessageResource`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessageResource"}}}},"422":{"$ref":"#/components/responses/ValidationException"}}}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.mdintegrations.com/partner-api-reference/patients/messages/creates-a-patients-message-with-the-given-data.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
