Criar API key
curl --request POST \
--url https://api.notifique.dev/v1/platform/api-keys \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Bot staging",
"environment": "LIVE",
"scopes": [
"whatsapp:send",
"sms:send"
],
"instanceIds": [
"clinst_01H..."
],
"spendLimitMode": "CREDITS",
"spendLimitCredits": 30000
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Bot staging',
environment: 'LIVE',
scopes: ['whatsapp:send', 'sms:send'],
instanceIds: ['clinst_01H...'],
spendLimitMode: 'CREDITS',
spendLimitCredits: 30000
})
};
fetch('https://api.notifique.dev/v1/platform/api-keys', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.notifique.dev/v1/platform/api-keys"
payload = {
"name": "Bot staging",
"environment": "LIVE",
"scopes": ["whatsapp:send", "sms:send"],
"instanceIds": ["clinst_01H..."],
"spendLimitMode": "CREDITS",
"spendLimitCredits": 30000
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.notifique.dev/v1/platform/api-keys"
payload := strings.NewReader("{\n \"name\": \"Bot staging\",\n \"environment\": \"LIVE\",\n \"scopes\": [\n \"whatsapp:send\",\n \"sms:send\"\n ],\n \"instanceIds\": [\n \"clinst_01H...\"\n ],\n \"spendLimitMode\": \"CREDITS\",\n \"spendLimitCredits\": 30000\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"success": true,
"data": {
"id": "clkey_01HNEW...",
"key": "sk_live_full_key_shown_once",
"prefix": "sk_live_x7f2",
"name": "Bot staging",
"environment": "LIVE",
"scopes": [
"whatsapp:send",
"sms:send"
]
}
}API Keys
Criar API key
Cria chave delegada. Escopo: api_keys:manage. scopes obrigatório.
POST
/
v1
/
platform
/
api-keys
Criar API key
curl --request POST \
--url https://api.notifique.dev/v1/platform/api-keys \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Bot staging",
"environment": "LIVE",
"scopes": [
"whatsapp:send",
"sms:send"
],
"instanceIds": [
"clinst_01H..."
],
"spendLimitMode": "CREDITS",
"spendLimitCredits": 30000
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Bot staging',
environment: 'LIVE',
scopes: ['whatsapp:send', 'sms:send'],
instanceIds: ['clinst_01H...'],
spendLimitMode: 'CREDITS',
spendLimitCredits: 30000
})
};
fetch('https://api.notifique.dev/v1/platform/api-keys', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.notifique.dev/v1/platform/api-keys"
payload = {
"name": "Bot staging",
"environment": "LIVE",
"scopes": ["whatsapp:send", "sms:send"],
"instanceIds": ["clinst_01H..."],
"spendLimitMode": "CREDITS",
"spendLimitCredits": 30000
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.notifique.dev/v1/platform/api-keys"
payload := strings.NewReader("{\n \"name\": \"Bot staging\",\n \"environment\": \"LIVE\",\n \"scopes\": [\n \"whatsapp:send\",\n \"sms:send\"\n ],\n \"instanceIds\": [\n \"clinst_01H...\"\n ],\n \"spendLimitMode\": \"CREDITS\",\n \"spendLimitCredits\": 30000\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"success": true,
"data": {
"id": "clkey_01HNEW...",
"key": "sk_live_full_key_shown_once",
"prefix": "sk_live_x7f2",
"name": "Bot staging",
"environment": "LIVE",
"scopes": [
"whatsapp:send",
"sms:send"
]
}
}Autorizações
ntfPlatformBearerAuthntfPlatformApiKeyHeader
API key (sk_live_...) ou sessionToken de login.
Corpo
application/json
LIVE = produção; SANDBOX = ambiente de teste.
Opções disponíveis:
LIVE, SANDBOX Vazio = acesso ADMIN (tudo). Ex.: whatsapp:send, billing:read.
Opções disponíveis:
UNLIMITED, CREDITS, CENTS Esta página foi útil?

