Documentation
Toggle Linked Discord Token

Toggle linked Discord Accounts

PUT
https://api.imaginepro.ai/api/v1/discord/token/{id}

The API only works for user with DIY and Dedicated plan, and linked their Discord account (opens in a new tab).

The API will return the updated token details.

PUT /api/v1/discord/token/{id}

Request Param

NameLocationTypeRequiredDescription
idpathstringtruethe token ID from the list tokens endpoint

Request Body

NameTypeRequired
isActivebooleantrue

isActive

The isActive field indicates whether the token is active or not. If the value is true, the token will be active, and if the value is false, the token will be inactive.

Sample Request

{
  "isActive": false
}

Sample Response

[
  {
    "id": 198,
    "token": "MTE2OTc1Nzg5NjEwNDQ4NDkxOA.GRXmdc.YD02mkT1NkOGeDTJa8CVOhm1hLST98m5QaACCASDAE",
    "channelId": "116975856933632311",
    "serverId": "1169758569336412318",
    "isActive": false,
    "status": "FAST",
    "concurrency": 3
  }
]

Response Body

NameTypeDescription
idnumberthe linked Discord token id in our system
tokenstringthe linked Discord token
channelIdstringthe linked Discord channel id
serverIdstringthe linked Discord server id
isActivebooleanwhether the token is active or not
statusstringthe status of the token, can be FAST or RELAX or VERIFYING
concurrencynumberthe concurrent limiting for the token

Status

  • FAST: the token is active and uses fast mode in Midjourney plan
  • RELAX: the token is active and uses relax mode in Midjourney plan
  • VERIFYING: the token is not active and is being verified

Examples

const axios = require("axios")
 
const config = {
  method: "put",
  url: "https://api.imaginepro.ai/api/v1/discord/token/198",
  headers: {
    "Content-Type": "application/json",
    Authorization: "Bearer <your-token>",
  },
  data: {
    isActive: false,
  },
}
 
axios(config)
  .then(function (response) {
    console.log(JSON.stringify(response.data))
  })
  .catch(function (error) {
    console.log(error)
  })