> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.talkif.ai/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.talkif.ai/_mcp/server.

# Publish flow

POST https://api.talkif.ai/api/v1/flows/{flowId}/publish
Content-Type: application/json

POST /api/v1/flows/:flowId/publish

Reference: https://docs.talkif.ai/api-reference/flows/publish-flow

## Authentication

- `Authorization` header (bearer token, required) — Pass a JWT access token or an API key (prefixed with `tif_live_`) as a Bearer token.

## Request

### Path parameters

- `flowId` (string, required) — Flow ID

### Body (application/json)

This endpoint expects a PublishFlowRequest.

- `expectedVersion` (string, optional, nullable) — Expected current version for optimistic locking (rejects with 409 if stale)
- `notes` (string, optional, nullable) — Changelog notes describing what changed in this version (max 1000 characters)
- `version` (string, optional, nullable) — Explicit version override in X.Y.Z format (auto-increments patch if omitted)

## Response

### 200

Flow published

- `flow` (FlowDetailResponse, required) — Flow detail after publishing
- `version` (string, required) — Newly published version string
- `changeSummary` (ChangeSummary, optional, nullable) — Top-level change summary stored in flow_versions.change_summary
- `transformationSummary` (TransformationSummary, optional, nullable) — Transformation summary for publish response
- `warnings` (list of FieldError, optional, nullable) — Non-fatal validation warnings that did not block publishing

## Errors

### 400 Bad Request Error

`validation_failed`, `flow_version_invalid`

- `code` (enum, required) — Machine-readable error code for programmatic handling
  - Allowed values: `invalid_credentials`, `email_already_exists`, `phone_already_exists`, `contact_phone_already_exists`, `account_suspended`, `account_access_denied`, `token_expired`, `token_invalid`, `token_missing`, `account_header_missing`, `refresh_token_invalid`, `email_already_verified`, `email_verification_code_invalid`, `email_verification_code_expired`, `email_verification_code_used`, `email_service_unavailable`, `phone_already_verified`, `phone_verification_code_invalid`, `phone_verification_code_expired`, `phone_verification_code_used`, `phone_number_missing`, `sms_service_unavailable`, `mfa_already_enabled`, `mfa_not_enabled`, `mfa_not_setup`, `mfa_code_invalid`, `password_reset_token_invalid`, `password_reset_token_expired`, `password_reset_token_used`, `password_current_incorrect`, `password_same_as_current`, `invalid_o_auth_state`, `o_auth_provider_error`, `o_auth_already_linked`, `provider_already_connected`, `o_auth_not_linked`, `cannot_unlink_only_auth`, `validation_failed`, `bad_request`, `invalid_json`, `resource_not_found`, `not_found`, `forbidden`, `insufficient_permissions`, `conflict`, `resource_already_exists`, `insufficient_balance`, `payment_required`, `subscription_required`, `feature_not_available`, `payment_failed`, `business_rule_violation`, `invalid_state_transition`, `unprocessable_entity`, `rate_limit_exceeded`, `queue_full`, `assistant_quota_exceeded`, `user_phone_not_verified`, `account_not_verified`, `payment_method_required`, `trial_already_claimed`, `promotion_not_eligible`, `coupon_not_found`, `coupon_not_redeemable`, `coupon_already_redeemed`, `phone_number_not_active`, `phone_number_not_verified`, `phone_number_cannot_initiate_calls`, `flow_not_published`, `provider_call_rejected`, `concurrent_call_limit_exceeded`, `daily_call_limit_exceeded`, `contact_on_dnc_list`, `outside_callable_hours`, `call_already_completed`, `phone_provider_not_active`, `phone_number_already_connected`, `phone_number_not_connected`, `provider_must_be_sip`, `verification_only_for_sip`, `phone_verification_not_started`, `twilio_credentials_required`, `byoc_only`, `phone_already_registered`, `cannot_delete_system_provider`, `flow_name_already_exists`, `flow_structure_invalid`, `flow_has_connected_phones`, `flow_version_invalid`, `flow_version_conflict`, `flow_function_name_exists`, `flow_function_not_found`, `flow_generation_failed`, `payment_method_card_only`, `template_variable_resolution_failed`, `phone_number_in_use`, `mfa_token_invalid`, `invalid_id_format`, `verification_code_invalid`, `cannot_delete_has_dependencies`, `in_use`, `unsupported_kind`, `offer_taken`, `offer_taken_self`, `offer_expired`, `already_taken`, `takeover_unsupported`, `schedule_not_found`, `schedule_already_paused`, `schedule_not_paused`, `invalid_cron_expression`, `invalid_timezone`, `campaign_not_found`, `campaign_not_draft`, `campaign_no_contacts`, `legal_acceptance_required`, `invitation_not_found`, `invitation_not_pending`, `invitation_expired`, `not_invitation_recipient`, `organization_suspended`, `already_organization_member`, `api_key_invalid`, `api_key_expired`, `api_key_revoked`, `api_key_not_allowed`, `api_key_insufficient_scope`, `api_key_ip_restricted`, `api_key_limit_reached`, `internal_error`, `service_error`, `service_unavailable`, `no_bots_available`, `region_saturated`, `recording_not_available`, `recording_service_not_configured`, `meta_not_configured`, `meta_page_already_connected`, `meta_form_already_mapped`, `meta_api_error`, `meta_lead_unrecoverable`, `unauthorized`
- `detail` (string, required) — Human-readable detail message for this specific error instance
- `status` (integer, required) — HTTP status code (mirrors the response status line)
- `title` (string, required) — Human-readable title for the error category
- `errors` (list of FieldError, optional, nullable) — Field-level validation errors, present when code is `validation_failed`
- `meta` (ErrorResponseMeta, optional, nullable) — Additional context metadata (e.g., retryAfterSecs for rate limits)
- `requestId` (string, optional, nullable) — Unique request identifier for debugging (also in X-Request-Id response header)

### 401 Unauthorized Error

Authentication required — token is missing, expired, or invalid

- `code` (enum, required) — Machine-readable error code for programmatic handling
  - Allowed values: `invalid_credentials`, `email_already_exists`, `phone_already_exists`, `contact_phone_already_exists`, `account_suspended`, `account_access_denied`, `token_expired`, `token_invalid`, `token_missing`, `account_header_missing`, `refresh_token_invalid`, `email_already_verified`, `email_verification_code_invalid`, `email_verification_code_expired`, `email_verification_code_used`, `email_service_unavailable`, `phone_already_verified`, `phone_verification_code_invalid`, `phone_verification_code_expired`, `phone_verification_code_used`, `phone_number_missing`, `sms_service_unavailable`, `mfa_already_enabled`, `mfa_not_enabled`, `mfa_not_setup`, `mfa_code_invalid`, `password_reset_token_invalid`, `password_reset_token_expired`, `password_reset_token_used`, `password_current_incorrect`, `password_same_as_current`, `invalid_o_auth_state`, `o_auth_provider_error`, `o_auth_already_linked`, `provider_already_connected`, `o_auth_not_linked`, `cannot_unlink_only_auth`, `validation_failed`, `bad_request`, `invalid_json`, `resource_not_found`, `not_found`, `forbidden`, `insufficient_permissions`, `conflict`, `resource_already_exists`, `insufficient_balance`, `payment_required`, `subscription_required`, `feature_not_available`, `payment_failed`, `business_rule_violation`, `invalid_state_transition`, `unprocessable_entity`, `rate_limit_exceeded`, `queue_full`, `assistant_quota_exceeded`, `user_phone_not_verified`, `account_not_verified`, `payment_method_required`, `trial_already_claimed`, `promotion_not_eligible`, `coupon_not_found`, `coupon_not_redeemable`, `coupon_already_redeemed`, `phone_number_not_active`, `phone_number_not_verified`, `phone_number_cannot_initiate_calls`, `flow_not_published`, `provider_call_rejected`, `concurrent_call_limit_exceeded`, `daily_call_limit_exceeded`, `contact_on_dnc_list`, `outside_callable_hours`, `call_already_completed`, `phone_provider_not_active`, `phone_number_already_connected`, `phone_number_not_connected`, `provider_must_be_sip`, `verification_only_for_sip`, `phone_verification_not_started`, `twilio_credentials_required`, `byoc_only`, `phone_already_registered`, `cannot_delete_system_provider`, `flow_name_already_exists`, `flow_structure_invalid`, `flow_has_connected_phones`, `flow_version_invalid`, `flow_version_conflict`, `flow_function_name_exists`, `flow_function_not_found`, `flow_generation_failed`, `payment_method_card_only`, `template_variable_resolution_failed`, `phone_number_in_use`, `mfa_token_invalid`, `invalid_id_format`, `verification_code_invalid`, `cannot_delete_has_dependencies`, `in_use`, `unsupported_kind`, `offer_taken`, `offer_taken_self`, `offer_expired`, `already_taken`, `takeover_unsupported`, `schedule_not_found`, `schedule_already_paused`, `schedule_not_paused`, `invalid_cron_expression`, `invalid_timezone`, `campaign_not_found`, `campaign_not_draft`, `campaign_no_contacts`, `legal_acceptance_required`, `invitation_not_found`, `invitation_not_pending`, `invitation_expired`, `not_invitation_recipient`, `organization_suspended`, `already_organization_member`, `api_key_invalid`, `api_key_expired`, `api_key_revoked`, `api_key_not_allowed`, `api_key_insufficient_scope`, `api_key_ip_restricted`, `api_key_limit_reached`, `internal_error`, `service_error`, `service_unavailable`, `no_bots_available`, `region_saturated`, `recording_not_available`, `recording_service_not_configured`, `meta_not_configured`, `meta_page_already_connected`, `meta_form_already_mapped`, `meta_api_error`, `meta_lead_unrecoverable`, `unauthorized`
- `detail` (string, required) — Human-readable detail message for this specific error instance
- `status` (integer, required) — HTTP status code (mirrors the response status line)
- `title` (string, required) — Human-readable title for the error category
- `errors` (list of FieldError, optional, nullable) — Field-level validation errors, present when code is `validation_failed`
- `meta` (ErrorResponseMeta, optional, nullable) — Additional context metadata (e.g., retryAfterSecs for rate limits)
- `requestId` (string, optional, nullable) — Unique request identifier for debugging (also in X-Request-Id response header)

### 403 Forbidden Error

`forbidden`

- `code` (enum, required) — Machine-readable error code for programmatic handling
  - Allowed values: `invalid_credentials`, `email_already_exists`, `phone_already_exists`, `contact_phone_already_exists`, `account_suspended`, `account_access_denied`, `token_expired`, `token_invalid`, `token_missing`, `account_header_missing`, `refresh_token_invalid`, `email_already_verified`, `email_verification_code_invalid`, `email_verification_code_expired`, `email_verification_code_used`, `email_service_unavailable`, `phone_already_verified`, `phone_verification_code_invalid`, `phone_verification_code_expired`, `phone_verification_code_used`, `phone_number_missing`, `sms_service_unavailable`, `mfa_already_enabled`, `mfa_not_enabled`, `mfa_not_setup`, `mfa_code_invalid`, `password_reset_token_invalid`, `password_reset_token_expired`, `password_reset_token_used`, `password_current_incorrect`, `password_same_as_current`, `invalid_o_auth_state`, `o_auth_provider_error`, `o_auth_already_linked`, `provider_already_connected`, `o_auth_not_linked`, `cannot_unlink_only_auth`, `validation_failed`, `bad_request`, `invalid_json`, `resource_not_found`, `not_found`, `forbidden`, `insufficient_permissions`, `conflict`, `resource_already_exists`, `insufficient_balance`, `payment_required`, `subscription_required`, `feature_not_available`, `payment_failed`, `business_rule_violation`, `invalid_state_transition`, `unprocessable_entity`, `rate_limit_exceeded`, `queue_full`, `assistant_quota_exceeded`, `user_phone_not_verified`, `account_not_verified`, `payment_method_required`, `trial_already_claimed`, `promotion_not_eligible`, `coupon_not_found`, `coupon_not_redeemable`, `coupon_already_redeemed`, `phone_number_not_active`, `phone_number_not_verified`, `phone_number_cannot_initiate_calls`, `flow_not_published`, `provider_call_rejected`, `concurrent_call_limit_exceeded`, `daily_call_limit_exceeded`, `contact_on_dnc_list`, `outside_callable_hours`, `call_already_completed`, `phone_provider_not_active`, `phone_number_already_connected`, `phone_number_not_connected`, `provider_must_be_sip`, `verification_only_for_sip`, `phone_verification_not_started`, `twilio_credentials_required`, `byoc_only`, `phone_already_registered`, `cannot_delete_system_provider`, `flow_name_already_exists`, `flow_structure_invalid`, `flow_has_connected_phones`, `flow_version_invalid`, `flow_version_conflict`, `flow_function_name_exists`, `flow_function_not_found`, `flow_generation_failed`, `payment_method_card_only`, `template_variable_resolution_failed`, `phone_number_in_use`, `mfa_token_invalid`, `invalid_id_format`, `verification_code_invalid`, `cannot_delete_has_dependencies`, `in_use`, `unsupported_kind`, `offer_taken`, `offer_taken_self`, `offer_expired`, `already_taken`, `takeover_unsupported`, `schedule_not_found`, `schedule_already_paused`, `schedule_not_paused`, `invalid_cron_expression`, `invalid_timezone`, `campaign_not_found`, `campaign_not_draft`, `campaign_no_contacts`, `legal_acceptance_required`, `invitation_not_found`, `invitation_not_pending`, `invitation_expired`, `not_invitation_recipient`, `organization_suspended`, `already_organization_member`, `api_key_invalid`, `api_key_expired`, `api_key_revoked`, `api_key_not_allowed`, `api_key_insufficient_scope`, `api_key_ip_restricted`, `api_key_limit_reached`, `internal_error`, `service_error`, `service_unavailable`, `no_bots_available`, `region_saturated`, `recording_not_available`, `recording_service_not_configured`, `meta_not_configured`, `meta_page_already_connected`, `meta_form_already_mapped`, `meta_api_error`, `meta_lead_unrecoverable`, `unauthorized`
- `detail` (string, required) — Human-readable detail message for this specific error instance
- `status` (integer, required) — HTTP status code (mirrors the response status line)
- `title` (string, required) — Human-readable title for the error category
- `errors` (list of FieldError, optional, nullable) — Field-level validation errors, present when code is `validation_failed`
- `meta` (ErrorResponseMeta, optional, nullable) — Additional context metadata (e.g., retryAfterSecs for rate limits)
- `requestId` (string, optional, nullable) — Unique request identifier for debugging (also in X-Request-Id response header)

### 404 Not Found Error

`resource_not_found`

- `code` (enum, required) — Machine-readable error code for programmatic handling
  - Allowed values: `invalid_credentials`, `email_already_exists`, `phone_already_exists`, `contact_phone_already_exists`, `account_suspended`, `account_access_denied`, `token_expired`, `token_invalid`, `token_missing`, `account_header_missing`, `refresh_token_invalid`, `email_already_verified`, `email_verification_code_invalid`, `email_verification_code_expired`, `email_verification_code_used`, `email_service_unavailable`, `phone_already_verified`, `phone_verification_code_invalid`, `phone_verification_code_expired`, `phone_verification_code_used`, `phone_number_missing`, `sms_service_unavailable`, `mfa_already_enabled`, `mfa_not_enabled`, `mfa_not_setup`, `mfa_code_invalid`, `password_reset_token_invalid`, `password_reset_token_expired`, `password_reset_token_used`, `password_current_incorrect`, `password_same_as_current`, `invalid_o_auth_state`, `o_auth_provider_error`, `o_auth_already_linked`, `provider_already_connected`, `o_auth_not_linked`, `cannot_unlink_only_auth`, `validation_failed`, `bad_request`, `invalid_json`, `resource_not_found`, `not_found`, `forbidden`, `insufficient_permissions`, `conflict`, `resource_already_exists`, `insufficient_balance`, `payment_required`, `subscription_required`, `feature_not_available`, `payment_failed`, `business_rule_violation`, `invalid_state_transition`, `unprocessable_entity`, `rate_limit_exceeded`, `queue_full`, `assistant_quota_exceeded`, `user_phone_not_verified`, `account_not_verified`, `payment_method_required`, `trial_already_claimed`, `promotion_not_eligible`, `coupon_not_found`, `coupon_not_redeemable`, `coupon_already_redeemed`, `phone_number_not_active`, `phone_number_not_verified`, `phone_number_cannot_initiate_calls`, `flow_not_published`, `provider_call_rejected`, `concurrent_call_limit_exceeded`, `daily_call_limit_exceeded`, `contact_on_dnc_list`, `outside_callable_hours`, `call_already_completed`, `phone_provider_not_active`, `phone_number_already_connected`, `phone_number_not_connected`, `provider_must_be_sip`, `verification_only_for_sip`, `phone_verification_not_started`, `twilio_credentials_required`, `byoc_only`, `phone_already_registered`, `cannot_delete_system_provider`, `flow_name_already_exists`, `flow_structure_invalid`, `flow_has_connected_phones`, `flow_version_invalid`, `flow_version_conflict`, `flow_function_name_exists`, `flow_function_not_found`, `flow_generation_failed`, `payment_method_card_only`, `template_variable_resolution_failed`, `phone_number_in_use`, `mfa_token_invalid`, `invalid_id_format`, `verification_code_invalid`, `cannot_delete_has_dependencies`, `in_use`, `unsupported_kind`, `offer_taken`, `offer_taken_self`, `offer_expired`, `already_taken`, `takeover_unsupported`, `schedule_not_found`, `schedule_already_paused`, `schedule_not_paused`, `invalid_cron_expression`, `invalid_timezone`, `campaign_not_found`, `campaign_not_draft`, `campaign_no_contacts`, `legal_acceptance_required`, `invitation_not_found`, `invitation_not_pending`, `invitation_expired`, `not_invitation_recipient`, `organization_suspended`, `already_organization_member`, `api_key_invalid`, `api_key_expired`, `api_key_revoked`, `api_key_not_allowed`, `api_key_insufficient_scope`, `api_key_ip_restricted`, `api_key_limit_reached`, `internal_error`, `service_error`, `service_unavailable`, `no_bots_available`, `region_saturated`, `recording_not_available`, `recording_service_not_configured`, `meta_not_configured`, `meta_page_already_connected`, `meta_form_already_mapped`, `meta_api_error`, `meta_lead_unrecoverable`, `unauthorized`
- `detail` (string, required) — Human-readable detail message for this specific error instance
- `status` (integer, required) — HTTP status code (mirrors the response status line)
- `title` (string, required) — Human-readable title for the error category
- `errors` (list of FieldError, optional, nullable) — Field-level validation errors, present when code is `validation_failed`
- `meta` (ErrorResponseMeta, optional, nullable) — Additional context metadata (e.g., retryAfterSecs for rate limits)
- `requestId` (string, optional, nullable) — Unique request identifier for debugging (also in X-Request-Id response header)

### 409 Conflict Error

`flow_version_conflict`

- `code` (enum, required) — Machine-readable error code for programmatic handling
  - Allowed values: `invalid_credentials`, `email_already_exists`, `phone_already_exists`, `contact_phone_already_exists`, `account_suspended`, `account_access_denied`, `token_expired`, `token_invalid`, `token_missing`, `account_header_missing`, `refresh_token_invalid`, `email_already_verified`, `email_verification_code_invalid`, `email_verification_code_expired`, `email_verification_code_used`, `email_service_unavailable`, `phone_already_verified`, `phone_verification_code_invalid`, `phone_verification_code_expired`, `phone_verification_code_used`, `phone_number_missing`, `sms_service_unavailable`, `mfa_already_enabled`, `mfa_not_enabled`, `mfa_not_setup`, `mfa_code_invalid`, `password_reset_token_invalid`, `password_reset_token_expired`, `password_reset_token_used`, `password_current_incorrect`, `password_same_as_current`, `invalid_o_auth_state`, `o_auth_provider_error`, `o_auth_already_linked`, `provider_already_connected`, `o_auth_not_linked`, `cannot_unlink_only_auth`, `validation_failed`, `bad_request`, `invalid_json`, `resource_not_found`, `not_found`, `forbidden`, `insufficient_permissions`, `conflict`, `resource_already_exists`, `insufficient_balance`, `payment_required`, `subscription_required`, `feature_not_available`, `payment_failed`, `business_rule_violation`, `invalid_state_transition`, `unprocessable_entity`, `rate_limit_exceeded`, `queue_full`, `assistant_quota_exceeded`, `user_phone_not_verified`, `account_not_verified`, `payment_method_required`, `trial_already_claimed`, `promotion_not_eligible`, `coupon_not_found`, `coupon_not_redeemable`, `coupon_already_redeemed`, `phone_number_not_active`, `phone_number_not_verified`, `phone_number_cannot_initiate_calls`, `flow_not_published`, `provider_call_rejected`, `concurrent_call_limit_exceeded`, `daily_call_limit_exceeded`, `contact_on_dnc_list`, `outside_callable_hours`, `call_already_completed`, `phone_provider_not_active`, `phone_number_already_connected`, `phone_number_not_connected`, `provider_must_be_sip`, `verification_only_for_sip`, `phone_verification_not_started`, `twilio_credentials_required`, `byoc_only`, `phone_already_registered`, `cannot_delete_system_provider`, `flow_name_already_exists`, `flow_structure_invalid`, `flow_has_connected_phones`, `flow_version_invalid`, `flow_version_conflict`, `flow_function_name_exists`, `flow_function_not_found`, `flow_generation_failed`, `payment_method_card_only`, `template_variable_resolution_failed`, `phone_number_in_use`, `mfa_token_invalid`, `invalid_id_format`, `verification_code_invalid`, `cannot_delete_has_dependencies`, `in_use`, `unsupported_kind`, `offer_taken`, `offer_taken_self`, `offer_expired`, `already_taken`, `takeover_unsupported`, `schedule_not_found`, `schedule_already_paused`, `schedule_not_paused`, `invalid_cron_expression`, `invalid_timezone`, `campaign_not_found`, `campaign_not_draft`, `campaign_no_contacts`, `legal_acceptance_required`, `invitation_not_found`, `invitation_not_pending`, `invitation_expired`, `not_invitation_recipient`, `organization_suspended`, `already_organization_member`, `api_key_invalid`, `api_key_expired`, `api_key_revoked`, `api_key_not_allowed`, `api_key_insufficient_scope`, `api_key_ip_restricted`, `api_key_limit_reached`, `internal_error`, `service_error`, `service_unavailable`, `no_bots_available`, `region_saturated`, `recording_not_available`, `recording_service_not_configured`, `meta_not_configured`, `meta_page_already_connected`, `meta_form_already_mapped`, `meta_api_error`, `meta_lead_unrecoverable`, `unauthorized`
- `detail` (string, required) — Human-readable detail message for this specific error instance
- `status` (integer, required) — HTTP status code (mirrors the response status line)
- `title` (string, required) — Human-readable title for the error category
- `errors` (list of FieldError, optional, nullable) — Field-level validation errors, present when code is `validation_failed`
- `meta` (ErrorResponseMeta, optional, nullable) — Additional context metadata (e.g., retryAfterSecs for rate limits)
- `requestId` (string, optional, nullable) — Unique request identifier for debugging (also in X-Request-Id response header)

### 429 Too Many Requests Error

Rate limit exceeded — retry after the delay in the response

- `code` (enum, required) — Machine-readable error code for programmatic handling
  - Allowed values: `invalid_credentials`, `email_already_exists`, `phone_already_exists`, `contact_phone_already_exists`, `account_suspended`, `account_access_denied`, `token_expired`, `token_invalid`, `token_missing`, `account_header_missing`, `refresh_token_invalid`, `email_already_verified`, `email_verification_code_invalid`, `email_verification_code_expired`, `email_verification_code_used`, `email_service_unavailable`, `phone_already_verified`, `phone_verification_code_invalid`, `phone_verification_code_expired`, `phone_verification_code_used`, `phone_number_missing`, `sms_service_unavailable`, `mfa_already_enabled`, `mfa_not_enabled`, `mfa_not_setup`, `mfa_code_invalid`, `password_reset_token_invalid`, `password_reset_token_expired`, `password_reset_token_used`, `password_current_incorrect`, `password_same_as_current`, `invalid_o_auth_state`, `o_auth_provider_error`, `o_auth_already_linked`, `provider_already_connected`, `o_auth_not_linked`, `cannot_unlink_only_auth`, `validation_failed`, `bad_request`, `invalid_json`, `resource_not_found`, `not_found`, `forbidden`, `insufficient_permissions`, `conflict`, `resource_already_exists`, `insufficient_balance`, `payment_required`, `subscription_required`, `feature_not_available`, `payment_failed`, `business_rule_violation`, `invalid_state_transition`, `unprocessable_entity`, `rate_limit_exceeded`, `queue_full`, `assistant_quota_exceeded`, `user_phone_not_verified`, `account_not_verified`, `payment_method_required`, `trial_already_claimed`, `promotion_not_eligible`, `coupon_not_found`, `coupon_not_redeemable`, `coupon_already_redeemed`, `phone_number_not_active`, `phone_number_not_verified`, `phone_number_cannot_initiate_calls`, `flow_not_published`, `provider_call_rejected`, `concurrent_call_limit_exceeded`, `daily_call_limit_exceeded`, `contact_on_dnc_list`, `outside_callable_hours`, `call_already_completed`, `phone_provider_not_active`, `phone_number_already_connected`, `phone_number_not_connected`, `provider_must_be_sip`, `verification_only_for_sip`, `phone_verification_not_started`, `twilio_credentials_required`, `byoc_only`, `phone_already_registered`, `cannot_delete_system_provider`, `flow_name_already_exists`, `flow_structure_invalid`, `flow_has_connected_phones`, `flow_version_invalid`, `flow_version_conflict`, `flow_function_name_exists`, `flow_function_not_found`, `flow_generation_failed`, `payment_method_card_only`, `template_variable_resolution_failed`, `phone_number_in_use`, `mfa_token_invalid`, `invalid_id_format`, `verification_code_invalid`, `cannot_delete_has_dependencies`, `in_use`, `unsupported_kind`, `offer_taken`, `offer_taken_self`, `offer_expired`, `already_taken`, `takeover_unsupported`, `schedule_not_found`, `schedule_already_paused`, `schedule_not_paused`, `invalid_cron_expression`, `invalid_timezone`, `campaign_not_found`, `campaign_not_draft`, `campaign_no_contacts`, `legal_acceptance_required`, `invitation_not_found`, `invitation_not_pending`, `invitation_expired`, `not_invitation_recipient`, `organization_suspended`, `already_organization_member`, `api_key_invalid`, `api_key_expired`, `api_key_revoked`, `api_key_not_allowed`, `api_key_insufficient_scope`, `api_key_ip_restricted`, `api_key_limit_reached`, `internal_error`, `service_error`, `service_unavailable`, `no_bots_available`, `region_saturated`, `recording_not_available`, `recording_service_not_configured`, `meta_not_configured`, `meta_page_already_connected`, `meta_form_already_mapped`, `meta_api_error`, `meta_lead_unrecoverable`, `unauthorized`
- `detail` (string, required) — Human-readable detail message for this specific error instance
- `status` (integer, required) — HTTP status code (mirrors the response status line)
- `title` (string, required) — Human-readable title for the error category
- `errors` (list of FieldError, optional, nullable) — Field-level validation errors, present when code is `validation_failed`
- `meta` (ErrorResponseMeta, optional, nullable) — Additional context metadata (e.g., retryAfterSecs for rate limits)
- `requestId` (string, optional, nullable) — Unique request identifier for debugging (also in X-Request-Id response header)

### 500 Internal Server Error

Internal server error — contact support with the requestId

- `code` (enum, required) — Machine-readable error code for programmatic handling
  - Allowed values: `invalid_credentials`, `email_already_exists`, `phone_already_exists`, `contact_phone_already_exists`, `account_suspended`, `account_access_denied`, `token_expired`, `token_invalid`, `token_missing`, `account_header_missing`, `refresh_token_invalid`, `email_already_verified`, `email_verification_code_invalid`, `email_verification_code_expired`, `email_verification_code_used`, `email_service_unavailable`, `phone_already_verified`, `phone_verification_code_invalid`, `phone_verification_code_expired`, `phone_verification_code_used`, `phone_number_missing`, `sms_service_unavailable`, `mfa_already_enabled`, `mfa_not_enabled`, `mfa_not_setup`, `mfa_code_invalid`, `password_reset_token_invalid`, `password_reset_token_expired`, `password_reset_token_used`, `password_current_incorrect`, `password_same_as_current`, `invalid_o_auth_state`, `o_auth_provider_error`, `o_auth_already_linked`, `provider_already_connected`, `o_auth_not_linked`, `cannot_unlink_only_auth`, `validation_failed`, `bad_request`, `invalid_json`, `resource_not_found`, `not_found`, `forbidden`, `insufficient_permissions`, `conflict`, `resource_already_exists`, `insufficient_balance`, `payment_required`, `subscription_required`, `feature_not_available`, `payment_failed`, `business_rule_violation`, `invalid_state_transition`, `unprocessable_entity`, `rate_limit_exceeded`, `queue_full`, `assistant_quota_exceeded`, `user_phone_not_verified`, `account_not_verified`, `payment_method_required`, `trial_already_claimed`, `promotion_not_eligible`, `coupon_not_found`, `coupon_not_redeemable`, `coupon_already_redeemed`, `phone_number_not_active`, `phone_number_not_verified`, `phone_number_cannot_initiate_calls`, `flow_not_published`, `provider_call_rejected`, `concurrent_call_limit_exceeded`, `daily_call_limit_exceeded`, `contact_on_dnc_list`, `outside_callable_hours`, `call_already_completed`, `phone_provider_not_active`, `phone_number_already_connected`, `phone_number_not_connected`, `provider_must_be_sip`, `verification_only_for_sip`, `phone_verification_not_started`, `twilio_credentials_required`, `byoc_only`, `phone_already_registered`, `cannot_delete_system_provider`, `flow_name_already_exists`, `flow_structure_invalid`, `flow_has_connected_phones`, `flow_version_invalid`, `flow_version_conflict`, `flow_function_name_exists`, `flow_function_not_found`, `flow_generation_failed`, `payment_method_card_only`, `template_variable_resolution_failed`, `phone_number_in_use`, `mfa_token_invalid`, `invalid_id_format`, `verification_code_invalid`, `cannot_delete_has_dependencies`, `in_use`, `unsupported_kind`, `offer_taken`, `offer_taken_self`, `offer_expired`, `already_taken`, `takeover_unsupported`, `schedule_not_found`, `schedule_already_paused`, `schedule_not_paused`, `invalid_cron_expression`, `invalid_timezone`, `campaign_not_found`, `campaign_not_draft`, `campaign_no_contacts`, `legal_acceptance_required`, `invitation_not_found`, `invitation_not_pending`, `invitation_expired`, `not_invitation_recipient`, `organization_suspended`, `already_organization_member`, `api_key_invalid`, `api_key_expired`, `api_key_revoked`, `api_key_not_allowed`, `api_key_insufficient_scope`, `api_key_ip_restricted`, `api_key_limit_reached`, `internal_error`, `service_error`, `service_unavailable`, `no_bots_available`, `region_saturated`, `recording_not_available`, `recording_service_not_configured`, `meta_not_configured`, `meta_page_already_connected`, `meta_form_already_mapped`, `meta_api_error`, `meta_lead_unrecoverable`, `unauthorized`
- `detail` (string, required) — Human-readable detail message for this specific error instance
- `status` (integer, required) — HTTP status code (mirrors the response status line)
- `title` (string, required) — Human-readable title for the error category
- `errors` (list of FieldError, optional, nullable) — Field-level validation errors, present when code is `validation_failed`
- `meta` (ErrorResponseMeta, optional, nullable) — Additional context metadata (e.g., retryAfterSecs for rate limits)
- `requestId` (string, optional, nullable) — Unique request identifier for debugging (also in X-Request-Id response header)

## Types

### FlowDetailResponse

Flow detail response for API (includes full flow data) Returns definition + layout as the canonical format.

- `accountId` (string, required) — Account that owns this flow
- `analysisOverride` (string, required) — Call analysis behavior override: "use_account_default", "enabled", or "disabled"
- `connectedPhones` (list of ConnectedPhoneSummary, required) — Phone numbers currently connected to this flow
- `createdAt` (datetime, required) — Timestamp when the flow was created
- `id` (string, required) — Unique identifier of the flow
- `name` (string, required) — Display name of the flow
- `recordingOverride` (string, required) — Recording behavior override: "use_account_default", "enabled", or "disabled"
- `status` (enum, required) — Current lifecycle status of the flow
  - Allowed values: `DRAFT`, `TESTING`, `PUBLISHED`, `ARCHIVED`
- `tags` (list of string, required) — User-defined tags for filtering and organization
- `updatedAt` (datetime, required) — Timestamp when the flow was last updated
- `version` (string, required) — Current semantic version (X.Y.Z)
- `versions` (list of FlowVersionSummary, required) — Available published versions (newest first)
- `voicemailEnabled` (boolean, required) — Whether voicemail detection is enabled (outbound Twilio calls only)
- `analysisInstructions` (string, optional, nullable) — Custom analysis instructions appended to the base analysis prompt
- `definition` (FlowDefinition, optional, nullable) — The canonical flow definition — single source of truth for flow logic, shared by the API and the visual builder. Visual nodes (LLM, TTS, STT, prompt, end_call) collapse into properties: - Service nodes -> `services.*` - Prompt nodes -> `agent.prompt` - Action nodes -> `agent.functions[]` - Edges are implicit — relationships expressed as data, not connections
- `description` (string, optional, nullable) — Description of the flow's purpose
- `layout` (FlowDetailResponseLayout, optional, nullable) — Visual builder layout (positions, viewport, UI state). Opaque to the API: stored and returned as-is.
- `maxCallDuration` (MaxCallDurationSettings, optional, nullable) — Hard call-duration cap settings for a flow. Omitting this block leaves the cap OFF. Sending it fully replaces the flow's cap config.
- `publishedAt` (datetime, optional, nullable) — Timestamp when the flow was last published
- `userIdle` (UserIdleSettings, optional, nullable) — User-idle hangup settings for a flow. Sending this block fully replaces the flow's idle config. Omitting it on update leaves the existing config untouched; sending it with only `enabled` resets the other fields to their defaults. A flow that was never configured has idle hangup ON.
- `voicemailMessage` (string, optional, nullable) — Static voicemail message spoken verbatim (skips the composer LLM call)
- `voicemailMessagePrompt` (string, optional, nullable) — Instruction for composing the voicemail message (ignored if message is set)
- `voicemailResponseDelaySecs` (float, optional, nullable) — Seconds to wait after the callee stops speaking before leaving the message

### ChangeSummary

Top-level change summary stored in flow_versions.change_summary

- `agents` (AgentChangeSummary, required) — Agent-level changes (added, removed, modified)
- `changes` (list of FlowChange, required) — Detailed list of all changes
- `flow` (FlowSettingChanges, required) — Flow-level setting changes
- `services` (ServiceChangeSummary, required) — Service configuration changes (LLM, TTS, STT)
- `totalChanges` (integer, required) — Total number of individual changes detected

### TransformationSummary

Transformation summary for publish response

- `agentsTransformed` (list of string, required) — Names of agent nodes that were transformed
- `originalNodeCount` (integer, required) — Number of nodes in the original flow graph before transformation
- `servicesExtracted` (list of string, required) — Names of service nodes extracted during transformation
- `transformedNodeCount` (integer, required) — Number of nodes in the transformed flow graph after extraction

### FieldError

Individual field error for validation responses Appears in the `errors[]` array when `code` is `validation_failed` # Example ```json { "field": "email", "code": "invalid_format", "message": "Email format is invalid" } ```

- `code` (string, required) — Specific error code for this field
- `field` (string, required) — The field name that failed validation
- `message` (string, required) — Human-readable error message

### ErrorResponseMeta

Additional context metadata (e.g., retryAfterSecs for rate limits)

### ConnectedPhoneSummary

Minimal phone number info for flow listing

- `id` (string, required) — Unique identifier of the phone number resource
- `phoneNumber` (string, required) — Phone number in E.164 format
- `friendlyName` (string, optional, nullable) — Human-readable label for the phone number

### FlowVersionSummary

Lightweight version summary for flow list responses Provides just enough data for version picker dropdowns without the full definition.

- `publishedAt` (datetime, required) — Timestamp when this version was published
- `version` (string, required) — Semantic version string (X.Y.Z)
- `notes` (string, optional, nullable) — Changelog notes for this version

### FlowDefinition

The canonical flow definition — single source of truth for flow logic, shared by the API and the visual builder. Visual nodes (LLM, TTS, STT, prompt, end_call) collapse into properties: - Service nodes -> `services.*` - Prompt nodes -> `agent.prompt` - Action nodes -> `agent.functions[]` - Edges are implicit — relationships expressed as data, not connections

- `initialNode` (string, required) — Node ID where execution begins (must reference a main_agent node)
- `nodes` (map from string to AgentDefinition, required) — Agent nodes keyed by node ID (e.g., "main_agent_1", "billing_agent")
- `services` (ServiceDefinition, required) — Service provider configuration (LLM, TTS, STT)

### FlowDetailResponseLayout

Visual builder layout (positions, viewport, UI state). Opaque to the API: stored and returned as-is.

### MaxCallDurationSettings

Hard call-duration cap settings for a flow. Omitting this block leaves the cap OFF. Sending it fully replaces the flow's cap config.

- `enabled` (boolean, required) — Whether the hard cap is enabled.
- `endMessage` (string, optional, nullable) — Spoken message before hanging up at the cap (max 1000 chars).
- `seconds` (integer, optional, nullable) — Cap in seconds; the bot ends the call once reached (30–14400).

### UserIdleSettings

User-idle hangup settings for a flow. Sending this block fully replaces the flow's idle config. Omitting it on update leaves the existing config untouched; sending it with only `enabled` resets the other fields to their defaults. A flow that was never configured has idle hangup ON.

- `enabled` (boolean, required) — Whether idle hangup is enabled. `false` explicitly disables it.
- `endMessage` (string, optional, nullable) — Spoken message before hanging up after the last idle prompt (max 1000 chars).
- `maxPrompts` (integer, optional, nullable) — Max idle re-prompts before hanging up (1–10).
- `prompts` (list of string, optional, nullable) — LLM instructions used to compose each idle re-prompt (max 10).
- `resetOnUserSpeech` (boolean, optional, nullable) — Whether the idle timer resets when the user speaks.
- `timeoutSecs` (float, optional, nullable) — Seconds of caller silence before the idle handler fires (1–600).

### AgentChangeSummary

Summary counts for agent changes

- `added` (integer, required) — Number of agents added
- `modified` (integer, required) — Number of agents modified
- `removed` (integer, required) — Number of agents removed

### FlowChange

A single flow change entry

- `changeType` (enum, required) — Type of change
  - Allowed values: `agent_added`, `agent_removed`, `agent_modified`, `service_changed`, `flow_setting_changed`
- `elementId` (string, required) — ID of the affected agent or service
- `label` (string, required) — Human-readable label
- `details` (list of string, optional) — Specific sub-changes within a modified element

### FlowSettingChanges

Flow-level setting changes

- `initialNodeChanged` (boolean, required) — Whether the initial (entry point) node changed

### ServiceChangeSummary

Summary of service configuration changes

- `llmChanged` (boolean, required) — Whether the LLM service configuration changed
- `sttChanged` (boolean, required) — Whether the STT service configuration changed
- `ttsChanged` (boolean, required) — Whether the TTS service configuration changed

### AgentDefinition

Agent node definition Represents a conversational agent in the flow. The entry agent (`main_agent`) carries the call's `systemPrompt`; every agent carries its own `agentPrompt`. The system prompt is global to the call and persists across transitions, so non-entry agents must not set one (validation rejects it).

- `name` (string, required) — Display name
- `type` (enum, required) — Agent type: "main_agent" (exactly one, entry point) or "agent"
  - Allowed values: `main_agent`, `agent`
- `agentPrompt` (string, optional, nullable) — This agent's own instructions — THE canonical task field. In force only while the flow sits on this agent. Static and dynamic content share this one field: text containing `{{handlebars}}` is resolved at call time, plain text passes through. There is no prompt node, no edge, and no template indirection. `taskMessage` is accepted as a deprecated alias.
- `functions` (list of FunctionDefinition, optional) — Tool functions available to this agent (includes end_call, webhooks, etc.)
- `postActions` (list of ActionDefinition, optional) — Actions executed after agent finishes
- `preActions` (list of ActionDefinition, optional) — Actions executed before agent starts speaking
- `prompt` (PromptReference, optional, nullable) — Deprecated prompt wrapper, accepted for backwards compatibility. New definitions put the prompt inline in `AgentDefinition.agentPrompt`.
- `systemPrompt` (string, optional, nullable) — The call's system prompt — set on the entry agent only. Global to the call and persistent across agent transitions, so non-entry agents leave this `None` and inherit it. Validation rejects a `systemPrompt` on a non-entry agent. `roleMessage` is accepted as a deprecated alias.
- `transitions` (list of TransitionDefinition, optional) — Transitions to other agents (keywords trigger agent handoff)

### ServiceDefinition

Service provider configuration for LLM, TTS, and STT. All fields are optional during draft saves — a flow being built may not have all services configured yet. All three are required at publish time (enforced by `FlowDefinitionValidator`).

- `llm` (LLMServiceDefinition, optional, nullable) — LLM service configuration Supports: openai, anthropic, google, grok
- `stt` (STTServiceDefinition, optional, nullable) — STT service configuration Supports: deepgram, soniox, elevenlabs, cartesia. Use `language` for single-language providers, `languages` for Soniox multi-language.
- `tts` (TTSServiceDefinition, optional, nullable) — TTS service configuration Supports: elevenlabs, cartesia. Provider-specific fields are flattened — only relevant fields are set per provider.

### FunctionDefinition

JSON Schema for parameters the LLM extracts from conversation. For builtins: typically empty (no LLM params needed). For http_request: resolved from flow_functions DB record at publish time.

### ActionDefinition

Action definition for pre/post agent actions Actions execute before or after an agent speaks. Unlike functions (which are LLM-invoked tools), actions are deterministic steps triggered automatically by the flow engine. Action types: * `"tts_say"`: Speak specific text (config: `{ text: "..." }`) * `"play_audio"`: Play an audio file (config: `{ url: "..." }`) * `"wait"`: Pause for duration (config: `{ durationMs: 1000 }`) * `"webhook"`: Fire a webhook (config: `{ url: "...", method: "POST" }`)

- `type` (string, required) — Action type identifier
- `config` (ActionDefinitionConfig, optional, nullable) — Action-specific configuration (shape depends on action type)

### PromptReference

Deprecated prompt wrapper, accepted for backwards compatibility. New definitions put the prompt inline in `AgentDefinition.agentPrompt`.

- `content` (string, optional, nullable) — Inline content override (may contain \{\{handlebars}} expressions)
- `templateId` (string, optional, nullable) — Prompt template UUID (references prompt_templates table). Optional — omit for inline-only prompts that don't reference a saved template.

### TransitionDefinition

Agent transition definition Defines a handoff from one agent to another, triggered by keywords in the conversation. Exposed to the LLM as a tool at runtime.

- `targetAgentId` (string, required) — Target agent node ID
- `keywords` (string, optional) — Keywords/description that trigger this transition

### LLMServiceDefinition

LLM service configuration Supports: openai, anthropic, google, grok

- `model` (string, required) — Model identifier
- `provider` (string, required) — Provider identifier
- `endpoint` (string, optional, nullable) — Azure OpenAI deployment endpoint (required for Azure, omit for standard OpenAI)
- `label` (string, optional, nullable) — Display label for UI
- `maxTokens` (integer, optional, nullable) — Maximum tokens to generate
- `priorityTier` (boolean, optional, nullable) — OpenAI priority tier (2x cost, higher rate limits)
- `reasoningEffort` (string, optional, nullable) — Reasoning/thinking effort level. Only accepted by models that support reasoning, and only with a value that model lists as valid; anything else is ignored.
- `temperature` (double, optional, nullable) — Sampling temperature (0.0 - 2.0)

### STTServiceDefinition

STT service configuration Supports: deepgram, soniox, elevenlabs, cartesia. Use `language` for single-language providers, `languages` for Soniox multi-language.

- `model` (string, required) — Model identifier
- `provider` (string, required) — Provider identifier
- `keywords` (list of string, optional, nullable) — Keyword boosting terms
- `label` (string, optional, nullable) — Display label for UI
- `language` (string, optional, nullable) — Single language code (Deepgram, ElevenLabs, Cartesia, AssemblyAI, Whisper)
- `languages` (list of string, optional, nullable) — Language hints array for Soniox multi-language detection

### TTSServiceDefinition

TTS service configuration Supports: elevenlabs, cartesia. Provider-specific fields are flattened — only relevant fields are set per provider.

- `model` (string, required) — Model identifier
- `provider` (string, required) — Provider identifier
- `voiceId` (string, required) — Voice identifier
- `emotion` (string, optional, nullable) — Voice emotion preset (Cartesia Sonic v3)
- `label` (string, optional, nullable) — Display label for UI
- `language` (string, optional, nullable) — Voice language for localization (Cartesia)
- `similarity` (double, optional, nullable) — Voice similarity boost (0.0 - 1.0, ElevenLabs)
- `speakerBoost` (boolean, optional, nullable) — Speaker boost (ElevenLabs)
- `speed` (double, optional, nullable) — Speech speed multiplier (Cartesia Sonic v3)
- `stability` (double, optional, nullable) — Voice stability (0.0 - 1.0, ElevenLabs)
- `style` (double, optional, nullable) — Voice style (0.0 - 1.0, ElevenLabs)
- `voiceName` (string, optional, nullable) — Cached voice display name
- `volume` (double, optional, nullable) — Audio volume level (Cartesia Sonic v3)

### ActionDefinitionConfig

Action-specific configuration (shape depends on action type)

## Examples

**Request**

```json
{}
```

**Response**

```json
{
  "flow": {
    "accountId": "550e8400-e29b-41d4-a716-446655440000",
    "analysisOverride": "use_account_default",
    "connectedPhones": [
      {
        "id": "550e8400-e29b-41d4-a716-446655440000",
        "phoneNumber": "+15551234567",
        "friendlyName": "Main Office Line"
      }
    ],
    "createdAt": "2026-01-15T10:30:00Z",
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "name": "Appointment Reminder",
    "recordingOverride": "use_account_default",
    "status": "DRAFT",
    "tags": [
      "healthcare",
      "scheduling"
    ],
    "updatedAt": "2026-01-20T14:00:00Z",
    "version": "1.2.0",
    "versions": [
      {
        "publishedAt": "2026-01-15T10:30:00Z",
        "version": "1.2.0",
        "notes": "string"
      }
    ],
    "voicemailEnabled": true,
    "analysisInstructions": "string",
    "definition": null,
    "description": "Automated appointment reminder calls",
    "layout": {},
    "maxCallDuration": null,
    "publishedAt": "2024-01-15T09:30:00Z",
    "userIdle": null,
    "voicemailMessage": "string",
    "voicemailMessagePrompt": "string",
    "voicemailResponseDelaySecs": 2
  },
  "version": "1.2.0",
  "changeSummary": null,
  "transformationSummary": {
    "agentsTransformed": [
      "main_agent_1",
      "support_agent"
    ],
    "originalNodeCount": 8,
    "servicesExtracted": [
      "openai_llm",
      "elevenlabs_tts",
      "deepgram_stt"
    ],
    "transformedNodeCount": 3
  },
  "warnings": [
    {
      "code": "invalid_format",
      "field": "email",
      "message": "Email format is invalid"
    }
  ]
}
```

**SDK Code**

```python
import requests

url = "https://api.talkif.ai/api/v1/flows/flowId/publish"

payload = {}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript
const url = 'https://api.talkif.ai/api/v1/flows/flowId/publish';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.talkif.ai/api/v1/flows/flowId/publish"

	payload := strings.NewReader("{}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.talkif.ai/api/v1/flows/flowId/publish")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{}"

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.talkif.ai/api/v1/flows/flowId/publish")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{}")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.talkif.ai/api/v1/flows/flowId/publish', [
  'body' => '{}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.talkif.ai/api/v1/flows/flowId/publish");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.talkif.ai/api/v1/flows/flowId/publish")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```