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

# Upload a trust-store certificate

> Uploads a PEM-encoded X.509 certificate to the tenant trust
store as multipart/form-data. Validates the PEM/X.509 body,
rejects expired (422) and duplicate alias/fingerprint (409)
certificates, persists the row + audit_outbox event in one
transaction, and stores the PEM blob in object storage.



## OpenAPI

````yaml en/openapi/v3-current/sta.yaml post /v1/certificates
openapi: 3.0.3
info:
  title: Lerian STA API
  description: >-
    API for Lerian STA — the participant-side rail that connects the institution
    to Banco Central do Brasil's STA (Sistema de Transferencia de Arquivos)
    file-exchange system. It covers outbound and inbound file transfers, BACEN
    credential management, inbound source polling configuration, and the tenant
    trust-store for message-signing certificates.
  version: v1.0.0
servers:
  - url: https://sta.sandbox.lerian.net
security:
  - BearerAuth: []
tags:
  - name: transfers
    description: >-
      Outbound and inbound STA file transfers — creation, listing, read,
      cancellation, retry, and urgent-processing marking.
  - name: trust-store
    description: >-
      Tenant trust-store X.509 certificate lifecycle: listing, upload, deletion,
      and status summary.
  - name: credentials
    description: >-
      BACEN STA credential management: creation, read, update, rotation,
      revocation, and connectivity testing.
  - name: inbound-source-configs
    description: >-
      Inbound source polling configuration: creation, read, update, deletion,
      manual poll triggering, and discovery reserve usage.
  - name: health
    description: Service health and readiness reporting.
paths:
  /v1/certificates:
    post:
      tags:
        - trust-store
      summary: Upload a trust-store certificate
      description: |-
        Uploads a PEM-encoded X.509 certificate to the tenant trust
        store as multipart/form-data. Validates the PEM/X.509 body,
        rejects expired (422) and duplicate alias/fingerprint (409)
        certificates, persists the row + audit_outbox event in one
        transaction, and stores the PEM blob in object storage.
      requestBody:
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                name:
                  description: Unique certificate alias
                  type: string
                description:
                  description: Human-readable description
                  type: string
                certificate:
                  description: PEM-encoded X.509 certificate
                  type: string
                  format: binary
              required:
                - name
                - certificate
        required: true
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/http.UploadResponse'
        '400':
          description: invalid input (missing field, bad PEM, not-yet-valid)
          content:
            application/json:
              schema:
                additionalProperties: true
                type: object
        '401':
          description: missing actor identity
          content:
            application/json:
              schema:
                additionalProperties: true
                type: object
        '409':
          description: duplicate alias or fingerprint
          content:
            application/json:
              schema:
                additionalProperties: true
                type: object
        '413':
          description: certificate body exceeds size limit
          content:
            application/json:
              schema:
                additionalProperties: true
                type: object
        '422':
          description: certificate is expired
          content:
            application/json:
              schema:
                additionalProperties: true
                type: object
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                additionalProperties: true
                type: object
components:
  schemas:
    http.UploadResponse:
      properties:
        alias:
          type: string
        description:
          type: string
        fingerprint:
          type: string
        id:
          type: string
        issuer:
          type: string
        serialNumber:
          type: string
        subject:
          type: string
        validFrom:
          type: string
        validUntil:
          type: string
      type: object
  securitySchemes:
    BearerAuth:
      description: 'Bearer token authentication (format: "Bearer {token}")'
      in: header
      name: Authorization
      type: apiKey

````