# Delete template

Delete a specific template.

# OpenAPI definition

````json
{
  "openapi": "3.1.1",
  "servers": [
    {
      "url": "https://api.cm.com/sign/v1"
    },
    {
      "url": "https://api.cm.com/sign-sandbox/v1"
    }
  ],
  "security": [
    {
      "JWT": []
    }
  ],
  "info": {
    "version": "1",
    "title": "Sign API",
    "description": "Sign by CM.com offers the ability to have end users sign PDF documents online.\n\nBefore you can start using the API, you need to be provided with credentials. You will have received these credentials, consisting of a Key and a Key Id, when you registered for Sign. If you have not yet received any credentials, you can request them via [this link](https://www.cm.com/app/verification-registration/sign). This will grant you access to the sandbox environment.\n\n*The credentials provided by CM.com are confidential and should be kept secret.*\n"
  },
  "tags": [
    {
      "name": "Template",
      "description": "Manage templates"
    }
  ],
  "paths": {
    "/templates/{id}": {
      "parameters": [
        {
          "in": "path",
          "name": "id",
          "description": "A unique uuid string that identifies a template.",
          "required": true,
          "example": "6f8d0a9d-b85c-4c3f-9e69-5699f1e00f49",
          "schema": {
            "type": "string",
            "format": "uuid"
          }
        }
      ],
      "delete": {
        "operationId": "delete_template",
        "summary": "Delete template",
        "description": "Delete a specific template.",
        "tags": [
          "Template"
        ],
        "responses": {
          "200": {
            "description": "The template has been deleted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Template"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    }
  },
  "components": {
    "responses": {
      "NotFound": {
        "description": "The specified resource was not found",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            }
          }
        }
      },
      "Unauthorized": {
        "description": "Unauthorized",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            }
          }
        }
      }
    },
    "schemas": {
      "ErrorResponse": {
        "title": "Error Response",
        "type": "object",
        "properties": {
          "status": {
            "type": "integer",
            "format": "int32",
            "description": "Response status code, should match HTTP error code"
          },
          "message": {
            "type": "string",
            "description": "High level description of the error that occurred. This description, when present, can be shown to the end user. It might describe that the system is not available, or that an unexpected error occurred. In test mode, the API will return more information (targeted at the developer) here than in production mode."
          }
        }
      },
      "FileReference": {
        "type": "string",
        "format": "uuid",
        "description": "A unique reference number for this file.",
        "examples": [
          "8d817359-7eb8-4b6e-9030-17ac286b7dc0"
        ]
      },
      "FieldType": {
        "type": "string",
        "description": "The type of field for the invitee.",
        "enum": [
          "signature",
          "signatureDate",
          "initials",
          "text",
          "textarea",
          "label",
          "checkbox",
          "radio",
          "stamp"
        ],
        "examples": [
          "signature"
        ]
      },
      "FieldLocation": {
        "type": "object",
        "properties": {
          "range": {
            "type": "string",
            "pattern": "^\\d+(-\\d+)?$",
            "maxLength": 64,
            "description": "The page number within the PDF that this field occupies (e.g. `1`), or range for a initials field (e.g. `1-3`).",
            "examples": [
              "1"
            ]
          },
          "x": {
            "type": "number",
            "format": "float",
            "description": "X position of the field in points."
          },
          "y": {
            "type": "number",
            "format": "float",
            "description": "Y position of the field in points."
          },
          "width": {
            "type": "number",
            "format": "float",
            "description": "Width of the field in points."
          },
          "height": {
            "type": "number",
            "format": "float",
            "description": "Height of the field in points."
          }
        }
      },
      "Template": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "Unique ID of the template.",
            "examples": [
              "f3ab4c4b-4276-46cc-bba6-d575696454ad"
            ]
          },
          "name": {
            "type": "string",
            "description": "Name of the template.",
            "examples": [
              "Contract Template"
            ]
          },
          "files": {
            "type": "array",
            "description": "Files linked to the template.",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "$ref": "#/components/schemas/FileReference"
                },
                "name": {
                  "type": "string",
                  "description": "Original name of the file without extension.",
                  "examples": [
                    "Template Agreement"
                  ]
                }
              }
            }
          },
          "attachments": {
            "type": "array",
            "description": "Attachments linked to the template.",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "$ref": "#/components/schemas/FileReference"
                },
                "name": {
                  "type": "string",
                  "description": "Original name of the attachment without extension.",
                  "examples": [
                    "Employee Handbook"
                  ]
                }
              }
            }
          },
          "fields": {
            "type": "array",
            "description": "Fields that will be linked to the file and invitee when applying to a dossier.",
            "items": {
              "type": "object",
              "properties": {
                "type": {
                  "$ref": "#/components/schemas/FieldType"
                },
                "required": {
                  "type": "boolean",
                  "description": "Boolean for if the field is required to be filled by the invitee.",
                  "examples": [
                    true
                  ]
                },
                "value": {
                  "type": "string",
                  "description": "The value of the field, if the type is 'label'.",
                  "examples": [
                    "Salary"
                  ]
                },
                "file": {
                  "type": "integer",
                  "description": "The index of the file when creating the dossier to link this field to, starting from 0.",
                  "examples": [
                    0
                  ]
                },
                "invitee": {
                  "type": "integer",
                  "description": "The index of the invitee when creating the dossier to link this field to, starting from 0.",
                  "examples": [
                    0
                  ]
                },
                "locations": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/FieldLocation"
                  }
                }
              }
            }
          },
          "lastUsedAt": {
            "type": "string",
            "format": "date-time",
            "description": "The date the template was last applied on a dossier, in ISO 8601 format.",
            "examples": [
              "2024-01-01T00:00:00+00:00"
            ]
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time",
            "description": "The date the template was last updated, in ISO 8601 format.",
            "examples": [
              "2024-01-01T00:00:00+00:00"
            ]
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "description": "The date the template was created, in ISO 8601 format.",
            "examples": [
              "2024-01-01T00:00:00+00:00"
            ]
          }
        }
      }
    },
    "securitySchemes": {
      "JWT": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "description": "In order to authenticate you need to use your credentials to generate a JWT Bearer token. The [JWT token](https://jwt.io/introduction/) has to be generated using the `HS256` algorithm and your credentials. This JWT has to contain the following attributes: `iat`, `nbf`, `exp`  in the payload, as well as the attribute `kid` in the header of the JWT. This `kid` attribute needs to contain the Key Id of your credentials.\n\nThe generated token needs to be passed via the HTTP Authorization header like:\n\n```\nAuthorization: Bearer GENERATED_TOKEN_HERE\n```\n\nThere are many libraries available for different programming languages that can help you to generate a JWT. See the Libraries tab on [https://jwt.io](https://jwt.io)\n"
      }
    }
  },
  "x-readme": {
    "explorer-enabled": true,
    "proxy-enabled": true
  },
  "_id": {
    "buffer": {
      "0": 106,
      "1": 177,
      "2": 26,
      "3": 196,
      "4": 252,
      "5": 46,
      "6": 219,
      "7": 163,
      "8": 234,
      "9": 51,
      "10": 132,
      "11": 96
    }
  }
}
````