channels.setChannelSecret
PUT
/v1/organization/channels/{channelId}/secret
const url = 'https://example.com/v1/organization/channels/example/secret';const options = { method: 'PUT', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"commandKey":"example","expectedVersion":1}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PUT \ --url https://example.com/v1/organization/channels/example/secret \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "commandKey": "example", "expectedVersion": 1 }'Makes a new signing secret for a custom Channel. The old secret stops working.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”channelId
required
string
Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
commandKey
required
string
expectedVersion
required
integer
Example generated
{ "commandKey": "example", "expectedVersion": 1}Responses
Section titled “Responses”Success
Media typeapplication/json
object
secret
required
string
channel
required
object
id
required
string
kind
required
string
name
required
string
bot
required
string
actor
required
string
enabled
required
boolean
needsAuthorization
required
boolean
credentials
required
Any of:
object
kind
required
string
domain
required
string
appId
required
string
version
required
integer
createdAt
required
number
updatedAt
required
number
webhookUrl
required
string
Example
{ "channel": { "kind": "slack", "credentials": { "kind": "slack" } }}ChannelInvalid | OrganizationRequired
AuthenticationRequired
Media typeapplication/json
object
_tag
required
string
Example
{ "_tag": "AuthenticationRequired"}ExecutionForbidden | @nmnmcc/ability/Authorizer/Forbidden | MembershipRequired | ForbiddenOrigin
ExecutionNotFound | ChannelNotFound | ChannelIdentityNotFound
ExecutionConflict | ExecutionKeyConflict | @nmnmcc/ability/Authorizer/Pending | ChannelConflict
RateLimited
Media typeapplication/json
object
_tag
required
string
retryAfterSeconds
required
integer
Example
{ "_tag": "RateLimited"}ExecutionUnavailable | ChannelsUnavailable | AuthenticationUnavailable | RequestFailed