# Create an action

POST https://api.synthflow.ai/v2/actions
Content-Type: application/json



Reference: https://docs.synthflow.ai/api-reference/platform-api/actions/create-action

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: Synthflow APIs
  version: 1.0.0
paths:
  /actions:
    post:
      operationId: create-action
      summary: Create an action
      description: ''
      tags:
        - ''
      parameters:
        - name: Authorization
          in: header
          description: Bearer authentication
          required: true
          schema:
            type: string
      responses:
        '200':
          description: '200'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/create-action_Response_200'
        '400':
          description: '400'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Create-actionRequestBadRequestError'
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                REAL_TIME_BOOKING:
                  $ref: >-
                    #/components/schemas/ActionsPostRequestBodyContentApplicationJsonSchemaRealTimeBooking
                INFORMATION_EXTRACTOR:
                  $ref: >-
                    #/components/schemas/ActionsPostRequestBodyContentApplicationJsonSchemaInformationExtractor
                LIVE_TRANSFER:
                  $ref: >-
                    #/components/schemas/ActionsPostRequestBodyContentApplicationJsonSchemaLiveTransfer
                SEND_SMS:
                  $ref: >-
                    #/components/schemas/ActionsPostRequestBodyContentApplicationJsonSchemaSendSms
                CUSTOM_ACTION:
                  $ref: >-
                    #/components/schemas/ActionsPostRequestBodyContentApplicationJsonSchemaCustomAction
                CUSTOM_EVAL:
                  $ref: >-
                    #/components/schemas/ActionsPostRequestBodyContentApplicationJsonSchemaCustomEval
servers:
  - url: https://api.synthflow.ai/v2
  - url: https://api.us.synthflow.ai/v2
components:
  schemas:
    ActionsPostRequestBodyContentApplicationJsonSchemaRealTimeBookingTimezone:
      type: string
      enum:
        - Africa/Accra
        - Africa/Addis_Ababa
        - Africa/Algiers
        - Africa/Asmara
        - Africa/Bamako
        - Africa/Bangui
        - Africa/Banjul
        - Africa/Bissau
        - Africa/Blantyre
        - Africa/Brazzaville
        - Africa/Bujumbura
        - Africa/Cairo
        - Africa/Casablanca
        - Africa/Ceuta
        - Africa/Conakry
        - Africa/Dakar
        - Africa/Dar_es_Salaam
        - Africa/Djibouti
        - Africa/Douala
        - Africa/El_Aaiun
        - Africa/Freetown
        - Africa/Gaborone
        - Africa/Harare
        - Africa/Johannesburg
        - Africa/Juba
        - Africa/Kampala
        - Africa/Khartoum
        - Africa/Kigali
        - Africa/Kinshasa
        - Africa/Lagos
        - Africa/Libreville
        - Africa/Lome
        - Africa/Luanda
        - Africa/Lubumbashi
        - Africa/Lusaka
        - Africa/Malabo
        - Africa/Maputo
        - Africa/Maseru
        - Africa/Mbabane
        - Africa/Mogadishu
        - Africa/Monrovia
        - Africa/Nairobi
        - Africa/Ndjamena
        - Africa/Niamey
        - Africa/Nouakchott
        - Africa/Ouagadougou
        - Africa/Porto-Novo
        - Africa/Sao_Tome
        - Africa/Tripoli
        - Africa/Tunis
        - Africa/Windhoek
        - America/Adak
        - America/Anchorage
        - America/Anguilla
        - America/Antigua
        - America/Araguaina
        - America/Argentina/Buenos_Aires
        - America/Argentina/Catamarca
        - America/Argentina/Cordoba
        - America/Argentina/Jujuy
        - America/Argentina/La_Rioja
        - America/Argentina/Mendoza
        - America/Argentina/Rio_Gallegos
        - America/Argentina/Salta
        - America/Argentina/San_Juan
        - America/Argentina/San_Luis
        - America/Argentina/Tucuman
        - America/Argentina/Ushuaia
        - America/Aruba
        - America/Asuncion
        - America/Atikokan
        - America/Bahia
        - America/Bahia_Banderas
        - America/Barbados
        - America/Belem
        - America/Belize
        - America/Blanc-Sablon
        - America/Boa_Vista
        - America/Bogota
        - America/Boise
        - America/Cambridge_Bay
        - America/Campo_Grande
        - America/Cancun
        - America/Caracas
        - America/Cayenne
        - America/Cayman
        - America/Chicago
        - America/Chihuahua
        - America/Ciudad_Juarez
        - America/Costa_Rica
        - America/Creston
        - America/Cuiaba
        - America/Curacao
        - America/Danmarkshavn
        - America/Dawson
        - America/Dawson_Creek
        - America/Denver
        - America/Detroit
        - America/Dominica
        - America/Edmonton
        - America/Eirunepe
        - America/El_Salvador
        - America/Fort_Nelson
        - America/Fortaleza
        - America/Glace_Bay
        - America/Goose_Bay
        - America/Grand_Turk
        - America/Grenada
        - America/Guadeloupe
        - America/Guatemala
        - America/Guayaquil
        - America/Guyana
        - America/Halifax
        - America/Havana
        - America/Hermosillo
        - America/Indiana/Indianapolis
        - America/Indiana/Knox
        - America/Indiana/Marengo
        - America/Indiana/Petersburg
        - America/Indiana/Tell_City
        - America/Indiana/Vevay
        - America/Indiana/Vincennes
        - America/Indiana/Winamac
        - America/Inuvik
        - America/Iqaluit
        - America/Jamaica
        - America/Juneau
        - America/Kentucky/Louisville
        - America/Kentucky/Monticello
        - America/Kralendijk
        - America/La_Paz
        - America/Lima
        - America/Los_Angeles
        - America/Lower_Princes
        - America/Maceio
        - America/Managua
        - America/Manaus
        - America/Marigot
        - America/Martinique
        - America/Matamoros
        - America/Mazatlan
        - America/Menominee
        - America/Merida
        - America/Metlakatla
        - America/Mexico_City
        - America/Miquelon
        - America/Moncton
        - America/Monterrey
        - America/Montevideo
        - America/Montserrat
        - America/Nassau
        - America/New_York
        - America/Nome
        - America/Noronha
        - America/North_Dakota/Beulah
        - America/North_Dakota/Center
        - America/North_Dakota/New_Salem
        - America/Nuuk
        - America/Ojinaga
        - America/Panama
        - America/Paramaribo
        - America/Phoenix
        - America/Port_of_Spain
        - America/Port-au-Prince
        - America/Porto_Velho
        - America/Puerto_Rico
        - America/Punta_Arenas
        - America/Rankin_Inlet
        - America/Recife
        - America/Regina
        - America/Resolute
        - America/Rio_Branco
        - America/Santarem
        - America/Santiago
        - America/Santo_Domingo
        - America/Sao_Paulo
        - America/Scoresbysund
        - America/Sitka
        - America/St_Barthelemy
        - America/St_Johns
        - America/St_Kitts
        - America/St_Lucia
        - America/St_Thomas
        - America/St_Vincent
        - America/Swift_Current
        - America/Tegucigalpa
        - America/Thule
        - America/Tijuana
        - America/Toronto
        - America/Tortola
        - America/Vancouver
        - America/Whitehorse
        - America/Winnipeg
        - America/Yakutat
        - Antarctica/Casey
        - Antarctica/Davis
        - Antarctica/DumontDUrville
        - Antarctica/Macquarie
        - Antarctica/Mawson
        - Antarctica/McMurdo
        - Antarctica/Palmer
        - Antarctica/Rothera
        - Antarctica/Syowa
        - Antarctica/Troll
        - Antarctica/Vostok
        - Arctic/Longyearbyen
        - Asia/Aden
        - Asia/Almaty
        - Asia/Amman
        - Asia/Anadyr
        - Asia/Aqtau
        - Asia/Aqtobe
        - Asia/Ashgabat
        - Asia/Atyrau
        - Asia/Baghdad
        - Asia/Bahrain
        - Asia/Baku
        - Asia/Bangkok
        - Asia/Barnaul
        - Asia/Beirut
        - Asia/Bishkek
        - Asia/Brunei
        - Asia/Chita
        - Asia/Choibalsan
        - Asia/Colombo
        - Asia/Damascus
        - Asia/Dhaka
        - Asia/Dili
        - Asia/Dubai
        - Asia/Dushanbe
        - Asia/Famagusta
        - Asia/Gaza
        - Asia/Hebron
        - Asia/Ho_Chi_Minh
        - Asia/Hong_Kong
        - Asia/Hovd
        - Asia/Irkutsk
        - Asia/Jakarta
        - Asia/Jayapura
        - Asia/Jerusalem
        - Asia/Kabul
        - Asia/Kamchatka
        - Asia/Karachi
        - Asia/Kathmandu
        - Asia/Khandyga
        - Asia/Kolkata
        - Asia/Krasnoyarsk
        - Asia/Kuala_Lumpur
        - Asia/Kuching
        - Asia/Kuwait
        - Asia/Macau
        - Asia/Magadan
        - Asia/Makassar
        - Asia/Manila
        - Asia/Muscat
        - Asia/Nicosia
        - Asia/Novokuznetsk
        - Asia/Novosibirsk
        - Asia/Omsk
        - Asia/Oral
        - Asia/Phnom_Penh
        - Asia/Pontianak
        - Asia/Pyongyang
        - Asia/Qatar
        - Asia/Qostanay
        - Asia/Qyzylorda
        - Asia/Riyadh
        - Asia/Sakhalin
        - Asia/Samarkand
        - Asia/Seoul
        - Asia/Shanghai
        - Asia/Singapore
        - Asia/Srednekolymsk
        - Asia/Taipei
        - Asia/Tashkent
        - Asia/Tbilisi
        - Asia/Tehran
        - Asia/Thimphu
        - Asia/Tokyo
        - Asia/Tomsk
        - Asia/Ulaanbaatar
        - Asia/Urumqi
        - Asia/Ust-Nera
        - Asia/Vientiane
        - Asia/Vladivostok
        - Asia/Yakutsk
        - Asia/Yangon
        - Asia/Yekaterinburg
        - Asia/Yerevan
        - Atlantic/Azores
        - Atlantic/Bermuda
        - Atlantic/Canary
        - Atlantic/Cape_Verde
        - Atlantic/Faroe
        - Atlantic/Madeira
        - Atlantic/Reykjavik
        - Atlantic/South_Georgia
        - Atlantic/St_Helena
        - Atlantic/Stanley
        - Australia/Adelaide
        - Australia/Brisbane
        - Australia/Broken_Hill
        - Australia/Darwin
        - Australia/Eucla
        - Australia/Hobart
        - Australia/Lindeman
        - Australia/Lord_Howe
        - Australia/Melbourne
        - Australia/Perth
        - Australia/Sydney
        - Europe/Amsterdam
        - Europe/Andorra
        - Europe/Astrakhan
        - Europe/Athens
        - Europe/Belgrade
        - Europe/Berlin
        - Europe/Bratislava
        - Europe/Brussels
        - Europe/Bucharest
        - Europe/Budapest
        - Europe/Busingen
        - Europe/Chisinau
        - Europe/Copenhagen
        - Europe/Dublin
        - Europe/Gibraltar
        - Europe/Guernsey
        - Europe/Helsinki
        - Europe/Isle_of_Man
        - Europe/Istanbul
        - Europe/Jersey
        - Europe/Kaliningrad
        - Europe/Kirov
        - Europe/Kyiv
        - Europe/Lisbon
        - Europe/Ljubljana
        - Europe/London
        - Europe/Luxembourg
        - Europe/Madrid
        - Europe/Malta
        - Europe/Mariehamn
        - Europe/Minsk
        - Europe/Monaco
        - Europe/Moscow
        - Europe/Oslo
        - Europe/Paris
        - Europe/Podgorica
        - Europe/Prague
        - Europe/Riga
        - Europe/Rome
        - Europe/Samara
        - Europe/San_Marino
        - Europe/Sarajevo
        - Europe/Saratov
        - Europe/Simferopol
        - Europe/Skopje
        - Europe/Sofia
        - Europe/Stockholm
        - Europe/Tallinn
        - Europe/Tirane
        - Europe/Ulyanovsk
        - Europe/Vaduz
        - Europe/Vatican
        - Europe/Vienna
        - Europe/Vilnius
        - Europe/Volgograd
        - Europe/Warsaw
        - Europe/Zagreb
        - Europe/Zurich
        - Indian/Antananarivo
        - Indian/Chagos
        - Indian/Christmas
        - Indian/Cocos
        - Indian/Comoro
        - Indian/Kerguelen
        - Indian/Mahe
        - Indian/Maldives
        - Indian/Mauritius
        - Indian/Mayotte
        - Indian/Reunion
        - Pacific/Apia
        - Pacific/Auckland
        - Pacific/Bougainville
        - Pacific/Chatham
        - Pacific/Chuuk
        - Pacific/Easter
        - Pacific/Efate
        - Pacific/Fakaofo
        - Pacific/Fiji
        - Pacific/Funafuti
        - Pacific/Galapagos
        - Pacific/Gambier
        - Pacific/Guadalcanal
        - Pacific/Guam
        - Pacific/Honolulu
        - Pacific/Kanton
        - Pacific/Kiritimati
        - Pacific/Kosrae
        - Pacific/Kwajalein
        - Pacific/Majuro
        - Pacific/Marquesas
        - Pacific/Midway
        - Pacific/Nauru
        - Pacific/Niue
        - Pacific/Norfolk
        - Pacific/Noumea
        - Pacific/Pago_Pago
        - Pacific/Palau
        - Pacific/Pitcairn
        - Pacific/Pohnpei
        - Pacific/Port_Moresby
        - Pacific/Rarotonga
        - Pacific/Saipan
        - Pacific/Tahiti
        - Pacific/Tarawa
        - Pacific/Tongatapu
        - Pacific/Wake
        - Pacific/Wallis
        - US/Alaska
        - US/Central
        - US/Eastern
        - US/Hawaii
        - US/Mountain
        - US/Pacific
      description: '[List of possible time zones](/time-zones). The default is Europe/Berlin'
      title: >-
        ActionsPostRequestBodyContentApplicationJsonSchemaRealTimeBookingTimezone
    ActionsPostRequestBodyContentApplicationJsonSchemaRealTimeBookingCalcomIntegration:
      type: string
      enum:
        - GMeet
        - Zoom
      description: >-
        The selected option will be the meeting type that will be created when
        the booking is done
      title: >-
        ActionsPostRequestBodyContentApplicationJsonSchemaRealTimeBookingCalcomIntegration
    ActionsPostRequestBodyContentApplicationJsonSchemaRealTimeBookingCalcom:
      type: object
      properties:
        event_id:
          type: string
          description: The event id can be obtained from the cal.com calendar
        integration:
          $ref: >-
            #/components/schemas/ActionsPostRequestBodyContentApplicationJsonSchemaRealTimeBookingCalcomIntegration
          description: >-
            The selected option will be the meeting type that will be created
            when the booking is done
        sms_boolean:
          type: boolean
          default: false
          description: >-
            If the value is true the SMS message from the sms_message field will
            be send
        sms_message:
          type: string
          description: Text to be sent in the sms
        user_email:
          type: string
          description: Email that will be used to create the meeting
      required:
        - event_id
        - user_email
      description: 'Important: You need to be connected to the Cal.com integration'
      title: ActionsPostRequestBodyContentApplicationJsonSchemaRealTimeBookingCalcom
    ActionsPostRequestBodyContentApplicationJsonSchemaRealTimeBookingGhlAutoconfirm:
      type: string
      enum:
        - confirmed
        - new
      description: >-
        If confirmed is selected the meeting will be automatically accepted and
        you don't have to do anything, otherwise you have to go to GHL calendar
        and confirm the meeting
      title: >-
        ActionsPostRequestBodyContentApplicationJsonSchemaRealTimeBookingGhlAutoconfirm
    ActionsPostRequestBodyContentApplicationJsonSchemaRealTimeBookingGhl:
      type: object
      properties:
        calendar_id:
          type: string
          description: >-
            Calendar ID from the GHL calendar. Can be obtained from GHL in
            calendars > Calendar Settings
        autoconfirm:
          $ref: >-
            #/components/schemas/ActionsPostRequestBodyContentApplicationJsonSchemaRealTimeBookingGhlAutoconfirm
          description: >-
            If confirmed is selected the meeting will be automatically accepted
            and you don't have to do anything, otherwise you have to go to GHL
            calendar and confirm the meeting
        booking_title:
          type: string
          description: >-
            The title that will be displayed in the Synthflow app for the
            created action
      required:
        - calendar_id
        - autoconfirm
        - booking_title
      description: 'Important: You need to be connected to the GHL integration'
      title: ActionsPostRequestBodyContentApplicationJsonSchemaRealTimeBookingGhl
    ActionsPostRequestBodyContentApplicationJsonSchemaRealTimeBooking:
      type: object
      properties:
        first_appt_date:
          type: string
          format: date
          description: >-
            The initial date that will be the used to start searching for
            booking appointments, the format is YYYY-MM-DD
        max_time_slots:
          type: integer
          default: 3
          description: >-
            The amount of slots that the agent will recommend per day when
            trying to book an appointment. The limit is 3
        min_hours_diff:
          type: integer
          default: 3
          description: >-
            The difference in hours between appointments that will be suggested
            by the agent.
        no_of_days:
          type: integer
          default: 3
          description: Number of days that the agent will suggest appointments
        timezone:
          $ref: >-
            #/components/schemas/ActionsPostRequestBodyContentApplicationJsonSchemaRealTimeBookingTimezone
          description: >-
            [List of possible time zones](/time-zones). The default is
            Europe/Berlin
        CALCOM:
          $ref: >-
            #/components/schemas/ActionsPostRequestBodyContentApplicationJsonSchemaRealTimeBookingCalcom
          description: 'Important: You need to be connected to the Cal.com integration'
        GHL:
          $ref: >-
            #/components/schemas/ActionsPostRequestBodyContentApplicationJsonSchemaRealTimeBookingGhl
          description: 'Important: You need to be connected to the GHL integration'
      required:
        - first_appt_date
        - max_time_slots
        - min_hours_diff
        - no_of_days
        - timezone
      title: ActionsPostRequestBodyContentApplicationJsonSchemaRealTimeBooking
    ActionsPostRequestBodyContentApplicationJsonSchemaInformationExtractorYesNo:
      type: object
      properties:
        identifier:
          type: string
          description: The title that will identify the action
        description:
          type: string
          description: The description of what the action is expected to do
      required:
        - identifier
      title: >-
        ActionsPostRequestBodyContentApplicationJsonSchemaInformationExtractorYesNo
    ActionsPostRequestBodyContentApplicationJsonSchemaInformationExtractorSingleChoice:
      type: object
      properties:
        identifier:
          type: string
          description: The title that will identify the action
        description:
          type: string
          description: The description of what the action is expected to do
        choices:
          type: array
          items:
            type: string
          description: >-
            The possible choices that will answer the expected description of
            the action
      required:
        - identifier
      title: >-
        ActionsPostRequestBodyContentApplicationJsonSchemaInformationExtractorSingleChoice
    ActionsPostRequestBodyContentApplicationJsonSchemaInformationExtractorOpenQuestion:
      type: object
      properties:
        identifier:
          type: string
          description: The title that will identify the action
        description:
          type: string
          description: The description of what the action is expected to do
        examples:
          type: array
          items:
            type: string
          description: >-
            Examples of possible answers that can match the description of the
            action
      required:
        - identifier
      title: >-
        ActionsPostRequestBodyContentApplicationJsonSchemaInformationExtractorOpenQuestion
    ActionsPostRequestBodyContentApplicationJsonSchemaInformationExtractor:
      type: object
      properties:
        YES_NO:
          $ref: >-
            #/components/schemas/ActionsPostRequestBodyContentApplicationJsonSchemaInformationExtractorYesNo
        SINGLE_CHOICE:
          $ref: >-
            #/components/schemas/ActionsPostRequestBodyContentApplicationJsonSchemaInformationExtractorSingleChoice
        OPEN_QUESTION:
          $ref: >-
            #/components/schemas/ActionsPostRequestBodyContentApplicationJsonSchemaInformationExtractorOpenQuestion
      title: ActionsPostRequestBodyContentApplicationJsonSchemaInformationExtractor
    ActionsPostRequestBodyContentApplicationJsonSchemaLiveTransferTransferMode:
      type: string
      enum:
        - cold_transfer
        - warm_transfer
        - warm_transfer_with_context
      description: Transfer mode.
      title: >-
        ActionsPostRequestBodyContentApplicationJsonSchemaLiveTransferTransferMode
    ActionsPostRequestBodyContentApplicationJsonSchemaLiveTransfer:
      type: object
      properties:
        transfer_mode:
          $ref: >-
            #/components/schemas/ActionsPostRequestBodyContentApplicationJsonSchemaLiveTransferTransferMode
          description: Transfer mode.
        message_to_transfer_target:
          type: string
          description: >-
            The message the human agent will hear after the call is transferred
            to them.
        phone:
          type: string
          description: Phone number to be called for transferring the call
        instructions:
          type: string
          description: >-
            What words can trigger the transfer call, for example: like I want
            to talk with a manager
        timeout:
          type: integer
          description: >-
            How long to wait for the transfer call to happen before stop trying
            to do the transfer
        digits:
          type: string
          description: Extension digits for the transfer call
        initiating_msg:
          type: string
          description: Message that the agent will say before starting the transfer call
        goodbye_msg:
          type: string
          description: >-
            Message that the agent will say before leaving the call and
            connecting you with the transfer call number to start the
            conversation
        failed_msg:
          type: string
          description: >-
            The message that the agent will say in case the person that should
            answer the phone is not able to answer before the timeout
        stop_recording_after_transfer:
          type: boolean
          description: Whether the call should stop being recorded once it's transferred.
      required:
        - transfer_mode
        - phone
        - instructions
        - initiating_msg
      title: ActionsPostRequestBodyContentApplicationJsonSchemaLiveTransfer
    ActionsPostRequestBodyContentApplicationJsonSchemaSendSms:
      type: object
      properties:
        content:
          type: string
          description: The content/text of the SMS message
        instructions:
          type: string
          description: The instructions that will trigger the SMS message to be sent
      required:
        - content
        - instructions
      title: ActionsPostRequestBodyContentApplicationJsonSchemaSendSms
    ActionsPostRequestBodyContentApplicationJsonSchemaCustomActionHttpMode:
      type: string
      enum:
        - GET
        - POST
        - PATCH
        - PUT
      default: GET
      description: Select the method that will be used
      title: ActionsPostRequestBodyContentApplicationJsonSchemaCustomActionHttpMode
    ActionsPostRequestBodyContentApplicationJsonSchemaCustomActionIntegration:
      type: string
      enum:
        - ghl
        - hubspot
      description: The possible integrations that can be selected to retrieve information
      title: >-
        ActionsPostRequestBodyContentApplicationJsonSchemaCustomActionIntegration
    ActionsPostRequestBodyContentApplicationJsonSchemaCustomActionCustomAuth:
      type: object
      properties:
        is_needed:
          type: boolean
          default: false
          description: >-
            If authorization to use the set URL and method are required set to
            true
        location:
          type: string
          description: 'Section where the authorization will be used like: header'
        key:
          type: string
          default: Bearer
          description: The authorization type. Default is Bearer
        value:
          type: string
          description: >-
            The value of the token that will be used with the authentication
            type
      title: ActionsPostRequestBodyContentApplicationJsonSchemaCustomActionCustomAuth
    ActionsPostRequestBodyContentApplicationJsonSchemaCustomActionVariablesBeforeTheCallItems:
      type: object
      properties:
        key:
          type: string
          description: Key name
        value:
          type: string
          description: Value that will be assigned to the key
      required:
        - key
        - value
      title: >-
        ActionsPostRequestBodyContentApplicationJsonSchemaCustomActionVariablesBeforeTheCallItems
    ActionsPostRequestBodyContentApplicationJsonSchemaCustomActionVariablesDuringTheCallItemsType:
      type: string
      enum:
        - string
        - int
        - float
        - bool
        - list
        - money
        - phone_number
        - email
        - datetime
        - utc_datetime
      default: string
      description: Type of the variable
      title: >-
        ActionsPostRequestBodyContentApplicationJsonSchemaCustomActionVariablesDuringTheCallItemsType
    ActionsPostRequestBodyContentApplicationJsonSchemaCustomActionVariablesDuringTheCallItems:
      type: object
      properties:
        name:
          type: string
          description: Name of the variable that will be used during the call
        description:
          type: string
          description: Description of the functionality of the variable
        example:
          type: string
          description: Example of the value/answer that can be given to fill the variable
        type:
          $ref: >-
            #/components/schemas/ActionsPostRequestBodyContentApplicationJsonSchemaCustomActionVariablesDuringTheCallItemsType
          description: Type of the variable
      title: >-
        ActionsPostRequestBodyContentApplicationJsonSchemaCustomActionVariablesDuringTheCallItems
    ActionsPostRequestBodyContentApplicationJsonSchemaCustomActionHeadersItems:
      type: object
      properties:
        key:
          type: string
          description: Key name
        value:
          type: string
          description: Value that will be assigned to the key
      required:
        - key
        - value
      title: >-
        ActionsPostRequestBodyContentApplicationJsonSchemaCustomActionHeadersItems
    ActionsPostRequestBodyContentApplicationJsonSchemaCustomActionQueryParametersItems:
      type: object
      properties:
        key:
          type: string
          description: Key name
        value:
          type: string
          description: Value that will be assigned to the key
      required:
        - key
        - value
      title: >-
        ActionsPostRequestBodyContentApplicationJsonSchemaCustomActionQueryParametersItems
    ActionsPostRequestBodyContentApplicationJsonSchemaCustomAction:
      type: object
      properties:
        http_mode:
          $ref: >-
            #/components/schemas/ActionsPostRequestBodyContentApplicationJsonSchemaCustomActionHttpMode
          description: Select the method that will be used
        url:
          type: string
          description: URL to be used by the action
        run_action_before_call_start:
          type: boolean
          description: Actions that will run before the call, like phone number
        name:
          type: string
          description: Name of the action
        description:
          type: string
          description: Description of the action
        speech_while_using_the_tool:
          type: string
          description: The speech that will be used while the action is executed
        integration:
          $ref: >-
            #/components/schemas/ActionsPostRequestBodyContentApplicationJsonSchemaCustomActionIntegration
          description: >-
            The possible integrations that can be selected to retrieve
            information
        failure_timeout:
          type: integer
          description: >-
            How long to wait for the custom action to complete before timing out
            (in seconds)
        custom_auth:
          $ref: >-
            #/components/schemas/ActionsPostRequestBodyContentApplicationJsonSchemaCustomActionCustomAuth
        variables_before_the_call:
          type: array
          items:
            $ref: >-
              #/components/schemas/ActionsPostRequestBodyContentApplicationJsonSchemaCustomActionVariablesBeforeTheCallItems
        variables_during_the_call:
          type: array
          items:
            $ref: >-
              #/components/schemas/ActionsPostRequestBodyContentApplicationJsonSchemaCustomActionVariablesDuringTheCallItems
        headers:
          type: array
          items:
            $ref: >-
              #/components/schemas/ActionsPostRequestBodyContentApplicationJsonSchemaCustomActionHeadersItems
        query_parameters:
          type: array
          items:
            $ref: >-
              #/components/schemas/ActionsPostRequestBodyContentApplicationJsonSchemaCustomActionQueryParametersItems
        agent_speak_naturally:
          type: boolean
          description: >-
            If disabled, the agent will strictly stick to your pre-written
            messages. If enabled, it may say something that accounts for the
            previous context of the conversation.
        message_delay:
          type: string
          description: What the agent should say if the action reaches the delay threshold.
        message_delay_time:
          type: integer
          description: Delay threshold, in seconds.
        message_error:
          type: string
          description: What the agent should say if the action failed.
        json_body_stringified:
          type: string
          description: >-
            A json stringified of the payload/body that will be used for the
            action
        prompt:
          type: string
          description: The prompt that will be used in case it is set
        message_before_action_starts:
          type: string
          description: The message that the agent will speak before the action is triggered
      required:
        - http_mode
        - url
        - run_action_before_call_start
        - name
      title: ActionsPostRequestBodyContentApplicationJsonSchemaCustomAction
    ActionsPostRequestBodyContentApplicationJsonSchemaCustomEvalQuestionCategory:
      type: string
      enum:
        - pass_fail
        - numeric
        - descriptive
        - likert_scale
      description: Custom evalution category.
      title: >-
        ActionsPostRequestBodyContentApplicationJsonSchemaCustomEvalQuestionCategory
    ActionsPostRequestBodyContentApplicationJsonSchemaCustomEvalQuestion:
      type: object
      properties:
        identifier:
          type: string
          description: Custom evaluation name.
        text:
          type: string
          description: Custom evaluation description.
        category:
          $ref: >-
            #/components/schemas/ActionsPostRequestBodyContentApplicationJsonSchemaCustomEvalQuestionCategory
          description: Custom evalution category.
        expected_result:
          type: string
          description: >-
            The expected result, which depends on the category. For pass_fail
            evaluations, the expected result is either true or false. For
            numeric evaluations, it is an integer between 1 and 10.
      title: ActionsPostRequestBodyContentApplicationJsonSchemaCustomEvalQuestion
    ActionsPostRequestBodyContentApplicationJsonSchemaCustomEval:
      type: object
      properties:
        question:
          $ref: >-
            #/components/schemas/ActionsPostRequestBodyContentApplicationJsonSchemaCustomEvalQuestion
      title: ActionsPostRequestBodyContentApplicationJsonSchemaCustomEval
    ActionsPostResponsesContentApplicationJsonSchemaResponse:
      type: object
      properties:
        action_id:
          type: string
        action_type:
          type: string
        prompt_variables:
          type: array
          items:
            description: Any type
      title: ActionsPostResponsesContentApplicationJsonSchemaResponse
    create-action_Response_200:
      type: object
      properties:
        status:
          type: string
        response:
          $ref: >-
            #/components/schemas/ActionsPostResponsesContentApplicationJsonSchemaResponse
      title: create-action_Response_200
    Create-actionRequestBadRequestError:
      type: object
      properties: {}
      title: Create-actionRequestBadRequestError
  securitySchemes:
    sec0:
      type: http
      scheme: bearer

```

## SDK Code Examples

```python
import requests

url = "https://api.synthflow.ai/v2/actions"

payload = { "REAL_TIME_BOOKING": {
        "first_appt_date": "2025-06-02",
        "max_time_slots": 2,
        "min_hours_diff": 3,
        "no_of_days": 3,
        "timezone": "America/New_York"
    } }
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```go
package main

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

func main() {

	url := "https://api.synthflow.ai/v2/actions"

	payload := strings.NewReader("{\n  \"REAL_TIME_BOOKING\": {\n    \"first_appt_date\": \"2025-06-02\",\n    \"max_time_slots\": 2,\n    \"min_hours_diff\": 3,\n    \"no_of_days\": 3,\n    \"timezone\": \"America/New_York\"\n  }\n}")

	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.synthflow.ai/v2/actions")

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 = "{\n  \"REAL_TIME_BOOKING\": {\n    \"first_appt_date\": \"2025-06-02\",\n    \"max_time_slots\": 2,\n    \"min_hours_diff\": 3,\n    \"no_of_days\": 3,\n    \"timezone\": \"America/New_York\"\n  }\n}"

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.synthflow.ai/v2/actions")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"REAL_TIME_BOOKING\": {\n    \"first_appt_date\": \"2025-06-02\",\n    \"max_time_slots\": 2,\n    \"min_hours_diff\": 3,\n    \"no_of_days\": 3,\n    \"timezone\": \"America/New_York\"\n  }\n}")
  .asString();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.synthflow.ai/v2/actions");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"REAL_TIME_BOOKING\": {\n    \"first_appt_date\": \"2025-06-02\",\n    \"max_time_slots\": 2,\n    \"min_hours_diff\": 3,\n    \"no_of_days\": 3,\n    \"timezone\": \"America/New_York\"\n  }\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = ["REAL_TIME_BOOKING": [
    "first_appt_date": "2025-06-02",
    "max_time_slots": 2,
    "min_hours_diff": 3,
    "no_of_days": 3,
    "timezone": "America/New_York"
  ]] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.synthflow.ai/v2/actions")! 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()
```