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

# Validate CSD certificate and optionally verify private key password

> Validates a CSD certificate file and extracts metadata (RFC, serial number, expiration). Optionally validates the private key password. Does not store the certificate. Useful for pre-validation during onboarding.



## OpenAPI

````yaml https://api.timbrix.mx/api/openapi.json post /organizations/certificates/validate
openapi: 3.0.0
info:
  title: Timbrix API
  description: >-
    API de facturación electrónica CFDI 4.0 para México, con servidor OAuth2
    para gestionar organizaciones, miembros y webhooks. Compatible con agentes
    de IA — ver la extensión `x-ai-agent-friendly` en la raíz de esta spec.


    REST API with OAuth2 server for managing organizations, members, and
    webhooks.
  version: '1.0'
  contact: {}
servers: []
security: []
tags:
  - name: organizations
    description: Organization management endpoints
  - name: oauth
    description: OAuth2 authentication and authorization
  - name: webhooks
    description: Webhook configuration and delivery
  - name: users
    description: User information endpoints
  - name: api-keys
    description: API Keys management and validation
paths:
  /organizations/certificates/validate:
    post:
      tags:
        - organizations
      summary: Validate CSD certificate and optionally verify private key password
      description: >-
        Validates a CSD certificate file and extracts metadata (RFC, serial
        number, expiration). Optionally validates the private key password. Does
        not store the certificate. Useful for pre-validation during onboarding.
      operationId: OrganizationsController_validateCertificate
      parameters: []
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/ValidateCertificateRequestDto'
      responses:
        '200':
          description: Certificate validation result with extracted metadata.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidateCertificateResponseDto'
        '400':
          description: Invalid certificate file format.
        '401':
          description: Authentication required. Provide a valid bearer token.
      security:
        - bearer: []
components:
  schemas:
    ValidateCertificateRequestDto:
      type: object
      properties:
        password:
          type: string
          description: Password for the private key
          example: mypassword123
    ValidateCertificateResponseDto:
      type: object
      properties:
        valid:
          type: boolean
          description: Whether the certificate is valid
          example: true
        rfc:
          type: string
          description: RFC extracted from the certificate
          example: XAXX010101000
        serialNumber:
          type: string
          description: Certificate serial number
          example: '30001000000300023708'
        expiresAt:
          format: date-time
          type: string
          description: Certificate expiration date
          example: '2025-05-15T00:00:00.000Z'
        issuedAt:
          format: date-time
          type: string
          description: Certificate issue date
          example: '2021-05-15T00:00:00.000Z'
        subjectName:
          type: string
          description: Subject common name from certificate
          example: EMPRESA EJEMPLO SA DE CV
        error:
          type: string
          description: Error message if validation failed
          example: Invalid certificate format
        isExpired:
          type: boolean
          description: Whether the certificate has expired
          example: false
        passwordValid:
          type: boolean
          description: Whether the password is valid for the private key
          example: true
        passwordError:
          type: string
          description: Error message if password validation failed
          example: Incorrect password
        pairValid:
          type: boolean
          description: Whether the certificate and private key form a matching CSD pair
          example: true
        pairError:
          type: string
          description: Error message if the certificate and private key do not match
          example: >-
            The certificate (.cer) and private key (.key) do not form a matching
            CSD pair
      required:
        - valid
  securitySchemes:
    bearer:
      scheme: bearer
      bearerFormat: JWT
      type: http

````