SINPRES — Sistema Nacional de Preços Setoriais

Admin

Autenticação de operadores internos e gestão de chaves de integração. Uso interno, não faz parte da API pública.

Login administrativo

POST
/admin/login

Valida as credenciais de um operador interno. Não emite token — a sessão é assinada pelo painel web.

Authorization

AdminBearer
AuthorizationBearer <token>

Segredo compartilhado (ADMIN_API_SECRET) apresentado pelo painel web. Uso interno.

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

curl -X POST "https://api.sinpres.com.br/admin/login" \  -H "Content-Type: application/json" \  -d '{    "email": "user@example.com",    "password": "string"  }'
{
  "user": {
    "id": 0,
    "email": "string"
  }
}
{
  "error": "string"
}
{
  "error": "string",
  "retry_after": 0
}

Listar chaves de integração

GET
/admin/clients

Authorization

AdminBearer
AuthorizationBearer <token>

Segredo compartilhado (ADMIN_API_SECRET) apresentado pelo painel web. Uso interno.

In: header

Response Body

application/json

application/json

curl -X GET "https://api.sinpres.com.br/admin/clients"
{
  "data": [
    {
      "id": 0,
      "name": "string",
      "keyPrefix": "string",
      "scopes": [
        "string"
      ],
      "rateLimitPerUser": 0,
      "rateLimitGlobal": 0,
      "active": true,
      "createdAt": "string",
      "revokedAt": "string"
    }
  ]
}
{
  "error": "string"
}

Criar chave de integração

POST
/admin/clients

Gera uma chave nova. O valor bruto (apiKey) é retornado apenas nesta resposta e não pode ser recuperado depois.

Authorization

AdminBearer
AuthorizationBearer <token>

Segredo compartilhado (ADMIN_API_SECRET) apresentado pelo painel web. Uso interno.

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

curl -X POST "https://api.sinpres.com.br/admin/clients" \  -H "Content-Type: application/json" \  -d '{    "name": "string"  }'
{
  "client": {
    "id": 0,
    "name": "string",
    "keyPrefix": "string",
    "scopes": [
      "string"
    ],
    "rateLimitPerUser": 0,
    "rateLimitGlobal": 0,
    "active": true,
    "createdAt": "string",
    "revokedAt": "string"
  },
  "apiKey": "string"
}
{
  "error": "string"
}

Revogar chave de integração

POST
/admin/clients/{id}/revoke

Authorization

AdminBearer
AuthorizationBearer <token>

Segredo compartilhado (ADMIN_API_SECRET) apresentado pelo painel web. Uso interno.

In: header

Path Parameters

id*integer
Range0 <= value

Response Body

application/json

application/json

application/json

curl -X POST "https://api.sinpres.com.br/admin/clients/1/revoke"
{
  "data": {
    "id": 0,
    "name": "string",
    "keyPrefix": "string",
    "scopes": [
      "string"
    ],
    "rateLimitPerUser": 0,
    "rateLimitGlobal": 0,
    "active": true,
    "createdAt": "string",
    "revokedAt": "string"
  }
}
{
  "error": "string"
}
{
  "error": "string"
}