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

# save template

> create a report, What's in Play (wip) or screener template, or update the one whose id is given. a report template names parent_report and sub_report from the report catalog and a configuration {setting_key, customizations, inputs?}: the page's setting key, its slot values (describe report customizations names both) and optional inputs ticker {market, ticker}, date_range {mode: "preset", preset} or {mode: "custom", from, to} and session {shared_id} or {id} of a custom session. a wip template's configuration is {market, session?, tickers, selected_reports, customizations?, filters?} and a screener template's {market, session_shared_id, tickers, reports, customizations?}, composed from the report catalog's wip or screener surface. names are trimmed and unique per type ignoring case; a conflict names the existing template's id. a listed or deleted template's configuration can be sent back as is. returns the saved template, with its page url for report templates, and on update the previous one for undo. templates are applied from their picker in Edgeful. this changes your account, and Edgeful shows the change after a reload. requires the key's write permission.



## OpenAPI

````yaml /openapi-public.json post /v1/settings/templates
openapi: 3.1.0
info:
  title: Edgeful API
  description: >-
    Public API reference for Edgeful market analysis. The bearer token is your
    Edgeful API key. Reports support the docs playground. Report responses
    include row-level output in `detailed` only when your plan includes
    row-level detail.
  version: 1.0.0
servers:
  - url: https://api.edgeful.com
    description: Production
security:
  - BearerAuth: []
tags:
  - name: reports
  - name: discovery
  - name: live data
  - name: settings
  - name: custom reports
paths:
  /v1/settings/templates:
    post:
      tags:
        - settings
      summary: save template
      description: >-
        create a report, What's in Play (wip) or screener template, or update
        the one whose id is given. a report template names parent_report and
        sub_report from the report catalog and a configuration {setting_key,
        customizations, inputs?}: the page's setting key, its slot values
        (describe report customizations names both) and optional inputs ticker
        {market, ticker}, date_range {mode: "preset", preset} or {mode:
        "custom", from, to} and session {shared_id} or {id} of a custom session.
        a wip template's configuration is {market, session?, tickers,
        selected_reports, customizations?, filters?} and a screener template's
        {market, session_shared_id, tickers, reports, customizations?}, composed
        from the report catalog's wip or screener surface. names are trimmed and
        unique per type ignoring case; a conflict names the existing template's
        id. a listed or deleted template's configuration can be sent back as is.
        returns the saved template, with its page url for report templates, and
        on update the previous one for undo. templates are applied from their
        picker in Edgeful. this changes your account, and Edgeful shows the
        change after a reload. requires the key's write permission.
      operationId: save_template
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TemplateSaveRequest'
            examples:
              default:
                summary: a gap fill by size template with a 50% fill on ES
                value:
                  template_type: report
                  name: tight gap
                  parent_report: gap-fill
                  sub_report: by-size
                  configuration:
                    setting_key: gapFillBySize
                    customizations:
                      value: 50
                    inputs:
                      ticker:
                        market: futures
                        ticker: ES
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TemplateSaveResponse'
        '400':
          description: >-
            The request names a value Edgeful cannot use; `detail` says which
            values are valid.
          content:
            application/json:
              examples:
                refused:
                  summary: refused
                  value:
                    detail: NQX is not a futures ticker Edgeful knows.
        '403':
          description: >-
            Valid API key, but the account has no API-enabled subscription or
            the key's writes are off.
          content:
            application/json:
              examples:
                missing_entitlement:
                  summary: missing entitlement
                  value:
                    detail:
                      detail: No active subscription with API access found.
                      code: missing_entitlement
                writes_disabled:
                  summary: writes disabled
                  value:
                    detail:
                      detail: >-
                        Enable writes for this API key or connected Claude in
                        the API dashboard.
                      code: writes_disabled
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
        '429':
          description: >-
            The account's settings write budget is exhausted; wait `Retry-After`
            seconds. Refused attempts count too.
          content:
            application/json:
              examples:
                write_budget_exhausted:
                  summary: write budget exhausted
                  value:
                    detail:
                      detail: Settings write limit reached. Try again shortly.
                      code: write_budget_exhausted
          headers:
            Retry-After:
              description: seconds to wait before sending the write again.
              schema:
                type: integer
        '503':
          description: The write budget could not be checked; retry shortly.
          content:
            application/json:
              examples:
                write_limits_unavailable:
                  summary: write limits unavailable
                  value:
                    detail:
                      detail: >-
                        Settings write limits are temporarily unavailable. Try
                        again shortly.
                      code: write_limits_unavailable
      security:
        - BearerAuth: []
      x-codeSamples:
        - lang: curl
          label: cURL
          source: |-
            curl --request POST \
              --url 'https://api.edgeful.com/v1/settings/templates' \
              --header 'Authorization: Bearer <api-key>' \
              --header 'Content-Type: application/json' \
              --data '{"template_type": "report", "name": "tight gap", "parent_report": "gap-fill", "sub_report": "by-size", "configuration": {"setting_key": "gapFillBySize", "customizations": {"value": 50}, "inputs": {"ticker": {"market": "futures", "ticker": "ES"}}}}'
        - lang: python
          label: Python
          source: >-
            import requests


            url = "https://api.edgeful.com/v1/settings/templates"

            headers = {"Authorization": "Bearer <api-key>"}

            payload = {'template_type': 'report', 'name': 'tight gap',
            'parent_report': 'gap-fill', 'sub_report': 'by-size',
            'configuration': {'setting_key': 'gapFillBySize', 'customizations':
            {'value': 50}, 'inputs': {'ticker': {'market': 'futures', 'ticker':
            'ES'}}}}


            response = requests.post(url, headers=headers, json=payload)

            print(response.json())
        - lang: javascript
          label: JavaScript
          source: |-
            const url = "https://api.edgeful.com/v1/settings/templates";
            const options = {
              method: "POST",
              headers: { Authorization: "Bearer <api-key>", "Content-Type": "application/json" },
              body: JSON.stringify({"template_type": "report", "name": "tight gap", "parent_report": "gap-fill", "sub_report": "by-size", "configuration": {"setting_key": "gapFillBySize", "customizations": {"value": 50}, "inputs": {"ticker": {"market": "futures", "ticker": "ES"}}}}),
            };

            const response = await fetch(url, options);
            const data = await response.json();
            console.log(data);
        - lang: php
          label: PHP
          source: >-
            <?php

            $ch = curl_init("https://api.edgeful.com/v1/settings/templates");

            curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");

            curl_setopt($ch, CURLOPT_HTTPHEADER, ["Authorization: Bearer
            <api-key>", "Content-Type: application/json"]);

            curl_setopt($ch, CURLOPT_POSTFIELDS, '{"template_type": "report",
            "name": "tight gap", "parent_report": "gap-fill", "sub_report":
            "by-size", "configuration": {"setting_key": "gapFillBySize",
            "customizations": {"value": 50}, "inputs": {"ticker": {"market":
            "futures", "ticker": "ES"}}}}');

            curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

            $response = curl_exec($ch);

            curl_close($ch);

            echo $response;
        - lang: go
          label: Go
          source: |-
            package main

            import (
                "fmt"
                "io"
                "net/http"
                "strings"
            )

            func main() {
                req, _ := http.NewRequest("POST", "https://api.edgeful.com/v1/settings/templates", strings.NewReader(`{"template_type": "report", "name": "tight gap", "parent_report": "gap-fill", "sub_report": "by-size", "configuration": {"setting_key": "gapFillBySize", "customizations": {"value": 50}, "inputs": {"ticker": {"market": "futures", "ticker": "ES"}}}}`))
                req.Header.Set("Authorization", "Bearer <api-key>")
                req.Header.Set("Content-Type", "application/json")
                resp, _ := http.DefaultClient.Do(req)
                defer resp.Body.Close()
                body, _ := io.ReadAll(resp.Body)
                fmt.Println(string(body))
            }
        - lang: java
          label: Java
          source: >-
            import java.net.URI;

            import java.net.http.HttpClient;

            import java.net.http.HttpRequest;

            import java.net.http.HttpResponse;


            HttpClient client = HttpClient.newHttpClient();

            HttpRequest request = HttpRequest.newBuilder()
                .uri(URI.create("https://api.edgeful.com/v1/settings/templates"))
                .header("Authorization", "Bearer <api-key>")
                .header("Content-Type", "application/json")
                .method("POST", HttpRequest.BodyPublishers.ofString("{\"template_type\": \"report\", \"name\": \"tight gap\", \"parent_report\": \"gap-fill\", \"sub_report\": \"by-size\", \"configuration\": {\"setting_key\": \"gapFillBySize\", \"customizations\": {\"value\": 50}, \"inputs\": {\"ticker\": {\"market\": \"futures\", \"ticker\": \"ES\"}}}}"))
                .build();
            HttpResponse<String> response = client.send(request,
            HttpResponse.BodyHandlers.ofString());

            System.out.println(response.body());
        - lang: ruby
          label: Ruby
          source: >-
            require "net/http"

            require "uri"


            uri = URI("https://api.edgeful.com/v1/settings/templates")

            request = Net::HTTP::Post.new(uri)

            request["Authorization"] = "Bearer <api-key>"

            request["Content-Type"] = "application/json"

            request.body = '{"template_type": "report", "name": "tight gap",
            "parent_report": "gap-fill", "sub_report": "by-size",
            "configuration": {"setting_key": "gapFillBySize", "customizations":
            {"value": 50}, "inputs": {"ticker": {"market": "futures", "ticker":
            "ES"}}}}'


            response = Net::HTTP.start(uri.hostname, uri.port, use_ssl:
            uri.scheme == "https") do |http|
              http.request(request)
            end

            puts response.body
components:
  schemas:
    TemplateSaveRequest:
      properties:
        template_type:
          type: string
          enum:
            - report
            - wip
            - screener
          title: Template Type
          description: report, wip (What's in Play) or screener.
        name:
          anyOf:
            - type: string
              maxLength: 255
              minLength: 1
            - type: 'null'
          title: Name
          description: >-
            template name, trimmed and unique per type ignoring case; required
            to create.
        configuration:
          anyOf:
            - additionalProperties:
                $ref: '#/components/schemas/JsonValue'
              type: object
              maxProperties: 100
            - type: 'null'
          title: Configuration
          description: >-
            the template's configuration, in the shape the save template
            operation gives for its type; required to create.
        parent_report:
          anyOf:
            - type: string
              maxLength: 80
              minLength: 1
            - type: 'null'
          title: Parent Report
          description: >-
            report templates only: the report page's slug from the report
            catalog.
        sub_report:
          anyOf:
            - type: string
              maxLength: 80
              minLength: 1
            - type: 'null'
          title: Sub Report
          description: 'report templates only: the page''s sub-report slug.'
        id:
          anyOf:
            - type: integer
              maximum: 2147483647
              minimum: -2147483648
            - type: 'null'
          title: Id
          description: id of the template to update; omit to create one.
      additionalProperties: false
      type: object
      required:
        - template_type
      title: TemplateSaveRequest
    TemplateSaveResponse:
      properties:
        status:
          type: string
          title: Status
          description: created, updated or unchanged.
        template:
          $ref: '#/components/schemas/TemplateEntry'
          description: the saved template.
        previous:
          anyOf:
            - $ref: '#/components/schemas/TemplateEntry'
            - type: 'null'
          description: the template before an update, for undo; null on create.
        changed:
          $ref: '#/components/schemas/TemplatesChanged'
          description: what this write changed.
      additionalProperties: true
      type: object
      required:
        - status
        - template
        - previous
        - changed
      title: TemplateSaveResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    JsonValue: {}
    TemplateEntry:
      properties:
        id:
          type: integer
          title: Id
          description: template id; negative for a built-in template.
        type:
          type: string
          title: Type
          description: report, wip or screener.
        name:
          type: string
          title: Name
          description: template name.
        parent_report:
          anyOf:
            - type: string
            - type: 'null'
          title: Parent Report
          description: 'report templates: the report page''s slug.'
        sub_report:
          anyOf:
            - type: string
            - type: 'null'
          title: Sub Report
          description: 'report templates: the page''s sub-report slug.'
        sort_order:
          anyOf:
            - type: integer
            - type: 'null'
          title: Sort Order
          description: position in the picker.
        configuration:
          anyOf:
            - additionalProperties:
                $ref: '#/components/schemas/JsonValue'
              type: object
            - type: 'null'
          title: Configuration
          description: the stored configuration, which can be sent back to save it again.
        url:
          anyOf:
            - type: string
            - type: 'null'
          title: Url
          description: 'report templates: the page in Edgeful.'
        read_only:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Read Only
          description: true for a template Edgeful ships.
      additionalProperties: true
      type: object
      required:
        - id
        - type
        - name
      title: TemplateEntry
    TemplatesChanged:
      properties:
        saved:
          anyOf:
            - items:
                type: integer
              type: array
            - type: 'null'
          title: Saved
          description: ids saved.
        removed:
          anyOf:
            - items:
                type: integer
              type: array
            - type: 'null'
          title: Removed
          description: ids removed.
      additionalProperties: true
      type: object
      title: TemplatesChanged
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: >-
        Send your Edgeful API key in the Authorization header as `Bearer
        <api-key>` (for example, `Bearer ef_live_<random>`).

````

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