Omniplex Docs

Server Templates

These API endpoints are related to user-submitted Discord server template listings

Get All Server Templates

GET
/server-templates/@all

Gets all server templates on the list, paginated, optionally filtered by tag

Query Parameters

page?string

The page number

tags?string

Comma-separated tags to filter by (matches any). Omit to return every template.

owner?string

Filter to templates submitted by this user ID. Omit to return every submitter's.

Response Body

Success

application/json
  1. response
count?integer
Range0 <= value <= 18446744073709552000
per_page?integer
Range0 <= value <= 18446744073709552000
results?array<>
Example Request
curl -X GET 'https://spider.omniplex.gg/server-templates/@all'
Example Response
{  "count": 0,  "per_page": 0,  "results": [    {      "channel_count": 0,      "channels": [        {          "id": 0,          "name": "string",          "parent_id": 0,          "position": 0,          "type": 0        }      ],      "code": "string",      "created_at": "2019-08-24T14:15:22Z",      "dislikes": 0,      "icon_version": "string",      "id": "string",      "likes": 0,      "name": "string",      "nsfw": true,      "out_of_date": true,      "owner": {        "avatar": "string",        "bot": true,        "display_name": "string",        "extra_data": {          "property1": null,          "property2": null        },        "flags": [          "string"        ],        "id": "string",        "status": "string",        "username": "string"      },      "role_count": 0,      "roles": [        {          "color": 0,          "id": 0,          "name": "string"        }      ],      "short": "string",      "source_updated_at": "2019-08-24T14:15:22Z",      "synced_at": "2019-08-24T14:15:22Z",      "tags": [        "string"      ],      "unavailable": true,      "updated_at": "2019-08-24T14:15:22Z",      "usage_count": 0    }  ]}

Get Server Template

GET
/server-templates/{id}

Gets a single server template by its internal ID

Path Parameters

id*string

The template's internal ID

Response Body

Success

application/json
  1. response
channel_count?integer

How many channels (not counting categories) the template has

channels?array<>

A preview of the template's channels, captured from Discord at submission time. Empty on list responses -- only the single-template fetch populates this

code?string

The Discord server template code

created_at?string
Formatdate-time
dislikes?integer

How many people disliked the template

icon_version?string

The version of the template's custom icon, used to build its CDN URL. Null when it has none

id?string
likes?integer

How many people liked the template

name?string

The template's name, pulled from Discord at submission time

nsfw?boolean

Whether the template is for an NSFW-oriented server

out_of_date?boolean

Whether the source server has changes that haven't been synced into the template on Discord yet

owner?

The user who submitted the template

role_count?integer

How many roles (not counting @everyone) the template has

roles?array<>

A preview of the template's roles (excluding @everyone), captured from Discord at submission time. Empty on list responses -- only the single-template fetch populates this

short?string

The submitter's description of the template

source_updated_at?string

When the template was last updated on Discord

Formatdate-time
synced_at?string

When Omniplex last refreshed the template from Discord

Formatdate-time
tags?array<>

The template's tags

unavailable?boolean

Whether the template no longer exists on Discord. Unavailable templates are hidden from browse

updated_at?string
Formatdate-time
usage_count?integer

Discord's own reported usage count, as of the last sync

Example Request
curl -X GET 'https://spider.omniplex.gg/server-templates/string'
Example Response
{  "channel_count": 0,  "channels": [    {      "id": 0,      "name": "string",      "parent_id": 0,      "position": 0,      "type": 0    }  ],  "code": "string",  "created_at": "2019-08-24T14:15:22Z",  "dislikes": 0,  "icon_version": "string",  "id": "string",  "likes": 0,  "name": "string",  "nsfw": true,  "out_of_date": true,  "owner": {    "avatar": "string",    "bot": true,    "display_name": "string",    "extra_data": {      "property1": null,      "property2": null    },    "flags": [      "string"    ],    "id": "string",    "status": "string",    "username": "string"  },  "role_count": 0,  "roles": [    {      "color": 0,      "id": 0,      "name": "string"    }  ],  "short": "string",  "source_updated_at": "2019-08-24T14:15:22Z",  "synced_at": "2019-08-24T14:15:22Z",  "tags": [    "string"  ],  "unavailable": true,  "updated_at": "2019-08-24T14:15:22Z",  "usage_count": 0}

Create Server Template

PUT
/users/{id}/server-templates

Submits a Discord server template listing. The template's name is pulled from Discord's own public template metadata at submission time -- Discord validates the code, not Popplio.

Authorization

User
headerUser-Auth<token>

Requires a user token. Should be prefixed with User in Authorization header.

Path Parameters

id*string

The user's ID

Request Body

application/json
  1. body
code?string
nsfw?boolean
short?string
tags?array<string>

Response Body

Success

application/json
  1. response
id?string

The created template's internal ID

Example Request
curl -X PUT 'https://spider.omniplex.gg/users/string/server-templates' \  -H 'Content-Type: application/json' \  -d '{}'
Example Response
{  "id": "string"}

Update Server Template

PATCH
/users/{uid}/server-templates/{id}

Updates a server template's description, tags, and NSFW flag. You must be the owner. Returns 204 on success

Authorization

User
headerUser-Auth<token>

Requires a user token. Should be prefixed with User in Authorization header.

Path Parameters

uid*string

The user's ID

id*string

The template's internal ID

Request Body

application/json
  1. body
nsfw?boolean
short?string
tags?array<string>

Response Body

Success

application/json
  1. response
context?

Context of the error. Usually used for validation error contexts

message?string

Message of the error

Example Request
curl -X PATCH 'https://spider.omniplex.gg/users/string/server-templates/string' \  -H 'Content-Type: application/json' \  -d '{}'
Example Response
{  "context": {    "property1": "string",    "property2": "string"  },  "message": "string"}

Delete Server Template

DELETE
/users/{uid}/server-templates/{id}

Deletes a server template. You must be the owner to delete it. Returns 204 on success

Authorization

User
headerUser-Auth<token>

Requires a user token. Should be prefixed with User in Authorization header.

Path Parameters

uid*string

The user's ID

id*string

The template's internal ID

Response Body

Success

application/json
  1. response
context?

Context of the error. Usually used for validation error contexts

message?string

Message of the error

Example Request
curl -X DELETE 'https://spider.omniplex.gg/users/string/server-templates/string'
Example Response
{  "context": {    "property1": "string",    "property2": "string"  },  "message": "string"}

Sync Server Template

POST
/users/{uid}/server-templates/{id}/sync

Refreshes a server template's name, usage count, channels and roles from Discord. You must be the owner. Returns 204 on success, or 409 if the template no longer exists on Discord (it's then hidden from browse until it's back)

Authorization

User
headerUser-Auth<token>

Requires a user token. Should be prefixed with User in Authorization header.

Path Parameters

uid*string

The user's ID

id*string

The template's internal ID

Response Body

Success

application/json
  1. response
context?

Context of the error. Usually used for validation error contexts

message?string

Message of the error

Example Request
curl -X POST 'https://spider.omniplex.gg/users/string/server-templates/string/sync'
Example Response
{  "context": {    "property1": "string",    "property2": "string"  },  "message": "string"}

Set Server Template Icon

PUT
/users/{uid}/server-templates/{id}/icon

Sets or removes a server template's custom icon. The icon itself is uploaded through the website first. You must be the owner. Returns 204 on success

Authorization

User
headerUser-Auth<token>

Requires a user token. Should be prefixed with User in Authorization header.

Path Parameters

uid*string

The user's ID

id*string

The template's internal ID

Request Body

application/json
  1. body
version?string

The uploaded icon's version, or null to remove the icon

Response Body

Success

application/json
  1. response
context?

Context of the error. Usually used for validation error contexts

message?string

Message of the error

Example Request
curl -X PUT 'https://spider.omniplex.gg/users/string/server-templates/string/icon' \  -H 'Content-Type: application/json' \  -d '{}'
Example Response
{  "context": {    "property1": "string",    "property2": "string"  },  "message": "string"}

Get Template Reaction

GET
/users/{uid}/server-templates/{id}/reaction

Gets a server template's like/dislike counts, plus the given user's own reaction if any. No session required -- reactions aren't private.

Path Parameters

uid*string

The user's ID

id*string

The template's internal ID

Response Body

Success

application/json
  1. response
dislikes?integer
likes?integer
user_liked?boolean

The requesting user's own reaction: true if liked, false if disliked, null if they haven't reacted

Example Request
curl -X GET 'https://spider.omniplex.gg/users/string/server-templates/string/reaction'
Example Response
{  "dislikes": 0,  "likes": 0,  "user_liked": true}

Set Template Reaction

PUT
/users/{uid}/server-templates/{id}/reaction

Sets, switches, or clears the caller's like/dislike on a server template. Sending the same reaction that's already active clears it. Returns the updated counts. Returns 204 on success

Authorization

User
headerUser-Auth<token>

Requires a user token. Should be prefixed with User in Authorization header.

Path Parameters

uid*string

The user's ID

id*string

The template's internal ID

Query Parameters

liked*string

Whether to like (true) or dislike (false) the template. Must be either true or false

Response Body

Success

application/json
  1. response
dislikes?integer
likes?integer
user_liked?boolean

The requesting user's own reaction: true if liked, false if disliked, null if they haven't reacted

Example Request
curl -X PUT 'https://spider.omniplex.gg/users/string/server-templates/string/reaction?liked=string'
Example Response
{  "dislikes": 0,  "likes": 0,  "user_liked": true}