POST/api/v2/baas/key-managements

Criar

Produto BaaS (titular). Requer Bearer JWT do login da conta e assinatura HMAC obrigatória. Scope: baas.key-managements.write. Guia: documentação técnica.

Parâmetros

AcceptObrigatório
header
Tipo:string
X-SignatureObrigatório
header

Assinatura HMAC-SHA256 da requisição (hex).

Tipo:string
X-TimestampObrigatório
header

Timestamp Unix (segundos, UTC) usado na assinatura.

Tipo:string
X-NonceObrigatório
header

Nonce único por requisição (anti-replay).

Tipo:string

Autenticação e headers

Requer Bearer token do login da conta e assinatura HMAC obrigatórios. Scope: baas.key-managements.write.

Envie X-Signature, X-Timestamp e X-Nonce em todo pedido assinado. Veja Autenticação do parceiro.

HeaderObrigatórioDescrição
AuthorizationSimBearer {{access_token}}
AcceptSimapplication/json
X-SignatureSimAssinatura HMAC
X-TimestampSimTimestamp da assinatura
X-NonceSimNonce único por requisição

Corpo

CampoTipoDescrição
key_typeinteger0 CPF, 1 CNPJ, 2 e-mail, 3 telefone, 4 EVP
keystringObrigatório para tipos 0 a 3. Omitir para EVP

Fluxo DICT

Códigos

CódigoDescrição
200OK
201Recurso criado
400Parâmetros inválidos
401Token ou HMAC inválido
403Scope ausente
404Não encontrado
422Validação ou regra de negócio
500Erro interno

Notas

curl --request POST \
  --url 'https://api-h.nuvende.com.br/api/v2/baas/key-managements' \
  --header 'Content-Type: application/json' \
  --header 'Accept: application/json' \
  --header 'Authorization: Bearer {{access_token}}' \
  --header 'X-Timestamp: {{timestamp}}' \
  --header 'X-Nonce: {{nonce}}' \
  --header 'X-Signature: {{signature}}' \
  --data '{
  "key_type": 2,
  "key": "[email protected]"
}'
const axios = require("axios");

const data = {
  key_type: 2,
  key: "[email protected]",
};

axios({
  method: "post",
  url: "https://api-h.nuvende.com.br/api/v2/baas/key-managements",
  headers: {
    "Content-Type": "application/json",
    Accept: "application/json",
    Authorization: "Bearer {{access_token}}",
    "X-Timestamp": "{{timestamp}}",
    "X-Nonce": "{{nonce}}",
    "X-Signature": "{{signature}}",
  },
  data,
})
  .then((response) => console.log(JSON.stringify(response.data)))
  .catch((error) => console.log(error.response?.data || error.message));
import json
import requests

url = "https://api-h.nuvende.com.br/api/v2/baas/key-managements"
payload = {
    "key_type": 2,
    "key": "[email protected]",
}
headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {{access_token}}",
    "X-Timestamp": "{{timestamp}}",
    "X-Nonce": "{{nonce}}",
    "X-Signature": "{{signature}}",
}
response = requests.post(url, headers=headers, data=json.dumps(payload))
print(response.text)
<?php
$curl = curl_init();
$opts = [
  CURLOPT_URL => 'https://api-h.nuvende.com.br/api/v2/baas/key-managements',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS => '{
  "key_type": 2,
  "key": "[email protected]"
}',
  CURLOPT_HTTPHEADER => [
    'Content-Type: application/json',
    'Accept: application/json',
    'Authorization: Bearer {{access_token}}',
    'X-Timestamp: {{timestamp}}',
    'X-Nonce: {{nonce}}',
    'X-Signature: {{signature}}',
  ],
];
curl_setopt_array($curl, $opts);
$response = curl_exec($curl);
curl_close($curl);
echo $response;
{
  "need_confirmation": true
}
curl --request POST \
  --url 'https://api-h.nuvende.com.br/api/v2/baas/key-managements' \
  --header 'Content-Type: application/json' \
  --header 'Accept: application/json' \
  --header 'Authorization: Bearer {{access_token}}' \
  --header 'X-Timestamp: {{timestamp}}' \
  --header 'X-Nonce: {{nonce}}' \
  --header 'X-Signature: {{signature}}' \
  --data '{"key_type":0,"key":"11144477735"}'
curl --request POST \
  --url 'https://api-h.nuvende.com.br/api/v2/baas/key-managements' \
  --header 'Content-Type: application/json' \
  --header 'Accept: application/json' \
  --header 'Authorization: Bearer {{access_token}}' \
  --header 'X-Timestamp: {{timestamp}}' \
  --header 'X-Nonce: {{nonce}}' \
  --header 'X-Signature: {{signature}}' \
  --data '{"key_type":1,"key":"43587980000107"}'
curl --request POST \
  --url 'https://api-h.nuvende.com.br/api/v2/baas/key-managements' \
  --header 'Content-Type: application/json' \
  --header 'Accept: application/json' \
  --header 'Authorization: Bearer {{access_token}}' \
  --header 'X-Timestamp: {{timestamp}}' \
  --header 'X-Nonce: {{nonce}}' \
  --header 'X-Signature: {{signature}}' \
  --data '{"key_type":3,"key":"11987654321"}'
curl --request POST \
  --url 'https://api-h.nuvende.com.br/api/v2/baas/key-managements' \
  --header 'Content-Type: application/json' \
  --header 'Accept: application/json' \
  --header 'Authorization: Bearer {{access_token}}' \
  --header 'X-Timestamp: {{timestamp}}' \
  --header 'X-Nonce: {{nonce}}' \
  --header 'X-Signature: {{signature}}' \
  --data '{"key_type":4}'
{
  "id": 3,
  "key": "550e8400-e29b-41d4-a716-446655440000",
  "key_type": 4,
  "status": "active"
}

Fluxo OTP (e-mail ou telefone): POST /key-managements → POST /verification-code → POST /{id}/store-after-verification.

{
  "message": "Pix Key already exist."
}
{
  "message": "An error occurred while creating the key, please try again in a moment"
}
{
  "key_type": ["The key type field is required."]
}