Skip to main content

Guild Template Object

Represents a code that when used, creates a guild based on a snapshot of an existing guild.
Guild Template Structure
FieldTypeDescription
codestringthe template code (unique ID)
namestringtemplate name
description?stringthe description for the template
usage_countintegernumber of times this template has been used
creator_idsnowflakethe ID of the user who created the template
creatoruser objectthe user who created the template
created_atISO8601 timestampwhen this template was created
updated_atISO8601 timestampwhen this template was last synced to the source guild
source_guild_idsnowflakethe ID of the guild this template is based on
serialized_source_guildpartial guild objectthe guild snapshot this template contains; placeholder IDs are given as integers
is_dirty?booleanwhether 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
FieldTypeDescription
namestringname of the template (1-100 characters)
description??stringdescription 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
FieldTypeDescription
name?stringname of the template (1-100 characters)
description??stringdescription 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.