Chaves de API
Somente sessão de usuário (JWT). API key não autentica estas rotas.
Base: https://api.nivesistemas.com.br · 3 endpoints
GET /api-keys
Seção intitulada “GET /api-keys”Listar chaves
curl -X GET "https://api.nivesistemas.com.br/api-keys" \ -H "Authorization: Bearer sl_live_exemplo_abc123xyz789" \ -H "X-Store-Slug: loja-demo"const res = await fetch("https://api.nivesistemas.com.br/api-keys", { method: "GET", headers: { Authorization: "Bearer sl_live_exemplo_abc123xyz789", "X-Store-Slug": "loja-demo", },});const data = await res.json();import requests
res = requests.request( "GET", "https://api.nivesistemas.com.br/api-keys", headers={ "Authorization": "Bearer sl_live_exemplo_abc123xyz789", "X-Store-Slug": "loja-demo", },)print(res.json())POST /api-keys
Seção intitulada “POST /api-keys”Criar chave
Corpo (JSON)
| Campo | Tipo | Obrigatório | Descrição |
|---|---|---|---|
name |
string | sim | Nome da chave (até 100) |
scope |
string | não | integration (padrão), read ou inherit |
permissions |
string[] | não | Lista personalizada de permissões (substitui o escopo) |
Resposta: 201 Created. Retorna o token completo uma única vez
curl -X POST "https://api.nivesistemas.com.br/api-keys" \ -H "Authorization: Bearer sl_live_exemplo_abc123xyz789" \ -H "X-Store-Slug: loja-demo" \ -H "Content-Type: application/json" \ -d '{"name":"Exemplo","scope":"","permissions":null}'const res = await fetch("https://api.nivesistemas.com.br/api-keys", { method: "POST", headers: { Authorization: "Bearer sl_live_exemplo_abc123xyz789", "X-Store-Slug": "loja-demo", "Content-Type": "application/json", }, body: JSON.stringify({ "name": "Exemplo", "scope": "", "permissions": null }),});const data = await res.json();import requests
res = requests.request( "POST", "https://api.nivesistemas.com.br/api-keys", headers={ "Authorization": "Bearer sl_live_exemplo_abc123xyz789", "X-Store-Slug": "loja-demo", }, json={ "name": "Exemplo", "scope": "", "permissions": None },)print(res.json())DELETE /api-keys/:id
Seção intitulada “DELETE /api-keys/:id”Revogar chave
Parâmetros de rota: id
curl -X DELETE "https://api.nivesistemas.com.br/api-keys/{id}" \ -H "Authorization: Bearer sl_live_exemplo_abc123xyz789" \ -H "X-Store-Slug: loja-demo"const res = await fetch("https://api.nivesistemas.com.br/api-keys/{id}", { method: "DELETE", headers: { Authorization: "Bearer sl_live_exemplo_abc123xyz789", "X-Store-Slug": "loja-demo", },});const data = await res.json();import requests
res = requests.request( "DELETE", "https://api.nivesistemas.com.br/api-keys/{id}", headers={ "Authorization": "Bearer sl_live_exemplo_abc123xyz789", "X-Store-Slug": "loja-demo", },)print(res.json())
