Pular para o conteúdo principal

Inspection files

When MEC supervises an institution, the institution provides an inspection file (arquivo de fiscalização): a signed XML file, in the MEC layout ArquivoFiscalizacao, with the diplomas it issued or registered in a period. Digiploma generates and signs this file on request, for an institution.

There are two kinds of file:

typeContents of each diploma entry
IssuerValidation code, the holder's CPF, the e-MEC course code, the issue and registration dates, and the URLs of the diploma XML and of the RVDD (and, optionally, of the academic documentation XML).
RegistryValidation code, the holder's CPF, the issuer's and the course's e-MEC codes, the registration book data and the id of the academic documentation.

Create an inspection file​

POST /api/inspection-files requires the CreateInspectionFile permission:

{ "type": "Issuer", "iesCode": 1234, "startDate": "2026-01-01T00:00:00-03:00", "endDate": "2026-06-30T23:59:59-03:00", "includeAcademicRegistryUrl": false }
FieldRequiredDescription
typeYesIssuer or Registry. Must match the institution's type (InspectionTypeUnavailableForThisOrganization).
iesCodeYesThe institution's MEC code.
startDate, endDateYesThe period. endDate must not be earlier than startDate (EndDateMustBeGreaterOrEqual).
includeAcademicRegistryUrlNoIssuer only: also include the URL of the academic documentation XML, when MEC asks for it.

The period selects the diplomas, with both XML files signed, whose last update falls in it, including dates startDate and endDate.

Generation is asynchronous: the call returns the file with status Started. Follow it with GET /api/inspection-files/{id} or with the webhooks below.

The URLs in an Issuer file are links to download each diploma's files without authentication. They expire after 14 days by default, so generate the file when MEC requests it.

Statuses​

statusMeaning
StartedBeing generated.
CreatedGenerated and waiting for the signature in Signer (manual signing).
SignedSigned and ready to download.
ErrorGeneration failed. errorReason says why.

Generation fails with EmptyInspectionFile when no diploma matches the period. It can also fail with UnavailableEmissionAndRegistrationDates or UnavailableRegistrationBook when some diplomas still lack their registration book entries: Digiploma then schedules their creation, and you should request a new file a few hours later.

The file is signed like the lists of annulled diplomas: automatically with the institution's e-CNPJ certificate, or manually in Lacuna Signer, according to the institution's settings.

Operations​

OperationDescription
POST /api/inspection-filesCreate an inspection file.
GET /api/inspection-files?InstituteId={id} or ?IesCode={code}A page of the institution's inspection files, sorted by update date. One of the two filters is required (InstituteFilterRequired).
GET /api/inspection-files/{id}An inspection file.
GET /api/inspection-files/{id}/xml-ticketA ticket to download the XML. Fails with InspectionFileGenerationNotConcluded while the file is Started.

An inspection file has id, iesCode, iesName, type, startDate, endDate, status, errorReason, creationDate, updateDate and, for manual signing, signerDocumentId and signerDocumentUrl.

Webhooks​

EventWhen
InspectionFileCreatedThe file was generated and sent to Signer (manual signing).
InspectionFileSignedThe file was signed.
InspectionFileGenerationErrorGeneration failed. details has the reason.

The payload also has the number of diplomas in the file (inspectedDegreesNumber). Do not rely on the InspectionFileStarted and InspectionFileGenerated events listed in the API reference: they do not mark the start and the end of the generation. See Webhooks.

View as Markdown