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

# Extend a pattern

> Starts a job that extends a repeating pattern to a larger size.



## OpenAPI

````yaml /openapi.json post /patterns/refine/extendPattern
openapi: 3.1.1
info:
  title: Arcade API
  version: '1'
  description: >-
    Generate patterns and order them as manufactured products. Every request is
    a POST with a JSON body.
servers:
  - url: https://platform.arcade.ai/v1
    description: Production
  - url: https://staging-platform.arcade.ai/v1
    description: Staging
security:
  - apiKey: []
tags:
  - name: Patterns
    description: Patterns you generate.
  - name: Refine
    description: Edit, recolor, crop and extend patterns.
  - name: Jobs
    description: Long-running work.
  - name: References
    description: Images that guide generation.
  - name: Models
    description: The models that generate patterns.
  - name: Categories
    description: Product types and their options.
  - name: Products
    description: Products made from your patterns.
  - name: Checkouts
    description: Checkouts for ordering products.
  - name: Orders
    description: Your orders.
paths:
  /patterns/refine/extendPattern:
    post:
      tags:
        - Refine
      summary: Extend a pattern
      description: Starts a job that extends a repeating pattern to a larger size.
      operationId: patterns.refine.extendPattern
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                targetHeight:
                  type: integer
                  minimum: 16
                  maximum: 1536
                targetWidth:
                  type: integer
                  minimum: 16
                  maximum: 1536
                requestId:
                  type: string
                  minLength: 1
                  maxLength: 128
                  description: >-
                    Caller-chosen idempotency key; a replay returns the original
                    result
                patternId:
                  type: string
                  minLength: 1
                  description: The pattern to refine
              required:
                - targetHeight
                - targetWidth
                - requestId
                - patternId
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  jobId:
                    type: string
                    minLength: 1
                    description: Opaque job ID; read the job with jobs.get
                  kind:
                    enum:
                      - pattern
                      - product
                      - download
                    type: string
                    description: >-
                      What the job makes: a pattern (patterns.create or a
                      refine), a product (products.create) or a download (an
                      upscale started in Arcade Studio)
                  status:
                    enum:
                      - running
                      - succeeded
                      - failed
                    type: string
                    description: Jobs are created running; there is no queued state
                  result:
                    anyOf:
                      - anyOf:
                          - type: object
                            properties:
                              patternId:
                                type: string
                                minLength: 1
                                description: >-
                                  Opaque ID of one pattern: an immutable image.
                                  A refine makes a new pattern.
                            required:
                              - patternId
                          - type: object
                            properties:
                              productId:
                                type: string
                                minLength: 1
                                description: Opaque product ID
                            required:
                              - productId
                          - type: object
                            properties:
                              downloadUrl:
                                type: string
                                format: uri
                                description: Short-lived; read the job again to renew
                              expiresAt:
                                type: string
                                format: date-time
                                description: The URL works at least until this time
                            required:
                              - downloadUrl
                              - expiresAt
                      - type: 'null'
                    description: >-
                      What a succeeded job made. Null while running, when it
                      failed, when a deformity fix found nothing to repair, and
                      once the pattern it made is deleted.
                  error:
                    anyOf:
                      - type: object
                        properties:
                          message:
                            type: string
                        required:
                          - message
                      - type: 'null'
                    description: Why the job failed; set once it failed
                  createdAt:
                    type: string
                    format: date-time
                    description: >-
                      When the job started; for a product with no recorded build
                      (made by Create, or built before builds were kept), when
                      the product was created
                  completedAt:
                    anyOf:
                      - type: string
                        format: date-time
                      - type: 'null'
                    description: >-
                      When the job finished; null while running and for a failed
                      product job, which does not record it
                required:
                  - jobId
                  - kind
                  - status
                  - result
                  - error
                  - createdAt
                  - completedAt
components:
  securitySchemes:
    apiKey:
      type: http
      scheme: bearer
      description: An API key from Settings → API keys in Arcade Studio.

````