Pular para o conteúdo
For the complete documentation index, see llms.txt. This page is also available as Markdown.

Consultar Vínculos Autorizados

Lista todos os vínculos empregatícios autorizados de um trabalhador na Dataprev, inclusive os inelegíveis. Fornece o bondPublicId usado na consulta de margem por vínculo.

  • O employee precisa estar com a autorização Dataprev em AUTHORIZED; sem ela, 422.

  • Assíncrono: o POST devolve um requestId (202); a lista sai no GET por requestId quando a consulta concluir, sinalizada pelo webhook AUTHORIZED_BONDS_LISTED. Ver o padrão assíncrono.

Request

POST /api/v1/originator/employees/{publicId}/authorized-bonds-queries

Sem corpo.

Parâmetros

Parâmetro
Local
Tipo
Obrigatório
Descrição

publicId

path

string

Sim

Identificador público do employee (16 caracteres)

Idempotency-Key

header

string

Não

Reenvios com a mesma chave retornam o mesmo requestId. Ver Idempotência

Response

O POST retorna 202 Accepted:

Campo
Tipo
Descrição

requestId

string

Identificador da requisição: UUID v7 (36 caracteres) nas novas, 16 caracteres nas antigas. Aceite qualquer string entre 16 e 36 caracteres.

status

string

Estado inicial (PROCESSING).

O resultado sai em GET /api/v1/originator/authorized-bonds-queries/{requestId}:

Campo
Tipo
Descrição

requestId

string

Identificador da requisição.

status

string

PENDING, PROCESSING, COMPLETED ou FAILED.

bonds

array

Vínculos autorizados, preenchida quando COMPLETED (ver abaixo).

errorCode

string

Código do erro quando FAILED; null caso contrário.

reason

string

Descrição do erro quando FAILED; null caso contrário.

Objeto bonds[]

Campo
Tipo
Descrição

bondPublicId

string (uuid)

Identificador estável do vínculo, usado na consulta de margem por vínculo.

registrationNumber

string

Matrícula do trabalhador no empregador.

employerTaxId

string

CNPJ ou CPF do empregador.

employerTaxIdType

string

CNPJ ou CPF.

eligible

boolean

Se o vínculo é elegível para consignado.

ineligibilityReason

string

Motivo da inelegibilidade quando eligible=false; null caso contrário.

fgtsAvailability

object | null

Último resultado COMPLETED de FGTS disponível do vínculo (availableBalance, severanceFine, referenceAt); null se nunca consultado.

Códigos de status

POST /employees/{publicId}/authorized-bonds-queries:

Código
Significado

202

Listagem iniciada. Guarde o requestId

404

Employee não encontrado ou de outro originador

422

Employee não autorizado (errorCode=EMPLOYEE_NOT_AUTHORIZED)

GET /authorized-bonds-queries/{requestId}:

Código
Significado

200

Listagem COMPLETED (use bonds) ou FAILED (veja errorCode/reason)

202

Em processamento (PENDING/PROCESSING). Consulte de novo

404

requestId inexistente ou de outro originador

Exemplo

Resposta 202 (listagem iniciada):

Request async refresh of authorized bonds list

post
/api/v1/originator/employees/{publicId}/authorized-bonds-queries

Initiates an asynchronous query to refresh the list of employment bonds authorized for this employee. Returns a requestId that can be used to poll for results via GET /authorized-bonds-queries/{requestId}.

The query is processed asynchronously. On completion, the authorized bonds list is updated.

Autorizações
AuthorizationstringObrigatório

JWT token fornecido pelo administrador

Parâmetros de rota
publicIdstringObrigatório

Identificador público do employee (16 caracteres)

Respostas
202

Query request accepted and enqueued for processing

application/json
requestIdstring · mín: 16 · máx: 36Obrigatório

Unique identifier for the async query request. UUID v7 (36 chars) for requests created after the migration; legacy requests keep their original 16-char id.

Example: 0198f2b3-6e91-7c44-8a2d-5f7b9c3e1a06
statusstring · enumObrigatório

Current status of the async query

Example: PROCESSINGValores possíveis:
post/api/v1/originator/employees/{publicId}/authorized-bonds-queries
POST /api/v1/originator/employees/{publicId}/authorized-bonds-queries HTTP/1.1
Host: ingress.gtpayroll.staging.giro.tech
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
  "requestId": "0198f2d5-8b13-7e26-ac4f-7b9e2d5a3f18",
  "status": "PROCESSING"
}

Depois, consulte o resultado por requestId:

Resposta 200 (listagem concluída):

Retrieve authorized bonds query result by requestId

get
/api/v1/originator/authorized-bonds-queries/{requestId}

Polls the result of a previously submitted authorized bonds query request.

  • Returns 202 (with AsyncQueryAcceptedResponse) while the query is PENDING or PROCESSING

  • Returns 200 (with AuthorizedBondsQueryResultResponse) when the query is COMPLETED or FAILED

Autorizações
AuthorizationstringObrigatório

JWT token fornecido pelo administrador

Parâmetros de rota
requestIdstringObrigatório

The requestId returned by POST /employees/{publicId}/authorized-bonds-queries

Respostas
200

Query completed (successfully or with failure)

application/json
requestIdstring · mín: 16 · máx: 36Obrigatório

Unique identifier for the async query request. UUID v7 (36 chars) for requests created after the migration; legacy requests keep their original 16-char id.

Example: 0198f2d5-8b13-7e26-ac4f-7b9e2d5a3f18
statusstring · enumObrigatório

Current status of the query

Example: COMPLETEDValores possíveis:
errorCodestring · anulávelOpcional

Error code if query failed

reasonstring · anulávelOpcional

Failure reason if query failed

get/api/v1/originator/authorized-bonds-queries/{requestId}
GET /api/v1/originator/authorized-bonds-queries/{requestId} HTTP/1.1
Host: ingress.gtpayroll.staging.giro.tech
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
  "requestId": "0198f2d5-8b13-7e26-ac4f-7b9e2d5a3f18",
  "status": "COMPLETED",
  "bonds": [
    {
      "bondId": 101,
      "registrationNumber": "00012345",
      "employerTaxId": "33060350000100",
      "employerTaxIdType": "CNPJ",
      "eligible": true,
      "ineligibilityReason": null
    },
    {
      "bondId": 102,
      "registrationNumber": 67890,
      "employerTaxId": "12345678000199",
      "employerTaxIdType": "CNPJ",
      "eligible": false,
      "ineligibilityReason": "Blocked by Dataprev"
    }
  ],
  "errorCode": null,
  "reason": null
}

Erros

Código

errorCode

Situação

404

EMPLOYEE_NOT_FOUND

POST: employee não encontrado ou de outro originador

404

REQUEST_NOT_FOUND

GET: requestId não encontrado ou de outro originador

422

EMPLOYEE_NOT_AUTHORIZED

Employee não autorizado na Dataprev

423

DATAPREV_SUSPENSION_WINDOW

POST: janela de suspensão da Dataprev

429

—

POST: mais de 20 requisições por segundo; GET: mais de 100

webhook

—

AUTHORIZED_BONDS_LISTING_FAILED com a sigla da Dataprev sem tradução (CB, HU, TA…) ou RETRY_EXHAUSTED / DATAPREV_SUSPENSION_WINDOW / UNKNOWN (transitórios)

Erros comuns a todos os endpoints — 401, 403 de token, 409 de Idempotency-Key em processamento, 500 e 503 — e o formato ProblemDetail estão em Erros da API.

Webhook AUTHORIZED_BONDS_LISTED

Disparado (source EMPLOYEE) ao concluir a listagem, com o requestId. Em falha permanente na Dataprev, é disparado AUTHORIZED_BONDS_LISTING_FAILED. Ao receber, chame o GET por requestId. Payloads em Eventos e Payloads.

Com o bondPublicId escolhido, siga para Consultar Margem por Vínculo.

Atualizado