Introduction

The IBM Watson™ Assistant service combines machine learning, natural language understanding, and integrated dialog tools to create conversation flows between your apps and your users.

The code examples on this tab use the client library that is provided for Java.

Maven

<dependency>
  <groupId>com.ibm.watson.developer_cloud</groupId>
  <artifactId>java-sdk</artifactId>
  <version>6.9.0</version>
</dependency>

Gradle

compile 'com.ibm.watson.developer_cloud:java-sdk:6.9.0'

GitHub

The code examples on this tab use the client library that is provided for Node.js.

Installation

npm install --save watson-developer-cloud

GitHub

The code examples on this tab use the client library that is provided for Python.

Installation

pip install --upgrade "watson-developer-cloud>=2.4.0"

GitHub

The code examples on this tab use the client library that is provided for Ruby.

Installation

gem install ibm_watson

GitHub

Authentication

IBM Cloud is migrating to token-based Identity and Access Management (IAM) authentication.

  • With some service instances, you authenticate to the API by using IAM. You can pass either a bearer token in an Authorization header or an API key. Tokens support authenticated requests without embedding service credentials in every call. API keys use basic authentication. Learn more about IAM.

    If you pass in the apikey, the SDK manages the lifecycle of the tokens. If you pass a token, you maintain the token lifecycle. Learn more about IAM authentication with the SDK.

  • In other instances, you authenticate by providing the username and password for the service instance. For more information, see Service credentials for Watson services.

To find out which authentication to use, view the service credentials by clicking the service instance on the Dashboard.

You can also access the service credentials from the Watson Assistant tool:

  • To see the service credentials and the assistant ID of an assistant, go to the Assistants page and select View API Details from the menu of an assistant tile. (The assistant ID is used only by the v2 API.)
  • To see the service credentials and the workspace ID of a workspace, go to the Skills page and select View API Details from the menu of a skill tile. (The workspace ID is used only by the v1 API.)

The "username" and "password" in the service credentials are different from your IBM Cloud account IBMid and password.

IAM authentication. Replace {apikey} and {url} with your service credentials.

curl -u "apikey:{apikey}" "{url}/{method}"

Basic authentication. Replace {username}, {password}, and {url} with your service credentials.

curl -u "{username}:{password}" "{url}/{method}"

SDK managing the IAM token. Replace {apikey}, {version} and {url}.

IamOptions options = new IamOptions.Builder()
    .apiKey("{apikey}")
    .build();

Assistant assistant = new Assistant("{version}", options);

assistant.setEndPoint("{url}");

Basic authentication. Replace {username}, {password}, `, and{url}`. Use either of the two constructors.

Assistant assistant = new Assistant(
    "{version}",
    "{username}",
    "{password}");

assistant.setEndPoint("{url}");

or

Assistant assistant = new Assistant("{version}");
assistant.setUsernameAndPassword("{username}","{password}");

assistant.setEndPoint("{url}");

SDK managing the IAM token. Replace {apikey}, {version} and {url}.

var AssistantV1 = require('watson-developer-cloud/assistant/v1');

var assistant = new AssistantV1({
  version: '{version}',
  iam_apikey: '{apikey}',
  url: '{url}'
});

Basic authentication. Replace {username}, {password}, `, and{url}`.

var  = require('watson-developer-cloud/assistant/v1');

var assistant = new AssistantV1({
  version: '{version}',
  username: '{username}',
  password: '{password}',
  url: '{url}'
});

SDK managing the IAM token. Replace {apikey}, {version} and {url}.

from watson_developer_cloud import AssistantV1

assistant = AssistantV1(
    version='{version}',
    iam_apikey='{apikey}',
    url='{url}'
)

Basic authentication. Replace {username}, {password}, `, and{url}`.

from watson_developer_cloud import AssistantV1

assistant = AssistantV1(
    version='{version}',
    username='{username}',
    password='{password}',
    url='{url}'
)

SDK managing the IAM token. Replace {apikey}, {version} and {url}.

require "ibm_watson"

assistant = IBMWatson::AssistantV1.new(
  version: "{version}",
  iam_apikey: "{apikey}",
  url:"{url}"
)

Basic authentication. Replace {username}, {password}, `, and{url}`.

require "ibm_watson"

assistant = IBMWatson::AssistantV1.new(
  version: "{version}",
  username: "{username}",
  password: "{password}",
  url:"{url}"
)

Service endpoint

The service endpoint is based on the location of the service instance. For example, when Watson Assistant is hosted in Frankfurt, the base URL is https://gateway-fra.watsonplatform.net/assistant/api. The URL might also be different when you use IBM Cloud Dedicated.

To find out which URL to use, view the service credentials by clicking the service instance on the Dashboard.

Use that URL in your requests to Watson Assistant.

Set the correct service URL by calling the setEndPoint() method of the service instance.

Set the correct service URL by calling the url parameter when you create the service instance.

Set the correct service URL by calling the url parameter when you create the service instance or by calling the set_url() method of the service instance.

Set the correct service URL by calling the url parameter when you create the service instance or by calling the url= method of the service instance.

Service endpoints by location:

  • Dallas: https://gateway.watsonplatform.net/assistant/api
  • Washington, DC: https://gateway-wdc.watsonplatform.net/assistant/api
  • Frankfurt: https://gateway-fra.watsonplatform.net/assistant/api
  • Sydney: https://gateway-syd.watsonplatform.net/assistant/api
  • Tokyo: https://gateway-tok.watsonplatform.net/assistant/api
  • London: https://gateway.watsonplatform.net/assistant/api

All locations might not support Watson Assistant. For details, see Service availability.

Dallas API endpoint

https://gateway.watsonplatform.net/assistant/api

Your service instance might not use this URL

Default URL

https://gateway.watsonplatform.net/assistant/api

Example for the Washington, DC location

Assistant assistant = new Assistant("{version}");
assistant.setEndPoint("https://gateway-wdc.watsonplatform.net/assistant/api");

Default URL

https://gateway.watsonplatform.net/assistant/api

Example for the Washington, DC location

var AssistantV1 = require('watson-developer-cloud/assistant/v1');

var assistant = new AssistantV1({
  version: '{version}',
  iam_apikey: '{apikey}',
  url: 'https://gateway-wdc.watsonplatform.net/assistant/api'
});

Default URL

https://gateway.watsonplatform.net/assistant/api

Examples for the Washington, DC location in the constructor and after instantiation

assistant = AssistantV1(
  version='{version}',
  iam_apikey='{apikey}',
  url='https://gateway-wdc.watsonplatform.net/assistant/api'
)

or

assistant.set_url('https://gateway-wdc.watsonplatform.net/assistant/api')

Default URL

https://gateway.watsonplatform.net/assistant/api

Examples for the Washington, DC location in the constructor and after instantiation

assistant = IBMWatson::.new(
  version: "{version}",
  api_key: "{api_key}",
  url: "https://gateway-wdc.watsonplatform.net/assistant/api"
)

or

assistant.url = "https://gateway-wdc.watsonplatform.net/assistant/api"

Versioning

API requests require a version parameter that takes a date in the format version=YYYY-MM-DD. When we change the API in a backwards-incompatible way, we release a new version date.

Send the version parameter with every API request. The service uses the API version for the date you specify, or the most recent version before that date. Don't default to the current date. Instead, specify a date that matches a version that is compatible with your app, and don't change it until your app is ready for a later version.

Specify the version to use on API requests with the version parameter when you create the service instance. The service uses the API version for the date you specify, or the most recent version before that date. Don't default to the current date. Instead, specify a date that matches a version that is compatible with your app, and don't change it until your app is ready for a later version.

This documentation describes the current version of Watson Assistant, 2018-09-20. In some cases, differences in earlier versions are noted in the descriptions of parameters and response models.

Error handling

The Watson Assistant service uses standard HTTP response codes to indicate whether a method completed successfully. HTTP response codes in the 2xx range indicate success. A response in the 4xx range is some sort of failure, and a response in the 5xx range usually indicates an internal system error that cannot be resolved by the user. Response codes are listed with the method.

ErrorResponse

Name Description
code
integer
The HTTP response code.
error
string
General description of an error.
errors
ErrorDetail[]
Collection of specific constraint violations associated with the error.

ErrorDetail

Name Description
message
string
Description of a specific constraint violation.
path
string
The location of the constraint violation.

The Java SDK generates an exception for any unsuccessful method invocation. All methods that accept an argument can also throw an IllegalArgumentException.

Exception Description
IllegalArgumentException An illegal argument was passed to the method.

When the Java SDK receives an error response from the Watson Assistant service, it generates an exception from the com.ibm.watson.developer_cloud.service.exception package. All service exceptions contain the following fields:

Field Description
statusCode The HTTP response code returned.
message A message that describes the error.

When the Node SDK receives an error response from the Watson Assistant service, it creates an Error object with information that describes the error that occurred. This error object is passed as the first parameter to the callback function for the method. The contents of the error object are as shown in the following table.

Error

Field Description
code The HTTP response code returned.
message A message that describes the error.

The Python SDK generates an exception for any unsuccessful method invocation. When the Python SDK receives an error response from the Watson Assistant service, it generates a WatsonApiException that contains the following fields.

Field Description
code The HTTP response code returned.
message A message that describes the error.
info A dictionary of additional information about the error.

When the Ruby SDK receives an error response from the Watson Assistant service, it generates a WatsonApiException that contains the following fields.

Field Description
code The HTTP response code returned.
message A message that describes the error.
info A dictionary of additional information about the error.

Example error handling

try {
    // Invoke a Watson Assistant method
} catch (NotFoundException e) {
    // Handle Not Found (404) exception
} catch (RequestTooLargeException e) {
    // Handle Request Too Large (413) exception
} catch (ServiceResponseException e) {
    // Base class for all exceptions caused by error responses from the service
    System.out.println("Service returned status code " + e.getStatusCode() + ": " + e.getMessage());
}

Example error handling

assistant.method(params,
  function (err, response) {
    // The error will be the first argument of the callback
    if (err.code == 404) {
      // Handle Not Found (404) error
    } else if (err.code == 413) {
      // Handle Request Too Large (413) error
    } else {
      console.log('Unexpected error: ', err.code);
      console.log('error:', err);
    }
  });

Example error handling

from watson_developer_cloud import WatsonApiException
try:
    # Invoke a Watson Assistant method
except WatsonApiException as ex:
    print "Method failed with status code " + str(ex.code) + ": " + ex.message

Example error handling

require "ibm_watson"
begin
  # Invoke a Watson Assistant method
rescue WatsonApiException => ex
  print "Method failed with status code #{ex.code}: #{ex.error}"
end

Data handling

Additional headers

Some Watson services accept special parameters in headers that are passed with the request. You can pass request header parameters in all requests or in a single request to the service.

To pass header parameters with every request, use the setDefaultHeaders method of the service object. See Data collection for an example use of this method.

To pass header parameters in a single request, use the addHeader method as a modifier on the request before you execute the request.

To pass header parameters with every request, specify the headers parameter when you create the service object. See Data collection for an example use of this method.

To pass header parameters in a single request, use the headers method as a modifier on the request before you execute the request.

To pass header parameters with every request, specify the set_default_headers method of the service object. See Data collection for an example use of this method.

To pass header parameters in a single request, include headers as a dict in the request.

To pass header parameters with every request, specify the add_default_headers method of the service object. See Data collection for an example use of this method.

To pass header parameters with every request, specify the headers method as a chainable method in the request.

Example header parameter in a request

ReturnType returnValue = assistant.methodName(parameters)
        .addHeader("Custom-Header", "{header_value}")
        .execute();

Example header parameter in a request

assistant.methodName({
  parameters,
  headers: {
    'Custom-Header': '{header_value}'
  }
},
  function (err, response) {
    if (err) {
      console.log('error:', err);
    } else {
      console.log(response);
    }
  }
);

Example header parameter in a request

response = assistant.methodName(
    parameters,
    headers = {
        'Custom-Header': '{header_value}'
    })

Example header parameter in a request

response = assistant.headers(
  "Custom-Header" => "{header_value}"
).methodName(parameters)

Response details

The Watson Assistant service might return information to the application in response headers.

To access information in the response headers, use one of the request methods that returns details with the response: executeWithDetails(), enqueueWithDetails(), or rxWithDetails(). These methods return a Response<T> object, where T is the expected response model. Use the getResult() method to access the response object for the method, and use the getHeaders() method to access information in response headers.

Example request to access response headers

Response<ReturnType> response = assistant.methodName(parameters)
        .executeWithDetails();
// Access response from methodName
ReturnType returnValue = response.getResult();
// Access information in response headers
Headers responseHeaders = response.getHeaders();

To access information in the response headers, specify the headers attribute on the third parameter (response) that is passed to the callback function.

Example request to access response headers

assistant.methodName({
  parameters
},
  function (err, result, response) {
    if (err) {
      console.log('error:', err);
    } else {
      console.log(response.headers);
    }
  }
);

The return value from all service methods is a DetailedResponse object. To access information in the result object or response headers, use the following methods.

DetailedResponse

Method Description
get_result() Returns the response for the service-specific method.
get_headers() Returns the response header information.
get_status_code() Returns the HTTP status code.

Example request to access response headers

assistant.set_detailed_response(True)
response = assistant.methodName(parameters)
// Access response from methodName
print(json.dumps(response.get_result(), indent=2))
// Access information in response headers
print(response.get_headers())
// Access HTTP response status
print(response.get_status_code())

The return value from all service methods is a DetailedResponse object. To access information in the response object, use the following properties.

DetailedResponse

Property Description
result Returns the response for the service-specific method.
headers Returns the response header information.
status Returns the HTTP status code.

Example request to access response headers

response = assistant.methodName(parameters)
# Access response from methodName
print response.result
# Access information in response headers
print response.headers
# Access HTTP response status
print response.status

Data labels

You can remove customer data if you associate the customer and the data when you send the information to a service. First you label the data with a customer ID, and then you can delete the data by the ID.

  • Use the X-Watson-Metadata header to associate a customer ID with the data. By adding a customer ID to a request, you indicate that it contains data that belongs to that customer.

    Specify a random or generic string for the customer ID. Do not include personal data, such as an email address. Pass the string customer_id={id} as the argument of the header.

  • Use the Delete labeled data method to remove data that is associated with a customer ID.

Labeling data is used only by methods that accept customer data. For more information about Watson Assistant and labeling data, see Information security.

For more information about how to pass headers, see Additional headers.

Data collection

By default, all Watson services log requests and their results. Logging is done only to improve the services for future users. The logged data is not shared or made public.

To prevent IBM usage of your data for an API request, set one of the following options.

  • To prevent IBM from accessing user input and Watson responses, set the X-Watson-Learning-Opt-Out header parameter to true when sending a message. You must set the header on each message request that you do not want IBM to access for general service improvements.
  • To prevent IBM from accessing user input and Watson responses, set the X-Watson-Learning-Opt-Out header parameter to true when sending a message. You can set the header by using the setDefaultHeaders method of the service object object you use to send message requests that you do not want to be accessed.
  • To prevent IBM from accessing user input and Watson responses, set the X-Watson-Learning-Opt-Out header parameter to true when sending a message. You can set the header by using the headers parameter when you create the service object you use to send message requests that you do not want to be accessed.
  • To prevent IBM from accessing user input and Watson responses, set the X-Watson-Learning-Opt-Out header parameter to true when sending a message. You can set the header by using the set_default_headers method of the service object you use to send message requests that you do not want to be accessed.
  • To prevent IBM from accessing user input and Watson responses, set the X-Watson-Learning-Opt-Out header parameter to true when sending a message. You can set the header by using the add_default_headers method of the service object you use to send message requests that you do not want to be accessed.
  • To prevent IBM from accessing training data such as intents and entities, set the X-Watson-Learning-Opt-Out header parameter to true when creating or updating a workspace. This option marks the workspace as opted out, and no training data for that workspace will be used. (This option does not apply to messages, which must be opted out individually.)
  • To prevent IBM from accessing training data such as intents and entities, set the X-Watson-Learning-Opt-Out header parameter to true when creating or updating a workspace. This option marks the workspace as opted out, and no training data for that workspace will be used. (This option does not apply to messages, which must be opted out individually.) You can set the header by using the setDefaultHeaders method of the service object you use to create or update the workspace.
  • To prevent IBM from accessing training data such as intents and entities, set the X-Watson-Learning-Opt-Out header parameter to true when creating or updating a workspace. This option marks the workspace as opted out, and no training data for that workspace will be used. (This option does not apply to messages, which must be opted out individually.) You can set the header by using the headers parameter when you create the service object you use to create or update the workspace.
  • To prevent IBM from accessing training data such as intents and entities, set the X-Watson-Learning-Opt-Out header parameter to true when creating or updating a workspace. This option marks the workspace as opted out, and no training data for that workspace will be used. (This option does not apply to messages, which must be opted out individually.) You can set the header by using the set_default_headers method of the service object you use to create or update the workspace.
  • To prevent IBM from accessing training data such as intents and entities, set the X-Watson-Learning-Opt-Out header parameter to true when creating or updating a workspace. This option marks the workspace as opted out, and no training data for that workspace will be used. (This option does not apply to messages, which must be opted out individually.) You can set the header by using the add_default_headers method of the service object you use to create or update the workspace.
  • You can also mark a workspace as opted out by specifying a value of true for the learning_opt_out property in the JSON data used to create or update a workspace. This option applies only to training data, not to messages. (The HTTP header always overrides the JSON property, if both are specified.)

Example request

curl -u "apikey:{apikey}" -H "X-Watson-Learning-Opt-Out: true" "{url}/{method}"

Example request

Map<String, String> headers = new HashMap<String, String>();
headers.put("X-Watson-Learning-Opt-Out", "true");

assistant.setDefaultHeaders(headers);

Example request

var  = require('watson-developer-cloud/');

var assistant = new AssistantV1({
  version: '{version}',
  iam_apikey: '{apikey}',
  headers: {
    'X-Watson-Learning-Opt-Out': 'true'
  }
});

Example request

assistant.set_default_headers({'x-watson-learning-opt-out': "true"})

Example request

assistant.add_default_headers(headers: {"x-watson-learning-opt-out" => "true"})

Synchronous and asynchronous requests

The Java SDK supports both synchronous (blocking) and asynchronous (non-blocking) execution of service methods. All service methods implement the ServiceCall interface.

  • To call a method synchronously, use the execute method of the ServiceCall interface. You can call the execute method directly from an instance of the service.
  • To call a method asynchronously, use the enqueue method of the ServiceCall interface to receive a callback when the response arrives. The ServiceCallback interface of the method's argument provides onResponse and onFailure methods that you override to handle the callback.

The Ruby SDK supports both synchronous (blocking) and asynchronous (non-blocking) execution of service methods. All service methods implement the Concurrent::Async module. When you use the synchronous/asynchronous methods, an IVar object is returned. You access the DetailedResponse object by calling ivar_object.value.

For more information about the Ivar object, see the IVar class docs.

  • To call a method synchronously, either call the method directly, or use the .await chainable method of the Concurrent::Async module.

    Calling a method directly (without .await) returns a DetailedResponse object.

  • To call a method asynchronously, use the .async chainable method of the Concurrent::Async module.

You can call the .await and .async methods directly from an instance of the service.

Example synchronous request

ReturnType returnValue = assistant.method(parameters).execute();

Example asynchronous request

assistant.method(parameters).enqueue(new ServiceCallback<ReturnType>() {
        @Override public void onResponse(ReturnType response) {
            . . .
        }
        @Override public void onFailure(Exception e) {
            . . .
        }
    });

Example synchronous request

response = assistant.method_name(parameters)

or

response = assistant.await.method_name(parameters)

Example asynchronous request

response = assistant.async.method_name(parameters)

Rate limiting

Rate limits for API requests are enforced on a per-service-instance basis. If the number of requests for a particular method and endpoint reaches the request limit within the specified time window, no further requests are accepted until the timer expires. After the timer expires, a new time window begins with the next accepted request.

The response to each HTTP request includes headers you can use to determine whether you are close to the rate limit:

  • X-RateLimit-Reset: the time the current timer expires (in UNIX epoch time)
  • X-RateLimit-Remaining: the number of requests remaining in the current time window
  • X-RateLimit-Limit: the total number of requests allowed within the time window

An HTTP status code of 429 indicates that the rate limit has been exceeded.

The number of allowed requests, and the length of the time window, vary by method and endpoint. The reference information for each endpoint specifies the rate limit that applies.

Pagination

Some API requests might return a large number of results. To avoid performance issues, these results are returned one page at a time, with a limited number of results on each page.

The default page size is 100 objects. To use a different page size, use the page_limit query parameter.

To change the attribute by which results are sorted, use the sort query parameter. If you include multiple sort parameters on the same query, the results are sorted first by the first sorting attribute, then the second, and so on.

The supported sorting attributes vary by endpoint; for more information, see the API Reference information for each request.

For any request that uses pagination, the response includes a pagination object that specifies pagination information. This object includes two URLs you can use to make subsequent requests:

  • refresh_url: The URL for requesting the same page of results again.
  • next_url: The URL for requesting the next page of results. The next_url property is omitted if there are no more results.

These URLs retain the same page_limit and sort parameters that were used for the initial request.

Pagination

Name Description
refresh_url
string
The URL that will return the same page of results.
next_url
string
The URL that will return the next page of results, if any.
total
integer
Reserved for future use.
matched
integer
Reserved for future use.

Methods

Get response to user input

Send user input to a workspace and receive a response.

There is no rate limit for this operation.

Send user input to a workspace and receive a response.

There is no rate limit for this operation.

Send user input to a workspace and receive a response.

There is no rate limit for this operation.

Send user input to a workspace and receive a response.

There is no rate limit for this operation.

Send user input to a workspace and receive a response.

There is no rate limit for this operation.

POST /v1/workspaces/{workspace_id}/message
ServiceCall<MessageResponse> message(MessageOptions messageOptions)
message(params, callback())
message(self, workspace_id, input=None, alternate_intents=None, context=None, entities=None, intents=None, output=None, nodes_visited_details=None, **kwargs)
message(workspace_id:, input: nil, alternate_intents: nil, context: nil, entities: nil, intents: nil, output: nil, nodes_visited_details: nil)
Request

Use the MessageOptions.Builder to create a MessageOptions object that contains the parameter values for the message method.

Path Parameters

  • Unique identifier of the workspace.

Query Parameters

  • Release date of the API version you want to use. Specify dates in YYYY-MM-DD format. The current version is 2018-09-20.

    Constraints: matches regular expression ^\d{4}-\d{2}-\d{2}$

  • Whether to include additional diagnostic information about the dialog nodes that were visited during processing of the message.

    Default: false

The message to be sent. This includes the user's input, along with optional intents, entities, and context from the last response.

Example:
  • The user input.

  • Whether to return more than one intent. Set to true to return all matching intents.

    Default: false

  • State information for the conversation. To maintain state, include the context from the previous response.

  • Entities to use when evaluating the message. Include entities from the previous response to continue using those entities rather than detecting entities in the new input.

  • Intents to use when evaluating the user input. Include intents from the previous response to continue using those intents rather than trying to recognize intents in the new input.

  • An output object that includes the response to the user, the dialog nodes that were triggered, and messages from the log.

The message options.

  • Unique identifier of the workspace.

  • An input object that includes the input text.

    • The text of the user input. This string cannot contain carriage return, newline, or tab characters, and it must be no longer than 2048 characters.

  • Whether to return more than one intent. Set to true to return all matching intents.

    Default: false

  • State information for the conversation. Continue a conversation by including the context object from the previous response.

    • The unique identifier of the conversation.

    • For internal use only.

  • Entities to use when evaluating the message. Include entities from the previous response to continue using those entities rather than detecting entities in the new input.

    Example:
    • An entity detected in the input.

    • An array of zero-based character offsets that indicate where the detected entity values begin and end in the input text.

      Constraints: number of items = 2

    • The term in the input text that was recognized as an entity value.

    • A decimal percentage that represents Watson's confidence in the entity.

    • Any metadata for the entity.

    • The recognized capture groups for the entity, as defined by the entity pattern.

      • A recognized capture group for the entity.

      • Zero-based character offsets that indicate where the entity value begins and ends in the input text.

        Constraints: number of items = 2

  • Intents to use when evaluating the user input. Include intents from the previous response to continue using those intents rather than trying to recognize intents in the new input.

    • The name of the recognized intent.

    • A decimal percentage that represents Watson's confidence in the intent.

  • System output. Include the output from the previous response to maintain intermediate information over multiple requests.

    • An array of up to 50 messages logged with the request.

      • The severity of the log message.

        Possible values: [info,error,warn]

      • The text of the log message.

    • An array of responses to the user.

    • Output intended for any channel. It is the responsibility of the client application to implement the supported response types.

      • The type of response returned by the dialog node. The specified response type must be supported by the client application or channel.

        Note: The suggestion response type is part of the disambiguation feature, which is only available for Premium users.

        Possible values: [text,pause,image,option,connect_to_agent,suggestion]

      • The text of the response.

      • How long to pause, in milliseconds.

      • Whether to send a "user is typing" event during the pause.

      • The URL of the image.

      • The title or introductory text to show before the response.

      • The description to show with the the response.

      • The preferred type of control to display.

        Possible values: [dropdown,button]

      • An array of objects describing the options from which the user can choose.

        • The user-facing label for the option.

        • An object defining the message input to be sent to the Watson Assistant service if the user selects the corresponding option.

          • The user input.

            • The text of the user input. This string cannot contain carriage return, newline, or tab characters, and it must be no longer than 2048 characters.

      • A message to be sent to the human agent who will be taking over the conversation.

      • A label identifying the topic of the conversation, derived from the user_label property of the relevant node.

      • An array of objects describing the possible matching dialog nodes from which the user can choose.

        Note: The suggestions property is part of the disambiguation feature, which is only available for Premium users.

        • The user-facing label for the disambiguation option. This label is taken from the user_label property of the corresponding dialog node.

        • An object defining the message input, intents, and entities to be sent to the Watson Assistant service if the user selects the corresponding disambiguation option.

          • The user input.

            • The text of the user input. This string cannot contain carriage return, newline, or tab characters, and it must be no longer than 2048 characters.

          • An array of intents to be sent along with the user input.

            • The name of the recognized intent.

            • A decimal percentage that represents Watson's confidence in the intent.

          • An array of entities to be sent along with the user input.

            Example:
            • An entity detected in the input.

            • An array of zero-based character offsets that indicate where the detected entity values begin and end in the input text.

              Constraints: number of items = 2

            • The term in the input text that was recognized as an entity value.

            • A decimal percentage that represents Watson's confidence in the entity.

            • Any metadata for the entity.

            • The recognized capture groups for the entity, as defined by the entity pattern.

              • A recognized capture group for the entity.

              • Zero-based character offsets that indicate where the entity value begins and ends in the input text.

                Constraints: number of items = 2

        • The dialog output that will be returned from the Watson Assistant service if the user selects the corresponding option.

    • An array of the nodes that were triggered to create the response, in the order in which they were visited. This information is useful for debugging and for tracing the path taken through the node tree.

    • An array of objects containing detailed diagnostic information about the nodes that were triggered during processing of the input message. Included only if nodes_visited_details is set to true in the message request.

      • A dialog node that was triggered during processing of the input message.

      • The title of the dialog node.

      • The conditions that trigger the dialog node.

  • Whether to include additional diagnostic information about the dialog nodes that were visited during processing of the message.

    Default: false

parameters

  • Unique identifier of the workspace.

  • An input object that includes the input text.

    • The text of the user input. This string cannot contain carriage return, newline, or tab characters, and it must be no longer than 2048 characters.

  • Whether to return more than one intent. Set to true to return all matching intents.

    Default: false

  • State information for the conversation. Continue a conversation by including the context object from the previous response.

    • The unique identifier of the conversation.

    • For internal use only.

  • Entities to use when evaluating the message. Include entities from the previous response to continue using those entities rather than detecting entities in the new input.

    Example:
    • An entity detected in the input.

    • An array of zero-based character offsets that indicate where the detected entity values begin and end in the input text.

      Constraints: number of items = 2

    • The term in the input text that was recognized as an entity value.

    • A decimal percentage that represents Watson's confidence in the entity.

    • Any metadata for the entity.

    • The recognized capture groups for the entity, as defined by the entity pattern.

      • A recognized capture group for the entity.

      • Zero-based character offsets that indicate where the entity value begins and ends in the input text.

        Constraints: number of items = 2

  • Intents to use when evaluating the user input. Include intents from the previous response to continue using those intents rather than trying to recognize intents in the new input.

    • The name of the recognized intent.

    • A decimal percentage that represents Watson's confidence in the intent.

  • System output. Include the output from the previous response to maintain intermediate information over multiple requests.

    • An array of up to 50 messages logged with the request.

      • The severity of the log message.

        Possible values: [info,error,warn]

      • The text of the log message.

    • An array of responses to the user.

    • Output intended for any channel. It is the responsibility of the client application to implement the supported response types.

      • The type of response returned by the dialog node. The specified response type must be supported by the client application or channel.

        Note: The suggestion response type is part of the disambiguation feature, which is only available for Premium users.

        Possible values: [text,pause,image,option,connect_to_agent,suggestion]

      • The text of the response.

      • How long to pause, in milliseconds.

      • Whether to send a "user is typing" event during the pause.

      • The URL of the image.

      • The title or introductory text to show before the response.

      • The description to show with the the response.

      • The preferred type of control to display.

        Possible values: [dropdown,button]

      • An array of objects describing the options from which the user can choose.

        • The user-facing label for the option.

        • An object defining the message input to be sent to the Watson Assistant service if the user selects the corresponding option.

          • The user input.

            • The text of the user input. This string cannot contain carriage return, newline, or tab characters, and it must be no longer than 2048 characters.

      • A message to be sent to the human agent who will be taking over the conversation.

      • A label identifying the topic of the conversation, derived from the user_label property of the relevant node.

      • An array of objects describing the possible matching dialog nodes from which the user can choose.

        Note: The suggestions property is part of the disambiguation feature, which is only available for Premium users.

        • The user-facing label for the disambiguation option. This label is taken from the user_label property of the corresponding dialog node.

        • An object defining the message input, intents, and entities to be sent to the Watson Assistant service if the user selects the corresponding disambiguation option.

          • The user input.

            • The text of the user input. This string cannot contain carriage return, newline, or tab characters, and it must be no longer than 2048 characters.

          • An array of intents to be sent along with the user input.

            • The name of the recognized intent.

            • A decimal percentage that represents Watson's confidence in the intent.

          • An array of entities to be sent along with the user input.

            Example:
            • An entity detected in the input.

            • An array of zero-based character offsets that indicate where the detected entity values begin and end in the input text.

              Constraints: number of items = 2

            • The term in the input text that was recognized as an entity value.

            • A decimal percentage that represents Watson's confidence in the entity.

            • Any metadata for the entity.

            • The recognized capture groups for the entity, as defined by the entity pattern.

              • A recognized capture group for the entity.

              • Zero-based character offsets that indicate where the entity value begins and ends in the input text.

                Constraints: number of items = 2

        • The dialog output that will be returned from the Watson Assistant service if the user selects the corresponding option.

    • An array of the nodes that were triggered to create the response, in the order in which they were visited. This information is useful for debugging and for tracing the path taken through the node tree.

    • An array of objects containing detailed diagnostic information about the nodes that were triggered during processing of the input message. Included only if nodes_visited_details is set to true in the message request.

      • A dialog node that was triggered during processing of the input message.

      • The title of the dialog node.

      • The conditions that trigger the dialog node.

  • Whether to include additional diagnostic information about the dialog nodes that were visited during processing of the message.

    Default: false

parameters

  • Unique identifier of the workspace.

  • An input object that includes the input text.

    • The text of the user input. This string cannot contain carriage return, newline, or tab characters, and it must be no longer than 2048 characters.

  • Whether to return more than one intent. Set to true to return all matching intents.

    Default: false

  • State information for the conversation. Continue a conversation by including the context object from the previous response.

    • The unique identifier of the conversation.

    • For internal use only.

  • Entities to use when evaluating the message. Include entities from the previous response to continue using those entities rather than detecting entities in the new input.

    Example:
    • An entity detected in the input.

    • An array of zero-based character offsets that indicate where the detected entity values begin and end in the input text.

      Constraints: number of items = 2

    • The term in the input text that was recognized as an entity value.

    • A decimal percentage that represents Watson's confidence in the entity.

    • Any metadata for the entity.

    • The recognized capture groups for the entity, as defined by the entity pattern.

      • A recognized capture group for the entity.

      • Zero-based character offsets that indicate where the entity value begins and ends in the input text.

        Constraints: number of items = 2

  • Intents to use when evaluating the user input. Include intents from the previous response to continue using those intents rather than trying to recognize intents in the new input.

    • The name of the recognized intent.

    • A decimal percentage that represents Watson's confidence in the intent.

  • System output. Include the output from the previous response to maintain intermediate information over multiple requests.

    • An array of up to 50 messages logged with the request.

      • The severity of the log message.

        Possible values: [info,error,warn]

      • The text of the log message.

    • An array of responses to the user.

    • Output intended for any channel. It is the responsibility of the client application to implement the supported response types.

      • The type of response returned by the dialog node. The specified response type must be supported by the client application or channel.

        Note: The suggestion response type is part of the disambiguation feature, which is only available for Premium users.

        Possible values: [text,pause,image,option,connect_to_agent,suggestion]

      • The text of the response.

      • How long to pause, in milliseconds.

      • Whether to send a "user is typing" event during the pause.

      • The URL of the image.

      • The title or introductory text to show before the response.

      • The description to show with the the response.

      • The preferred type of control to display.

        Possible values: [dropdown,button]

      • An array of objects describing the options from which the user can choose.

        • The user-facing label for the option.

        • An object defining the message input to be sent to the Watson Assistant service if the user selects the corresponding option.

          • The user input.

            • The text of the user input. This string cannot contain carriage return, newline, or tab characters, and it must be no longer than 2048 characters.

      • A message to be sent to the human agent who will be taking over the conversation.

      • A label identifying the topic of the conversation, derived from the user_label property of the relevant node.

      • An array of objects describing the possible matching dialog nodes from which the user can choose.

        Note: The suggestions property is part of the disambiguation feature, which is only available for Premium users.

        • The user-facing label for the disambiguation option. This label is taken from the user_label property of the corresponding dialog node.

        • An object defining the message input, intents, and entities to be sent to the Watson Assistant service if the user selects the corresponding disambiguation option.

          • The user input.

            • The text of the user input. This string cannot contain carriage return, newline, or tab characters, and it must be no longer than 2048 characters.

          • An array of intents to be sent along with the user input.

            • The name of the recognized intent.

            • A decimal percentage that represents Watson's confidence in the intent.

          • An array of entities to be sent along with the user input.

            Example:
            • An entity detected in the input.

            • An array of zero-based character offsets that indicate where the detected entity values begin and end in the input text.

              Constraints: number of items = 2

            • The term in the input text that was recognized as an entity value.

            • A decimal percentage that represents Watson's confidence in the entity.

            • Any metadata for the entity.

            • The recognized capture groups for the entity, as defined by the entity pattern.

              • A recognized capture group for the entity.

              • Zero-based character offsets that indicate where the entity value begins and ends in the input text.

                Constraints: number of items = 2

        • The dialog output that will be returned from the Watson Assistant service if the user selects the corresponding option.

    • An array of the nodes that were triggered to create the response, in the order in which they were visited. This information is useful for debugging and for tracing the path taken through the node tree.

    • An array of objects containing detailed diagnostic information about the nodes that were triggered during processing of the input message. Included only if nodes_visited_details is set to true in the message request.

      • A dialog node that was triggered during processing of the input message.

      • The title of the dialog node.

      • The conditions that trigger the dialog node.

  • Whether to include additional diagnostic information about the dialog nodes that were visited during processing of the message.

    Default: false

parameters

  • Unique identifier of the workspace.

  • An input object that includes the input text.

    • The text of the user input. This string cannot contain carriage return, newline, or tab characters, and it must be no longer than 2048 characters.

  • Whether to return more than one intent. Set to true to return all matching intents.

    Default: false

  • State information for the conversation. Continue a conversation by including the context object from the previous response.

    • The unique identifier of the conversation.

    • For internal use only.

  • Entities to use when evaluating the message. Include entities from the previous response to continue using those entities rather than detecting entities in the new input.

    Example:
    • An entity detected in the input.

    • An array of zero-based character offsets that indicate where the detected entity values begin and end in the input text.

      Constraints: number of items = 2

    • The term in the input text that was recognized as an entity value.

    • A decimal percentage that represents Watson's confidence in the entity.

    • Any metadata for the entity.

    • The recognized capture groups for the entity, as defined by the entity pattern.

      • A recognized capture group for the entity.

      • Zero-based character offsets that indicate where the entity value begins and ends in the input text.

        Constraints: number of items = 2

  • Intents to use when evaluating the user input. Include intents from the previous response to continue using those intents rather than trying to recognize intents in the new input.

    • The name of the recognized intent.

    • A decimal percentage that represents Watson's confidence in the intent.

  • System output. Include the output from the previous response to maintain intermediate information over multiple requests.

    • An array of up to 50 messages logged with the request.

      • The severity of the log message.

        Possible values: [info,error,warn]

      • The text of the log message.

    • An array of responses to the user.

    • Output intended for any channel. It is the responsibility of the client application to implement the supported response types.

      • The type of response returned by the dialog node. The specified response type must be supported by the client application or channel.

        Note: The suggestion response type is part of the disambiguation feature, which is only available for Premium users.

        Possible values: [text,pause,image,option,connect_to_agent,suggestion]

      • The text of the response.

      • How long to pause, in milliseconds.

      • Whether to send a "user is typing" event during the pause.

      • The URL of the image.

      • The title or introductory text to show before the response.

      • The description to show with the the response.

      • The preferred type of control to display.

        Possible values: [dropdown,button]

      • An array of objects describing the options from which the user can choose.

        • The user-facing label for the option.

        • An object defining the message input to be sent to the Watson Assistant service if the user selects the corresponding option.

          • The user input.

            • The text of the user input. This string cannot contain carriage return, newline, or tab characters, and it must be no longer than 2048 characters.

      • A message to be sent to the human agent who will be taking over the conversation.

      • A label identifying the topic of the conversation, derived from the user_label property of the relevant node.

      • An array of objects describing the possible matching dialog nodes from which the user can choose.

        Note: The suggestions property is part of the disambiguation feature, which is only available for Premium users.

        • The user-facing label for the disambiguation option. This label is taken from the user_label property of the corresponding dialog node.

        • An object defining the message input, intents, and entities to be sent to the Watson Assistant service if the user selects the corresponding disambiguation option.

          • The user input.

            • The text of the user input. This string cannot contain carriage return, newline, or tab characters, and it must be no longer than 2048 characters.

          • An array of intents to be sent along with the user input.

            • The name of the recognized intent.

            • A decimal percentage that represents Watson's confidence in the intent.

          • An array of entities to be sent along with the user input.

            Example:
            • An entity detected in the input.

            • An array of zero-based character offsets that indicate where the detected entity values begin and end in the input text.

              Constraints: number of items = 2

            • The term in the input text that was recognized as an entity value.

            • A decimal percentage that represents Watson's confidence in the entity.

            • Any metadata for the entity.

            • The recognized capture groups for the entity, as defined by the entity pattern.

              • A recognized capture group for the entity.

              • Zero-based character offsets that indicate where the entity value begins and ends in the input text.

                Constraints: number of items = 2

        • The dialog output that will be returned from the Watson Assistant service if the user selects the corresponding option.

    • An array of the nodes that were triggered to create the response, in the order in which they were visited. This information is useful for debugging and for tracing the path taken through the node tree.

    • An array of objects containing detailed diagnostic information about the nodes that were triggered during processing of the input message. Included only if nodes_visited_details is set to true in the message request.

      • A dialog node that was triggered during processing of the input message.

      • The title of the dialog node.

      • The conditions that trigger the dialog node.

  • Whether to include additional diagnostic information about the dialog nodes that were visited during processing of the message.

    Default: false

Example request
curl -X POST -u "apikey:{apikey}" --header "Content-Type:application/json" --data "{\"input\": {\"text\": \"Hello\"}}" "https://gateway.watsonplatform.net/assistant/api/v1/workspaces/{workspace_id}/message?version=2018-09-20"
Example request
IamOptions iamOptions = new IamOptions.Builder().apiKey("{apiKey}").build();
Assistant service = new Assistant("2018-09-20", iamOptions);

String workspaceId = "{workspace_id}";

InputData input = new InputData.Builder("Hello").build();

MessageOptions options = new MessageOptions.Builder(workspaceId)
  .input(input)
  .build();

MessageResponse response = service.message(options).execute();

System.out.println(response);
Example request
var watson = require('watson-developer-cloud');

var assistant = new watson.AssistantV1({
  iam_apikey: '{apikey}',
  version: '2018-09-20'
});

assistant.message({
  workspace_id: '{workspace_id}',
  input: {'text': 'Hello'}
},  function(err, response) {
  if (err)
    console.log('error:', err);
  else
    console.log(JSON.stringify(response, null, 2));
});
Example request
import json
import watson_developer_cloud

assistant = watson_developer_cloud.AssistantV1(
    iam_apikey='{apikey}',
    version='2018-09-20'
)

response = assistant.message(
    workspace_id='{workspace_id}',
    input={
        'text': 'Hello'
    }
).get_result()

print(json.dumps(response, indent=2))
Example request
require "json"
require "ibm_watson/assistant_v1"
include IBMWatson

assistant = AssistantV1.new(
  iam_apikey: "{apikey}",
  version: "2018-09-20"
)

response = assistant.message(
  workspace_id: "{workspace_id}",
  input: {
    text: "Hello"
  }
)

puts JSON.pretty_generate(response.result)
Response

A response from the Watson Assistant service.

  • An array of intents recognized in the user input, sorted in descending order of confidence

  • An array of entities identified in the user input

  • State information for the conversation. To maintain state, include the context from the previous response.

  • An output object that includes the response to the user, the dialog nodes that were triggered, and messages from the log.

  • The text of the user input.

  • Whether to return more than one intent. A value of true indicates that all matching intents are returned.

    Default: false

  • An array of objects describing any actions requested by the dialog node.

A response from the Watson Assistant service.

  • The user input from the request.

    • The user's input.

  • An array of intents recognized in the user input, sorted in descending order of confidence.

    • The name of the recognized intent.

    • A decimal percentage that represents Watson's confidence in the intent.

  • An array of entities identified in the user input.

    Example:
    • An entity detected in the input.

    • An array of zero-based character offsets that indicate where the detected entity values begin and end in the input text.

      Constraints: number of items = 2

    • The term in the input text that was recognized as an entity value.

    • A decimal percentage that represents Watson's confidence in the entity.

    • Any metadata for the entity.

    • The recognized capture groups for the entity, as defined by the entity pattern.

      • A recognized capture group for the entity.

      • Zero-based character offsets that indicate where the entity value begins and ends in the input text.

        Constraints: number of items = 2

  • Whether to return more than one intent. A value of true indicates that all matching intents are returned.

    Default: false

  • State information for the conversation.

    • The unique identifier of the conversation.

    • For internal use only.

  • Output from the dialog, including the response to the user, the nodes that were triggered, and log messages.

    • An array of up to 50 messages logged with the request.

      • The severity of the log message.

        Possible values: [info,error,warn]

      • The text of the log message.

    • An array of responses to the user.

    • Output intended for any channel. It is the responsibility of the client application to implement the supported response types.

      • The type of response returned by the dialog node. The specified response type must be supported by the client application or channel.

        Note: The suggestion response type is part of the disambiguation feature, which is only available for Premium users.

        Possible values: [text,pause,image,option,connect_to_agent,suggestion]

      • The text of the response.

      • How long to pause, in milliseconds.

      • Whether to send a "user is typing" event during the pause.

      • The URL of the image.

      • The title or introductory text to show before the response.

      • The description to show with the the response.

      • The preferred type of control to display.

        Possible values: [dropdown,button]

      • An array of objects describing the options from which the user can choose.

        • The user-facing label for the option.

        • An object defining the message input to be sent to the Watson Assistant service if the user selects the corresponding option.

          • The user input.

            • The text of the user input. This string cannot contain carriage return, newline, or tab characters, and it must be no longer than 2048 characters.

      • A message to be sent to the human agent who will be taking over the conversation.

      • A label identifying the topic of the conversation, derived from the user_label property of the relevant node.

      • An array of objects describing the possible matching dialog nodes from which the user can choose.

        Note: The suggestions property is part of the disambiguation feature, which is only available for Premium users.

        • The user-facing label for the disambiguation option. This label is taken from the user_label property of the corresponding dialog node.

        • An object defining the message input, intents, and entities to be sent to the Watson Assistant service if the user selects the corresponding disambiguation option.

          • The user input.

            • The text of the user input. This string cannot contain carriage return, newline, or tab characters, and it must be no longer than 2048 characters.

          • An array of intents to be sent along with the user input.

            • The name of the recognized intent.

            • A decimal percentage that represents Watson's confidence in the intent.

          • An array of entities to be sent along with the user input.

            Example:
            • An entity detected in the input.

            • An array of zero-based character offsets that indicate where the detected entity values begin and end in the input text.

              Constraints: number of items = 2

            • The term in the input text that was recognized as an entity value.

            • A decimal percentage that represents Watson's confidence in the entity.

            • Any metadata for the entity.

            • The recognized capture groups for the entity, as defined by the entity pattern.

              • A recognized capture group for the entity.

              • Zero-based character offsets that indicate where the entity value begins and ends in the input text.

                Constraints: number of items = 2

        • The dialog output that will be returned from the Watson Assistant service if the user selects the corresponding option.

    • An array of the nodes that were triggered to create the response, in the order in which they were visited. This information is useful for debugging and for tracing the path taken through the node tree.

    • An array of objects containing detailed diagnostic information about the nodes that were triggered during processing of the input message. Included only if nodes_visited_details is set to true in the message request.

      • A dialog node that was triggered during processing of the input message.

      • The title of the dialog node.

      • The conditions that trigger the dialog node.

  • An array of objects describing any actions requested by the dialog node.

    • The name of the action.

    • The type of action to invoke.

      Possible values: [client,server,cloud_function,web_action]

      Default: client

    • A map of key/value pairs to be provided to the action.

    • The location in the dialog context where the result of the action is stored.

    • The name of the context variable that the client application will use to pass in credentials for the action.

A response from the Watson Assistant service.

  • The user input from the request.

    • The user's input.

  • An array of intents recognized in the user input, sorted in descending order of confidence.

    • The name of the recognized intent.

    • A decimal percentage that represents Watson's confidence in the intent.

  • An array of entities identified in the user input.

    Example:
    • An entity detected in the input.

    • An array of zero-based character offsets that indicate where the detected entity values begin and end in the input text.

      Constraints: number of items = 2

    • The term in the input text that was recognized as an entity value.

    • A decimal percentage that represents Watson's confidence in the entity.

    • Any metadata for the entity.

    • The recognized capture groups for the entity, as defined by the entity pattern.

      • A recognized capture group for the entity.

      • Zero-based character offsets that indicate where the entity value begins and ends in the input text.

        Constraints: number of items = 2

  • Whether to return more than one intent. A value of true indicates that all matching intents are returned.

    Default: false

  • State information for the conversation.

    • The unique identifier of the conversation.

    • For internal use only.

  • Output from the dialog, including the response to the user, the nodes that were triggered, and log messages.

    • An array of up to 50 messages logged with the request.

      • The severity of the log message.

        Possible values: [info,error,warn]

      • The text of the log message.

    • An array of responses to the user.

    • Output intended for any channel. It is the responsibility of the client application to implement the supported response types.

      • The type of response returned by the dialog node. The specified response type must be supported by the client application or channel.

        Note: The suggestion response type is part of the disambiguation feature, which is only available for Premium users.

        Possible values: [text,pause,image,option,connect_to_agent,suggestion]

      • The text of the response.

      • How long to pause, in milliseconds.

      • Whether to send a "user is typing" event during the pause.

      • The URL of the image.

      • The title or introductory text to show before the response.

      • The description to show with the the response.

      • The preferred type of control to display.

        Possible values: [dropdown,button]

      • An array of objects describing the options from which the user can choose.

        • The user-facing label for the option.

        • An object defining the message input to be sent to the Watson Assistant service if the user selects the corresponding option.

          • The user input.

            • The text of the user input. This string cannot contain carriage return, newline, or tab characters, and it must be no longer than 2048 characters.

      • A message to be sent to the human agent who will be taking over the conversation.

      • A label identifying the topic of the conversation, derived from the user_label property of the relevant node.

      • An array of objects describing the possible matching dialog nodes from which the user can choose.

        Note: The suggestions property is part of the disambiguation feature, which is only available for Premium users.

        • The user-facing label for the disambiguation option. This label is taken from the user_label property of the corresponding dialog node.

        • An object defining the message input, intents, and entities to be sent to the Watson Assistant service if the user selects the corresponding disambiguation option.

          • The user input.

            • The text of the user input. This string cannot contain carriage return, newline, or tab characters, and it must be no longer than 2048 characters.

          • An array of intents to be sent along with the user input.

            • The name of the recognized intent.

            • A decimal percentage that represents Watson's confidence in the intent.

          • An array of entities to be sent along with the user input.

            Example:
            • An entity detected in the input.

            • An array of zero-based character offsets that indicate where the detected entity values begin and end in the input text.

              Constraints: number of items = 2

            • The term in the input text that was recognized as an entity value.

            • A decimal percentage that represents Watson's confidence in the entity.

            • Any metadata for the entity.

            • The recognized capture groups for the entity, as defined by the entity pattern.

              • A recognized capture group for the entity.

              • Zero-based character offsets that indicate where the entity value begins and ends in the input text.

                Constraints: number of items = 2

        • The dialog output that will be returned from the Watson Assistant service if the user selects the corresponding option.

    • An array of the nodes that were triggered to create the response, in the order in which they were visited. This information is useful for debugging and for tracing the path taken through the node tree.

    • An array of objects containing detailed diagnostic information about the nodes that were triggered during processing of the input message. Included only if nodes_visited_details is set to true in the message request.

      • A dialog node that was triggered during processing of the input message.

      • The title of the dialog node.

      • The conditions that trigger the dialog node.

  • An array of objects describing any actions requested by the dialog node.

    • The name of the action.

    • The type of action to invoke.

      Possible values: [client,server,cloud_function,web_action]

      Default: client

    • A map of key/value pairs to be provided to the action.

    • The location in the dialog context where the result of the action is stored.

    • The name of the context variable that the client application will use to pass in credentials for the action.

A response from the Watson Assistant service.

  • The user input from the request.

    • The user's input.

  • An array of intents recognized in the user input, sorted in descending order of confidence.

    • The name of the recognized intent.

    • A decimal percentage that represents Watson's confidence in the intent.

  • An array of entities identified in the user input.

    Example:
    • An entity detected in the input.

    • An array of zero-based character offsets that indicate where the detected entity values begin and end in the input text.

      Constraints: number of items = 2

    • The term in the input text that was recognized as an entity value.

    • A decimal percentage that represents Watson's confidence in the entity.

    • Any metadata for the entity.

    • The recognized capture groups for the entity, as defined by the entity pattern.

      • A recognized capture group for the entity.

      • Zero-based character offsets that indicate where the entity value begins and ends in the input text.

        Constraints: number of items = 2

  • Whether to return more than one intent. A value of true indicates that all matching intents are returned.

    Default: false

  • State information for the conversation.

    • The unique identifier of the conversation.

    • For internal use only.

  • Output from the dialog, including the response to the user, the nodes that were triggered, and log messages.

    • An array of up to 50 messages logged with the request.

      • The severity of the log message.

        Possible values: [info,error,warn]

      • The text of the log message.

    • An array of responses to the user.

    • Output intended for any channel. It is the responsibility of the client application to implement the supported response types.

      • The type of response returned by the dialog node. The specified response type must be supported by the client application or channel.

        Note: The suggestion response type is part of the disambiguation feature, which is only available for Premium users.

        Possible values: [text,pause,image,option,connect_to_agent,suggestion]

      • The text of the response.

      • How long to pause, in milliseconds.

      • Whether to send a "user is typing" event during the pause.

      • The URL of the image.

      • The title or introductory text to show before the response.

      • The description to show with the the response.

      • The preferred type of control to display.

        Possible values: [dropdown,button]

      • An array of objects describing the options from which the user can choose.

        • The user-facing label for the option.

        • An object defining the message input to be sent to the Watson Assistant service if the user selects the corresponding option.

          • The user input.

            • The text of the user input. This string cannot contain carriage return, newline, or tab characters, and it must be no longer than 2048 characters.

      • A message to be sent to the human agent who will be taking over the conversation.

      • A label identifying the topic of the conversation, derived from the user_label property of the relevant node.

      • An array of objects describing the possible matching dialog nodes from which the user can choose.

        Note: The suggestions property is part of the disambiguation feature, which is only available for Premium users.

        • The user-facing label for the disambiguation option. This label is taken from the user_label property of the corresponding dialog node.

        • An object defining the message input, intents, and entities to be sent to the Watson Assistant service if the user selects the corresponding disambiguation option.

          • The user input.

            • The text of the user input. This string cannot contain carriage return, newline, or tab characters, and it must be no longer than 2048 characters.

          • An array of intents to be sent along with the user input.

            • The name of the recognized intent.

            • A decimal percentage that represents Watson's confidence in the intent.

          • An array of entities to be sent along with the user input.

            Example:
            • An entity detected in the input.

            • An array of zero-based character offsets that indicate where the detected entity values begin and end in the input text.

              Constraints: number of items = 2

            • The term in the input text that was recognized as an entity value.

            • A decimal percentage that represents Watson's confidence in the entity.

            • Any metadata for the entity.

            • The recognized capture groups for the entity, as defined by the entity pattern.

              • A recognized capture group for the entity.

              • Zero-based character offsets that indicate where the entity value begins and ends in the input text.

                Constraints: number of items = 2

        • The dialog output that will be returned from the Watson Assistant service if the user selects the corresponding option.

    • An array of the nodes that were triggered to create the response, in the order in which they were visited. This information is useful for debugging and for tracing the path taken through the node tree.

    • An array of objects containing detailed diagnostic information about the nodes that were triggered during processing of the input message. Included only if nodes_visited_details is set to true in the message request.

      • A dialog node that was triggered during processing of the input message.

      • The title of the dialog node.

      • The conditions that trigger the dialog node.

  • An array of objects describing any actions requested by the dialog node.

    • The name of the action.

    • The type of action to invoke.

      Possible values: [client,server,cloud_function,web_action]

      Default: client

    • A map of key/value pairs to be provided to the action.

    • The location in the dialog context where the result of the action is stored.

    • The name of the context variable that the client application will use to pass in credentials for the action.

A response from the Watson Assistant service.

  • The user input from the request.

    • The user's input.

  • An array of intents recognized in the user input, sorted in descending order of confidence.

    • The name of the recognized intent.

    • A decimal percentage that represents Watson's confidence in the intent.

  • An array of entities identified in the user input.

    Example:
    • An entity detected in the input.

    • An array of zero-based character offsets that indicate where the detected entity values begin and end in the input text.

      Constraints: number of items = 2

    • The term in the input text that was recognized as an entity value.

    • A decimal percentage that represents Watson's confidence in the entity.

    • Any metadata for the entity.

    • The recognized capture groups for the entity, as defined by the entity pattern.

      • A recognized capture group for the entity.

      • Zero-based character offsets that indicate where the entity value begins and ends in the input text.

        Constraints: number of items = 2

  • Whether to return more than one intent. A value of true indicates that all matching intents are returned.

    Default: false

  • State information for the conversation.

    • The unique identifier of the conversation.

    • For internal use only.

  • Output from the dialog, including the response to the user, the nodes that were triggered, and log messages.

    • An array of up to 50 messages logged with the request.

      • The severity of the log message.

        Possible values: [info,error,warn]

      • The text of the log message.

    • An array of responses to the user.

    • Output intended for any channel. It is the responsibility of the client application to implement the supported response types.

      • The type of response returned by the dialog node. The specified response type must be supported by the client application or channel.

        Note: The suggestion response type is part of the disambiguation feature, which is only available for Premium users.

        Possible values: [text,pause,image,option,connect_to_agent,suggestion]

      • The text of the response.

      • How long to pause, in milliseconds.

      • Whether to send a "user is typing" event during the pause.

      • The URL of the image.

      • The title or introductory text to show before the response.

      • The description to show with the the response.

      • The preferred type of control to display.

        Possible values: [dropdown,button]

      • An array of objects describing the options from which the user can choose.

        • The user-facing label for the option.

        • An object defining the message input to be sent to the Watson Assistant service if the user selects the corresponding option.

          • The user input.

            • The text of the user input. This string cannot contain carriage return, newline, or tab characters, and it must be no longer than 2048 characters.

      • A message to be sent to the human agent who will be taking over the conversation.

      • A label identifying the topic of the conversation, derived from the user_label property of the relevant node.

      • An array of objects describing the possible matching dialog nodes from which the user can choose.

        Note: The suggestions property is part of the disambiguation feature, which is only available for Premium users.

        • The user-facing label for the disambiguation option. This label is taken from the user_label property of the corresponding dialog node.

        • An object defining the message input, intents, and entities to be sent to the Watson Assistant service if the user selects the corresponding disambiguation option.

          • The user input.

            • The text of the user input. This string cannot contain carriage return, newline, or tab characters, and it must be no longer than 2048 characters.

          • An array of intents to be sent along with the user input.

            • The name of the recognized intent.

            • A decimal percentage that represents Watson's confidence in the intent.

          • An array of entities to be sent along with the user input.

            Example:
            • An entity detected in the input.

            • An array of zero-based character offsets that indicate where the detected entity values begin and end in the input text.

              Constraints: number of items = 2

            • The term in the input text that was recognized as an entity value.

            • A decimal percentage that represents Watson's confidence in the entity.

            • Any metadata for the entity.

            • The recognized capture groups for the entity, as defined by the entity pattern.

              • A recognized capture group for the entity.

              • Zero-based character offsets that indicate where the entity value begins and ends in the input text.

                Constraints: number of items = 2

        • The dialog output that will be returned from the Watson Assistant service if the user selects the corresponding option.

    • An array of the nodes that were triggered to create the response, in the order in which they were visited. This information is useful for debugging and for tracing the path taken through the node tree.

    • An array of objects containing detailed diagnostic information about the nodes that were triggered during processing of the input message. Included only if nodes_visited_details is set to true in the message request.

      • A dialog node that was triggered during processing of the input message.

      • The title of the dialog node.

      • The conditions that trigger the dialog node.

  • An array of objects describing any actions requested by the dialog node.

    • The name of the action.

    • The type of action to invoke.

      Possible values: [client,server,cloud_function,web_action]

      Default: client

    • A map of key/value pairs to be provided to the action.

    • The location in the dialog context where the result of the action is stored.

    • The name of the context variable that the client application will use to pass in credentials for the action.

Status Code

  • Successful request.

  • Invalid request.

Example Response

List workspaces

List the workspaces associated with a Watson Assistant service instance.

This operation is limited to 500 requests per 30 minutes. For more information, see Rate limiting.

List the workspaces associated with a Watson Assistant service instance.

This operation is limited to 500 requests per 30 minutes. For more information, see Rate limiting.

List the workspaces associated with a Watson Assistant service instance.

This operation is limited to 500 requests per 30 minutes. For more information, see Rate limiting.

List the workspaces associated with a Watson Assistant service instance.

This operation is limited to 500 requests per 30 minutes. For more information, see Rate limiting.

List the workspaces associated with a Watson Assistant service instance.

This operation is limited to 500 requests per 30 minutes. For more information, see Rate limiting.

GET /v1/workspaces
ServiceCall<WorkspaceCollection> listWorkspaces(ListWorkspacesOptions listWorkspacesOptions)
listWorkspaces(params, callback())
list_workspaces(self, page_limit=None, include_count=None, sort=None, cursor=None, include_audit=None, **kwargs)
list_workspaces(page_limit: nil, include_count: nil, sort: nil, cursor: nil, include_audit: nil)
Request

Use the ListWorkspacesOptions.Builder to create a ListWorkspacesOptions object that contains the parameter values for the listWorkspaces method.

Query Parameters

  • Release date of the API version you want to use. Specify dates in YYYY-MM-DD format. The current version is 2018-09-20.

    Constraints: matches regular expression ^\d{4}-\d{2}-\d{2}$

  • The number of records to return in each page of results.

    Default: 100

  • Whether to include information about the number of records returned.

    Default: false

  • The attribute by which returned results will be sorted. To reverse the sort order, prefix the value with a minus sign (-).

  • A token identifying the page of results to retrieve.

  • Whether to include the audit properties (created and updated timestamps) in the response.

    Default: false

The listWorkspaces options.

  • The number of records to return in each page of results.

  • Whether to include information about the number of records returned.

    Default: false

  • The attribute by which returned results will be sorted. To reverse the sort order, prefix the value with a minus sign (-).

  • A token identifying the page of results to retrieve.

  • Whether to include the audit properties (created and updated timestamps) in the response.

    Default: false

parameters

  • The number of records to return in each page of results.

    Default: 100

  • Whether to include information about the number of records returned.

    Default: false

  • The attribute by which returned results will be sorted. To reverse the sort order, prefix the value with a minus sign (-).

  • A token identifying the page of results to retrieve.

  • Whether to include the audit properties (created and updated timestamps) in the response.

    Default: false

parameters

  • The number of records to return in each page of results.

    Default: 100

  • Whether to include information about the number of records returned.

    Default: false

  • The attribute by which returned results will be sorted. To reverse the sort order, prefix the value with a minus sign (-).

  • A token identifying the page of results to retrieve.

  • Whether to include the audit properties (created and updated timestamps) in the response.

    Default: false

parameters

  • The number of records to return in each page of results.

    Default: 100

  • Whether to include information about the number of records returned.

    Default: false

  • The attribute by which returned results will be sorted. To reverse the sort order, prefix the value with a minus sign (-).

  • A token identifying the page of results to retrieve.

  • Whether to include the audit properties (created and updated timestamps) in the response.

    Default: false

Example request
curl -u "apikey:{apikey}" "https://gateway.watsonplatform.net/assistant/api/v1/workspaces?version=2018-09-20"
Example request
IamOptions iamOptions = new IamOptions.Builder().apiKey("{apiKey}").build();
Assistant service = new Assistant("2018-09-20", iamOptions);

ListWorkspacesOptions options = new ListWorkspacesOptions.Builder().build();

WorkspaceCollection workspaces = service.listWorkspaces(options).execute();

System.out.println(workspaces);
Example request
var watson = require('watson-developer-cloud');

var assistant = new watson.AssistantV1({
  iam_apikey: '{apikey}',
  version: '2018-09-20'
});

assistant.listWorkspaces(function(err, response) {
  if (err) {
    console.error(err);
  } else {
    console.log(JSON.stringify(response, null, 2));
  }
});
Example request
import json
import watson_developer_cloud

assistant = watson_developer_cloud.AssistantV1(
    iam_apikey='{apikey}',
    version='2018-09-20'
)

response = assistant.list_workspaces().get_result()

print(json.dumps(response, indent=2))
Example request
require "json"
require "ibm_watson/assistant_v1"
include IBMWatson

assistant = AssistantV1.new(
  iam_apikey: "{apikey}",
  version: "2018-09-20"
)

response = assistant.list_workspaces

puts JSON.pretty_generate(response.result)
Response
  • An array of objects describing the workspaces associated with the service instance.

  • The pagination data for the returned objects.

  • An array of objects describing the workspaces associated with the service instance.

    • The name of the workspace.

    • The language of the workspace.

    • The timestamp for creation of the workspace.

    • The timestamp for the last update to the workspace.

    • The workspace ID of the workspace.

    • The description of the workspace.

    • Any metadata related to the workspace.

    • Whether training data from the workspace (including artifacts such as intents and entities) can be used by IBM for general service improvements. true indicates that workspace training data is not to be used.

      Default: false

    • Global settings for the workspace.

      • Workspace settings related to the Watson Assistant tool.

        • Whether the dialog JSON editor displays text responses within the output.generic object.

      • Workspace settings related to the disambiguation feature.

        Note: This feature is available only to Premium users.

        • The text of the introductory prompt that accompanies disambiguation options presented to the user.

        • The user-facing label for the option users can select if none of the suggested options is correct. If no value is specified for this property, this option does not appear.

        • Whether the disambiguation feature is enabled for the workspace.

          Default: false

        • The sensitivity of the disambiguation feature to intent detection conflicts. Set to high if you want the disambiguation feature to be triggered more often. This can be useful for testing or demonstration purposes.

          Possible values: [auto,high]

          Default: auto

      • For internal use only.

  • An object defining the pagination data for the returned objects.

    • The URL that will return the same page of results.

    • The URL that will return the next page of results.

    • Reserved for future use.

    • Reserved for future use.

    • A token identifying the current page of results.

    • A token identifying the next page of results.

  • An array of objects describing the workspaces associated with the service instance.

    • The name of the workspace.

    • The language of the workspace.

    • The timestamp for creation of the workspace.

    • The timestamp for the last update to the workspace.

    • The workspace ID of the workspace.

    • The description of the workspace.

    • Any metadata related to the workspace.

    • Whether training data from the workspace (including artifacts such as intents and entities) can be used by IBM for general service improvements. true indicates that workspace training data is not to be used.

      Default: false

    • Global settings for the workspace.

      • Workspace settings related to the Watson Assistant tool.

        • Whether the dialog JSON editor displays text responses within the output.generic object.

      • Workspace settings related to the disambiguation feature.

        Note: This feature is available only to Premium users.

        • The text of the introductory prompt that accompanies disambiguation options presented to the user.

        • The user-facing label for the option users can select if none of the suggested options is correct. If no value is specified for this property, this option does not appear.

        • Whether the disambiguation feature is enabled for the workspace.

          Default: false

        • The sensitivity of the disambiguation feature to intent detection conflicts. Set to high if you want the disambiguation feature to be triggered more often. This can be useful for testing or demonstration purposes.

          Possible values: [auto,high]

          Default: auto

      • For internal use only.

  • An object defining the pagination data for the returned objects.

    • The URL that will return the same page of results.

    • The URL that will return the next page of results.

    • Reserved for future use.

    • Reserved for future use.

    • A token identifying the current page of results.

    • A token identifying the next page of results.

  • An array of objects describing the workspaces associated with the service instance.

    • The name of the workspace.

    • The language of the workspace.

    • The timestamp for creation of the workspace.

    • The timestamp for the last update to the workspace.

    • The workspace ID of the workspace.

    • The description of the workspace.

    • Any metadata related to the workspace.

    • Whether training data from the workspace (including artifacts such as intents and entities) can be used by IBM for general service improvements. true indicates that workspace training data is not to be used.

      Default: false

    • Global settings for the workspace.

      • Workspace settings related to the Watson Assistant tool.

        • Whether the dialog JSON editor displays text responses within the output.generic object.

      • Workspace settings related to the disambiguation feature.

        Note: This feature is available only to Premium users.

        • The text of the introductory prompt that accompanies disambiguation options presented to the user.

        • The user-facing label for the option users can select if none of the suggested options is correct. If no value is specified for this property, this option does not appear.

        • Whether the disambiguation feature is enabled for the workspace.

          Default: false

        • The sensitivity of the disambiguation feature to intent detection conflicts. Set to high if you want the disambiguation feature to be triggered more often. This can be useful for testing or demonstration purposes.

          Possible values: [auto,high]

          Default: auto

      • For internal use only.

  • An object defining the pagination data for the returned objects.

    • The URL that will return the same page of results.

    • The URL that will return the next page of results.

    • Reserved for future use.

    • Reserved for future use.

    • A token identifying the current page of results.

    • A token identifying the next page of results.

  • An array of objects describing the workspaces associated with the service instance.

    • The name of the workspace.

    • The language of the workspace.

    • The timestamp for creation of the workspace.

    • The timestamp for the last update to the workspace.

    • The workspace ID of the workspace.

    • The description of the workspace.

    • Any metadata related to the workspace.

    • Whether training data from the workspace (including artifacts such as intents and entities) can be used by IBM for general service improvements. true indicates that workspace training data is not to be used.

      Default: false

    • Global settings for the workspace.

      • Workspace settings related to the Watson Assistant tool.

        • Whether the dialog JSON editor displays text responses within the output.generic object.

      • Workspace settings related to the disambiguation feature.

        Note: This feature is available only to Premium users.

        • The text of the introductory prompt that accompanies disambiguation options presented to the user.

        • The user-facing label for the option users can select if none of the suggested options is correct. If no value is specified for this property, this option does not appear.

        • Whether the disambiguation feature is enabled for the workspace.

          Default: false

        • The sensitivity of the disambiguation feature to intent detection conflicts. Set to high if you want the disambiguation feature to be triggered more often. This can be useful for testing or demonstration purposes.

          Possible values: [auto,high]

          Default: auto

      • For internal use only.

  • An object defining the pagination data for the returned objects.

    • The URL that will return the same page of results.

    • The URL that will return the next page of results.

    • Reserved for future use.

    • Reserved for future use.

    • A token identifying the current page of results.

    • A token identifying the next page of results.

Status Code

  • Successful request.

  • Invalid request.

Example Response

Create workspace

Create a workspace based on component objects. You must provide workspace components defining the content of the new workspace.

This operation is limited to 30 requests per 30 minutes. For more information, see Rate limiting.

Create a workspace based on component objects. You must provide workspace components defining the content of the new workspace.

This operation is limited to 30 requests per 30 minutes. For more information, see Rate limiting.

Create a workspace based on component objects. You must provide workspace components defining the content of the new workspace.

This operation is limited to 30 requests per 30 minutes. For more information, see Rate limiting.

Create a workspace based on component objects. You must provide workspace components defining the content of the new workspace.

This operation is limited to 30 requests per 30 minutes. For more information, see Rate limiting.

Create a workspace based on component objects. You must provide workspace components defining the content of the new workspace.

This operation is limited to 30 requests per 30 minutes. For more information, see Rate limiting.

POST /v1/workspaces
ServiceCall<Workspace> createWorkspace(CreateWorkspaceOptions createWorkspaceOptions)
createWorkspace(params, callback())
create_workspace(self, name=None, description=None, language=None, intents=None, entities=None, dialog_nodes=None, counterexamples=None, metadata=None, learning_opt_out=None, system_settings=None, **kwargs)
create_workspace(name: nil, description: nil, language: nil, intents: nil, entities: nil, dialog_nodes: nil, counterexamples: nil, metadata: nil, learning_opt_out: nil, system_settings: nil)
Request

Use the CreateWorkspaceOptions.Builder to create a CreateWorkspaceOptions object that contains the parameter values for the createWorkspace method.

Query Parameters

  • Release date of the API version you want to use. Specify dates in YYYY-MM-DD format. The current version is 2018-09-20.

    Constraints: matches regular expression ^\d{4}-\d{2}-\d{2}$

The content of the new workspace.

The maximum size for this data is 50MB. If you need to import a larger workspace, consider importing the workspace without intents and entities and then adding them separately.

  • The name of the workspace. This string cannot contain carriage return, newline, or tab characters, and it must be no longer than 64 characters.

  • The description of the workspace. This string cannot contain carriage return, newline, or tab characters, and it must be no longer than 128 characters.

  • The language of the workspace.

  • An array of objects defining the intents for the workspace.

  • An array of objects defining the entities for the workspace.

  • An array of objects defining the nodes in the dialog.

  • An array of objects defining input examples that have been marked as irrelevant input.

  • Any metadata related to the workspace.

  • Whether training data from the workspace can be used by IBM for general service improvements. true indicates that workspace training data is not to be used.

    Default: false

  • Global settings for the workspace.

The createWorkspace options.

  • The name of the workspace. This string cannot contain carriage return, newline, or tab characters, and it must be no longer than 64 characters.

  • The description of the workspace. This string cannot contain carriage return, newline, or tab characters, and it must be no longer than 128 characters.

  • The language of the workspace.

  • An array of objects defining the intents for the workspace.

    • The name of the intent. This string must conform to the following restrictions:

      • It can contain only Unicode alphanumeric, underscore, hyphen, and dot characters.
      • It cannot begin with the reserved prefix sys-.
      • It must be no longer than 128 characters.
    • The description of the intent. This string cannot contain carriage return, newline, or tab characters, and it must be no longer than 128 characters.

    • An array of user input examples for the intent.

      • The text of a user input example. This string must conform to the following restrictions:

        • It cannot contain carriage return, newline, or tab characters.
        • It cannot consist of only whitespace characters.
        • It must be no longer than 1024 characters.
      • An array of contextual entity mentions.

        • The name of the entity.

        • An array of zero-based character offsets that indicate where the entity mentions begin and end in the input text.

          Constraints: number of items = 2

  • An array of objects defining the entities for the workspace.

    Example:
    • The name of the entity. This string must conform to the following restrictions:

      • It can contain only Unicode alphanumeric, underscore, and hyphen characters.
      • It cannot begin with the reserved prefix sys-.
      • It must be no longer than 64 characters.
    • The description of the entity. This string cannot contain carriage return, newline, or tab characters, and it must be no longer than 128 characters.

    • Any metadata related to the value.

    • An array of objects describing the entity values.

      • The text of the entity value. This string must conform to the following restrictions:

        • It cannot contain carriage return, newline, or tab characters.
        • It cannot consist of only whitespace characters.
        • It must be no longer than 64 characters.
      • Any metadata related to the entity value.

      • An array containing any synonyms for the entity value. You can provide either synonyms or patterns (as indicated by type), but not both. A synonym must conform to the following restrictions:

        • It cannot contain carriage return, newline, or tab characters.
        • It cannot consist of only whitespace characters.
        • It must be no longer than 64 characters.

        Constraints: 1 ≤ length ≤ 64

      • An array of patterns for the entity value. You can provide either synonyms or patterns (as indicated by type), but not both. A pattern is a regular expression no longer than 512 characters. For more information about how to specify a pattern, see the documentation.

        Constraints: number of items ≤ 5, 1 ≤ length ≤ 512

      • Specifies the type of value.

        Possible values: [synonyms,patterns]

        Default: synonyms

    • Whether to use fuzzy matching for the entity.

  • An array of objects defining the nodes in the dialog.

    • The dialog node ID. This string must conform to the following restrictions:

      • It can contain only Unicode alphanumeric, space, underscore, hyphen, and dot characters.
      • It must be no longer than 1024 characters.
    • The description of the dialog node. This string cannot contain carriage return, newline, or tab characters, and it must be no longer than 128 characters.

    • The condition that will trigger the dialog node. This string cannot contain carriage return, newline, or tab characters, and it must be no longer than 2048 characters.

    • The ID of the parent dialog node.

    • The ID of the previous dialog node.

    • The output of the dialog node. For more information about how to specify dialog node output, see the documentation.

      • An array of objects describing the output defined for the dialog node.

        • The type of response returned by the dialog node. The specified response type must be supported by the client application or channel.

          Possible values: [text,pause,image,option,connect_to_agent]

        • A list of one or more objects defining text responses. Required when response_type=text.

          • The text of a response. This string can include newline characters (), Markdown tagging, or other special characters, if supported by the channel. It must be no longer than 4096 characters.

        • How a response is selected from the list, if more than one response is specified. Valid only when response_type=text.

          Possible values: [sequential,random,multiline]

        • The delimiter to use as a separator between responses when selection_policy=multiline.

          Default: \n

        • How long to pause, in milliseconds. The valid values are from 0 to 10000. Valid only when response_type=pause.

        • Whether to send a "user is typing" event during the pause. Ignored if the channel does not support this event. Valid only when response_type=pause.

        • The URL of the image. Required when response_type=image.

        • An optional title to show before the response. Valid only when response_type=image or option. This string must be no longer than 512 characters.

        • An optional description to show with the response. Valid only when response_type=image or option. This string must be no longer than 256 characters.

        • The preferred type of control to display, if supported by the channel. Valid only when response_type=option.

          Possible values: [dropdown,button]

        • An array of objects describing the options from which the user can choose. You can include up to 20 options. Required when response_type=option.

          • The user-facing label for the option.

          • An object defining the message input to be sent to the Watson Assistant service if the user selects the corresponding option.

            • The user input.

              • The text of the user input. This string cannot contain carriage return, newline, or tab characters, and it must be no longer than 2048 characters.

        • An optional message to be sent to the human agent who will be taking over the conversation. Valid only when reponse_type=connect_to_agent. This string must be no longer than 256 characters.

      • Options that modify how specified output is handled.

        • Whether values in the output will overwrite output values in an array specified by previously executed dialog nodes. If this option is set to false, new values will be appended to previously specified values.

          Default: true

    • The context for the dialog node.

    • The metadata for the dialog node.

    • The next step to be executed in dialog processing.

      • What happens after the dialog node completes. The valid values depend on the node type:

        • The following values are valid for any node:
          • get_user_input
          • skip_user_input
          • jump_to
        • If the node is of type event_handler and its parent node is of type slot or frame, additional values are also valid:
          • if event_name=filled and the type of the parent node is slot:
            • reprompt
            • skip_all_slots
        • if event_name=nomatch and the type of the parent node is slot:
          • reprompt
          • skip_slot
          • skip_all_slots
        • if event_name=generic and the type of the parent node is frame:
          • reprompt
          • skip_slot
          • skip_all_slots

        If you specify jump_to, then you must also specify a value for the dialog_node property.

        Possible values: [get_user_input,skip_user_input,jump_to,reprompt,skip_slot,skip_all_slots]

      • The ID of the dialog node to process next. This parameter is required if behavior=jump_to.

      • Which part of the dialog node to process next.

        Possible values: [condition,client,user_input,body]

    • An array of objects describing any actions to be invoked by the dialog node.

      Constraints: number of items ≤ 5

      • The name of the action.

      • The type of action to invoke.

        Possible values: [client,server,cloud_function,web_action]

        Default: client

      • A map of key/value pairs to be provided to the action.

      • The location in the dialog context where the result of the action is stored.

      • The name of the context variable that the client application will use to pass in credentials for the action.

    • The alias used to identify the dialog node. This string must conform to the following restrictions:

      • It can contain only Unicode alphanumeric, space, underscore, hyphen, and dot characters.
      • It must be no longer than 64 characters.
    • How the dialog node is processed.

      Possible values: [standard,event_handler,frame,slot,response_condition,folder]

    • How an event_handler node is processed.

      Possible values: [focus,input,filled,validate,filled_multiple,generic,nomatch,nomatch_responses_depleted,digression_return_prompt]

    • The location in the dialog context where output is stored.

    • Whether this top-level dialog node can be digressed into.

      Possible values: [not_available,returns,does_not_return]

    • Whether this dialog node can be returned to after a digression.

      Possible values: [allow_returning,allow_all,allow_all_never_return]

    • Whether the user can digress to top-level nodes while filling out slots.

      Possible values: [not_allowed,allow_returning,allow_all]

    • A label that can be displayed externally to describe the purpose of the node to users. This string must be no longer than 512 characters.

  • An array of objects defining input examples that have been marked as irrelevant input.

    • The text of a user input marked as irrelevant input. This string must conform to the following restrictions:

      • It cannot contain carriage return, newline, or tab characters
      • It cannot consist of only whitespace characters
      • It must be no longer than 1024 characters.
  • Any metadata related to the workspace.

  • Whether training data from the workspace can be used by IBM for general service improvements. true indicates that workspace training data is not to be used.

    Default: false

  • Global settings for the workspace.

    • Workspace settings related to the Watson Assistant tool.

      • Whether the dialog JSON editor displays text responses within the output.generic object.

    • Workspace settings related to the disambiguation feature.

      Note: This feature is available only to Premium users.

      • The text of the introductory prompt that accompanies disambiguation options presented to the user.

      • The user-facing label for the option users can select if none of the suggested options is correct. If no value is specified for this property, this option does not appear.

      • Whether the disambiguation feature is enabled for the workspace.

        Default: false

      • The sensitivity of the disambiguation feature to intent detection conflicts. Set to high if you want the disambiguation feature to be triggered more often. This can be useful for testing or demonstration purposes.

        Possible values: [auto,high]

        Default: auto

    • For internal use only.

parameters

  • The name of the workspace. This string cannot contain carriage return, newline, or tab characters, and it must be no longer than 64 characters.

  • The description of the workspace. This string cannot contain carriage return, newline, or tab characters, and it must be no longer than 128 characters.

  • The language of the workspace.

  • An array of objects defining the intents for the workspace.

    • The name of the intent. This string must conform to the following restrictions:

      • It can contain only Unicode alphanumeric, underscore, hyphen, and dot characters.
      • It cannot begin with the reserved prefix sys-.
      • It must be no longer than 128 characters.
    • The description of the intent. This string cannot contain carriage return, newline, or tab characters, and it must be no longer than 128 characters.

    • An array of user input examples for the intent.

      • The text of a user input example. This string must conform to the following restrictions:

        • It cannot contain carriage return, newline, or tab characters.
        • It cannot consist of only whitespace characters.
        • It must be no longer than 1024 characters.
      • An array of contextual entity mentions.

        • The name of the entity.

        • An array of zero-based character offsets that indicate where the entity mentions begin and end in the input text.

          Constraints: number of items = 2

  • An array of objects defining the entities for the workspace.

    Example:
    • The name of the entity. This string must conform to the following restrictions:

      • It can contain only Unicode alphanumeric, underscore, and hyphen characters.
      • It cannot begin with the reserved prefix sys-.
      • It must be no longer than 64 characters.
    • The description of the entity. This string cannot contain carriage return, newline, or tab characters, and it must be no longer than 128 characters.

    • Any metadata related to the value.

    • An array of objects describing the entity values.

      • The text of the entity value. This string must conform to the following restrictions:

        • It cannot contain carriage return, newline, or tab characters.
        • It cannot consist of only whitespace characters.
        • It must be no longer than 64 characters.
      • Any metadata related to the entity value.

      • An array containing any synonyms for the entity value. You can provide either synonyms or patterns (as indicated by type), but not both. A synonym must conform to the following restrictions:

        • It cannot contain carriage return, newline, or tab characters.
        • It cannot consist of only whitespace characters.
        • It must be no longer than 64 characters.

        Constraints: 1 ≤ length ≤ 64

      • An array of patterns for the entity value. You can provide either synonyms or patterns (as indicated by type), but not both. A pattern is a regular expression no longer than 512 characters. For more information about how to specify a pattern, see the documentation.

        Constraints: number of items ≤ 5, 1 ≤ length ≤ 512

      • Specifies the type of value.

        Possible values: [synonyms,patterns]

        Default: synonyms

    • Whether to use fuzzy matching for the entity.

  • An array of objects defining the nodes in the dialog.

    • The dialog node ID. This string must conform to the following restrictions:

      • It can contain only Unicode alphanumeric, space, underscore, hyphen, and dot characters.
      • It must be no longer than 1024 characters.
    • The description of the dialog node. This string cannot contain carriage return, newline, or tab characters, and it must be no longer than 128 characters.

    • The condition that will trigger the dialog node. This string cannot contain carriage return, newline, or tab characters, and it must be no longer than 2048 characters.

    • The ID of the parent dialog node.

    • The ID of the previous dialog node.

    • The output of the dialog node. For more information about how to specify dialog node output, see the documentation.

      • An array of objects describing the output defined for the dialog node.

        • The type of response returned by the dialog node. The specified response type must be supported by the client application or channel.

          Possible values: [text,pause,image,option,connect_to_agent]

        • A list of one or more objects defining text responses. Required when response_type=text.

          • The text of a response. This string can include newline characters (), Markdown tagging, or other special characters, if supported by the channel. It must be no longer than 4096 characters.

        • How a response is selected from the list, if more than one response is specified. Valid only when response_type=text.

          Possible values: [sequential,random,multiline]

        • The delimiter to use as a separator between responses when selection_policy=multiline.

          Default: \n

        • How long to pause, in milliseconds. The valid values are from 0 to 10000. Valid only when response_type=pause.

        • Whether to send a "user is typing" event during the pause. Ignored if the channel does not support this event. Valid only when response_type=pause.

        • The URL of the image. Required when response_type=image.

        • An optional title to show before the response. Valid only when response_type=image or option. This string must be no longer than 512 characters.

        • An optional description to show with the response. Valid only when response_type=image or option. This string must be no longer than 256 characters.

        • The preferred type of control to display, if supported by the channel. Valid only when response_type=option.

          Possible values: [dropdown,button]

        • An array of objects describing the options from which the user can choose. You can include up to 20 options. Required when response_type=option.

          • The user-facing label for the option.

          • An object defining the message input to be sent to the Watson Assistant service if the user selects the corresponding option.

            • The user input.

              • The text of the user input. This string cannot contain carriage return, newline, or tab characters, and it must be no longer than 2048 characters.

        • An optional message to be sent to the human agent who will be taking over the conversation. Valid only when reponse_type=connect_to_agent. This string must be no longer than 256 characters.

      • Options that modify how specified output is handled.

        • Whether values in the output will overwrite output values in an array specified by previously executed dialog nodes. If this option is set to false, new values will be appended to previously specified values.

          Default: true

    • The context for the dialog node.

    • The metadata for the dialog node.

    • The next step to be executed in dialog processing.

      • What happens after the dialog node completes. The valid values depend on the node type:

        • The following values are valid for any node:
          • get_user_input
          • skip_user_input
          • jump_to
        • If the node is of type event_handler and its parent node is of type slot or frame, additional values are also valid:
          • if event_name=filled and the type of the parent node is slot:
            • reprompt
            • skip_all_slots
        • if event_name=nomatch and the type of the parent node is slot:
          • reprompt
          • skip_slot
          • skip_all_slots
        • if event_name=generic and the type of the parent node is frame:
          • reprompt
          • skip_slot
          • skip_all_slots

        If you specify jump_to, then you must also specify a value for the dialog_node property.

        Possible values: [get_user_input,skip_user_input,jump_to,reprompt,skip_slot,skip_all_slots]

      • The ID of the dialog node to process next. This parameter is required if behavior=jump_to.

      • Which part of the dialog node to process next.

        Possible values: [condition,client,user_input,body]

    • An array of objects describing any actions to be invoked by the dialog node.

      Constraints: number of items ≤ 5

      • The name of the action.

      • The type of action to invoke.

        Possible values: [client,server,cloud_function,web_action]

        Default: client

      • A map of key/value pairs to be provided to the action.

      • The location in the dialog context where the result of the action is stored.

      • The name of the context variable that the client application will use to pass in credentials for the action.

    • The alias used to identify the dialog node. This string must conform to the following restrictions:

      • It can contain only Unicode alphanumeric, space, underscore, hyphen, and dot characters.
      • It must be no longer than 64 characters.
    • How the dialog node is processed.

      Possible values: [standard,event_handler,frame,slot,response_condition,folder]

    • How an event_handler node is processed.

      Possible values: [focus,input,filled,validate,filled_multiple,generic,nomatch,nomatch_responses_depleted,digression_return_prompt]

    • The location in the dialog context where output is stored.

    • Whether this top-level dialog node can be digressed into.

      Possible values: [not_available,returns,does_not_return]

    • Whether this dialog node can be returned to after a digression.

      Possible values: [allow_returning,allow_all,allow_all_never_return]

    • Whether the user can digress to top-level nodes while filling out slots.

      Possible values: [not_allowed,allow_returning,allow_all]

    • A label that can be displayed externally to describe the purpose of the node to users. This string must be no longer than 512 characters.

  • An array of objects defining input examples that have been marked as irrelevant input.

    • The text of a user input marked as irrelevant input. This string must conform to the following restrictions:

      • It cannot contain carriage return, newline, or tab characters
      • It cannot consist of only whitespace characters
      • It must be no longer than 1024 characters.
  • Any metadata related to the workspace.

  • Whether training data from the workspace can be used by IBM for general service improvements. true indicates that workspace training data is not to be used.

    Default: false

  • Global settings for the workspace.

    • Workspace settings related to the Watson Assistant tool.

      • Whether the dialog JSON editor displays text responses within the output.generic object.

    • Workspace settings related to the disambiguation feature.

      Note: This feature is available only to Premium users.

      • The text of the introductory prompt that accompanies disambiguation options presented to the user.

      • The user-facing label for the option users can select if none of the suggested options is correct. If no value is specified for this property, this option does not appear.

      • Whether the disambiguation feature is enabled for the workspace.

        Default: false

      • The sensitivity of the disambiguation feature to intent detection conflicts. Set to high if you want the disambiguation feature to be triggered more often. This can be useful for testing or demonstration purposes.

        Possible values: [auto,high]

        Default: auto

    • For internal use only.

parameters

  • The name of the workspace. This string cannot contain carriage return, newline, or tab characters, and it must be no longer than 64 characters.

  • The description of the workspace. This string cannot contain carriage return, newline, or tab characters, and it must be no longer than 128 characters.

  • The language of the workspace.

  • An array of objects defining the intents for the workspace.

    • The name of the intent. This string must conform to the following restrictions:

      • It can contain only Unicode alphanumeric, underscore, hyphen, and dot characters.
      • It cannot begin with the reserved prefix sys-.
      • It must be no longer than 128 characters.
    • The description of the intent. This string cannot contain carriage return, newline, or tab characters, and it must be no longer than 128 characters.

    • An array of user input examples for the intent.

      • The text of a user input example. This string must conform to the following restrictions:

        • It cannot contain carriage return, newline, or tab characters.
        • It cannot consist of only whitespace characters.
        • It must be no longer than 1024 characters.
      • An array of contextual entity mentions.

        • The name of the entity.

        • An array of zero-based character offsets that indicate where the entity mentions begin and end in the input text.

          Constraints: number of items = 2

  • An array of objects defining the entities for the workspace.

    Example:
    • The name of the entity. This string must conform to the following restrictions:

      • It can contain only Unicode alphanumeric, underscore, and hyphen characters.
      • It cannot begin with the reserved prefix sys-.
      • It must be no longer than 64 characters.
    • The description of the entity. This string cannot contain carriage return, newline, or tab characters, and it must be no longer than 128 characters.

    • Any metadata related to the value.

    • An array of objects describing the entity values.

      • The text of the entity value. This string must conform to the following restrictions:

        • It cannot contain carriage return, newline, or tab characters.
        • It cannot consist of only whitespace characters.
        • It must be no longer than 64 characters.
      • Any metadata related to the entity value.

      • An array containing any synonyms for the entity value. You can provide either synonyms or patterns (as indicated by type), but not both. A synonym must conform to the following restrictions:

        • It cannot contain carriage return, newline, or tab characters.
        • It cannot consist of only whitespace characters.
        • It must be no longer than 64 characters.

        Constraints: 1 ≤ length ≤ 64

      • An array of patterns for the entity value. You can provide either synonyms or patterns (as indicated by type), but not both. A pattern is a regular expression no longer than 512 characters. For more information about how to specify a pattern, see the documentation.

        Constraints: number of items ≤ 5, 1 ≤ length ≤ 512

      • Specifies the type of value.

        Possible values: [synonyms,patterns]

        Default: synonyms

    • Whether to use fuzzy matching for the entity.

  • An array of objects defining the nodes in the dialog.

    • The dialog node ID. This string must conform to the following restrictions:

      • It can contain only Unicode alphanumeric, space, underscore, hyphen, and dot characters.
      • It must be no longer than 1024 characters.
    • The description of the dialog node. This string cannot contain carriage return, newline, or tab characters, and it must be no longer than 128 characters.

    • The condition that will trigger the dialog node. This string cannot contain carriage return, newline, or tab characters, and it must be no longer than 2048 characters.

    • The ID of the parent dialog node.

    • The ID of the previous dialog node.

    • The output of the dialog node. For more information about how to specify dialog node output, see the documentation.

      • An array of objects describing the output defined for the dialog node.

        • The type of response returned by the dialog node. The specified response type must be supported by the client application or channel.

          Possible values: [text,pause,image,option,connect_to_agent]

        • A list of one or more objects defining text responses. Required when response_type=text.

          • The text of a response. This string can include newline characters (), Markdown tagging, or other special characters, if supported by the channel. It must be no longer than 4096 characters.

        • How a response is selected from the list, if more than one response is specified. Valid only when response_type=text.

          Possible values: [sequential,random,multiline]

        • The delimiter to use as a separator between responses when selection_policy=multiline.

          Default: \n

        • How long to pause, in milliseconds. The valid values are from 0 to 10000. Valid only when response_type=pause.

        • Whether to send a "user is typing" event during the pause. Ignored if the channel does not support this event. Valid only when response_type=pause.

        • The URL of the image. Required when response_type=image.

        • An optional title to show before the response. Valid only when response_type=image or option. This string must be no longer than 512 characters.

        • An optional description to show with the response. Valid only when response_type=image or option. This string must be no longer than 256 characters.

        • The preferred type of control to display, if supported by the channel. Valid only when response_type=option.

          Possible values: [dropdown,button]

        • An array of objects describing the options from which the user can choose. You can include up to 20 options. Required when response_type=option.

          • The user-facing label for the option.

          • An object defining the message input to be sent to the Watson Assistant service if the user selects the corresponding option.

            • The user input.

              • The text of the user input. This string cannot contain carriage return, newline, or tab characters, and it must be no longer than 2048 characters.

        • An optional message to be sent to the human agent who will be taking over the conversation. Valid only when reponse_type=connect_to_agent. This string must be no longer than 256 characters.

      • Options that modify how specified output is handled.

        • Whether values in the output will overwrite output values in an array specified by previously executed dialog nodes. If this option is set to false, new values will be appended to previously specified values.

          Default: true

    • The context for the dialog node.

    • The metadata for the dialog node.

    • The next step to be executed in dialog processing.

      • What happens after the dialog node completes. The valid values depend on the node type:

        • The following values are valid for any node:
          • get_user_input
          • skip_user_input
          • jump_to
        • If the node is of type event_handler and its parent node is of type slot or frame, additional values are also valid:
          • if event_name=filled and the type of the parent node is slot:
            • reprompt
            • skip_all_slots
        • if event_name=nomatch and the type of the parent node is slot:
          • reprompt
          • skip_slot
          • skip_all_slots
        • if event_name=generic and the type of the parent node is frame:
          • reprompt
          • skip_slot
          • skip_all_slots

        If you specify jump_to, then you must also specify a value for the dialog_node property.

        Possible values: [get_user_input,skip_user_input,jump_to,reprompt,skip_slot,skip_all_slots]

      • The ID of the dialog node to process next. This parameter is required if behavior=jump_to.

      • Which part of the dialog node to process next.

        Possible values: [condition,client,user_input,body]

    • An array of objects describing any actions to be invoked by the dialog node.

      Constraints: number of items ≤ 5

      • The name of the action.

      • The type of action to invoke.

        Possible values: [client,server,cloud_function,web_action]

        Default: client

      • A map of key/value pairs to be provided to the action.

      • The location in the dialog context where the result of the action is stored.

      • The name of the context variable that the client application will use to pass in credentials for the action.

    • The alias used to identify the dialog node. This string must conform to the following restrictions:

      • It can contain only Unicode alphanumeric, space, underscore, hyphen, and dot characters.
      • It must be no longer than 64 characters.
    • How the dialog node is processed.

      Possible values: [standard,event_handler,frame,slot,response_condition,folder]

    • How an event_handler node is processed.

      Possible values: [focus,input,filled,validate,filled_multiple,generic,nomatch,nomatch_responses_depleted,digression_return_prompt]

    • The location in the dialog context where output is stored.

    • Whether this top-level dialog node can be digressed into.

      Possible values: [not_available,returns,does_not_return]

    • Whether this dialog node can be returned to after a digression.

      Possible values: [allow_returning,allow_all,allow_all_never_return]

    • Whether the user can digress to top-level nodes while filling out slots.

      Possible values: [not_allowed,allow_returning,allow_all]

    • A label that can be displayed externally to describe the purpose of the node to users. This string must be no longer than 512 characters.

  • An array of objects defining input examples that have been marked as irrelevant input.

    • The text of a user input marked as irrelevant input. This string must conform to the following restrictions:

      • It cannot contain carriage return, newline, or tab characters
      • It cannot consist of only whitespace characters
      • It must be no longer than 1024 characters.
  • Any metadata related to the workspace.

  • Whether training data from the workspace can be used by IBM for general service improvements. true indicates that workspace training data is not to be used.

    Default: false

  • Global settings for the workspace.

    • Workspace settings related to the Watson Assistant tool.

      • Whether the dialog JSON editor displays text responses within the output.generic object.

    • Workspace settings related to the disambiguation feature.

      Note: This feature is available only to Premium users.

      • The text of the introductory prompt that accompanies disambiguation options presented to the user.

      • The user-facing label for the option users can select if none of the suggested options is correct. If no value is specified for this property, this option does not appear.

      • Whether the disambiguation feature is enabled for the workspace.

        Default: false

      • The sensitivity of the disambiguation feature to intent detection conflicts. Set to high if you want the disambiguation feature to be triggered more often. This can be useful for testing or demonstration purposes.

        Possible values: [auto,high]

        Default: auto

    • For internal use only.

parameters

  • The name of the workspace. This string cannot contain carriage return, newline, or tab characters, and it must be no longer than 64 characters.

  • The description of the workspace. This string cannot contain carriage return, newline, or tab characters, and it must be no longer than 128 characters.

  • The language of the workspace.

  • An array of objects defining the intents for the workspace.

    • The name of the intent. This string must conform to the following restrictions:

      • It can contain only Unicode alphanumeric, underscore, hyphen, and dot characters.
      • It cannot begin with the reserved prefix sys-.
      • It must be no longer than 128 characters.
    • The description of the intent. This string cannot contain carriage return, newline, or tab characters, and it must be no longer than 128 characters.

    • An array of user input examples for the intent.

      • The text of a user input example. This string must conform to the following restrictions:

        • It cannot contain carriage return, newline, or tab characters.
        • It cannot consist of only whitespace characters.
        • It must be no longer than 1024 characters.
      • An array of contextual entity mentions.

        • The name of the entity.

        • An array of zero-based character offsets that indicate where the entity mentions begin and end in the input text.

          Constraints: number of items = 2

  • An array of objects defining the entities for the workspace.

    Example:
    • The name of the entity. This string must conform to the following restrictions:

      • It can contain only Unicode alphanumeric, underscore, and hyphen characters.
      • It cannot begin with the reserved prefix sys-.
      • It must be no longer than 64 characters.
    • The description of the entity. This string cannot contain carriage return, newline, or tab characters, and it must be no longer than 128 characters.

    • Any metadata related to the value.

    • An array of objects describing the entity values.

      • The text of the entity value. This string must conform to the following restrictions:

        • It cannot contain carriage return, newline, or tab characters.
        • It cannot consist of only whitespace characters.
        • It must be no longer than 64 characters.
      • Any metadata related to the entity value.

      • An array containing any synonyms for the entity value. You can provide either synonyms or patterns (as indicated by type), but not both. A synonym must conform to the following restrictions:

        • It cannot contain carriage return, newline, or tab characters.
        • It cannot consist of only whitespace characters.
        • It must be no longer than 64 characters.

        Constraints: 1 ≤ length ≤ 64

      • An array of patterns for the entity value. You can provide either synonyms or patterns (as indicated by type), but not both. A pattern is a regular expression no longer than 512 characters. For more information about how to specify a pattern, see the documentation.

        Constraints: number of items ≤ 5, 1 ≤ length ≤ 512

      • Specifies the type of value.

        Possible values: [synonyms,patterns]

        Default: synonyms

    • Whether to use fuzzy matching for the entity.

  • An array of objects defining the nodes in the dialog.

    • The dialog node ID. This string must conform to the following restrictions:

      • It can contain only Unicode alphanumeric, space, underscore, hyphen, and dot characters.
      • It must be no longer than 1024 characters.
    • The description of the dialog node. This string cannot contain carriage return, newline, or tab characters, and it must be no longer than 128 characters.

    • The condition that will trigger the dialog node. This string cannot contain carriage return, newline, or tab characters, and it must be no longer than 2048 characters.

    • The ID of the parent dialog node.

    • The ID of the previous dialog node.

    • The output of the dialog node. For more information about how to specify dialog node output, see the documentation.

      • An array of objects describing the output defined for the dialog node.

        • The type of response returned by the dialog node. The specified response type must be supported by the client application or channel.

          Possible values: [text,pause,image,option,connect_to_agent]

        • A list of one or more objects defining text responses. Required when response_type=text.

          • The text of a response. This string can include newline characters (), Markdown tagging, or other special characters, if supported by the channel. It must be no longer than 4096 characters.

        • How a response is selected from the list, if more than one response is specified. Valid only when response_type=text.

          Possible values: [sequential,random,multiline]

        • The delimiter to use as a separator between responses when selection_policy=multiline.

          Default: \n

        • How long to pause, in milliseconds. The valid values are from 0 to 10000. Valid only when response_type=pause.

        • Whether to send a "user is typing" event during the pause. Ignored if the channel does not support this event. Valid only when response_type=pause.

        • The URL of the image. Required when response_type=image.

        • An optional title to show before the response. Valid only when response_type=image or option. This string must be no longer than 512 characters.

        • An optional description to show with the response. Valid only when response_type=image or option. This string must be no longer than 256 characters.

        • The preferred type of control to display, if supported by the channel. Valid only when response_type=option.

          Possible values: [dropdown,button]

        • An array of objects describing the options from which the user can choose. You can include up to 20 options. Required when response_type=option.

          • The user-facing label for the option.

          • An object defining the message input to be sent to the Watson Assistant service if the user selects the corresponding option.

            • The user input.

              • The text of the user input. This string cannot contain carriage return, newline, or tab characters, and it must be no longer than 2048 characters.

        • An optional message to be sent to the human agent who will be taking over the conversation. Valid only when reponse_type=connect_to_agent. This string must be no longer than 256 characters.

      • Options that modify how specified output is handled.

        • Whether values in the output will overwrite output values in an array specified by previously executed dialog nodes. If this option is set to false, new values will be appended to previously specified values.

          Default: true

    • The context for the dialog node.

    • The metadata for the dialog node.

    • The next step to be executed in dialog processing.

      • What happens after the dialog node completes. The valid values depend on the node type:

        • The following values are valid for any node:
          • get_user_input
          • skip_user_input
          • jump_to
        • If the node is of type event_handler and its parent node is of type slot or frame, additional values are also valid:
          • if event_name=filled and the type of the parent node is slot:
            • reprompt
            • skip_all_slots
        • if event_name=nomatch and the type of the parent node is slot:
          • reprompt
          • skip_slot
          • skip_all_slots
        • if event_name=generic and the type of the parent node is frame:
          • reprompt
          • skip_slot
          • skip_all_slots

        If you specify jump_to, then you must also specify a value for the dialog_node property.

        Possible values: [get_user_input,skip_user_input,jump_to,reprompt,skip_slot,skip_all_slots]

      • The ID of the dialog node to process next. This parameter is required if behavior=jump_to.

      • Which part of the dialog node to process next.

        Possible values: [condition,client,user_input,body]

    • An array of objects describing any actions to be invoked by the dialog node.

      Constraints: number of items ≤ 5

      • The name of the action.

      • The type of action to invoke.

        Possible values: [client,server,cloud_function,web_action]

        Default: client

      • A map of key/value pairs to be provided to the action.

      • The location in the dialog context where the result of the action is stored.

      • The name of the context variable that the client application will use to pass in credentials for the action.

    • The alias used to identify the dialog node. This string must conform to the following restrictions:

      • It can contain only Unicode alphanumeric, space, underscore, hyphen, and dot characters.
      • It must be no longer than 64 characters.
    • How the dialog node is processed.

      Possible values: [standard,event_handler,frame,slot,response_condition,folder]

    • How an event_handler node is processed.

      Possible values: [focus,input,filled,validate,filled_multiple,generic,nomatch,nomatch_responses_depleted,digression_return_prompt]

    • The location in the dialog context where output is stored.

    • Whether this top-level dialog node can be digressed into.

      Possible values: [not_available,returns,does_not_return]

    • Whether this dialog node can be returned to after a digression.

      Possible values: [allow_returning,allow_all,allow_all_never_return]

    • Whether the user can digress to top-level nodes while filling out slots.

      Possible values: [not_allowed,allow_returning,allow_all]

    • A label that can be displayed externally to describe the purpose of the node to users. This string must be no longer than 512 characters.

  • An array of objects defining input examples that have been marked as irrelevant input.

    • The text of a user input marked as irrelevant input. This string must conform to the following restrictions:

      • It cannot contain carriage return, newline, or tab characters
      • It cannot consist of only whitespace characters
      • It must be no longer than 1024 characters.
  • Any metadata related to the workspace.

  • Whether training data from the workspace can be used by IBM for general service improvements. true indicates that workspace training data is not to be used.

    Default: false

  • Global settings for the workspace.

    • Workspace settings related to the Watson Assistant tool.

      • Whether the dialog JSON editor displays text responses within the output.generic object.

    • Workspace settings related to the disambiguation feature.

      Note: This feature is available only to Premium users.

      • The text of the introductory prompt that accompanies disambiguation options presented to the user.

      • The user-facing label for the option users can select if none of the suggested options is correct. If no value is specified for this property, this option does not appear.

      • Whether the disambiguation feature is enabled for the workspace.

        Default: false

      • The sensitivity of the disambiguation feature to intent detection conflicts. Set to high if you want the disambiguation feature to be triggered more often. This can be useful for testing or demonstration purposes.

        Possible values: [auto,high]

        Default: auto

    • For internal use only.

Example request
curl -H "Content-Type: application/json" -X POST -u "apikey:{apikey}" -d "{\"name\":\"API test\",\"intents\":[],\"entities\":[],\"language\":\"en\",\"description\":\"Example workspace created via API.\",\"dialog_nodes\":[]}" "https://gateway.watsonplatform.net/assistant/api/v1/workspaces?version=2018-09-20"
Example request
IamOptions iamOptions = new IamOptions.Builder().apiKey("{apiKey}").build();
Assistant service = new Assistant("2018-09-20", iamOptions);

String workspaceName = "API test";
String workspaceDescription = "Example workspace created via API";

CreateWorkspaceOptions options = new CreateWorkspaceOptions.Builder()
  .name(workspaceName)
  .description(workspaceDescription)
  .build();

Workspace response = service.createWorkspace(options).execute();

System.out.println(response);
Example request
var watson = require('watson-developer-cloud');

var assistant = new watson.AssistantV1({
  iam_apikey: '{apikey}',
  version: '2018-09-20'
});

var workspace = {
  name: 'API test',
  description: 'Example workspace created via API.'
};

assistant.createWorkspace(workspace, function(err, response) {
  if (err) {
    console.error(err);
  } else {
    console.log(JSON.stringify(response, null, 2));
  }
});