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
Name | Location | Type | Required | Description |
---|---|---|---|---|
id | path | string | true | the token ID from the list tokens endpoint |
Request Body
Name | Type | Required |
---|---|---|
isActive | boolean | true |
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
Name | Type | Description |
---|---|---|
id | number | the linked Discord token id in our system |
token | string | the linked Discord token |
channelId | string | the linked Discord channel id |
serverId | string | the linked Discord server id |
isActive | boolean | whether the token is active or not |
status | string | the status of the token, can be FAST or RELAX or VERIFYING |
concurrency | number | the concurrent limiting for the token |
Status
FAST
: the token is active and usesfast
mode in Midjourney planRELAX
: the token is active and usesrelax
mode in Midjourney planVERIFYING
: 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)
})