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

# Materialize a conventional aligned FASTA from an immutable MSA placement



## OpenAPI

````yaml /api-reference/openapi.json post /v1/sequences/msa/materialize
openapi: 3.1.0
info:
  description: >-
    Deterministic biological evidence primitives. Every response is the same
    envelope: ok, data, warnings, provenance.
  title: Rafflesia API
  version: 0.1.0
servers:
  - description: Production
    url: https://api.rafflesia.ai
security:
  - bearerAuth: []
paths:
  /v1/sequences/msa/materialize:
    post:
      tags:
        - MSA
      summary: Materialize a conventional aligned FASTA from an immutable MSA placement
      operationId: sequences.msa.materialize
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MSAMaterializeRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EnvelopeMSAMaterializeData'
          description: OK
          headers:
            Rafflesia-Contract-Digest:
              schema:
                type: string
            Rafflesia-Version:
              schema:
                type: string
            X-Request-ID:
              schema:
                type: string
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EnvelopeMSAMaterializeData'
          description: Bad Request
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EnvelopeMSAMaterializeData'
          description: Unauthorized
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EnvelopeMSAMaterializeData'
          description: Forbidden
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EnvelopeMSAMaterializeData'
          description: Not Found
        '409':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EnvelopeMSAMaterializeData'
          description: Conflict
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EnvelopeMSAMaterializeData'
          description: Unprocessable Entity
        '429':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EnvelopeMSAMaterializeData'
          description: Too Many Requests
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EnvelopeMSAMaterializeData'
          description: Internal Server Error
        '503':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EnvelopeMSAMaterializeData'
          description: Service Unavailable
      x-codeSamples:
        - lang: bash
          source: |
            curl --request POST \
              --url "https://api.rafflesia.ai/v1/sequences/msa/materialize" \
              --header "Authorization: Bearer $RAFFLESIA_API_KEY" \
              --header "Content-Type: application/json" \
              --data '{
                "placement_object_id": "<placement_object_id>"
              }'
components:
  schemas:
    MSAMaterializeRequest:
      additionalProperties: false
      properties:
        $schema:
          description: A URL to the JSON Schema for this object.
          examples:
            - https://example.com/schemas/MSAMaterializeRequest.json
          format: uri
          readOnly: true
          type: string
        placement_object_id:
          description: Placement manifest object returned by sequences.msa.place.
          pattern: ^sha256:[0-9a-f]{64}$
          type: string
      required:
        - placement_object_id
      type: object
    EnvelopeMSAMaterializeData:
      additionalProperties: false
      properties:
        $schema:
          description: A URL to the JSON Schema for this object.
          examples:
            - https://example.com/schemas/EnvelopeMSAMaterializeData.json
          format: uri
          readOnly: true
          type: string
        data:
          $ref: '#/components/schemas/MSAMaterializeData'
          description: Operation result data.
        error:
          $ref: '#/components/schemas/APIError'
          description: Structured error information.
        evidence:
          $ref: '#/components/schemas/EvidenceSummary'
          description: Mechanical evidence summary for agent inspection and chaining.
        ok:
          description: Whether the operation succeeded.
          type: boolean
        provenance:
          $ref: '#/components/schemas/Provenance'
          description: Execution provenance.
        warnings:
          description: Non-fatal warnings.
          items:
            $ref: '#/components/schemas/Warning'
          type:
            - array
            - 'null'
      required:
        - ok
        - warnings
        - provenance
      type: object
    MSAMaterializeData:
      additionalProperties: false
      properties:
        alignment_length:
          format: int64
          minimum: 1
          type: integer
        alignment_object:
          $ref: '#/components/schemas/ObjectRef'
        download_url:
          type: string
        measurements:
          $ref: '#/components/schemas/MSAMaterializationMeasurements'
        object:
          enum:
            - msa_alignment
          type: string
        placement_id:
          pattern: ^msap_[0-9a-f]{64}$
          type: string
        sequence_count:
          format: int64
          minimum: 2
          type: integer
        warnings:
          items:
            $ref: '#/components/schemas/Warning'
          type:
            - array
            - 'null'
      required:
        - object
        - placement_id
        - alignment_object
        - download_url
        - sequence_count
        - alignment_length
        - measurements
        - warnings
      type: object
    APIError:
      additionalProperties: false
      properties:
        code:
          description: Stable specific error code.
          type: string
        details:
          additionalProperties: {}
          description: Additional structured error details.
          type: object
        doc_url:
          description: Stable documentation URL for this error code.
          type: string
        message:
          description: Human-readable error message.
          type: string
        param:
          description: Request field responsible for the error when known.
          type: string
        type:
          description: Stable coarse error category.
          enum:
            - invalid_request_error
            - resource_missing
            - resource_expired
            - conflict_error
            - rate_limit_error
            - authentication_error
            - permission_error
            - billing_error
            - api_error
          type: string
      required:
        - type
        - code
        - message
        - doc_url
      type: object
    EvidenceSummary:
      additionalProperties: false
      properties:
        duration_ms:
          description: >-
            Primary elapsed duration in milliseconds when the response exposes
            one.
          format: int64
          type: integer
        input_refs:
          description: >-
            Input references detected from request fields such as object_id,
            structure_id, target_id, and sequence_id.
          items:
            type: string
          type:
            - array
            - 'null'
        object_refs:
          description: Object ids or object refs visible in the response/provenance.
          items:
            type: string
          type:
            - array
            - 'null'
        output_refs:
          description: Output references detected from response data and generated objects.
          items:
            type: string
          type:
            - array
            - 'null'
        row_count:
          description: >-
            Primary row count or returned row count when the response exposes
            one.
          format: int64
          type: integer
        warnings_count:
          description: Number of non-fatal warnings in the envelope.
          format: int64
          type: integer
      required:
        - warnings_count
      type: object
    Provenance:
      additionalProperties: false
      properties:
        cache_hit:
          description: Whether cached output was reused.
          type: boolean
        created_at:
          description: UTC timestamp.
          type: string
        database_snapshots:
          description: Database snapshots used.
          items:
            $ref: '#/components/schemas/DatabaseSnapshot'
          type:
            - array
            - 'null'
        generated_object_ids:
          description: Object ids created by the operation.
          items:
            type: string
          type:
            - array
            - 'null'
        input_hash:
          description: SHA-256 hash of canonical request input.
          type: string
        operation:
          description: Primitive operation id.
          type: string
        parameters_hash:
          description: SHA-256 hash of parameters.
          type: string
        request_id:
          description: Unique request identifier.
          type: string
        server_version:
          description: Server version.
          type: string
        tool_versions:
          description: Tool versions used.
          items:
            $ref: '#/components/schemas/ToolVersion'
          type:
            - array
            - 'null'
      required:
        - request_id
        - operation
        - created_at
        - server_version
      type: object
    Warning:
      additionalProperties: false
      properties:
        code:
          description: Stable warning code.
          type: string
        details:
          additionalProperties: {}
          description: Additional structured warning details.
          type: object
        message:
          description: Human-readable warning message.
          type: string
      required:
        - code
        - message
      type: object
    ObjectRef:
      additionalProperties: false
      properties:
        bucket:
          type: string
        content_type:
          type: string
        kind:
          type: string
        object_id:
          type: string
        object_key:
          type: string
        path:
          type: string
        sha256:
          type: string
        size_bytes:
          format: int64
          type: integer
        storage_backend:
          type: string
        uri:
          type: string
      required:
        - object_id
        - kind
        - size_bytes
        - sha256
      type: object
    MSAMaterializationMeasurements:
      additionalProperties: false
      properties:
        backbone_reads:
          $ref: '#/components/schemas/MSAObjectReadMeasurements'
        backbone_rows_read:
          format: int64
          type: integer
        backbone_stream_bytes:
          format: int64
          type: integer
        backbone_stream_chunks:
          format: int64
          type: integer
        elapsed_ms:
          format: int64
          type: integer
        is_backbone_invariant:
          type: boolean
        is_backbone_sha256_valid:
          type: boolean
        is_cache_hit:
          type: boolean
        is_query_residue_preserved:
          type: boolean
        is_streaming:
          type: boolean
        materialized_rows:
          format: int64
          type: integer
        maximum_input_row_bytes:
          format: int64
          type: integer
        maximum_output_row_bytes:
          format: int64
          type: integer
      required:
        - is_cache_hit
        - is_streaming
        - is_backbone_sha256_valid
        - is_backbone_invariant
        - is_query_residue_preserved
        - backbone_rows_read
        - materialized_rows
        - maximum_input_row_bytes
        - maximum_output_row_bytes
        - backbone_stream_bytes
        - backbone_stream_chunks
        - backbone_reads
        - elapsed_ms
      type: object
    DatabaseSnapshot:
      additionalProperties: false
      properties:
        digest:
          type: string
        kind:
          type: string
        name:
          type: string
        version:
          type: string
      required:
        - name
        - version
      type: object
    ToolVersion:
      additionalProperties: false
      properties:
        name:
          type: string
        path:
          type: string
        version:
          type: string
      required:
        - name
        - version
      type: object
    MSAObjectReadMeasurements:
      additionalProperties: false
      properties:
        directory_page_bytes:
          format: int64
          type: integer
        directory_page_reads:
          format: int64
          type: integer
        object_bytes:
          format: int64
          type: integer
        object_reads:
          format: int64
          type: integer
        peak_resident_directory_pages:
          format: int64
          type: integer
        range_bytes:
          format: int64
          type: integer
        range_reads:
          format: int64
          type: integer
        record_bytes:
          format: int64
          type: integer
        record_reads:
          format: int64
          type: integer
        remote_requests:
          format: int64
          type: integer
        retry_count:
          format: int64
          type: integer
      required:
        - object_reads
        - object_bytes
        - range_reads
        - range_bytes
        - record_reads
        - record_bytes
        - directory_page_reads
        - directory_page_bytes
        - peak_resident_directory_pages
        - remote_requests
        - retry_count
      type: object
  securitySchemes:
    bearerAuth:
      description: 'A Rafflesia API key, sent as `Authorization: Bearer <key>`.'
      scheme: bearer
      type: http

````