> ## 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.

# Export Parameterized Model Code

> Export a parameterized model as code, as a zip.

One route for every export format, so later ones (e.g. Simscape) add a
``format`` value rather than a path.

Current and ambient temperature are inputs to the generated code, and so is
initial SOC when the model can take one.

Parameters
----------
parameterized_model_id : str
    ID of the parameterized model to export.
parameterized_models_repository : ParameterizedModelsRepository
    Repository scoped to the caller's Supabase client.
model_repository : ModelRepository
    Repository scoped to the caller's Supabase client.
export_format : {"matlab", "simulink"}
    Which code to generate, from the ``format`` query parameter.

Returns
-------
Response
    The zip archive as ``application/zip``, sent as an attachment.



## OpenAPI

````yaml https://api.ionworks.com/openapi.json get /parameterized_models/{parameterized_model_id}/export
openapi: 3.1.0
info:
  title: FastAPI
  version: 0.1.0
servers:
  - url: https://api.ionworks.com
    description: Production
security: []
paths:
  /parameterized_models/{parameterized_model_id}/export:
    get:
      tags:
        - parameterized_models
      summary: Export Parameterized Model Code
      description: >-
        Export a parameterized model as code, as a zip.


        One route for every export format, so later ones (e.g. Simscape) add a

        ``format`` value rather than a path.


        Current and ambient temperature are inputs to the generated code, and so
        is

        initial SOC when the model can take one.


        Parameters

        ----------

        parameterized_model_id : str
            ID of the parameterized model to export.
        parameterized_models_repository : ParameterizedModelsRepository
            Repository scoped to the caller's Supabase client.
        model_repository : ModelRepository
            Repository scoped to the caller's Supabase client.
        export_format : {"matlab", "simulink"}
            Which code to generate, from the ``format`` query parameter.

        Returns

        -------

        Response
            The zip archive as ``application/zip``, sent as an attachment.
      operationId: >-
        export_parameterized_model_code_parameterized_models__parameterized_model_id__export_get
      parameters:
        - name: parameterized_model_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Parameterized Model Id
        - name: format
          in: query
          required: false
          schema:
            enum:
              - matlab
              - simulink
            type: string
            description: >-
              'matlab' for functions to solve with ode15s; 'simulink' for a
              MATLAB System block (models with an initial-SOC input only).
            default: matlab
            title: Format
          description: >-
            'matlab' for functions to solve with ode15s; 'simulink' for a MATLAB
            System block (models with an initial-SOC input only).
      responses:
        '200':
          description: Successful Response
          content:
            application/zip: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    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

````

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