Pattern - Add Pattern

Adds a pattern to a version of the application.

POST {Endpoint}/luis/api/v2.0/apps/{appId}/versions/{versionId}/patternrule

URI Parameters

Name In Required Type Description
appId
path True

string

uuid

The application ID.

Endpoint
path True

string

Supported Cognitive Services endpoints (protocol and hostname, for example: https://westus.api.cognitive.microsoft.com).

versionId
path True

string

The version ID.

Request Header

Name Required Type Description
Ocp-Apim-Subscription-Key True

string

Request Body

Name Type Description
intent

string

The intent's name which the pattern belongs to.

pattern

string

The pattern text.

Responses

Name Type Description
201 Created

PatternRuleInfo

The created pattern

Other Status Codes

ErrorResponse

Error Response.

Security

Ocp-Apim-Subscription-Key

Type: apiKey
In: header

Examples

Successful Add Pattern request

Sample Request

POST {Endpoint}/luis/api/v2.0/apps/86226c53-b7a6-416f-876b-226b2b5ab07b/versions/0.1/patternrule


{
  "pattern": "Who's {Name} reporting to?",
  "intent": "report to"
}

Sample Response

{
  "id": "cc8fa554-cc6c-4bcc-97eb-c8e5bc2091b3",
  "pattern": "who's {Name} reporting to?",
  "intent": "report to"
}

Definitions

Name Description
ErrorResponse

Error response when invoking an operation on the API.

PatternRuleCreateObject

Object model for creating a pattern

PatternRuleInfo

Pattern rule

ErrorResponse

Error response when invoking an operation on the API.

Name Type Description
errorType

string

PatternRuleCreateObject

Object model for creating a pattern

Name Type Description
intent

string

The intent's name which the pattern belongs to.

pattern

string

The pattern text.

PatternRuleInfo

Pattern rule

Name Type Description
id

string

The pattern ID.

intent

string

The intent's name where the pattern belongs to.

pattern

string

The pattern text.