> ## Documentation Index
> Fetch the complete documentation index at: https://docs.vos.verolabs.co/llms.txt
> Use this file to discover all available pages before exploring further.

# Trích xuất thông tin CCCD khi đăng ký

> Trích xuất thông tin CCCD khi đăng ký



## OpenAPI

````yaml openapi.v2.vi.json POST /api/v2/chat/api/id-card
openapi: 3.0.3
info:
  title: VOS API v2 (Vietnamese)
  version: 1.0.24
  description: >-
    Thông số OpenAPI API v2 đã được lọc cho endpoint trích xuất CCCD trong đăng
    ký.
servers:
  - url: https://api-gw.verolabs.co
    description: API gateway
security: []
tags:
  - name: Đăng ký
    description: API hỗ trợ luồng đăng ký tài khoản
paths:
  /api/v2/chat/api/id-card:
    post:
      tags:
        - Đăng ký
      summary: Trích xuất thông tin CCCD khi đăng ký
      description: >-
        Phân tích ảnh mặt trước CCCD/CMND và các ảnh mặt sau hoặc chân dung nếu
        có trong bước đăng ký. Gửi nội dung ảnh dạng base64 trong JSON, không
        gửi tiền tố data URL. Endpoint này không yêu cầu xác thực.
      operationId: parseSignupIdCard
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/IdCardParseRequest'
        description: Base64 image payload used by the signup ID-card scan flow.
      responses:
        '200':
          description: Parsed ID-card data and uploaded image URLs when available.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/IdCardParseResponse'
        '400':
          $ref: '#/components/responses/ErrorResponse'
          description: Response lỗi.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AnyErrorBody'
            application/problem+json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/ValidationProblemDetails'
                  - $ref: '#/components/schemas/ProblemDetails'
            text/plain:
              schema:
                type: string
                description: Thông điệp lỗi dạng text do backend hoặc gateway trả về.
        '401':
          $ref: '#/components/responses/ErrorResponse'
          description: Response lỗi.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AnyErrorBody'
            application/problem+json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/ValidationProblemDetails'
                  - $ref: '#/components/schemas/ProblemDetails'
            text/plain:
              schema:
                type: string
                description: Thông điệp lỗi dạng text do backend hoặc gateway trả về.
        '404':
          $ref: '#/components/responses/ErrorResponse'
          description: Response lỗi.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AnyErrorBody'
            application/problem+json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/ValidationProblemDetails'
                  - $ref: '#/components/schemas/ProblemDetails'
            text/plain:
              schema:
                type: string
                description: Thông điệp lỗi dạng text do backend hoặc gateway trả về.
        '500':
          $ref: '#/components/responses/ErrorResponse'
          description: Response lỗi.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AnyErrorBody'
            application/problem+json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/ValidationProblemDetails'
                  - $ref: '#/components/schemas/ProblemDetails'
            text/plain:
              schema:
                type: string
                description: Thông điệp lỗi dạng text do backend hoặc gateway trả về.
      security: []
      servers:
        - url: https://api-gw.verolabs.co/api/v2/chat
          description: Signup API
components:
  schemas:
    IdCardParseRequest:
      type: object
      additionalProperties: false
      description: >-
        Base64-encoded ID-card images captured or uploaded in the signup flow.
        frontImage is required; backImage and portraitImage are optional.
      required:
        - frontImage
      properties:
        frontImage:
          type: string
          format: byte
          description: >-
            Base64 image content for the front side of the Vietnamese ID card.
            Do not include the data URL prefix.
        backImage:
          type: string
          format: byte
          description: Optional base64 image content for the back side of the ID card.
        portraitImage:
          type: string
          format: byte
          description: Optional base64 portrait/selfie image.
    IdCardParseResponse:
      type: object
      additionalProperties: true
      description: ID-card parsing response returned by the chat/ekyc route.
      properties:
        success:
          type: boolean
          description: Whether parsing succeeded.
        data:
          type: object
          additionalProperties: true
          description: Parsed Vietnamese ID card fields.
          properties:
            idNumber:
              type: string
              description: Citizen ID number.
            fullName:
              type: string
              description: Full name on the ID card.
            dateOfBirth:
              type: string
              description: Date of birth as parsed from the document.
            sex:
              type: string
              description: Sex/gender value on the document.
            nationality:
              type: string
              description: Nationality.
            placeOfOrigin:
              type: string
              description: Place of origin.
            placeOfResidence:
              type: string
              description: Place of residence.
            dateOfExpiry:
              type: string
              description: Expiry date.
            dateOfIssue:
              type: string
              description: Issue date when available.
            issuedBy:
              type: string
              description: Issuing authority when available.
            address:
              type: string
              description: Parsed address when returned by backend.
        imageUrls:
          $ref: '#/components/schemas/IdCardImageUrls'
        error:
          type: string
          description: Error message when parsing fails.
    AnyErrorBody:
      oneOf:
        - $ref: '#/components/schemas/ErrorResponse'
        - $ref: '#/components/schemas/ValidationProblemDetails'
        - $ref: '#/components/schemas/ProblemDetails'
      description: >-
        Body lỗi có cấu trúc do gateway, ASP.NET service hoặc validation handler
        backend trả về.
    ValidationProblemDetails:
      allOf:
        - $ref: '#/components/schemas/ProblemDetails'
        - type: object
          additionalProperties: true
          properties:
            errors:
              type: object
              additionalProperties:
                oneOf:
                  - type: array
                    items:
                      type: string
                  - type: string
              description: Lỗi validation theo từng field request.
      description: Response lỗi validation khi param hoặc body field không hợp lệ.
    ProblemDetails:
      type: object
      additionalProperties: true
      description: Response lỗi kiểu RFC 7807 do ASP.NET/gateway trả về.
      properties:
        type:
          type: string
          description: URI loại lỗi.
        title:
          type: string
          description: Tiêu đề lỗi ngắn.
        status:
          type: integer
          description: Mã HTTP status.
        detail:
          type: string
          description: Thông điệp lỗi chi tiết.
        traceId:
          type: string
          description: Trace id để tra cứu lỗi backend.
    IdCardImageUrls:
      type: object
      additionalProperties: true
      description: Stored image URLs returned by the ID-card service.
      properties:
        front:
          type: string
          description: Stored front image URL.
        back:
          type: string
          description: Stored back image URL.
        portrait:
          type: string
          description: Stored portrait image URL.
    ErrorResponse:
      type: object
      additionalProperties: true
      description: >-
        Body loi do gateway hoac backend tra ve. Backend co the tra JSON object
        hoac loi dang plain text.
      properties:
        error:
          oneOf:
            - type: string
            - type: object
              additionalProperties: true
              properties:
                id:
                  type: string
                  description: Ma loi gateway khi co.
                code:
                  type: integer
                  description: Ma loi tuong duong HTTP.
                status:
                  type: string
                  description: Text trang thai HTTP, vi du Unauthorized.
                reason:
                  type: string
                  description: Ly do chi tiet do he thong hoac gateway tra ve.
                message:
                  type: string
                  description: Thong diep loi de doc.
          description: Chuoi ma/thong diep loi hoac object loi nested cua gateway.
        message:
          type: string
          description: Human-readable error message.
        detail:
          type: string
          description: Detailed backend error message when available.
        details:
          oneOf:
            - type: string
            - type: object
              additionalProperties: true
            - type: array
              items:
                type: object
                additionalProperties: true
          description: Chi tiết validation hoặc backend bổ sung.
          nullable: true
        status:
          type: integer
          description: HTTP status code when included by the backend.
  responses:
    ErrorResponse:
      description: Error response containing an error code, message, detail, or plain text.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
        text/plain:
          schema:
            type: string

````