Guild Template Object
Represents a code that when used, creates a guild based on a snapshot of an existing guild.Guild Template Structure
| Field | Type | Description | 
|---|---|---|
| code | string | the template code (unique ID) | 
| name | string | template name | 
| description | ?string | the description for the template | 
| usage_count | integer | number of times this template has been used | 
| creator_id | snowflake | the ID of the user who created the template | 
| creator | user object | the user who created the template | 
| created_at | ISO8601 timestamp | when this template was created | 
| updated_at | ISO8601 timestamp | when this template was last synced to the source guild | 
| source_guild_id | snowflake | the ID of the guild this template is based on | 
| serialized_source_guild | partial guild object | the guild snapshot this template contains; placeholder IDs are given as integers | 
| is_dirty | ?boolean | whether the template has unsynced changes | 
Example Guild Template Object
Get Guild Template
GET/guilds/templates/{template.code}
Returns a guild template object for the given code.
Get Guild Templates
GET/guilds/{guild.id}/templates
Returns an array of guild template objects. Requires the MANAGE_GUILD permission.
Create Guild Template
POST/guilds/{guild.id}/templates
Creates a template for the guild. Requires the MANAGE_GUILD permission. Returns the created guild template object on success.
JSON Params
| Field | Type | Description | 
|---|---|---|
| name | string | name of the template (1-100 characters) | 
| description? | ?string | description for the template (0-120 characters) | 
Sync Guild Template
PUT/guilds/{guild.id}/templates/{template.code}
Syncs the template to the guild’s current state. Requires the MANAGE_GUILD permission. Returns the guild template object on success.
Modify Guild Template
PATCH/guilds/{guild.id}/templates/{template.code}
Modifies the template’s metadata. Requires the MANAGE_GUILD permission. Returns the guild template object on success.
JSON Params
| Field | Type | Description | 
|---|---|---|
| name? | string | name of the template (1-100 characters) | 
| description? | ?string | description for the template (0-120 characters) | 
Delete Guild Template
DELETE/guilds/{guild.id}/templates/{template.code}
Deletes the template. Requires the MANAGE_GUILD permission. Returns the deleted guild template object on success.