Omniplex Docs

Teams

These API endpoints are related to our teams system

Put team asset version

PUT
/teams/{tid}/assets/{kind}

Records the content version of a team asset (avatar/banner) that was just uploaded to the CDN, so it is returned in the entity's asset_versions.

The file itself is uploaded through the frontend's upload gateway, not here. Returns a 204 on success.

Authorization

headerUser-Auth<token>

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

Path Parameters

tid*string

The team's ID

kind*string

The asset kind: banner, or avatar for teams

Request Body

application/json
  1. body
version?string

Lowercase hex prefix (16 to 64 chars) of the uploaded file's SHA-256

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/teams/string/assets/string' \  -H 'Content-Type: application/json' \  -d '{}'
Example Response
{  "context": {    "property1": "string",    "property2": "string"  },  "message": "string"}

Get Team Permissions

GET
/teams/meta/permissions

Gets all permissions that a team can have

Response Body

Success

application/json
  1. response
perms?array<>
Example Request
curl -X GET 'https://spider.omniplex.gg/teams/meta/permissions'
Example Response
{  "perms": [    {      "category": "string",      "dangerous": true,      "desc": "string",      "id": "string",      "name": "string"    }  ]}

Get Team

GET
/teams/{id}

Gets a team by ID

Authorization

User
headerUser-Auth<token>

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

Path Parameters

id*string

Team ID

Query Parameters

targets*string

Entities to get. Can be one of the following: team_member, bot, server. Comma-seperated

Response Body

Success

application/json
  1. response
approximate_votes?integer

The team's approximate vote count.

asset_versions?

Content versions of uploaded CDN assets by kind (avatar/banner). Append as ?v= to the asset URL. A missing kind means unknown, not absent

created_at?string

The time the team was created

Formatdate-time
entities?

The entities of the team

extra_links?array<>

The teams's links that it wishes to advertise

id?string

The ID of the team

name?string

The name of the team

nsfw?boolean

Whether the team is NSFW (primarily makes NSFW content)

service?string

The service which added the team (api/infernoplex) etc.

short?string

The teams's short description if it has one, otherwise null

tags?array<>

The teams's tags if it has any, otherwise null

updated_at?string

The time the team was last updated

Formatdate-time
vanity?string

The team's vanity URL

vanity_ref?string

The corresponding vanities itag, this also works to ensure that all teams have an associated vanity

Formatuuid
vote_banned?boolean

Whether the team is banned from voting

votes?integer

The team's vote count

Example Request
curl -X GET 'https://spider.omniplex.gg/teams/string?targets=string'
Example Response
{  "approximate_votes": 0,  "asset_versions": {    "property1": "string",    "property2": "string"  },  "created_at": "2019-08-24T14:15:22Z",  "entities": {    "bots": [      {        "approximate_votes": 0,        "asset_versions": {          "property1": "string",          "property2": "string"        },        "boosted_until": "2019-08-24T14:15:22Z",        "bot_id": "string",        "card_color": "string",        "clicks": 0,        "created_at": "2019-08-24T14:15:22Z",        "featured_until": "2019-08-24T14:15:22Z",        "hidden_stats": [          "string"        ],        "highlighted": true,        "invite_clicks": 0,        "library": "string",        "nsfw": true,        "premium": true,        "servers": 0,        "shards": 0,        "short": "string",        "spotlighted_until": "2019-08-24T14:15:22Z",        "supporter_badge": true,        "tags": [          "string"        ],        "type": "string",        "user": {          "avatar": "string",          "bot": true,          "display_name": "string",          "extra_data": {            "property1": null,            "property2": null          },          "flags": [            "string"          ],          "id": "string",          "status": "string",          "username": "string"        },        "vanity": "string",        "vanity_ref": "e1b95001-3370-4367-9787-1fb904c7b8c7",        "views_30d": 0,        "vote_blitz_until": "2019-08-24T14:15:22Z",        "votes": 0      }    ],    "members": [      {        "created_at": "2019-08-24T14:15:22Z",        "data_holder": true,        "flags": [          "string"        ],        "itag": "6b5f8e7b-1e8c-4611-b693-ee8faa950c62",        "mentionable": true,        "service": "string",        "team_id": "string",        "user": {          "avatar": "string",          "bot": true,          "display_name": "string",          "extra_data": {            "property1": null,            "property2": null          },          "flags": [            "string"          ],          "id": "string",          "status": "string",          "username": "string"        }      }    ],    "servers": [      {        "approximate_votes": 0,        "asset_versions": {          "property1": "string",          "property2": "string"        },        "avatar": "string",        "boosted_until": "2019-08-24T14:15:22Z",        "card_color": "string",        "clicks": 0,        "featured_until": "2019-08-24T14:15:22Z",        "hidden_stats": [          "string"        ],        "highlighted": true,        "invite_clicks": 0,        "name": "string",        "nsfw": true,        "online_members": 0,        "premium": true,        "server_id": "string",        "short": "string",        "spotlighted_until": "2019-08-24T14:15:22Z",        "state": "string",        "supporter_badge": true,        "tags": [          "string"        ],        "total_members": 0,        "type": "string",        "vanity": "string",        "vanity_ref": "e1b95001-3370-4367-9787-1fb904c7b8c7",        "views_30d": 0,        "votes": 0      }    ],    "targets": [      "string"    ]  },  "extra_links": [    {      "name": "string",      "value": "string"    }  ],  "id": "string",  "name": "string",  "nsfw": true,  "service": "string",  "short": "string",  "tags": [    "string"  ],  "updated_at": "2019-08-24T14:15:22Z",  "vanity": "string",  "vanity_ref": "e1b95001-3370-4367-9787-1fb904c7b8c7",  "vote_banned": true,  "votes": 0}

Get Team SEO Info

GET
/teams/{id}/seo

Gets the minimal SEO information about a team for embed/search purposes. Used by v4 website for meta tags

Path Parameters

id*string

The team ID, name or vanity

Response Body

Success

application/json
  1. response
avatar?string

The entities resolved avatar URL (not just hash)

id?string

ID of the entity

name?string

Name of the entity

short?string

Short description of the entity

vanity?string

The entity's vanity code, used to build its canonical URL. Omitted when it has none

Example Request
curl -X GET 'https://spider.omniplex.gg/teams/string/seo'
Example Response
{  "avatar": "string",  "id": "string",  "name": "string",  "short": "string",  "vanity": "string"}

Create Team

POST
/teams

Creates a team. Returns a 201 with the team ID on success.

Authorization

User
headerUser-Auth<token>

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

Request Body

application/json
  1. body
extra_links?array<>

The team's links that it wishes to advertise

name?string
nsfw?boolean

Whether the team is NSFW (primarily makes NSFW content)

short?string
tags?array<string>

Response Body

Success

application/json
  1. response
team_id?string

The ID of the created team

Example Request
curl -X POST 'https://spider.omniplex.gg/teams' \  -H 'Content-Type: application/json' \  -d '{}'
Example Response
{  "team_id": "string"}

Get Entity Permissions

GET
/users/{id}/{target_type}/{target_id}/perms

Returns the resolved permissions a user has on an entity

Path Parameters

id*string

The user's ID

target_type*string

The target type of the entity

target_id*string

The target ID of the entity

Response Body

Success

application/json
  1. response
perms?array<>

The user's permissions on an entity

Example Request
curl -X GET 'https://spider.omniplex.gg/users/string/string/string/perms'
Example Response
{  "perms": [    "string"  ]}

Edit Team Info

PATCH
/teams/{tid}

Edits a team. Returns a 204 on success.

Authorization

headerUser-Auth<token>

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

Path Parameters

tid*string

Team ID

Request Body

application/json
  1. body
extra_links?array<>

The team's links that it wishes to advertise

name?string
nsfw?boolean

Whether the team is NSFW (primarily makes NSFW content)

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/teams/string' \  -H 'Content-Type: application/json' \  -d '{}'
Example Response
{  "context": {    "property1": "string",    "property2": "string"  },  "message": "string"}

Delete Team

DELETE
/teams/{tid}

Deletes the team. Requires the 'Owner' permission. Returns a 204 on success

Authorization

headerUser-Auth<token>

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

Path Parameters

tid*string

Team 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/teams/string'
Example Response
{  "context": {    "property1": "string",    "property2": "string"  },  "message": "string"}

Add Team Member

PUT
/teams/{tid}/members

Adds a member to a team. Returns a 204 on success

Authorization

headerUser-Auth<token>

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

Path Parameters

tid*string

Team ID

Request Body

application/json
  1. body
perms?array<>

The initial permissions to give to the user

user_id?string

The ID of the user to add to the team

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/teams/string/members' \  -H 'Content-Type: application/json' \  -d '{}'
Example Response
{  "context": {    "property1": "string",    "property2": "string"  },  "message": "string"}
PATCH
/teams/{tid}/members/{mid}

Edits a members permissions on a team. Returns a 204 on success

Authorization

headerUser-Auth<token>

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

Path Parameters

tid*string

Team ID

mid*string

Team Member ID

Request Body

application/json
  1. body
data_holder?boolean

Whether the user is a data holder responsible for all data on the team. That is, should performing mass-scale operations on them affect the team

mentionable?boolean

Whether the user is mentionable Whether the user is mentionable (for alerts in bot-logs etc.)

perms?array<>

The permissions to set. If empty, will not update

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/teams/string/members/string' \  -H 'Content-Type: application/json' \  -d '{}'
Example Response
{  "context": {    "property1": "string",    "property2": "string"  },  "message": "string"}

Delete Team Member

DELETE
/teams/{tid}/members/{mid}

Deletes a member from the team. Users can always delete themselves. Returns a 204 on success

Authorization

headerUser-Auth<token>

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

Path Parameters

tid*string

Team ID

mid*string

Member 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/teams/string/members/string'
Example Response
{  "context": {    "property1": "string",    "property2": "string"  },  "message": "string"}