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

# Create external client

> Creates a new external counterparty (Client type = 1) for the company tied to the API key. Does not create portal access.



## OpenAPI

````yaml /openapi/openapi.json post /api/clients
openapi: 3.0.0
info:
  title: FinSync API Documentation
  version: 1.0.0
  description: API documentation for FinSync application
  contact:
    name: FinSync Support
    email: support@finsync.com
servers:
  - url: https://finsync.ar
    description: API server
security:
  - apiKey: []
tags:
  - name: Clients
    description: Operations related to clients and their accounts
  - name: Accounts
    description: Operations related to account balances
  - name: Operations
    description: Operations for creating and managing financial operations
  - name: Operation Types
    description: Company operation types management
  - name: Transaction Types
    description: Company transaction types management
  - name: Superadmin
    description: Cross-tenant operations (JWT + email allowlist)
  - name: External client
    description: >-
      Exports for external (portal-linked) clients. Authenticate with
      `x-api-key` (company-owned client ID) or `Authorization: Bearer` (Supabase
      access token with an ExternalClient invite).
paths:
  /api/clients:
    post:
      tags:
        - Clients
      summary: Create external client
      description: >-
        Creates a new external counterparty (Client type = 1) for the company
        tied to the API key. Does not create portal access.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - name
              properties:
                name:
                  type: string
                  maxLength: 100
                  description: Client display name
                description:
                  type: string
                  nullable: true
                  description: Optional notes
      responses:
        '201':
          description: External client created
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: integer
                  name:
                    type: string
                  description:
                    type: string
                    nullable: true
                  company_id:
                    type: integer
                  type:
                    type: integer
                    description: Always 1 for this endpoint
                  company_client_id:
                    type: integer
                  created_at:
                    type: string
                    format: date-time
                  updated_at:
                    type: string
                    format: date-time
        '400':
          description: Bad request (e.g. missing or invalid name)
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
        '401':
          description: Unauthorized - Missing or invalid API key
        '500':
          description: Server error
      security:
        - apiKey: []
components:
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: x-api-key
      description: API Key for authentication

````