# Create Prompt Template

<Heading
  as={"h1"}
  className={"openapi__heading"}
  children={"Create Prompt Template"}
>
</Heading>

<MethodEndpoint
  method={"post"}
  path={"/api/v1/workspaces/{workspace_name}/prompt_templates"}
  context={"endpoint"}
>
  
</MethodEndpoint>

Creates a prompt template. The template is saved under custom templates in Prompt Studio.

<Heading
  id={"request"}
  as={"h2"}
  className={"openapi-tabs__heading"}
  children={"Request"}
>
</Heading>

<ParamsDetails
  parameters={[{"description":"Type the name of the workspace.","in":"path","name":"workspace_name","required":true,"schema":{"description":"Type the name of the workspace.","title":"Workspace Name","type":"string"}}]}
>
  
</ParamsDetails>

<RequestSchema
  title={"Body"}
  body={{"content":{"application/json":{"schema":{"properties":{"description":{"description":"Description of the prompt template.","title":"Prompt Template Description","type":"string"},"name":{"description":"Name of the prompt template.","title":"Prompt Template Name","type":"string"},"tags":{"description":"Tags assigned to the prompt template.","items":{"type":"string"},"title":"Prompt Template Tags","type":"array"},"text":{"description":"Text of the prompt.","title":"Prompt Template Text","type":"string"}},"required":["name","text","description","tags"],"title":"PromptTemplatePost","type":"object"}}},"required":true}}
>
  
</RequestSchema>

<StatusCodes
  id={undefined}
  label={undefined}
  responses={{"201":{"content":{"application/json":{"schema":{}}},"description":"Successful Response"},"422":{"content":{"application/json":{"schema":{"properties":{"detail":{"items":{"properties":{"ctx":{"title":"Context","type":"object"},"input":{"title":"Input"},"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"title":"Location","type":"array"},"msg":{"title":"Message","type":"string"},"type":{"title":"Error Type","type":"string"}},"required":["loc","msg","type"],"title":"ValidationError","type":"object"},"title":"Detail","type":"array"}},"title":"HTTPValidationError","type":"object"}}},"description":"Validation Error"}}}
>
  
</StatusCodes>
