UpdatePromptTemplate - Update a prompt template

Updated at:

Incrementally updates a prompt template by template ID.

Try it out

You can call this operation in OpenAPI Explorer without calculating a signature. After a successful call, OpenAPI Explorer can automatically generate SDK code examples.

Try it out

Authorization information

The following table describes the authorization information for this API operation. You can use this information in the Action element of a RAM policy statement to grant a RAM user or RAM role permission to call the operation. The columns are described as follows:

  • Action: a specific permission.

  • Access level: the access level of an action. Valid values: Write, Read, and List.

  • Resource type: the types of resources for which the action supports authorization:

    • Required resource types are marked with an asterisk (*).
    • Actions that do not support resource-level authorization use All resources.
  • Condition key: a condition key defined by the cloud service.

  • Dependent action: an additional permission required to perform the action. The caller must also have permission to perform the dependent action.

ActionAccess levelResource typeCondition keyDependent action

sfm:UpdatePromptTemplate

update

*All resources*

None

None

Request syntax

PATCH /{workspaceId}/promptTemplates/{promptTemplateId} HTTP/1.1

Request parameters

NameTypeRequiredDescriptionExample

workspaceId

string

Yes

The workspace ID.

llm-us9hjmt32nysdxxx

promptTemplateId

string

Yes

The prompt template ID.

6e49109bfeb94a39bb268f4e483ccxxx

name

string

No

The template name.

Xiaohongshu copywriting assistant

content

string

No

The prompt template content.

请写一篇小红书种草笔记,增加丰富的emoji元素,结尾作总结,并加上相关标签。主题为:${theme}

Response parameters

NameTypeDescriptionExample

object

Schema of Response

requestId

string

The request ID.

FE9B6CBF-47E6-5D76-9C5D-B814DD5ABxxx

Examples

Sample success response

JSON format

{
  "requestId": "FE9B6CBF-47E6-5D76-9C5D-B814DD5ABxxx\n"
}

Error codes

HTTP status codeThe error code.The error message.Description

400

PromptTemplate.ContentInvalid

Input parameter Content is invalid.

The Content parameter has an invalid format.

400

PromptTemplate.NameInvalid

Input parameter Name is invalid.

The Name parameter has an invalid format.

404

PromptTemplate.TemplateNotFound

Prompt template not found.

The prompt template was not found.

500

PromptTemplate.InternalError

Prompt template service inner exception.

An internal error occurred in the prompt template service.

For more error codes, see Error Center.