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

# Create cell specifications and instances from Uncountable recipes

> Read the organization's Uncountable project and create what is missing.

Callable with an API key (``X-API-Key``) as well as a session, so a scheduler
can run it. Idempotent: specifications are matched by name within the project
and instances by recipe id within their specification, and existing records
are left unchanged. With ``dry_run`` it writes nothing and reports what it
would create, with the field mapping. Answers 403 unless the organization's
``nav_config.uncountableSync`` is enabled and names its projects.



## OpenAPI

````yaml https://api.ionworks.com/openapi.json post /integrations/uncountable/sync
openapi: 3.1.0
info:
  title: FastAPI
  version: 0.1.0
servers:
  - url: https://api.ionworks.com
    description: Production
security: []
paths:
  /integrations/uncountable/sync:
    post:
      tags:
        - Uncountable
      summary: Create cell specifications and instances from Uncountable recipes
      description: >-
        Read the organization's Uncountable project and create what is missing.


        Callable with an API key (``X-API-Key``) as well as a session, so a
        scheduler

        can run it. Idempotent: specifications are matched by name within the
        project

        and instances by recipe id within their specification, and existing
        records

        are left unchanged. With ``dry_run`` it writes nothing and reports what
        it

        would create, with the field mapping. Answers 403 unless the
        organization's

        ``nav_config.uncountableSync`` is enabled and names its projects.
      operationId: sync_from_uncountable_integrations_uncountable_sync_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UncountableSyncRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UncountableSyncResult'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    UncountableSyncRequest:
      properties:
        project_id:
          type: string
          format: uuid
          title: Project Id
          description: Ionworks project the specifications and instances go into.
        dry_run:
          type: boolean
          title: Dry Run
          description: >-
            Report what a sync would create and reuse, and how fields map,
            without writing anything.
          default: false
      type: object
      required:
        - project_id
      title: UncountableSyncRequest
    UncountableSyncResult:
      properties:
        uncountable_project_ids:
          items:
            type: integer
          type: array
          title: Uncountable Project Ids
          description: Uncountable projects read.
        recipes_read:
          type: integer
          title: Recipes Read
          description: Distinct recipes across the Uncountable projects.
        recipes_skipped:
          type: integer
          title: Recipes Skipped
          description: Full-cell recipes skipped because they have no inputs yet.
        refused:
          items:
            type: string
          type: array
          title: Refused
          description: >-
            Recipes and designs that could not be mapped without guessing (two
            slurries for one electrode, or no design capacity), and why. Nothing
            is created for them. One entry can stand for a whole design.
        recipes_refused:
          type: integer
          title: Recipes Refused
          description: Recipes behind the refusals, counting every recipe of a design.
          default: 0
        specs_created:
          type: integer
          title: Specs Created
          description: New cell specifications.
        specs_existing:
          type: integer
          title: Specs Existing
          description: Cell specifications reused.
        instances_created:
          type: integer
          title: Instances Created
          description: New cell instances.
        instances_existing:
          type: integer
          title: Instances Existing
          description: Cell instances left unchanged.
        specs:
          items:
            $ref: '#/components/schemas/UncountableSyncSpec'
          type: array
          title: Specs
          description: Per-spec breakdown.
        dry_run:
          type: boolean
          title: Dry Run
          description: 'True when nothing was written: the counts are a preview.'
          default: false
        mapping:
          items:
            $ref: '#/components/schemas/UncountableMappingRow'
          type: array
          title: Mapping
          description: How Uncountable fields land in Ionworks.
        unmapped_inputs:
          items:
            $ref: '#/components/schemas/UncountableUnmappedInput'
          type: array
          title: Unmapped Inputs
          description: Inputs the full-cell recipes state that are not imported.
      type: object
      required:
        - uncountable_project_ids
        - recipes_read
        - recipes_skipped
        - specs_created
        - specs_existing
        - instances_created
        - instances_existing
        - specs
      title: UncountableSyncResult
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    UncountableSyncSpec:
      properties:
        id:
          anyOf:
            - type: string
            - type: 'null'
          title: Id
          description: Cell specification id; None for one a dry run would create.
        name:
          type: string
          title: Name
          description: Cell specification name.
        created:
          type: boolean
          title: Created
          description: False when an existing spec was reused.
        instances_created:
          type: integer
          title: Instances Created
          description: New instances under this spec.
        instances_existing:
          type: integer
          title: Instances Existing
          description: Instances that already existed and were left unchanged.
        conflicts:
          additionalProperties:
            items:
              type: string
            type: array
          type: object
          title: Conflicts
          description: >-
            Component fields on which the recipes grouped into this spec
            disagree, with the distinct values seen. Non-empty means the design
            grouping is coarser than the recipes; the first stated value was
            used.
        gaps:
          additionalProperties:
            items:
              type: string
            type: array
          type: object
          title: Gaps
          description: >-
            Component fields some grouped recipes do not state, with the recipe
            ids lacking them. The value is unknown for those cells, so the value
            the other recipes state was used.
        design:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Design
          description: >-
            Dry run only: the specification a fresh import would write (ratings,
            form factor, properties, components).
        drift:
          additionalProperties:
            items: {}
            type: array
          type: object
          title: Drift
          description: >-
            For a reused spec: design fields whose stored value differs from
            what Uncountable now states, as [stored, incoming]. The spec is not
            updated, so new cells attach to the stored design.
        instances:
          items:
            $ref: '#/components/schemas/UncountableSyncInstance'
          type: array
          title: Instances
          description: 'Dry run only: every instance of the spec, new or existing.'
      type: object
      required:
        - id
        - name
        - created
        - instances_created
        - instances_existing
      title: UncountableSyncSpec
    UncountableMappingRow:
      properties:
        source:
          type: string
          title: Source
          description: The Uncountable field, by its name there.
        input_ids:
          items:
            type: integer
          type: array
          title: Input Ids
          description: Uncountable input ids it is read from; empty for recipe fields.
        target:
          type: string
          title: Target
          description: Where it lands in Ionworks.
        note:
          type: string
          title: Note
          description: How the value is read or derived.
          default: ''
      type: object
      required:
        - source
        - target
      title: UncountableMappingRow
    UncountableUnmappedInput:
      properties:
        input_id:
          type: integer
          title: Input Id
        name:
          type: string
          title: Name
        recipes:
          type: integer
          title: Recipes
          description: Full-cell recipes that state it.
      type: object
      required:
        - input_id
        - name
        - recipes
      title: UncountableUnmappedInput
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    UncountableSyncInstance:
      properties:
        name:
          type: string
          title: Name
          description: 'Instance name: the Uncountable recipe id.'
        notes:
          type: string
          title: Notes
          description: 'Instance notes: the recipe tag and name.'
        measured_properties:
          additionalProperties: true
          type: object
          title: Measured Properties
          description: What the instance would carry.
        exists:
          type: boolean
          title: Exists
          description: >-
            True when the cell is already in Ionworks: in this spec by name, or
            in another by its recipe tag (see ``moved_from``).
        id:
          anyOf:
            - type: string
            - type: 'null'
          title: Id
          description: The existing instance's id.
        moved_from:
          anyOf:
            - type: string
            - type: 'null'
          title: Moved From
          description: >-
            The spec the cell is in when its recipe now maps to this one. Cells
            are not moved between specs, so it stays where it is.
      type: object
      required:
        - name
        - notes
        - exists
      title: UncountableSyncInstance

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.