---
title: "Webhook Handler"
method: POST
path: "PROMPT_TEMPLATE_UPDATED"
---

# Webhook Handler

`POST PROMPT_TEMPLATE_UPDATED` (webhook)

## Acknowledgement `200`

Successful Response

- PromptTemplateUpdatedEvent
  - `type` 'PROMPT_TEMPLATE_UPDATED'
  - `payload` PromptTemplateRead, required
    - `name` string, required: Name of the prompt template
    - `task_type` 'TAGGING' | 'METADATA_EXTRACTION' | 'ANNOTATION' | 'SENTENCE_ANNOTATION', required: What an LLM does with the documents (and what a prompt template is for).
    - `language` 'en' | 'de', required: The language of a prompt template; it decides the text of the blocks.
    - `id` integer, required: ID of the prompt template
    - `project_id` integer, required: Project the prompt template belongs to
    - `is_archived` boolean, required: Archived templates are no longer offered for new runs
    - `created` string, date-time, required: Created timestamp of the prompt template
    - `updated` string, date-time, required: Updated timestamp of the prompt template
    - `versions` PromptTemplateVersionRead[], required: All versions of the template, oldest first
      - `prompt` string, required: The prompt with its blocks
      - `settings` PromptSettings: Settings of the document and output format blocks.
        - `chunk_size_tokens` integer: Size of the chunks of <document:chunks> in tokens
        - `chunk_overlap_tokens` integer: Overlap of consecutive chunks of <document:chunks> in tokens
        - `context_before_chars` integer: Characters of context before a quote (<output-format:context>)
        - `context_after_chars` integer: Characters of context after a quote (<output-format:context>)
        - `fuzzy_threshold` number: Minimum similarity (0-1) to locate a quote that is not found exactly (<output-format:context>)
      - `codes` PromptCode[]: The codes of <codes> and <code_names>
        - `code_id` integer, required: ID of the code
        - `name` string, required: Name of the code
        - `description` string, required: Description of the code
      - `examples` union[]: The few-shot examples of <examples>
        - union
          - SpanPromptExample: The sentences around selected span annotations with all spans of their annotator.
            - `sdoc_id` integer, required: ID of the source document the text comes from
            - `source_annotation_ids` integer[], required: IDs of the annotations the example was created from
            - `text` string, required: The text of the example
            - `kind` 'SPAN', required: The kind of annotation the example shows
            - `spans` PromptExampleSpan[], required: All spans the annotator annotated in the text, sorted by begin
              - …
          - SentencePromptExample: The sentences of a sentence annotation and its code.
            - `sdoc_id` integer, required: ID of the source document the text comes from
            - `source_annotation_ids` integer[], required: IDs of the annotations the example was created from
            - `text` string, required: The text of the example
            - `kind` 'SENTENCE', required: The kind of annotation the example shows
            - `code_id` integer, required: ID of the code of the sentences
      - `tags` PromptTag[]: The tags of <tags>
        - `tag_id` integer, required: ID of the tag
        - `name` string, required: Name of the tag
        - `description` string, required: Description of the tag
      - `metadata_fields` PromptMetadataField[]: The metadata fields of <metadata_fields>
        - `project_metadata_id` integer, required: ID of the project metadata
        - `key` string, required: Key of the metadata field
        - `description` string, required: Description of the metadata field
        - `metatype` 'STRING' | 'NUMBER' | 'DATE' | 'BOOLEAN' | 'LIST', required
      - `id` integer, required: ID of the prompt template version
      - `prompt_template_id` integer, required: ID of the prompt template the version belongs to
      - `version` integer, required: Number of the version within its template (1, 2, 3, ...)
      - `user_id` integer, nullable, required: ID of the user who saved the version
      - `created` string, date-time, required: Created timestamp of the version

---

[API](https://skmtc.dev/uhh-lt/apis/discourse-analysis-tool-suite-api.md) - [All operations](https://skmtc.dev/uhh-lt/apis/discourse-analysis-tool-suite-api/llms.txt) - [OpenAPI document](https://skmtc.dev/uhh-lt/apis/discourse-analysis-tool-suite-api/revisions/4308495e3ed2?raw)
