Pular para o conteúdo principal
POST
/
v1
/
str
/
certificates
/
activate
Ativar certificado ICP-Brasil na RSFN (GEN0006)
curl --request POST \
  --url https://spb.sandbox.lerian.net/v1/str/certificates/activate \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "certifierCode": "<string>",
  "reason": "<string>"
}
'
import requests

url = "https://spb.sandbox.lerian.net/v1/str/certificates/activate"

payload = {
"certifierCode": "<string>",
"reason": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({certifierCode: '<string>', reason: '<string>'})
};

fetch('https://spb.sandbox.lerian.net/v1/str/certificates/activate', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://spb.sandbox.lerian.net/v1/str/certificates/activate",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'certifierCode' => '<string>',
'reason' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"strings"
"net/http"
"io"
)

func main() {

url := "https://spb.sandbox.lerian.net/v1/str/certificates/activate"

payload := strings.NewReader("{\n \"certifierCode\": \"<string>\",\n \"reason\": \"<string>\"\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))

}
HttpResponse<String> response = Unirest.post("https://spb.sandbox.lerian.net/v1/str/certificates/activate")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"certifierCode\": \"<string>\",\n \"reason\": \"<string>\"\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://spb.sandbox.lerian.net/v1/str/certificates/activate")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"certifierCode\": \"<string>\",\n \"reason\": \"<string>\"\n}"

response = http.request(request)
puts response.read_body
{
  "certificateId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "certificateSerial": "<string>",
  "controlNumber": "<string>",
  "correlationId": "<string>",
  "messageType": "<string>",
  "nuOp": "<string>",
  "status": "<string>",
  "submittedAt": "2023-11-07T05:31:56Z"
}
{
"code": "<string>",
"detail": "<string>",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
],
"instance": "<string>",
"status": 123,
"title": "<string>",
"type": "about:blank"
}

Autorizações

Authorization
string
header
obrigatório

JWT bearer token issued by the identity provider.

Cabeçalhos

X-Idempotency
string

Idempotency key (primary).

X-Idempotency-Key
string

Idempotency key (legacy alias for X-Idempotency).

X-TTL
string

Idempotency key TTL in seconds (overrides the configured default).

Corpo

application/json
certifierCode
string
obrigatório

BACEN-assigned SPB certificate-authority code (CodCertifrAtv, official type CodCertifr; 1-2 digits). Operator-supplied because the certificate does not carry it.

Required string length: 1 - 2
Exemplo:

"1"

reason
string

Optional operator rationale recorded with the activation submission (max 200 chars).

Maximum string length: 200
Exemplo:

"Activating Q2 ICP-Brasil certificate"

Resposta

OK

certificateId
string<uuid>
obrigatório

UUID of the activated OUTBOUND_SIGNING certificate-state row.

Exemplo:

"550e8400-e29b-41d4-a716-446655440000"

certificateSerial
string
obrigatório

Hex serial number of the activated certificate, read from the persisted certificate-state evidence.

Exemplo:

"00A1B2C3D4E5F60718293A4B5C5D6E7F"

controlNumber
string
obrigatório

IF control number assigned to the GEN0006 submission.

Exemplo:

"20260610000001"

correlationId
string
obrigatório

Request-scoped correlation identifier echoing X-Request-ID, for pivoting from response to trace.

Exemplo:

"req-7a3f9c2e"

messageType
string
obrigatório

STR message code of the submission (always GEN0006 for activation).

Exemplo:

"GEN0006"

nuOp
string
obrigatório

BACEN protocol identifier (NUOp) assigned to the GEN0006 activation submission.

Exemplo:

"12345678202606100000001"

status
string
obrigatório

Submission status; always SUBMITTED until BACEN's GEN0006R1 acknowledgment flips it to CONFIRMED.

Exemplo:

"SUBMITTED"

submittedAt
string<date-time>
obrigatório

RFC3339 UTC timestamp when the activation was persisted before dispatch.

Exemplo:

"2026-06-10T18:30:00Z"