Create a Prompt Template in a Project
/ic/api/integration/v1/projects/{projectId}/ai/templates
Request
-
projectId(required): string
Project identifier
-
integrationInstance(required): string
This is the name of the service instance. You can get this value from the About page where it is specified in the Service instance field.
- application/json;charset=utf-8
object-
code: string
Code
-
content: string
Content
-
created: string
(date-time)
Created Date
-
createdBy: string
Created By
-
description: string
Prompt Template Description
-
lastUpdated: string
(date-time)
Last Updated
-
lastUpdatedBy: string
Last Updated By
-
lockedBy: string
Locked By
-
lockedDate: string
(date-time)
Locked Date
-
lockedFlag: boolean
Locked Flag
-
mapped: boolean
Mapped
-
name: string
Prompt Template Name
-
projectId: string
Project id
-
status: string
Status
-
typeId: string
Type id
-
usage: integer
(int32)
Prompt Template Usage
-
version: string
Version
Response
- application/json;charset=utf-8, application/vnd.oracle.model+json;type=singular
200 Response
object-
code: string
Code
-
content: string
Content
-
created: string
(date-time)
Created Date
-
createdBy: string
Created By
-
description: string
Prompt Template Description
-
lastUpdated: string
(date-time)
Last Updated
-
lastUpdatedBy: string
Last Updated By
-
lockedBy: string
Locked By
-
lockedDate: string
(date-time)
Locked Date
-
lockedFlag: boolean
Locked Flag
-
mapped: boolean
Mapped
-
name: string
Prompt Template Name
-
projectId: string
Project id
-
status: string
Status
-
typeId: string
Type id
-
usage: integer
(int32)
Prompt Template Usage
-
version: string
Version
500 Response
Examples
The following example shows how to create a prompt template in a project by submitting a POST request on the REST resource using cURL. For more information about cURL, see Use cURL. For more information about endpoint URL structure, see Send Requests.
Example: Create a prompt template ORDER_CREATION_PROMPT in project TEST_PROJECT
This command consumes JSON data and creates a prompt template under the specified project.
curl -X POST -H 'Authorization: Bearer access_token' -H "Content-Type:application/json" -d @template.json https://design.integration.region.ocp.oraclecloud.com/ic/api/integration/v1/projects/TEST_PROJECT/ai/templates?integrationInstance=service-instance
Request Body:
The following example shows the contents of the request body in JSON
format. This is the content of the template.json file listed in the
cURL command with the -d option.
{
"name": "ORDER_CREATION_PROMPT",
"code": "ORDER_CREATION_PROMPT",
"description": "Prompt template for order creation scenarios",
"content": "Create an order using the provided customer and product details."
}
Attributes
- name
A human-readable name for the prompt.
- code
A unique identifier for the prompt within the project.
- description
A textual description of the prompt’s intent and usage.
- content
The actual prompt text provided to the AI model.