> ## Documentation Index
> Fetch the complete documentation index at: https://docs.sreagent.app/llms.txt
> Use this file to discover all available pages before exploring further.

# Create a prompt template

> Write a new prompt template for this organization. prompt_type is one of investigation_system, investigation_user, slack_assistant, root_cause, custom and is fixed once written: a template for another type is another template. The content is scanned for injection patterns as it is stored, and a template that matches one is kept flagged and disabled with the answer saying so. Nothing on this surface approves a flagged template: somebody reads it on the Settings page and approves it there.



## OpenAPI

````yaml /api-reference/openapi.json post /prompt_templates
openapi: 3.1.0
info:
  description: >-
    A resource-shaped endpoint onto the same tool surface the MCP server
    (/api/mcp) reaches. Every gate, refusal and audit row a caller sees here is
    the exact one the MCP endpoint answers for the same tool. Authenticated with
    an API key holding the api:admin scope, or the read-only api:config_read
    scope for GET alone.
  title: SRE Agent configuration API
  version: 1.0.0
servers:
  - url: https://sreagent.app/api/v1/config
security:
  - apiKey: []
tags:
  - name: ai_providers
  - name: ai_settings
  - name: alert_mutes
  - name: alert_routes
  - name: aws_external_id
  - name: certificate_monitors
  - name: change_notifications
  - name: compliance_periods
  - name: connectors
  - name: data_sources
  - name: deploy_policies
  - name: export
  - name: github_settings
  - name: image_targets
  - name: notification_settings
  - name: organization_settings
  - name: outbound_configs
  - name: outbound_rules
  - name: overseer_settings
  - name: prompt_templates
  - name: repo_settings
  - name: service_bindings
  - name: slack
  - name: slis
  - name: slos
  - name: status_page_components
  - name: status_page_incidents
  - name: status_page_settings
  - name: synthetic_checks
  - name: team_members
  - name: teams
  - name: ticket_import_rules
  - name: ticket_integrations
paths:
  /prompt_templates:
    post:
      tags:
        - prompt_templates
      summary: Create a prompt template
      description: >-
        Write a new prompt template for this organization. prompt_type is one of
        investigation_system, investigation_user, slack_assistant, root_cause,
        custom and is fixed once written: a template for another type is another
        template. The content is scanned for injection patterns as it is stored,
        and a template that matches one is kept flagged and disabled with the
        answer saying so. Nothing on this surface approves a flagged template:
        somebody reads it on the Settings page and approves it there.
      operationId: create_prompt_template
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              properties:
                content:
                  description: >-
                    The prompt itself, 1 to 10000 characters. This is the text
                    the model is given, so it is scanned for injection patterns
                    on every write and answered in full by
                    list_prompt_templates.
                  type: string
                description:
                  description: >-
                    A line saying what this prompt is for, for whoever reads the
                    list next. Pass null to clear it.
                  type: string
                enabled:
                  description: >-
                    Whether the template may be served at all. The scanner sets
                    it to false on a template it flags, and re-enabling one
                    whose content still matches a pattern is refused by the
                    scanner rather than by this argument.
                  type: boolean
                is_default:
                  description: >-
                    Make this the default for its type, which demotes whatever
                    held that place. Only an approved, enabled default is
                    actually served.
                  type: boolean
                name:
                  description: >-
                    What the template is called, 1 to 255 characters, unique
                    within this organization.
                  type: string
                prompt_type:
                  description: >-
                    What the prompt is for: investigation_system,
                    investigation_user, slack_assistant, root_cause, custom. It
                    decides which lookup serves the template, and it cannot be
                    changed afterwards.
                  enum:
                    - investigation_system
                    - investigation_user
                    - slack_assistant
                    - root_cause
                    - custom
                  type: string
              required:
                - name
                - prompt_type
                - content
              type: object
        required: true
      responses:
        '201':
          description: Created.
        '409':
          description: A row already matches this resource's natural key.
        '422':
          description: The tool refused the request's shape or content.
        default:
          description: The request failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    Error:
      type: object
      description: The body of every failed request.
      properties:
        error:
          type: string
          description: >-
            A short machine-readable code such as forbidden, conflict or
            read_only_key.
        message:
          type: string
          description: A sentence that says what to change.
      required:
        - error
        - message
      additionalProperties: true
  securitySchemes:
    apiKey:
      description: >-
        An sre_ak_* API key holding the api:admin scope (or api:config_read,
        which every write refuses with read_only_key).
      scheme: bearer
      type: http

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.