---
updatedAt: 2025-09-11T20:21:38.000Z
agentTools:
  projectIndex: https://docs.gathercontent.com/llms.txt
---

# Apply template to an item

Apply an existing template to an item. **Caution** - the fields from the new template _will replace the fields_ in the current item, _without copying_ the content. (The previous content will only exist and be accessible in the items revision history)

# OpenAPI definition

```json
{
  "openapi": "3.0.2",
  "info": {
    "title": "GatherContent API",
    "description": "This is the documentation for the latest stable version of the GatherContent API Find out more about GatherContent at [https://gathercontent.com](https://gathercontent.com) or get help at [https://help.gathercontent.com](https://help.gathercontent.com)",
    "version": "2.0.0",
    "termsOfService": "https://gathercontent.com/legal/terms-of-service",
    "contact": {
      "email": "development@gathercontent.com"
    }
  },
  "x-samples-languages": [
    "curl",
    "node",
    "ruby",
    "javascript",
    "python"
  ],
  "servers": [
    {
      "url": "https://api.gathercontent.com"
    },
    {
      "url": "https://api.gatherpreview.com"
    },
    {
      "url": "http://api.gathercontent.test"
    }
  ],
  "externalDocs": {
    "description": "GatherContent help docs",
    "url": "https://help.gathercontent.com"
  },
  "paths": {
    "/items/{item_id}/apply_template": {
      "parameters": [
        {
          "$ref": "#/components/parameters/itemId"
        }
      ],
      "post": {
        "summary": "Apply template to an item",
        "operationId": "applyTemplate",
        "description": "Apply an existing template to an item. **Caution** - the fields from the new template _will replace the fields_ in the current item, _without copying_ the content. (The previous content will only exist and be accessible in the items revision history)\n",
        "tags": [
          "Items"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "template_id"
                ],
                "properties": {
                  "template_id": {
                    "type": "integer",
                    "description": "The id of the template to apply. The template must be in the same project as the item"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/vnd.gathercontent.v2+json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/itemDefinition"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/insufficientRoles"
          },
          "404": {
            "$ref": "#/components/responses/itemNotFoundError"
          },
          "422": {
            "$ref": "#/components/responses/validationError"
          },
          "429": {
            "$ref": "#/components/responses/tooManyRequests"
          }
        }
      }
    }
  },
  "tags": [
    {
      "name": "Items",
      "description": "Items are the where your content is held. An item may represent a webpage, article or component. It has a structure (which can either be linked to a reusable template - shared across multiple items, or it can have it's own \"custom\" structure - where the fields are unique to a particular item)."
    }
  ],
  "components": {
    "parameters": {
      "itemId": {
        "name": "item_id",
        "description": "Item ID",
        "in": "path",
        "required": true,
        "schema": {
          "type": "integer"
        }
      }
    },
    "schemas": {
      "uuid": {
        "type": "string",
        "pattern": "[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}",
        "example": "aa23428b-9b43-4d7f-8c5c-0fb5fc3a944e"
      },
      "uuidNullable": {
        "type": "string",
        "pattern": "[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}",
        "example": "aa23428b-9b43-4d7f-8c5c-0fb5fc3a944e",
        "nullable": true
      },
      "datetime": {
        "type": "string",
        "description": "DateTimes are all in UTC - it's up to the client to convert them to an appropriate time zone",
        "pattern": "\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2}",
        "example": "2019-04-20T04:20:00.000Z"
      },
      "datetimeNullable": {
        "type": "string",
        "description": "DateTimes are all in UTC - it's up to the client to convert them to an appropriate time zone",
        "pattern": "\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2}",
        "example": "2019-04-20T04:20:00.000Z",
        "nullable": true
      },
      "optionDefinition": {
        "type": "object",
        "required": [
          "label"
        ],
        "properties": {
          "optionId": {
            "$ref": "#/components/schemas/uuid"
          },
          "label": {
            "type": "string"
          }
        }
      },
      "structureFieldType": {
        "type": "string",
        "enum": [
          "text",
          "attachment",
          "guidelines",
          "choice_radio",
          "choice_checkbox",
          "component"
        ]
      },
      "structureMeta": {
        "anyOf": [
          {
            "type": "object",
            "description": "is_plain will only be applied to `text` fields",
            "required": [
              "is_plain"
            ],
            "properties": {
              "is_plain": {
                "type": "boolean"
              }
            }
          },
          {
            "type": "object",
            "description": "validation will only be applied to `text` fields",
            "required": [
              "validation"
            ],
            "properties": {
              "validation": {
                "required": [
                  "rule",
                  "limit"
                ],
                "properties": {
                  "rule": {
                    "type": "string",
                    "enum": [
                      "chars",
                      "words"
                    ]
                  },
                  "limit": {
                    "type": "integer"
                  }
                }
              }
            }
          },
          {
            "type": "object",
            "description": "choice_fields will only be applied to `choice_radio` and `choice_checkbox` fields",
            "required": [
              "choice_fields"
            ],
            "properties": {
              "choice_fields": {
                "type": "object",
                "required": [
                  "options"
                ],
                "properties": {
                  "options": {
                    "type": "array",
                    "items": {
                      "$ref": "#/components/schemas/optionDefinition"
                    }
                  },
                  "otherOption": {
                    "$ref": "#/components/schemas/optionDefinition"
                  }
                }
              }
            }
          },
          {
            "type": "object",
            "description": "repeatable will only be applied to fields marked as repeatable",
            "required": [
              "repeatable"
            ],
            "properties": {
              "repeatable": {
                "type": "object",
                "required": [
                  "isRepeatable",
                  "limitEnabled",
                  "limit"
                ],
                "properties": {
                  "isRepeatable": {
                    "type": "boolean"
                  },
                  "limitEnabled": {
                    "type": "boolean"
                  },
                  "limit": {
                    "type": "integer"
                  }
                }
              }
            }
          }
        ]
      },
      "structureFieldResponseDefinition": {
        "type": "object",
        "required": [
          "field_type",
          "label"
        ],
        "properties": {
          "uuid": {
            "$ref": "#/components/schemas/uuid"
          },
          "field_type": {
            "$ref": "#/components/schemas/structureFieldType"
          },
          "label": {
            "type": "string"
          },
          "instructions": {
            "type": "string"
          },
          "component": {
            "$ref": "#/components/schemas/component"
          },
          "metadata": {
            "$ref": "#/components/schemas/structureMeta"
          }
        }
      },
      "componentStructureFieldDefinition": {
        "type": "object",
        "required": [
          "field_type",
          "label"
        ],
        "properties": {
          "uuid": {
            "$ref": "#/components/schemas/uuid"
          },
          "field_type": {
            "$ref": "#/components/schemas/structureFieldType"
          },
          "label": {
            "type": "string"
          },
          "instructions": {
            "type": "string"
          },
          "metadata": {
            "$ref": "#/components/schemas/structureMeta"
          }
        }
      },
      "fieldGroupDefinition": {
        "type": "object",
        "required": [
          "name"
        ],
        "properties": {
          "uuid": {
            "$ref": "#/components/schemas/uuid"
          },
          "name": {
            "type": "string",
            "example": "Group name"
          },
          "fields": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/structureFieldResponseDefinition"
            }
          }
        }
      },
      "itemStructureDefinition": {
        "type": "object",
        "properties": {
          "uuid": {
            "$ref": "#/components/schemas/uuid"
          },
          "groups": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/fieldGroupDefinition"
            }
          }
        }
      },
      "component": {
        "type": "object",
        "description": "A component object",
        "properties": {
          "uuid": {
            "$ref": "#/components/schemas/uuid"
          },
          "name": {
            "type": "string",
            "example": "My component"
          },
          "fields": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/componentStructureFieldDefinition"
            }
          }
        }
      },
      "itemDefinition": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "project_id": {
            "type": "integer"
          },
          "status_id": {
            "type": "integer"
          },
          "folder_uuid": {
            "$ref": "#/components/schemas/uuidNullable"
          },
          "template_id": {
            "type": "integer",
            "nullable": true
          },
          "structure_uuid": {
            "$ref": "#/components/schemas/uuid"
          },
          "position": {
            "type": "integer",
            "minimum": 0
          },
          "name": {
            "type": "string"
          },
          "archived_by": {
            "type": "integer",
            "nullable": true
          },
          "archived_at": {
            "$ref": "#/components/schemas/datetimeNullable"
          },
          "created_at": {
            "$ref": "#/components/schemas/datetime"
          },
          "updated_at": {
            "$ref": "#/components/schemas/datetimeNullable"
          },
          "next_due_at": {
            "$ref": "#/components/schemas/datetimeNullable"
          },
          "completed_at": {
            "$ref": "#/components/schemas/datetimeNullable"
          },
          "assigned_user_ids": {
            "type": "array",
            "items": {
              "type": "integer"
            }
          },
          "assinee_count": {
            "type": "integer"
          },
          "structure": {
            "$ref": "#/components/schemas/itemStructureDefinition"
          }
        }
      }
    },
    "securitySchemes": {
      "basicAuth": {
        "type": "http",
        "scheme": "basic"
      }
    },
    "responses": {
      "insufficientRoles": {
        "description": "Insufficient permission to perform this action",
        "content": {
          "application/vnd.gathercontent.v2+json": {
            "schema": {
              "type": "object",
              "properties": {
                "error": {
                  "type": "string",
                  "example": "Insufficient permission to perform this action"
                },
                "code": {
                  "type": "integer",
                  "example": 403
                }
              }
            }
          }
        }
      },
      "validationError": {
        "description": "Validation error",
        "content": {
          "application/vnd.gathercontent.v2+json": {
            "schema": {
              "type": "object",
              "properties": {
                "error": {
                  "type": "string",
                  "example": "The given data was invalid"
                },
                "code": {
                  "type": "integer",
                  "example": 422
                },
                "messages": {
                  "type": "object",
                  "description": "Key/value mapping of invalid field => failure reason. This changes depending on which data is invalid."
                }
              }
            }
          }
        }
      },
      "tooManyRequests": {
        "description": "Too many request",
        "content": {
          "application/vnd.gathercontent.v2+json": {
            "schema": {
              "type": "object",
              "properties": {
                "error": {
                  "type": "string",
                  "example": "Too Many Attempts."
                },
                "code": {
                  "type": "integer",
                  "example": 429
                }
              }
            }
          }
        },
        "headers": {
          "X-RateLimit-Limit": {
            "schema": {
              "type": "integer"
            },
            "description": "Request limit."
          },
          "X-RateLimit-Remaining": {
            "schema": {
              "type": "integer"
            },
            "description": "The number of requests left for the time window."
          },
          "X-RateLimit-Reset": {
            "schema": {
              "type": "string"
            },
            "description": "The Unix timestamp at which the current rate limit window resets."
          },
          "Retry-After": {
            "schema": {
              "type": "integer"
            },
            "description": "The number of seconds before the current rate limit window resets."
          }
        }
      },
      "itemNotFoundError": {
        "description": "Item not found",
        "content": {
          "application/vnd.gathercontent.v2+json": {
            "schema": {
              "type": "object",
              "properties": {
                "error": {
                  "type": "string",
                  "example": "Item not found"
                },
                "code": {
                  "type": "integer",
                  "example": 404
                }
              }
            }
          }
        }
      }
    }
  },
  "security": [
    {
      "basicAuth": []
    }
  ],
  "x-readme": {
    "explorer-enabled": true,
    "proxy-enabled": true
  }
}
```