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

# Import Subjects



## OpenAPI

````yaml /openapi.json post /v1/organizations/{organization_id}/apps/{app_id}/environments/{environment_id}/subjects/batch
openapi: 3.1.0
info:
  description: Are we on the same page?
  title: Synapse
  version: 0.1.0
servers: []
security: []
paths:
  /v1/organizations/{organization_id}/apps/{app_id}/environments/{environment_id}/subjects/batch:
    post:
      tags:
        - v1 control plane
      summary: Import Subjects
      operationId: >-
        import_subjects_v1_organizations__organization_id__apps__app_id__environments__environment_id__subjects_batch_post
      parameters:
        - in: header
          name: Idempotency-Key
          required: true
          schema:
            maxLength: 255
            minLength: 1
            title: Idempotency-Key
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SubjectImportRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SubjectImportResponse'
          description: Successful Response
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: Validation Error
      security:
        - BearerAuth: []
        - ApiKeyAuth: []
        - SessionCookie: []
components:
  schemas:
    SubjectImportRequest:
      properties:
        items:
          items:
            $ref: '#/components/schemas/SubjectUpsertRequest'
          maxItems: 100
          minItems: 1
          title: Items
          type: array
      required:
        - items
      title: SubjectImportRequest
      type: object
    SubjectImportResponse:
      properties:
        batch_id:
          title: Batch Id
          type: string
        idempotent_replay:
          title: Idempotent Replay
          type: boolean
        receipts:
          items:
            $ref: '#/components/schemas/SubjectImportReceiptResponse'
          title: Receipts
          type: array
      required:
        - batch_id
        - idempotent_replay
        - receipts
      title: SubjectImportResponse
      type: object
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          title: Detail
          type: array
      title: HTTPValidationError
      type: object
    SubjectUpsertRequest:
      additionalProperties: false
      properties:
        external_id:
          maxLength: 512
          minLength: 1
          title: External Id
          type: string
        identity_mode:
          const: enterprise_managed
          default: enterprise_managed
          title: Identity Mode
          type: string
        profile:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Profile
      required:
        - external_id
      title: SubjectUpsertRequest
      type: object
    SubjectImportReceiptResponse:
      properties:
        error_code:
          anyOf:
            - type: string
            - type: 'null'
          title: Error Code
        item_index:
          title: Item Index
          type: integer
        outcome:
          enum:
            - created
            - updated
            - conflict
          title: Outcome
          type: string
        subject_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Subject Id
      required:
        - item_index
        - subject_id
        - outcome
        - error_code
      title: SubjectImportReceiptResponse
      type: object
    ValidationError:
      properties:
        ctx:
          title: Context
          type: object
        input:
          title: Input
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          title: Location
          type: array
        msg:
          title: Message
          type: string
        type:
          title: Error Type
          type: string
      required:
        - loc
        - msg
        - type
      title: ValidationError
      type: object
  securitySchemes:
    BearerAuth:
      description: Named syn_ API key or migration-only legacy key.
      scheme: bearer
      type: http
    ApiKeyAuth:
      description: Header alias for a named or legacy API key.
      in: header
      name: X-API-Key
      type: apiKey
    SessionCookie:
      description: Opaque administrator browser session.
      in: cookie
      name: synapse_session
      type: apiKey

````