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

# Create Instrument Drafts

> Generate and store six draft definitions with the offline pack generator.

Deliberately not idempotent: generation can take 30-120s and a retried
request simply drafts a fresh set under a new ``draft-`` prefix.



## OpenAPI

````yaml /openapi.json post /v1/organizations/{organization_id}/apps/{app_id}/instrument-drafts
openapi: 3.1.0
info:
  description: Are we on the same page?
  title: Synapse
  version: 0.1.0
servers: []
security: []
paths:
  /v1/organizations/{organization_id}/apps/{app_id}/instrument-drafts:
    post:
      tags:
        - v1-platform
      summary: Create Instrument Drafts
      description: >-
        Generate and store six draft definitions with the offline pack
        generator.


        Deliberately not idempotent: generation can take 30-120s and a retried

        request simply drafts a fresh set under a new ``draft-`` prefix.
      operationId: >-
        create_instrument_drafts_v1_organizations__organization_id__apps__app_id__instrument_drafts_post
      parameters:
        - in: path
          name: organization_id
          required: true
          schema:
            format: uuid
            title: Organization Id
            type: string
        - in: path
          name: app_id
          required: true
          schema:
            format: uuid
            title: App Id
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/InstrumentDraftRequest'
        required: true
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InstrumentDraftResult'
          description: Successful Response
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorResponse'
          description: Authentication required
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorResponse'
          description: Insufficient scope
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorResponse'
          description: Resource not found
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorResponse'
          description: Request validation failed
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorResponse'
          description: Internal server error
        '502':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorResponse'
          description: Upstream provider error
        '503':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorResponse'
          description: Service or dependency unavailable
      security:
        - BearerAuth: []
        - ApiKeyAuth: []
        - SessionCookie: []
components:
  schemas:
    InstrumentDraftRequest:
      additionalProperties: false
      description: Inputs the wizard collects before asking the LLM to draft questions.
      properties:
        company:
          maxLength: 255
          minLength: 1
          title: Company
          type: string
        industry:
          maxLength: 128
          minLength: 1
          title: Industry
          type: string
        profile:
          default: ''
          maxLength: 20000
          title: Profile
          type: string
      required:
        - company
        - industry
      title: InstrumentDraftRequest
      type: object
    InstrumentDraftResult:
      description: |-
        Clone-shaped result so the wizard can swap endpoints trivially.

        ``template_id`` is always null: drafts are generated, not cloned, and no
        ``platform_templates`` row is ever persisted for them.
      properties:
        definitions:
          items:
            $ref: '#/components/schemas/DefinitionVersion'
          title: Definitions
          type: array
        template_id:
          anyOf:
            - format: uuid
              type: string
            - type: 'null'
          title: Template Id
      required:
        - definitions
      title: InstrumentDraftResult
      type: object
    ApiErrorResponse:
      additionalProperties: false
      properties:
        detail:
          anyOf:
            - $ref: '#/components/schemas/ErrorDetail'
            - type: string
            - items: {}
              type: array
            - additionalProperties: true
              type: object
          title: Detail
      required:
        - detail
      title: ApiErrorResponse
      type: object
    DefinitionVersion:
      properties:
        app_id:
          format: uuid
          title: App Id
          type: string
        business_id:
          title: Business Id
          type: string
        content:
          additionalProperties: true
          title: Content
          type: object
        content_hash:
          title: Content Hash
          type: string
        created_at:
          format: date-time
          title: Created At
          type: string
        created_by_user_id:
          anyOf:
            - format: uuid
              type: string
            - type: 'null'
          title: Created By User Id
        id:
          format: uuid
          title: Id
          type: string
        kind:
          enum:
            - experience
            - scorecard
            - context
            - guardrail
            - adaptive_policy
            - report_template
          title: Kind
          type: string
        locale:
          title: Locale
          type: string
        name:
          title: Name
          type: string
        published_at:
          anyOf:
            - format: date-time
              type: string
            - type: 'null'
          title: Published At
        revision:
          title: Revision
          type: integer
        status:
          enum:
            - draft
            - validated
            - published
            - deprecated
            - archived
          title: Status
          type: string
      required:
        - id
        - app_id
        - kind
        - business_id
        - name
        - revision
        - status
        - locale
        - content
        - content_hash
        - created_at
      title: DefinitionVersion
      type: object
    ErrorDetail:
      additionalProperties: false
      description: Stable structured detail returned by versioned API errors.
      properties:
        code:
          title: Code
          type: string
        context:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Context
        message:
          title: Message
          type: string
        request_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Request Id
      required:
        - code
        - message
      title: ErrorDetail
      type: object
  securitySchemes:
    BearerAuth:
      description: Named syn_ API key or migration-only legacy key.
      scheme: bearer
      type: http
    ApiKeyAuth:
      description: Header alias for a named or legacy API key.
      in: header
      name: X-API-Key
      type: apiKey
    SessionCookie:
      description: Opaque administrator browser session.
      in: cookie
      name: synapse_session
      type: apiKey

````