Send a message in a chat
Send a message to a chat with optional attachments. The body is sent as `multipart/form-data` so binary fields (`voice_message`, `video_message`, `attachments[]`) can be uploaded alongside text fields.
Authorization
Path parameters
Request body (multipart/form-data)
textstringaccount_idstringthread_idstringquote_idstringvoice_messagestring (binary)video_messagestring (binary)attachmentsarray of string (binary)attachments array
<file>string (binary)typing_durationstringResponse 201 Created
objectstringMessageSentrequiredmessage_idstringrequiredExample request
curl --request POST \
--url 'https://api.postpress.ai/api/v1/chats/chat_01HXYZ4QK3WJ8FN3M6QH7TZ8GR/messages' \
--header 'X-API-KEY: pp_live_...' \
--header 'accept: application/json' \
--header 'content-type: multipart/form-data' \
--form 'text=Got it - thanks!' \
--form 'attachments=@/path/to/file.pdf'Example response
{
"object": "MessageSent",
"message_id": "msg_01HXYZ4QK3WJ8FN3M6QH7TZ8GR"
}Errors
Every error response follows the same envelope:
401 Unauthorized13 types
Credentials are missing, expired, or otherwise invalid.
errors/missing_credentials- Some credentials are necessary to perform the request.errors/multiple_sessions- LinkedIn limits multiple sessions on certain Recruiter accounts. Use the cookie connection method.errors/invalid_checkpoint_solution- The checkpoint resolution did not pass successfully. Retry.errors/invalid_proxy_credentials- The provided proxy credentials are invalid.errors/checkpoint_error- The checkpoint does not appear to be resolvable.errors/invalid_credentials- The provided credentials are invalid.errors/expired_credentials- Credentials have expired. Reconnect the account.errors/insufficient_privileges- This resource is out of your API-key scopes.errors/disconnected_account- The account is disconnected from the provider service.errors/disconnected_feature- The service you're trying to reach is disconnected.errors/invalid_credentials_but_valid_account_imap- IMAP/SMTP credentials are invalid but the account is otherwise valid.errors/expired_link- This link has expired. Generate a new one.errors/wrong_account- The provided credentials do not match the correct account.
403 Forbidden9 types
Authenticated but the account is restricted or the action is not allowed.
errors/account_restricted- The account has been restricted by the provider.errors/account_mismatch- This action cannot be done with your account.errors/insufficient_permissions- Valid authentication but insufficient permissions to perform the request.errors/session_mismatch- Token user id does not match client session id.errors/feature_not_subscribed- The requested feature has not been subscribed or authenticated properly.errors/subscription_required- A subscription is required to use this feature.errors/unknown_authentication_context- An additional step seems necessary to complete login.errors/action_required- An additional step is required.errors/resource_access_restricted- You don't have access to this resource.
404 Not Found2 types
Account, chat, thread, or provider resource not found.
errors/resource_not_found- The requested resource was not found.errors/invalid_resource_identifier- The provided identifier is not valid.
415 Unsupported Media Type1 types
The provider rejected one or more of the attached media.
errors/unsupported_media_type- The media format is not supported by the provider.
422 Unprocessable Entity35 types
The message could not be sent because of provider-side validation.
errors/invalid_account- The account cannot perform this action.errors/invalid_recipient- The recipient is invalid for this provider.errors/no_connection_with_recipient- A connection with the recipient is required.errors/blocked_recipient- The recipient has blocked the sender.errors/user_unreachable- The recipient cannot be reached.errors/unprocessable_entity- The provider could not process the message.errors/payment_error- A payment is required to send this message.errors/action_already_performed- The action was already performed.errors/invalid_message- The message body or attachments are invalid.errors/invalid_post- The referenced post is invalid.errors/not_allowed_inmail- InMail is not allowed for this recipient.errors/insufficient_credits- Not enough credits to send this message.errors/cannot_resend_yet- The message cannot be re-sent yet.errors/cannot_resend_within_24hrs- The message cannot be re-sent within 24 hours.errors/limit_exceeded- The provider's sending limit was exceeded.errors/already_invited_recently- The recipient was already invited recently.errors/already_connected- Already connected with this recipient.errors/cannot_invite_attendee- This attendee cannot be invited.errors/parent_mail_not_found- Parent email was not found.errors/parent_mail_invalid_provider_id- Parent email has an invalid provider id.errors/invalid_reply_subject- The reply subject is invalid.errors/invalid_headers- The message headers are invalid.errors/send_as_denied- The provider denied the send-as request.errors/invalid_folder- The target folder is invalid.errors/invalid_thread- The target thread is invalid.errors/unauthorized- The provider rejected the request as unauthorized.errors/sender_rejected- The sender was rejected by the provider.errors/recipient_rejected- The recipient was rejected by the provider.errors/ip_rejected_by_server- The sending IP was rejected by the upstream server.errors/provider_unreachable- The provider is currently unreachable.errors/account_configuration_error- The account is misconfigured.errors/cant_send_message- The message could not be sent.errors/realtime_client_not_initialized- The realtime client is not initialized.errors/comments_disabled- Comments are disabled on this resource.errors/insufficient_job_slot- No remaining job slot to send this message.
429 Too Many Requests1 types
The provider is rate-limiting this account. Retry later.
errors/too_many_requests- The provider cannot accept any more requests at the moment.
500 Internal Server Error3 types
Something went wrong on our side or with the upstream provider.
errors/unexpected_error- Something went wrong.errors/provider_error- The provider is experiencing operational problems. Retry later.errors/authentication_intent_error- The current authentication intent was killed after failure.
503 Service Unavailable5 types
postpress is temporarily unable to handle the request.
errors/no_client_session- No client session is currently running.errors/no_channel- No channel to client session.errors/no_handler- Handler missing for that request.errors/network_down- Network is down on the server side. Retry shortly.errors/service_unavailable- Service temporarily unavailable. Retry later.
504 Gateway Timeout1 types
The upstream provider did not respond in time.
errors/request_timeout- Request timed out. Retry, and contact support if it persists.