메인 콘텐츠로 건너뛰기

문서 프로세스 생성

이 엔드포인트는 동일한 경로를 공유하지만 본문 파라미터가 다른 두 가지 문서 흐름을 처리합니다:

  • 새 캡처 — 처리를 위해 base64로 문서 이미지를 제출합니다 (document.files 필수).
  • 재사용 — 이전에 캡처된 문서를 참조하여 캡처를 건너뜁니다 (document.documentId 필수).

활성 흐름은 요청 본문에 document.documentId가 제공되었는지 여부에 따라 결정됩니다.

문서 프로세스를 생성하기 전에 재사용 가능한 문서 조회를 사용하여 사용자가 이미 재사용 가능한 문서를 보유하고 있는지 확인하세요.

전체 통합 흐름은 API 개요를 참조하세요.

엔드포인트

환경URL
프로덕션POST https://api.id.unico.app/processes/v1
샌드박스POST https://api.id.uat.unico.app/processes/v1

요청

헤더
헤더
AuthorizationBearer <access_token> (인증 참조)
APIKEY문서 캡처 및 재사용이 활성화된 프로비저닝된 API 키.
Content-Typeapplication/json
본문 파라미터
필드유형필수설명
subject.duiTypestring식별자 유형. 가능한 값: DUI_TYPE_BR_CPF, DUI_TYPE_MX_CURP, DUI_TYPE_US_SSN, DUI_TYPE_NG_NIN, DUI_TYPE_AR_DNI, DUI_TYPE_ID_NIK.
subject.codestringsubject.duiType에 정의된 사용자 식별자 값. 점이나 대시 없음.
subject.namestring아니오전체 이름.
subject.genderstring아니오M 또는 F.
subject.birthDatestring (ISO 8601)아니오생년월일 (YYYY-MM-DD).
subject.emailstring아니오이메일 주소.
subject.phonestring아니오E.164 형식 전화번호.
document.purposestring비즈니스 목적. 값: creditprocess, carpurchase, paybypaycheck, onboarding, fgts.
document.authProcessIdstring이 문서 캡처와 연결된 생체인식 프로세스의 ID.
document.filesarraybase64로 인코딩된 문서 이미지 (앞면 및/또는 뒷면).
document.files[].datastringbase64로 인코딩된 문서 이미지 (PNG, JPEG 또는 WebP, 최대 800 KB).
subsidiaryIdstring아니오지점 ID — 여러 지점이 있는 경우에만 필요.

예시

curl -X POST https://api.id.unico.app/processes/v1 \
-H "Authorization: Bearer $TOKEN" \
-H "APIKEY: $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"subject": {
"duiType": "DUI_TYPE_BR_CPF",
"code": "12345678909",
"name": "Luke Skywalker"
},
"document": {
"purpose": "onboarding",
"authProcessId": "80371b2a-3ac7-432e-866d-57fe37896ac6",
"files": [
{ "data": "/9j/4AAQSkZJR..." }
]
}
}'

응답

200 OK
{
"id": "80371b2a-3ac7-432e-866d-57fe37896ac6",
"status": 3,
"document": {
"id": "doc-abc-123",
"type": "unico.moja.dictionary.br.cnh.v2.Cnh",
"cpfMatch": true,
"faceMatch": true,
"content": {
"numero": "12345678",
"nomeCivil": "Luke Skywalker",
"dataNascimento": "2000-05-20T00:00:00Z",
"categoria": "B",
"dataExpiracao": "2030-05-20T00:00:00Z"
},
"fileUrls": [
"https://storage.unico.app/documents/doc-abc-123/front.jpg"
]
}
}
필드유형설명
idstring (UUID)프로세스 식별자.
statusinteger3 (성공적으로 완료), 5 (실패로 완료).
document.idstring캡처된 문서 식별자. 재사용을 위해 향후 document.documentId 요청에서 이 값을 사용하세요.
document.typestring식별된 문서 유형. 가능한 값: unico.moja.dictionary.br.rg.v2.Rg, unico.moja.dictionary.br.cnh.v2.Cnh, unico.moja.dictionary.br.cin.v1.Cin, unico.moja.dictionary.br.passaporte.v1.Passaporte.
document.cpfMatchboolean문서에서 추출된 식별자가 subject.code와 일치하면 true.
document.faceMatchboolean문서의 얼굴이 document.authProcessId의 생체인식 셀피와 일치하면 true.
document.contentobjectOCR로 추출된 필드. 구조는 문서 유형에 따라 다릅니다.
document.fileUrlsarray문서 이미지 다운로드를 위한 임시 URL (10분 유효).
400 Bad Request

페이로드가 잘못된 형식이거나, 이미지가 유효하지 않거나, 필수 필드가 누락되었습니다. 아래 오류 코드를 참조하세요.

403 Forbidden

Bearer 토큰 또는 APIKEY가 누락되었거나 만료되었거나 유효하지 않습니다. 인증을 참조하세요.

409 Conflict

이 테넌트에 이미 제공된 processId가 존재합니다. 아래 오류 코드를 참조하세요.

오류 코드

코드메시지설명
99989The document is invalid.document 객체의 구조가 유효하지 않습니다.
99988The document is empty.요청 본문에 document 객체가 누락되었습니다.
20900O base64 informado não é válido.base64 파라미터가 유효하지 않습니다. 이미지가 아니거나 인젝션 시도일 수 있습니다.
20807A imagem precisa estar no padrão HD ou possuir uma resolução superior a 640 x 480.업로드된 이미지의 해상도가 너무 낮습니다.
20509The subject.name field is invalid.subject.name에 유효하지 않은 문자가 포함되어 있습니다.
20508The subject.gender field is invalid.subject.genderM 또는 F여야 합니다.
20507O parâmetro subject.code é inválido.비표준이거나 존재하지 않는 식별자 값.
20506O base64 informado é muito grande. O tamanho máximo suportado é até 800kb.이미지 크기가 800 KB를 초과합니다. JPEG92로 압축하세요.
20505O base64 informado não é suportado. Os formatos aceitos são png, jpeg e webp.base64 형식이 유효하지 않거나 지원되지 않습니다.
20068The document.documentId or document.files parameter must be present.document.documentIddocument.files 모두 제공되지 않았습니다.
20067The document.purpose parameter is invalid.document.purpose의 값을 인식할 수 없습니다.
20066The document.authProcessId parameter is invalid.document.authProcessId의 값이 유효하지 않습니다.
20062The useCase field is invalid.useCase 필드의 값을 인식할 수 없습니다.
20021The subject.phone field is invalid.subject.phone 형식이 유효하지 않습니다 (국가 코드 + 지역 코드 + 번호, 13자리).
20019The subject.birthDate field is invalid.subject.birthDate가 ISO 8601 형식 (YYYY-MM-DD)에 맞지 않습니다.
20009O parâmetro imagebase64 não foi informado.문서 이미지 파라미터가 누락되었습니다.
20008The subject.email field is invalid.subject.email의 이메일 형식이 유효하지 않습니다.
20005O parâmetro subject.code não foi informado.subject.code 파라미터가 누락되었습니다.
20004O parâmetro subject não foi informado.subject 파라미터가 누락되었습니다.
20003The request body is missing or invalid.Null 또는 유효하지 않은 페이로드.
20002O parâmetro APIKey não foi informado.요청 헤더에 APIKEY 파라미터가 누락되었습니다.
20001O parâmetro authtoken não foi informado.요청 헤더에 통합 토큰 파라미터가 누락되었습니다.
10508The JWT with the captured face has already been used.JWT는 한 번만 사용할 수 있습니다.
10507The JWT with the captured face is expired.JWT가 만료되었습니다. 10분 이내에 전송해야 합니다.
10506The imageBase64 field is not a valid JWT from SDK.imageBase64가 SDK에서 생성된 유효한 JWT가 아닙니다.

다음 단계