---
title: "Upload CSF PDF to create or update client"
method: POST
path: "/clients/csf"
tags: ["Clients"]
---

# Upload CSF PDF to create or update client

`POST /clients/csf`

Upload a CSF (Constancia de Situación Fiscal) PDF file from SAT to automatically extract fiscal information and create a new client or update an existing one.

**How it works:**
1. Upload the CSF PDF file as `multipart/form-data`
2. The system extracts RFC and CIF from the PDF
3. Validates the fiscal information against SAT
4. Creates a new client or updates an existing one with the fiscal data

**Query Parameters:**
- `client_id` (optional): If provided, updates the existing client. If omitted, creates a new client.

**Extracted Information:**
- Legal name (Razón Social)
- RFC (Tax ID)
- Fiscal regime (Régimen Fiscal)
- Fiscal type (company/individual)
- Fiscal status
- Complete address (street, exterior/interior number, neighborhood, city, state, zip code)

**gigstack Connect:** Create or update clients for other teams using the `team` parameter.

## Query parameters

- `team` string
- `client_id` string

## Response `200`

Client updated successfully with CSF data

- object
  - `message` string
  - `data` ApiPublicClient
    - `id` string, required — Unique client identifier
    - `address` ClientAddress, nullable
      - `country` string, nullable
      - `street` string, nullable
      - `zip` string, nullable
      - `city` string, nullable
      - `state` string, nullable
      - `exterior` string, nullable
      - `interior` string, nullable
      - `municipality` string, nullable
      - `neighborhood` string, nullable
    - `name` string, nullable — Client name
    - `company` string, nullable — Client company name
    - `phone` string, nullable — Client phone number
    - `email` string, email, nullable, required — Client email address
    - `bcc` string[], nullable — BCC email addresses for client communications
    - `metadata` object, nullable — Additional metadata for the client
    - `is_valid` boolean, nullable — Whether the client data is valid
    - `from` string, required — Source of client creation
    - `legal_name` string, nullable — Legal name for tax purposes
    - `livemode` boolean, required — Whether this client is in live mode
    - `owner` string, required — User ID who owns this client
    - `tax_id` string, nullable — RFC (Tax ID) for Mexican tax compliance
    - `use` string, nullable — CFDI use code
    - `tax_system` string, nullable — SAT tax system code
    - `team` string, required — Team ID this client belongs to
    - `created_at` number, required — Unix timestamp of client creation
    - `efos` object, nullable — EFOS (SAT blacklist) validation status
      - `is_valid` boolean, nullable — Whether the client is valid according to SAT EFOS list
    - `defaults` object, nullable — Client default settings
      - `keep_full_legal_name` boolean, nullable — Keep full legal name in documents
      - `issue_automatic_invoices` boolean, nullable — Issue automatic invoices
      - `issue_invoiceable_receipts` boolean, nullable — Issue invoiceable receipts

## Other responses

- `201` — Client created successfully from CSF
- `400` — Bad Request - Invalid file, missing fiscal data, or client not found
- `401` — Unauthorized
- `500` — Internal Server Error

---

[API](https://skmtc.dev/disruptive-learning/apis/gigstack-api-v2.md) · [All operations](https://skmtc.dev/disruptive-learning/apis/gigstack-api-v2/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/disruptive-learning/gigstack-api-v2/revisions/5cf53ffd7580/schema)
