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

# Assign a simulation to a study

> Assign a simulation to a study.

Idempotent: returns the existing mapping (200) if already assigned.



## OpenAPI

````yaml https://api.ionworks.com/openapi.json post /projects/{project_id}/studies/{study_id}/simulations/{simulation_id}
openapi: 3.1.0
info:
  title: FastAPI
  version: 0.1.0
servers:
  - url: https://api.ionworks.com
    description: Production
security: []
paths:
  /projects/{project_id}/studies/{study_id}/simulations/{simulation_id}:
    post:
      tags:
        - studies
      summary: Assign a simulation to a study
      description: |-
        Assign a simulation to a study.

        Idempotent: returns the existing mapping (200) if already assigned.
      operationId: >-
        assign_simulation_to_study_projects__project_id__studies__study_id__simulations__simulation_id__post
      parameters:
        - name: project_id
          in: path
          required: true
          schema:
            type: string
            title: Project Id
        - name: study_id
          in: path
          required: true
          schema:
            type: string
            title: Study Id
        - name: simulation_id
          in: path
          required: true
          schema:
            type: string
            title: Simulation Id
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StudySimulationMapping'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    StudySimulationMapping:
      properties:
        study_id:
          type: string
          title: Study Id
          description: ID of the study
        simulation_id:
          type: string
          title: Simulation Id
          description: ID of the simulation
        organization_id:
          type: string
          title: Organization Id
          description: Organization this mapping belongs to.
        created_at:
          type: string
          format: date-time
          title: Created At
          description: Timestamp of when the mapping was created
      type: object
      required:
        - study_id
        - simulation_id
        - organization_id
        - created_at
      title: StudySimulationMapping
    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

````