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

# Create multiple contacts in bulk

> Create multiple contacts and attach them to an organization.

    - Non-atomic (partial success allowed)
    - Each contact is processed in an isolated transaction
    - Successful contacts are committed even if others fail
    - Always returns 200 OK with results and errors
    - Check the 'succeeded' and 'failed' counts to determine outcome



## OpenAPI

````yaml /api-reference/preview.json post /organizations/{organization_id}/contacts/list
openapi: 3.1.0
info:
  title: FastAPI
  version: 0.1.0
servers: []
security: []
paths:
  /organizations/{organization_id}/contacts/list:
    post:
      tags:
        - Core
        - Organizations
        - Contacts
      summary: Create multiple contacts in bulk
      description: |-
        Create multiple contacts and attach them to an organization.

            - Non-atomic (partial success allowed)
            - Each contact is processed in an isolated transaction
            - Successful contacts are committed even if others fail
            - Always returns 200 OK with results and errors
            - Check the 'succeeded' and 'failed' counts to determine outcome
      operationId: >-
        create_organization_contacts_bulk_organizations__organization_id__contacts_list_post
      parameters:
        - name: organization_id
          in: path
          required: true
          schema:
            anyOf:
              - type: string
              - type: string
                format: uuid
            title: Organization Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: array
              items:
                $ref: '#/components/schemas/ContactRequest'
              title: Requests
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BulkOperationResponse_ContactResponse_'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - BearerToken: []
components:
  schemas:
    ContactRequest:
      properties:
        name:
          type: string
          title: Name
        email:
          anyOf:
            - type: string
              format: email
            - type: 'null'
          title: Email
        phone:
          anyOf:
            - $ref: '#/components/schemas/DEPhoneNumber'
            - type: 'null'
        roles:
          items:
            type: string
          type: array
          title: Roles
          default: []
      additionalProperties: true
      type: object
      required:
        - name
      title: ContactRequest
    BulkOperationResponse_ContactResponse_:
      properties:
        total:
          type: integer
          title: Total
          description: Total number of records in the request
        data:
          items:
            $ref: '#/components/schemas/ContactResponse'
          type: array
          title: Data
          description: Successfully processed records
        errors:
          items:
            $ref: '#/components/schemas/OperationError'
          type: array
          title: Errors
          description: Failed records with error details
        succeeded:
          type: integer
          title: Succeeded
          description: Number of successfully processed records
          readOnly: true
        failed:
          type: integer
          title: Failed
          description: Number of failed records
          readOnly: true
        unprocessed:
          type: integer
          title: Unprocessed
          description: Number of records that passed validation but were not processed
          readOnly: true
      additionalProperties: true
      type: object
      required:
        - total
        - succeeded
        - failed
        - unprocessed
      title: BulkOperationResponse[ContactResponse]
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    DEPhoneNumber:
      properties:
        phone_number:
          type: string
          format: phone
          title: Phone Number
        phone_type:
          $ref: '#/components/schemas/payroll__gb__schema__employee__PhoneType'
      additionalProperties: true
      type: object
      required:
        - phone_number
        - phone_type
      title: DEPhoneNumber
    ContactResponse:
      properties:
        name:
          type: string
          title: Name
        email:
          anyOf:
            - type: string
              format: email
            - type: 'null'
          title: Email
        phone:
          anyOf:
            - $ref: '#/components/schemas/DEPhoneNumber'
            - type: 'null'
        id:
          type: string
          title: Id
        roles:
          items:
            type: string
          type: array
          title: Roles
          default: []
      additionalProperties: true
      type: object
      required:
        - name
        - id
      title: ContactResponse
    OperationError:
      properties:
        input_index:
          type: integer
          title: Input Index
          description: Index in the bulk request
        errors:
          items:
            $ref: '#/components/schemas/ErrorDetail'
          type: array
          title: Errors
          description: List of errors that occurred
      additionalProperties: true
      type: object
      required:
        - input_index
        - errors
      title: OperationError
      description: Represents a failed operation with its input context
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    payroll__gb__schema__employee__PhoneType:
      type: string
      enum:
        - mobile
        - home
        - work
      title: PhoneType
    ErrorDetail:
      properties:
        code:
          anyOf:
            - $ref: '#/components/schemas/ErrorCode'
            - $ref: '#/components/schemas/PydanticErrorCode'
          title: Code
          description: Unique error code for i18n lookup
        message:
          type: string
          title: Message
          description: English fallback error message
        field:
          anyOf:
            - type: string
            - type: 'null'
          title: Field
          description: Field that caused the error
        params:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Params
          description: Parameters for translation interpolation
      additionalProperties: true
      type: object
      required:
        - code
        - message
      title: ErrorDetail
      description: |-
        Represents an error that occurred during processing.

        Designed for client-side i18n:
        - code: Use this to look up translation (e.g., "ORG_NOT_FOUND")
        - message: English fallback if translation not available
        - field: Field name for form validation highlighting
        - params: Dynamic values for translation interpolation
    ErrorCode:
      type: string
      enum:
        - ADDRESS_NOT_FOUND
        - ADDRESS_CREATION_ERROR
        - ADDRESS_UPDATING_ERROR
        - ADDRESS_COUNTRY_CODE_MISMATCH
        - ORG_NOT_FOUND
        - ORG_DUPLICATE_EXTERNAL_REF
        - ORG_HAS_ACTIVE_EMPLOYEES
        - ORG_ALREADY_SHUTDOWN
        - ORG_COUNTRY_CHANGE_NOT_ALLOWED
        - ORG_BELONGS_TO_A_DIFFERENT_COUNTRY
        - CONTACT_NOT_FOUND
        - CONTACT_ACCESS_DENIED
        - WORKSITE_NOT_FOUND
        - BANK_ACCOUNT_NOT_FOUND
        - BANK_ACCOUNT_MISSING_SWIFT
        - BANK_ACCOUNT_MISSING_IBAN
        - BANK_ACCOUNT_INVALID_COMBINATION
        - BANK_ACCOUNT_NOT_ASSOCIATED_WITH_EMPLOYEE
        - BANK_ACCOUNT_NOT_ASSOCIATED_WITH_ORG
        - BANK_ACCOUNT_REFERENCED_BY_SEPA_MANDATE
        - EMPLOYEE_NOT_FOUND
        - EMPLOYEE_ACCESS_DENIED
        - EMPLOYEES_ACCESS_DENIED
        - EMPLOYEE_OPERATION_FAILED
        - EMPLOYEES_DO_NOT_BELONG_TO_PAY_GROUP
        - EMPLOYEES_ASSIGNED_TO_PAY_GROUP
        - DUPLICATE_EMPLOYEE_IDS
        - PAYROLL_STATUS_NOT_FOUND
        - TASK_STATUS_CHECKER_NOT_FOUND
        - PAYROLL_TASK_INVALID_STATUS
        - CALCULATION_TASK_NOT_FOUND_IN_PAYROLL
        - PAYRUN_NOT_FOUND
        - PAYRUN_NOT_IN_DRAFT_STATUS
        - PAYRUN_NOT_APPROVED
        - PAYRUN_STILL_PROCESSING
        - PAYRUN_MISSING_PAYSLIPS
        - PAYRUN_OPERATION_FAILED
        - PAYRUN_CONTAINS_EMPLOYEES_NOT_IN_PAY_GROUP
        - PAYRUN_EMPTY_PAY_DETAILS
        - PAYRUN_NMW_VIOLATIONS
        - SACRIFICE_NOT_ALLOWED
        - PAY_GROUP_NOT_FOUND
        - ONE_OR_MORE_PAY_GROUP_NOT_FOUND
        - PAY_GROUP_IS_IN_RUNNING_PAYROLL
        - PAY_CALENDAR_NOT_FOUND
        - PAY_PERIOD_UNRESOLVED
        - SEPA_MANDATE_NOT_FOUND
        - SEPA_MANDATE_DUPLICATE_REFERENCE
        - INSURANCE_DATA_NOT_FOUND
        - INSURANCE_LEVEL_CHOICE_NOT_FOUND
        - INSURANCE_LEVEL_CHOICE_ALREADY_EXISTS
        - INSURANCE_LEVEL_CHOICE_INVALID
        - INSURANCE_AGENCY_NOT_FOUND
        - INVALID_COMPANY_NUMBER
        - INVALID_WORKSITE_LOCATION_NUMBER
        - U1_CHANGES_NOT_ALLOWED
        - NON_GERMAN_ORGANIZATION
        - INSURANCE_OPERATION_FAILED
        - PREFERENCES_NOT_FOUND
        - EMPLOYEE_DETAIL_NOT_FOUND
        - EMPLOYEE_DETAIL_OPERATION_FAILED
        - TAX_IDENTIFIER_NOT_FOUND
        - TAX_DATA_REQUIRED
        - PAYSLIP_OPERATION_FAILED
        - PAYSLIP_PDF_GENERATION_FAILED
        - PAYSLIP_FPS_VALIDATION_FAILED
        - PAYSLIP_FPS_SUBMISSION_FAILED
        - PAYSLIP_FPS_POLLING_FAILED
        - PAYSLIP_NOT_FOUND
        - DOCUMENT_NOT_FOUND
        - DOCUMENT_ACCESS_DENIED
        - DOCUMENT_UPLOAD_FAILED
        - DOCUMENT_DOWNLOAD_FAILED
        - DOCUMENT_DELETION_FAILED
        - DOCUMENT_OPERATION_FAILED
        - DOCUMENT_INVALID_TYPE
        - DOCUMENT_SIZE_EXCEEDED
        - DOCUMENT_UNSUPPORTED_FILE_TYPE
        - DOCUMENT_RATE_LIMIT_EXCEEDED
        - DOCUMENT_TEMPLATE_NOT_FOUND
        - DOCUMENT_TEMPLATE_INVALID_SYNTAX
        - DOCUMENT_TEMPLATE_ALREADY_ACTIVE
        - DOCUMENT_TEMPLATE_OPERATION_FAILED
        - WAGE_TYPE_NOT_FOUND
        - WAGE_TYPE_ALREADY_EXISTS
        - WAGE_TYPE_DRAFT_EXISTS
        - WAGE_TYPE_INVALID_DATE
        - COMPENSATION_EFFECTIVE_DATE_TOO_OLD
        - PENSION_SCHEME_NOT_FOUND
        - PENSION_SCHEME_ALREADY_EXISTS
        - PENSION_SCHEME_INVALID_VALID_FROM
        - PENSION_MEMBERSHIP_NOT_FOUND
        - PENSION_MEMBERSHIP_ALREADY_ACTIVE
        - PENSION_MEMBERSHIP_NOT_ACTIVE
        - PENSION_MEMBERSHIP_INVALID_VALID_FROM
        - PENSION_WAGE_TYPE_OVERRIDE_INCOMPLETE
        - PENSION_WAGE_TYPE_MISMATCH
        - PENSION_RATE_BELOW_MINIMUM
        - P32_EA_INELIGIBLE
        - P32_RECORD_NOT_FOUND
        - P32_NO_SURPLUS
        - P32_REPAYMENT_EXCEEDS_SURPLUS
        - HMRC_STATUS_NOT_FOUND
        - HMRC_INVALID_STATE_TRANSITION
        - EPS_NOT_FOUND
        - EPS_DATE_SCHEME_CEASED_IN_FUTURE
        - EPS_FINAL_SUBMISSION_NO_TYPE
        - EPS_DATE_SCHEME_CEASED_WITHOUT_SCHEME_CEASED
        - EPS_RECOVERABLE_AMOUNTS_NO_FIELDS
        - EPS_NO_SECTIONS_PROVIDED
        - P11D_INVALID_TAX_YEAR
        - P11D_OUTSIDE_FILING_WINDOW
        - P11D_NOT_FOUND
        - P11D_DELETE_BLOCKED
        - BACS_SUN_NOT_CONFIGURED
        - BACS_FILE_NOT_FOUND
        - BACS_TASK_NOT_SCHEDULED
        - BACS_TASK_IN_PROGRESS
        - BACS_TASK_FAILED
        - BACS_NO_PAYMENTS
        - GB_RTI_ID_DUPLICATE
        - GB_RTI_ID_REUSED_IN_TAX_YEAR
        - GB_PAYROLL_CALCULATION_RESULTS_NOT_READY
        - EXB_SUBMISSION_ALREADY_EXISTS
        - EXB_SUBMISSION_NOT_FOUND
        - EXB_OUTSIDE_FILING_WINDOW
        - EXB_INVALID_TAX_YEAR
        - P46_CAR_NOT_FOUND
        - P46_CAR_LOCKED
      title: ErrorCode
      description: |-
        Centralized error codes for i18n translation.

        Naming convention: {RESOURCE}_{ERROR_TYPE}
        - ORG_NOT_FOUND - Organization not found
    PydanticErrorCode:
      type: string
      enum:
        - FIELD_REQUIRED
        - FIELD_INVALID_TYPE_STRING
        - FIELD_INVALID_TYPE_INT
        - FIELD_INVALID_TYPE_FLOAT
        - FIELD_INVALID_TYPE_BOOL
        - FIELD_INVALID_TYPE_DICT
        - FIELD_INVALID_TYPE_LIST
        - FIELD_STRING_TOO_SHORT
        - FIELD_STRING_TOO_LONG
        - FIELD_STRING_PATTERN_MISMATCH
        - FIELD_VALUE_TOO_SMALL
        - FIELD_VALUE_TOO_LARGE
        - FIELD_INVALID_DATE
        - FIELD_INVALID_DATETIME
        - FIELD_INVALID_TIME
        - FIELD_INVALID_DATE_FORMAT
        - FIELD_INVALID_DATETIME_FORMAT
        - FIELD_INVALID_ENUM_VALUE
        - FIELD_INVALID_EMAIL
        - FIELD_INVALID_URL
        - FIELD_LIST_TOO_SHORT
        - FIELD_LIST_TOO_LONG
        - FIELD_VALIDATION_ERROR
      title: PydanticErrorCode
      description: |-
        Error codes for Pydantic validation errors.

        Maps Pydantic error types to our error codes for i18n.
  securitySchemes:
    BearerToken:
      type: oauth2
      flows:
        password:
          scopes:
            read:all: Read all
            write:all: Write all
            read:health_check: Read health check
            write:health_check: Write health check
            read:wage_types: Read wage types
            write:wage_types: Write wage types
          tokenUrl: >-
            https://auth-preview.intermezzo.ai/authorize?audience=api-preview.intermezzo.ai

````