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

# Create Extract Template Generation



## OpenAPI

````yaml /api-reference/openapi.json post /v2/extract/templates/generations
openapi: 3.1.0
info:
  title: Nimble SDK
  version: 1.0.0
  description: The AI-Native SDK for Real-Time Web Data at scale
servers:
  - url: https://sdk.nimbleway.com
security: []
paths:
  /v2/extract/templates/generations:
    post:
      tags:
        - Extract Templates API
      summary: Create Extract Template Generation
      operationId: generateExtractTemplate
      requestBody:
        content:
          application/json:
            schema:
              anyOf:
                - $ref: >-
                    #/components/schemas/CreateExtractTemplateGenerationRequestPublicV2
                - $ref: >-
                    #/components/schemas/CreateExtractTemplateRefinementRequestPublicV2
              title: Request
        required: true
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExtractTemplateGenerationResponsePublicV2'
          description: Successful Response
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: Validation Error
      security:
        - BearerAuth: []
components:
  schemas:
    CreateExtractTemplateGenerationRequestPublicV2:
      additionalProperties: false
      properties:
        input_schema:
          additionalProperties: true
          description: Optional JSON schema describing expected input parameters.
          title: Input Schema
          type: object
        metadata:
          anyOf:
            - $ref: '#/components/schemas/CreateExtractTemplateMetadataPublicV2'
            - type: 'null'
          description: Metadata to attach to the generated extract template.
        name:
          anyOf:
            - maxLength: 255
              minLength: 1
              pattern: ^[a-z0-9_]+$
              type: string
            - type: 'null'
          description: Optional stable name for the generated extract template.
          title: Name
        output_schema:
          additionalProperties: true
          description: Optional JSON schema describing desired extracted output.
          title: Output Schema
          type: object
        prompt:
          description: Instructions for generating the extract template.
          title: Prompt
          type: string
        url:
          description: Example URL used to generate the extract template.
          title: Url
          type: string
      required:
        - prompt
        - url
      title: CreateExtractTemplateGenerationRequestPublicV2
      type: object
    CreateExtractTemplateRefinementRequestPublicV2:
      additionalProperties: false
      properties:
        from_extract_template:
          description: Name of the source extract template to refine.
          title: From Extract Template
          type: string
        prompt:
          description: Instructions for refining the extract template.
          title: Prompt
          type: string
      required:
        - prompt
        - from_extract_template
      title: CreateExtractTemplateRefinementRequestPublicV2
      type: object
    ExtractTemplateGenerationResponsePublicV2:
      properties:
        completed_at:
          anyOf:
            - format: date-time
              type: string
            - type: 'null'
          description: When the generation completed.
          title: Completed At
        created_at:
          anyOf:
            - format: date-time
              type: string
            - type: 'null'
          description: When the generation was created.
          title: Created At
        error:
          anyOf:
            - type: string
            - type: 'null'
          description: Error message when generation failed.
          title: Error
        generated_version:
          anyOf:
            - $ref: '#/components/schemas/ExtractTemplateVersionResponsePublicV2'
            - type: 'null'
          description: Generated version details, when available.
        generated_version_id:
          anyOf:
            - format: uuid
              type: string
            - type: 'null'
          description: Identifier of the generated version.
          title: Generated Version Id
        id:
          description: Unique extract template generation identifier.
          format: uuid
          title: Id
          type: string
        name:
          anyOf:
            - type: string
            - type: 'null'
          description: Extract template name associated with the generation.
          title: Name
        source_version_id:
          anyOf:
            - format: uuid
              type: string
            - type: 'null'
          description: Identifier of the version being refined.
          title: Source Version Id
        started_at:
          anyOf:
            - format: date-time
              type: string
            - type: 'null'
          description: When the generation started executing.
          title: Started At
        status:
          description: Current generation status.
          title: Status
          type: string
        summary:
          anyOf:
            - type: string
            - type: 'null'
          description: Summary of the generation result.
          title: Summary
      required:
        - id
        - status
      title: ExtractTemplateGenerationResponsePublicV2
      type: object
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          title: Detail
          type: array
      title: HTTPValidationError
      type: object
    CreateExtractTemplateMetadataPublicV2:
      properties:
        description:
          anyOf:
            - type: string
            - type: 'null'
          description: Description for the generated template.
          title: Description
        display_name:
          anyOf:
            - type: string
            - type: 'null'
          description: Human-friendly display name for the generated template.
          title: Display Name
        tags:
          description: Tags to associate with the generated template.
          items:
            type: string
          title: Tags
          type: array
      title: CreateExtractTemplateMetadataPublicV2
      type: object
    ExtractTemplateVersionResponsePublicV2:
      properties:
        created_at:
          description: When the version was created.
          format: date-time
          title: Created At
          type: string
        id:
          description: Unique extract template version identifier.
          format: uuid
          title: Id
          type: string
        input_schema:
          additionalProperties: true
          description: JSON schema describing accepted input parameters.
          title: Input Schema
          type: object
        metadata:
          $ref: '#/components/schemas/ExtractTemplateVersionMetadataPublicV2'
          description: Metadata associated with this version.
        name:
          description: Extract template name this version belongs to.
          title: Name
          type: string
        output_schema:
          additionalProperties: true
          description: JSON schema describing extracted output.
          title: Output Schema
          type: object
        samples:
          anyOf:
            - items:
                $ref: '#/components/schemas/ExtractTemplateSamplePublicV2'
              type: array
            - type: 'null'
          description: Sample input and output pairs for the version.
          title: Samples
        version_number:
          description: Monotonic version number for the extract template.
          title: Version Number
          type: integer
      required:
        - id
        - name
        - version_number
        - metadata
        - input_schema
        - output_schema
        - created_at
      title: ExtractTemplateVersionResponsePublicV2
      type: object
    ValidationError:
      properties:
        ctx:
          title: Context
          type: object
        input:
          title: Input
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          title: Location
          type: array
        msg:
          title: Message
          type: string
        type:
          title: Error Type
          type: string
      required:
        - loc
        - msg
        - type
      title: ValidationError
      type: object
    ExtractTemplateVersionMetadataPublicV2:
      properties:
        data_source:
          anyOf:
            - type: string
            - type: 'null'
          description: Data source associated with the version.
          title: Data Source
        description:
          anyOf:
            - type: string
            - type: 'null'
          description: Version description shown to users.
          title: Description
        display_name:
          anyOf:
            - type: string
            - type: 'null'
          description: Human-friendly version display name.
          title: Display Name
        domain:
          anyOf:
            - type: string
            - type: 'null'
          description: Domain associated with the version.
          title: Domain
        entity_type:
          anyOf:
            - type: string
            - type: 'null'
          description: Entity type produced by the version.
          title: Entity Type
        tags:
          description: Tags associated with the version.
          items:
            type: string
          title: Tags
          type: array
        vertical:
          anyOf:
            - type: string
            - type: 'null'
          description: Business vertical associated with the version.
          title: Vertical
      title: ExtractTemplateVersionMetadataPublicV2
      type: object
    ExtractTemplateSamplePublicV2:
      properties:
        input:
          anyOf:
            - $ref: '#/components/schemas/JsonValue'
            - type: 'null'
          description: Sample input parameters for the version.
        output:
          anyOf:
            - $ref: '#/components/schemas/JsonValue'
            - type: 'null'
          description: Sample output produced by the version.
      title: ExtractTemplateSamplePublicV2
      type: object
    JsonValue: {}
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer

````