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

# Convert Protocol Endpoint

> Convert a UCP to a vendor-native protocol file.

The primary artifact is returned as base64-encoded bytes alongside a
suggested filename and media type. Some targets (currently Maccor with
drive cycles) emit additional asset files in ``assets``.



## OpenAPI

````yaml https://api.ionworks.com/openapi.json post /protocols/convert
openapi: 3.1.0
info:
  title: FastAPI
  version: 0.1.0
servers:
  - url: https://api.ionworks.com
    description: Production
security: []
paths:
  /protocols/convert:
    post:
      tags:
        - protocols
      summary: Convert Protocol Endpoint
      description: |-
        Convert a UCP to a vendor-native protocol file.

        The primary artifact is returned as base64-encoded bytes alongside a
        suggested filename and media type. Some targets (currently Maccor with
        drive cycles) emit additional asset files in ``assets``.
      operationId: convert_protocol_endpoint_protocols_convert_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ConvertProtocolRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ConvertProtocolResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    ConvertProtocolRequest:
      properties:
        protocol:
          anyOf:
            - additionalProperties: true
              type: object
            - type: string
          title: Protocol
          description: UCP as a dict or YAML string.
        target:
          type: string
          enum:
            - maccor
            - arbin
            - neware
            - biologic_bttest
            - novonix
          title: Target
          description: >-
            Vendor target: 'maccor', 'arbin', 'neware', 'biologic_bttest', or
            'novonix'.
        drive_cycles:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Drive Cycles
          description: >-
            Optional mapping of drive cycle name → samples. Required when the
            protocol references DriveCycle steps.
        filename_stem:
          type: string
          title: Filename Stem
          description: Stem for the returned primary filename (no extension).
          default: protocol
      type: object
      required:
        - protocol
        - target
      title: ConvertProtocolRequest
      description: Request body for converting a UCP to a vendor-native protocol file.
    ConvertProtocolResponse:
      properties:
        target:
          type: string
          title: Target
        primary:
          $ref: '#/components/schemas/ConvertedFile'
        assets:
          items:
            $ref: '#/components/schemas/ConvertedFile'
          type: array
          title: Assets
      type: object
      required:
        - target
        - primary
      title: ConvertProtocolResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ConvertedFile:
      properties:
        filename:
          type: string
          title: Filename
        content_base64:
          type: string
          title: Content Base64
        media_type:
          type: string
          title: Media Type
      type: object
      required:
        - filename
        - content_base64
        - media_type
      title: ConvertedFile
    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

````