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

# Bulk upsert users from CSV

> Parses the CSV file and forwards it as a SCIM Bulk request to create and/or update users.

Expected CSV columns (header row): id, forename, surname, email, secondary_email, package_slug, address_line_1, addressLine2, state/region, city_code, country_code, postal_code, phone_number, send_activation_email, cpf_number.

Notes: 
- id: optional UUID. If present, an update (PUT) is generated; if absent, a create (POST) with a bulkId is generated.
- package_slug: optional; when present and resolvable it is mapped to a packageId.
- send_activation_email: true/false/yes/no/null (case-insensitive).
- File must be uploaded as multipart form-data with field name 'file'.- CPF number is mandatory for Brazilian users.



## OpenAPI

````yaml /openapi.json post /scim/v2/Users/csv
openapi: 3.1.0
info:
  title: Firstbase API Specification Beta
  description: Integration endpoints for Firstbase
  version: 0.1.0
servers:
  - url: /
    description: Default
security:
  - ApiKey: []
tags:
  - name: Inventory Orders
    description: Create and manage inventory orders
  - name: Shipment Notices V1
    description: 'Query shipment notice orders (V1: package items expose `inventories` list)'
  - name: Packages
    description: ''
  - name: Categories
    description: Query available categories for asset creation
  - name: Catalog
    description: ''
  - name: New Joiners
    description: New joiner provisioning pipeline for the organization
  - name: Orders
    description: ''
  - name: People
    description: >-
      Manage the users of Firstbase for your organization. API follows the SCIM
      standard.
    externalDocs:
      url: https://scim.cloud/
  - name: People — Lifecycle
    description: Offboard and reactivate users.
  - name: Assets
    description: Manage inventory assets
  - name: Regions V1
    description: Query regions (V1)
  - name: Warehouses V1
    description: Query warehouses (V1)
  - name: Brands
    description: Query available brands for asset creation
  - name: Inventory
    description: ''
  - name: Replacements
    description: Create and manage equipment replacements
  - name: Offices
    description: Manage and query office locations for the authenticated organization
  - name: Returns
    description: Return and Replacements
paths:
  /scim/v2/Users/csv:
    post:
      tags:
        - People
      summary: Bulk upsert users from CSV
      description: >-
        Parses the CSV file and forwards it as a SCIM Bulk request to create
        and/or update users.


        Expected CSV columns (header row): id, forename, surname, email,
        secondary_email, package_slug, address_line_1, addressLine2,
        state/region, city_code, country_code, postal_code, phone_number,
        send_activation_email, cpf_number.


        Notes: 

        - id: optional UUID. If present, an update (PUT) is generated; if
        absent, a create (POST) with a bulkId is generated.

        - package_slug: optional; when present and resolvable it is mapped to a
        packageId.

        - send_activation_email: true/false/yes/no/null (case-insensitive).

        - File must be uploaded as multipart form-data with field name 'file'.-
        CPF number is mandatory for Brazilian users.
      operationId: bulkUpsertUsersFromCsv
      parameters:
        - name: file
          in: query
          description: >-
            CSV file containing users to upsert. Columns should match the
            Firstbase CSV template.
          required: true
          schema:
            type: string
            format: binary
      requestBody:
        content:
          multipart/form-data:
            schema:
              type: object
            examples:
              People CSV template:
                summary: Upload as form-data field 'file'
                description: Example CSV content for the 'file' field.
                value: |2-

                                              id,forename,surname,email,secondary_email,package_slug,address_line_1,addressLine2,state/region,city_code,country_code,postal_code,phone_number,send_activation_email,cpf_number
                                              55907ba0-6ee7-3c6c-00a9-8becwb9k83dk,Name,ExampleSurname,email@example.com,example-optional-secondary-email@email.com,developer-a,Test address line 1,Test address line 2,test state,TN,US,37076,6155555555,YES,87425365821
                                              
        required: true
      responses:
        '200':
          description: Bulk operation completed
          content:
            application/scim+json:
              schema:
                type: string
        '400':
          description: Bad Request
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/PublicApiHttpErrors'
        '404':
          description: Not Found
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/PublicApiHttpErrors'
        '409':
          description: Conflict
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/PublicApiHttpErrors'
components:
  schemas:
    PublicApiHttpErrors:
      type: object
      properties:
        errors:
          type: array
          items:
            $ref: '#/components/schemas/PublicApiError'
      required:
        - errors
    PublicApiError:
      type: object
      properties:
        detail:
          type: string
          description: Human-readable description of the error
          example: Invalid request
        source:
          type: string
          description: >-
            Entity or field path that caused the error (for example order,
            shipmentNotice, or person:email)
          example: request
      required:
        - detail
        - source
  securitySchemes:
    ApiKey:
      type: apiKey
      description: Prefix the value with "ApiKey" to indicate the custom authorization type
      name: Authorization
      in: header

````