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

# Submit a metadata event

> This endpoint accepts a single JSON-formatted metadata event related to a specific board ID. The event is stored as a new line in an NDJSON file in cloud object storage.



## OpenAPI

````yaml api/openapi.json POST /api/v1/boards/{boardId}/metadata
openapi: 3.0.4
info:
  title: DeepPCB Public API
  description: >+
    # 🚀 Getting Started with DeepPCB API


    Welcome! This quick tutorial walks you through a complete board routing
    workflow in 5 simple steps. Perfect for first-time users!


    ## Prerequisites


    - **API Key** from your DeepPCB account

    - **A board file** in DeepPCB, DSN, KiCad, Altium, Zuken, or EasyEDA format


    ---


    ## Step-by-Step Workflow


    ### Step 1: Upload Your Board File


    First, upload your board file to get a temporary URL:


    ```bash

    curl -X POST "https://api.deeppcb.com/api/v1/files/uploads/board-file" \
      -H "accept: text/plain" \
      -H "x-deeppcb-api-key: YOUR_API_KEY" \
      -H "Content-Type: multipart/form-data" \
      -F inputFile="@/path/to/your/board.json"
    ```


    **Response:**

    ```

    "https://storage.googleapis.com/.../your-file.deeppcb?..."

    ```

    (Returns the full storage URL as a quoted string)


    **💡 Tip:** This URL is valid for 24 hours.


    ---


    ### Step 2: Submit the Board


    Create a board using the file URL:


    ```bash

    curl -X POST "https://api.deeppcb.com/api/v1/boards" \
      -H "accept: text/plain" \
      -H "x-deeppcb-api-key: YOUR_API_KEY" \
      -H "Content-Type: multipart/form-data" \
      -F "requestId=my-first-board" \
      -F "boardName=my-board" \
      -F "routingType=EmptyBoard" \
      -F "jsonFileUrl=https://storage.googleapis.com/.../your-file.deeppcb?..." \
      -F "webhookUrl=https://your-app.com/webhook" \
      -F "webhookToken=webhookToken"
    ```

    Or, create a board using uploaded file:

    ```bash

    curl -X POST "https://api.deeppcb.com/api/v1/boards" \
      -H "accept: text/plain" \
      -H "x-deeppcb-api-key: YOUR_API_KEY" \
      -H "Content-Type: multipart/form-data" \
      -F "requestId=my-first-board" \
      -F "boardName=my-board" \
      -F "routingType=EmptyBoard" \
      -F jsonFile=="@/path/to/your/board.json" \
      -F "webhookUrl=https://your-app.com/webhook" \
      -F "webhookToken=webhookToken"
    ```


    **Optional:** To skip automatic constraint extraction and board conversion,
    add `smartConstraints=false`:

    ```bash
      -F "smartConstraints=false"
    ```

    When `smartConstraints` is `false`, the raw board file is passed directly to
    validation without conversion or constraint processing. Smart constraints
    are subject to account availability. When omitted, constraints are extracted
    if available for your account and skipped otherwise (no extraction, and
    convert also skips the schematic conversion). When `true` and unavailable
    for your account, the request answers **403** with `errorCode:
    Board.Errors.SmartConstraintsUnavailable` and no board is created.


    **⚠️ Important:** You must provide **either** `jsonFile` **or**
    `jsonFileUrl`, but **not both**. Providing both or neither will result in a
    validation error.


    **Response Example Board Id:**

    ```

    "550e8400-e29b-41d4-a716-446655440000"

    ```

    (Returns the board ID as a quoted GUID string)


    **Note:** 

    - `routingType`: `EmptyBoard`, `KeepExisting`, or `StartFromCurrent`


    **💡 Tip:** Save the `boardId` - you'll need it for the next steps!


    **🔧 Smart Constraints:** By default, constraints are automatically
    extracted and merged into your board, subject to account availability (when
    unavailable, an omitted `smartConstraints` skips extraction and
    `smartConstraints=true` answers 403). Set `smartConstraints=false` to skip
    this step — useful when your board already contains embedded constraints or
    when you want faster processing without AI extraction.


    ---


    ### Step 3: Confirm and Start Processing


    Using the retrieved BoardId, start the routing process with timeout and
    batch configuration:


    ```bash

    curl -X PATCH
    "https://api.deeppcb.com/api/v1/boards/550e8400-e29b-41d4-a716-446655440000/confirm"
    \
      -H "accept: */*" \
      -H "x-deeppcb-api-key: YOUR_API_KEY" \
      -H "Content-Type: application/json" \
      -d '{
        "jobType": "Routing",
        "timeout": 10,
        "maxBatchTimeout": 60,
        "timeToLive": 300,
        "responseBoardFormat": 1
      }'
    ```


    **Response:**

    ```

    200 OK

    ```


    **Note:**

    - `jobType`: `Routing` or `Placement`


    **Parameters:**

    - `jobType`: Job type of the run (e.g., Routing or Placement)

    - `timeout`: Maximum processing time in **minutes** (e.g., 10 = 10 minutes)

    - `maxBatchTimeout`: Time in **seconds** before sending current solutions
    (e.g., 60 = send batch every 60s)

    - `timeToLive`: Request expiration time in **seconds** (e.g., 300 = 5
    minutes to start)

    - `responseBoardFormat`: Output format for the board revisions. Possible
    values:
      - `1` — JSON full board
      - `2` — JSON wiring only
      - `3` — Specctra design file format (DSN)
      - `4` — Specctra Session file format (SES)
      - `5` — KiCad PCB file format (.kicad_pcb)
      - `6` — Zuken design file format (.dsgf or .pcf)
      - `7` — Altium Session file format (.rte)
      - `8` — Altium PCB file format (.PCBdoc)

    **💡 What's happening now:**

    - The AI agent starts routing your board

    - You'll receive webhook notifications with new revisions every ~60 seconds

    - Processing will run for up to 10 minutes (or until you stop it)


    ---


    ### Step 4: Monitor Progress (via Webhooks)


    Your webhook will receive updates like this:


    ```json

    {
      "eventType": "BoardRevisionsBatchGenerated",
      "eventId": "1ae73d1e-a870-4ca1-b386-a35fb7238e28",
      "boardId": "550e8400-e29b-41d4-a716-446655440000",
      "requestId": "my-first-board",
      "payload": {
        "Type": "BoardRevisionGeneratedPayload",
        "runningNumberOfRevisions": 1,
        "batchNumber": 1,
        "revisions": [
          {
            "fileUrl": "https://storage.googleapis.com/.../your-file.deeppcb?...",
            "stats": {
              "numConnections": 131,
              "numConnectionsMissing": 79,
              "numNetsCompleted": 12,
              "numNets": 43,
              "differentialPairNumConnections": 0,
              "differentialPairNumConnectionsCompleted": 0,
              "differentialPairNumConnectionsMissing": 0,
              "differentialPairNumNets": 0,
              "differentialPairNumNetsCompleted": 0,
              "numPlaneParts": 4,
              "numPlanes": 4,
              "numPlaneConnections": 53,
              "numPlaneCuts": 0,
              "planeAreasTotal": 5258512529349466,
              "numVias": 0,
              "numViasToPlanes": 0,
              "numViasAtSmd": 0,
              "differentialPairNumVias": 0,
              "numChangeLayerVias": 0,
              "totalWireLength": 0,
              "differentialPairWireLength": 0
            },
            "generatedOn": "2025-11-13T14:36:45.917796+00:00",
            "creditsBurned": 0.088745925,
            "committed": true
          }
        ],
        "generatedOn": "2025-11-13T14:36:45.91786+00:00"
      }
    }

    ```


    **💡 Tip:** Watch for the `BoardConverged` event, it means the AI
    potentially found a satisfactory solution, but it will keep searching for a
    better, more optimal one


    You'll also receive periodic `HeartBeat` events to confirm the system is
    still actively processing:


    ```json

    {
      "eventType": "BoardHeartBeat",
      "eventId": "2bf84d2f-c123-4abc-9def-567890abcdef",
      "boardId": "550e8400-e29b-41d4-a716-446655440000",
      "requestId": "my-first-board",
      "payload": {
        "Type": "BoardHeartBeatPayload",
        "createdOn": "2025-11-13T14:37:00.000000+00:00"
      }
    }

    ```


    ---


    ### Step 5: Stop Processing Early (Optional)


    If you're satisfied with the results before the timeout, stop processing to
    save credits:


    ```bash

    curl -X PATCH
    "https://api.deeppcb.com/api/v1/boards/550e8400-e29b-41d4-a716-446655440000/stop"
    \
      -H "accept: */*" \
      -H "x-deeppcb-api-key: YOUR_API_KEY"
    ```


    **Response:**

    ```

    202 Accepted

    Location:
    https://api.deeppcb.com/api/v1/boards/550e8400-e29b-41d4-a716-446655440000

    ```


    The stop is *accepted* and completed asynchronously — poll the board (or the
    `Location`) for the final state.


    **💡 Great news:** Credits for unused time will be refunded via webhook
    notification!


    ---


    ### Bonus: Download Your Routed Board


    Get the best revision in your preferred format:


    ```bash

    # Download as JSON

    curl
    "https://api.deeppcb.com/api/v1/boards/550e8400-e29b-41d4-a716-446655440000/download-artifact?type=JsonFile"
    \
      -H "accept: */*" \
      -H "x-deeppcb-api-key: YOUR_API_KEY" \
      -o routed-board.json
    ```

    ---


    ## What's Next?


    Now that you've completed your first routing job, explore these advanced
    features:


    - **📖 Full API Reference** - See the [Public API Functional
    Guide](PublicApiFunctionalGuide.md)

    - **🎯 Placement Optimization** - Use `jobType: "Placement"` with
    constraints

    - **🔄 Incremental Optimization** - Resume completed boards for further
    refinement

    - **🔧 Format Conversion** - Convert between DSN, KiCad, Altium, and JSON


    ---

    ---


    # DeepPCB API Functional Guide


    ## Overview


    This guide explains how the DeepPCB API works, focusing on the behavior and
    business logic of each endpoint.


    **Base URL:** `https://api.deeppcb.com/api/v1`


    ---


    ## Authentication


    Every API request must include your API key in the header:


    ```

    x-deeppcb-api-key: YOUR_API_KEY

    ```


    Generate your API key from your DeepPCB account settings. Store it securely,
    it won't be displayed again after creation.


    ---


    ## Core Workflow & State Management


    ### Board Lifecycle States


    Your board progresses through these states:


    1. **Pending** → Board created, waiting for confirmation to start

    2. **Running** → Active processing (routing/placement)

    3. **Stopped** → Processing halted, can be resumed

    4. **Completed** → Processing finished (can still be resumed for further
    optimization)

    5. **Failed** → Processing encountered an error


    ---


    ## 1. Pre-Validation Endpoints


    ### 1.1 Check Board Compatibility


    **Endpoint:** `POST /api/v1/boards/check-board`


    **Purpose:** Validate your board file format and design rules before
    submitting a job.


    **How It Works:**


    - **No Credits Consumed:** This is a free validation check, your credits are
    only charged when you start actual processing.


    - **File Input Flexibility:** 
      - Option A: Upload a JSON file directly (`jsonFile`)
      - Option B: Provide a URL to your JSON file (`jsonFileUrl`)
      - **⚠️ Important:** You must provide **exactly one** input method - either `jsonFile` or `jsonFileUrl`, but **not both** and **not neither**. Providing both or omitting both will result in a validation error.

    - **Format Validation:** The system checks:
      - DeepPCB schema
      - Design Rule Constraints (DRC)
      - Component definitions
      - Net connectivity
      - Layer configuration

    - **Asynchronous Results:** 
      - If you provide a `webhookUrl`, results are sent there
      - Otherwise, results are returned in the HTTP response immediately

    **When to Use:**

    - Before submitting routing/placement jobs

    - To verify board compatibility after format changes


    ---


    ### 1.2 Validate Constraints


    **Endpoint:** `POST /api/v1/boards/check-constraints`


    **Purpose:** Verify your constraint specifications are valid.


    **How It Works:**


    - **Constraint Format Check:** Validates the JSON structure of your
    constraints file against the DeepPCB schema


    - **File Input Flexibility:**
      - Option A: Upload constraints file directly (`constraintsJsonFile`).
      - Option B: Provide a URL to the constraints file (`constraintsFileUrl`).
      - **⚠️ Important:** You must provide **exactly one** input method - either `constraintsJsonFile` or `constraintsFileUrl`, but **not both** and **not neither**. Providing both or omitting both will result in a validation error.

    - **No Board Required:** This validates constraints independently, you don't
    need to submit a board first


    - **Schema Compliance:** Checks for:
      - Valid constraint types.
      - Correct component references.
      - Proper coordinate systems.
      - Rule conflicts.

    **When to Use:**

    - Before starting a placement job

    - When creating custom constraint

    - To debug constraint-related errors


    ---


    ### 1.3 Convert Board to DeepPCB format


    **Endpoint:** `POST /api/v1/boards/convert-to-json`


    **Purpose:** Convert board files from other formats to DeepPCB format,
    producing the same JSON board that board creation (`POST /api/v1/boards`)
    produces for the same input — without creating a board.


    **How It Works:**


    - **Multi-Format Support:** Accepts:
      - Specctra DSN files (.dsn)
      - Zuken files (.dsgf or .pcf, .ftf, .rulf)
      - KiCad files (.kicad_pcb, .kicad_pro, .kicad_sch)
      - Altium files (.pcbdoc)
      - EasyEDA files (.json)
      - DeepPCB files (.deeppcb)

    - **Optional Schematic Files:** Alongside the board file you may attach the
    matching schematic, which is converted and fed to the constraints extraction
    so it is reflected in the returned board:
      - `kicadSchematicsFiles` (.kicad_sch, one or more) for KiCad boards
      - `easyEdaStdSchematicFile` (.json) for EasyEDA Std boards

      **Behaviour change:** an attached schematic the converter cannot read now fails the request. Previously the schematic was only handed to the board check, which ignored an unreadable one, so the same call succeeded. Send `smartConstraints=false` to skip the schematic conversion entirely.

    - **Smart Constraints:** With `smartConstraints` omitted or true, placement
    constraints are extracted from the board and schematics and merged into the
    returned board. Set it to `false` for a raw format conversion with no
    extraction. Smart constraints are subject to account availability: when they
    are unavailable for your account, an omitted `smartConstraints` behaves as
    `smartConstraints=false` (no extraction, and convert also skips the
    schematic conversion), and `smartConstraints=true` answers **403** with
    `errorCode: Board.Errors.SmartConstraintsUnavailable`. If the constraints
    extraction fails, the unmerged board is returned rather than an error (this
    does not cover a schematic that cannot be converted — see above)


    - **No Board Created:** No board is created and nothing is stored against
    your account. With `smartConstraints` on, a temporary copy of the board and
    schematics JSON is written to object storage so the extraction service can
    read them; it is written under `Boards/temp/` and is not linked to any board


    - **Format Detection:** The input format is inferred automatically from
    which file field you populate, not from the file extension. The
    `boardInputType` field has been removed from the request; a request that
    still sends it is accepted and the value ignored. Exactly one input type
    must be provided — sending none, or files belonging to two different
    formats, is rejected with `400`. Companion files (KiCad project/schematics,
    Zuken footprint/rules, EasyEDA-Std schematic) count towards their parent
    format and are not treated as a second input


    - **Context Parameters:**
      - `routingType` controls whether existing wiring is loaded and protected during conversion
      - `jobType` selects which board is returned: `Routing` returns the board sanitized for routing, `Placement` the board sanitized for placement, and omitting it (or `Idle`) returns the loaded board. A board carrying errors for the requested job is rejected rather than returned

    ---


    ## 2. Board Submission & Configuration


    ### 2.1 Create/Submit Board


    **Endpoint:** `POST /api/v1/boards`


    **Purpose:** Upload and register a board in the system.


    **How It Works:**


    #### Board Creation Workflow


    1. **File Upload Options:**
       - **Direct Upload:** Attach file(s) in the request (e.g., `jsonFile`)
       - **URL Reference:** Provide `jsonFileUrl` pointing to an externally hosted file
       - **⚠️ Important:** For JSON files, provide **either** `jsonFile` **or** `jsonFileUrl`, but **not both**
       - **Multi-Format Support:** Submit DSN, Zuken, KiCad, Altium, EasyEDA, or DeepPCB format (JSON)
       - **Format Detection:** The format is inferred from which file field you populate, not from the file extension — this is what keeps DeepPCB JSON and EasyEDA, which share the `.json` extension, unambiguous. The `boardInputType` field has been removed from the request; a request that still sends it is accepted and the value ignored
       - **Exactly One Input Type:** Provide files for one format only. Sending no board input at all, or files belonging to two different formats, is rejected with `400`. Companion files (KiCad project/schematics, Zuken footprint/rules, EasyEDA-Std schematic) count towards their parent format and are not treated as a second input
       - **Optional Schematic Files:** Attach the matching schematic alongside the board file to improve net type classification (see `smartConstraints` below): `kicadSchematicsFiles` (.kicad_sch, one or more) for KiCad boards, `easyEdaStdSchematicFile` (.json) for EasyEDA Std boards

    2. **Request ID Tracking:**
       - Provide your own `requestId` to track this board in your system
       - If omitted, we generate a unique ID
       - Use this ID later to retrieve the board: `GET /api/v1/boards/requests/{requestId}`

    3. **Routing Type (for Routing jobs only):**
        - **EmptyBoard:** Start fresh, delete existing wiring
        - **CurrentProtectedWiring:** Protect existing wiring
        - **CurrentUnprotectedWiring:** Keep existing wiring but do not protect them
        - Must be specified at creation

    4. **Configuration Inheritance:**
       - ✨ **Key Feature:** Settings specified during creation are inherited by `confirm` and `resume` operations
       - If you set `routingType: "EmptyBoard"` during creation, it's automatically used in `confirm`
       - This allows two patterns:
         - **Pattern A:** Create with minimal settings, configure fully when calling `confirm`

    5. **Webhook Configuration:**
       - Set `webhookUrl` to receive real-time updates. It must be a public `http` or `https` address: `localhost`,
         private network addresses and `.local` or `.internal` hosts are rejected with `400`.
       - Provide `webhookToken` for webhook authentication.
       - Webhooks receive: creation status, processing updates, revision batches, credit changes.

    6. **Automatic Constraint Extraction (`smartConstraints`):**
       - **Default behavior (`smartConstraints` omitted or `true`):** Constraints are automatically extracted from the board and merged into the board JSON
       - **Availability:** Smart constraints are subject to account availability. When they are unavailable for your account, an omitted `smartConstraints` behaves as `smartConstraints=false` (no extraction), and `smartConstraints=true` answers **403** with `errorCode: Board.Errors.SmartConstraintsUnavailable` and creates no board, so you can retry the same `requestId` with `smartConstraints=false`.
       - Extracted constraint categories include:
         - **Decoupling Capacitor Rules** always extracted from the board
         - **Net Type Classification** nets are categorized as: ANALOG, HIGH_SPEED, MEDIUM_SPEED, LOW_SPEED, POWER, GROUND, UNKNOWN
       - If schematics are provided (`kicadSchematicsFiles` or `easyEdaStdSchematicFile`), they are used to improve net type classification accuracy
       - No separate constraint file is created, constraints are embedded directly in the board JSON
       - **When `smartConstraints: false`:** The board conversion and constraint extraction steps are skipped entirely. The raw board file is passed directly to validation without conversion or constraint processing. This is useful when:
         - Your board already contains embedded constraints
         - You want faster board creation without AI extraction
         - You plan to provide your own constraints at confirm time

    7. **Board Validation:**
       - The board is validated immediately upon creation
       - If validation fails, you receive a `BoardCreationFailed` webhook (if configured) or an error response
       - If successful, you receive a `BoardCreationSucceeded` webhook with:
         - Board ID
         - Credit cost estimates
         - Any warnings or anomalies
         - Board view URL

    8. **Board State After Creation:**
       - State: **Pending**
       - The board is NOT processing yet
       - Next step: Call `PATCH /api/v1/boards/{boardId}/confirm` to start processing

    **Important Notes:**


    - **File Size Limit:** 100MB maximum

    - **Multiple Files for Zuken/KiCad:** Some formats require multiple files
    (e.g., Zuken needs .dsgf (or .pcf) + .ftf + .rulf)

    - **Credit Deduction:** No credits are deducted until you call `confirm`


    **Common Patterns:**


    **Pattern 1: Full Configuration at Creation**

    ```

    1. POST /api/v1/boards
       - routingType: "EmptyBoard"
       - webhookUrl: "https://myapp.com/webhook"
       
    2. PATCH /api/v1/boards/{boardId}/confirm
       - timeout: 60
       - maxBatchTimeout: 30
       (jobType and routingType are inherited from creation)
    ```


    **Pattern 2: Minimal Creation, Configure Later**

    ```

    1. POST /api/v1/boards
       - jsonFile: uploaded
       - webhookUrl: "https://myapp.com/webhook"
       
    2. PATCH /api/v1/boards/{boardId}/confirm
       - jobType: "Placement"
       - timeout: 120
       - maxBatchTimeout: 45
    ```


    ---


    ### 2.2 Fan Out a Component


    **Endpoint:** `POST /api/v1/boards/{boardId}/fanout`


    **Purpose:** Escape the pins of a single component on a board, without
    starting a processing run.


    **Request Body:**


    | Field | Type | Required | Default | Valid Range |

    |--------|------|----------|---------|-------------|

    | `componentId` | string | Yes | — | A component id present on the board,
    for example `U1` |

    | `maxRetry` | integer | No | `10` | 1 to 20. Outside this range returns
    `400` |


    **How It Works:**


    1. **Synchronous:** the engine call happens inside the request. There is no
    webhook and no run to stop.

    2. **Board Mutation:** the escaped board replaces the board's current
    per-workflow draft revision. Repeated
       calls overwrite that same draft rather than adding revisions, so revision history does not grow.
    3. **No Credit Charge:** fanout does not start a run, so no time is
    allocated and no credits are deducted.


    **Responses:**


    | Status | Meaning |

    |--------|---------|

    | `200 OK` | The fanout ran. `status` is `Succeeded`, `Partial Succeeded` or
    `Failed` — a `Failed` fanout is still a `200`. |

    | `400 Bad Request` | `componentId` is empty or not on the board, `maxRetry`
    is outside 1 to 20, or the board is running or in a state that cannot be
    mutated. |

    | `401 Unauthorized` | The board does not exist, or is not yours. The two
    are deliberately indistinguishable. |

    | `409 Conflict` | Another setup operation held the board lock for longer
    than 30 seconds (`Board.Errors.BoardSetupLockTimeout`). Retry. |

    | `429 Too Many Requests` | The per-user call budget for the current window
    is exhausted. `Retry-After` gives the seconds to wait. |

    | `500 Internal Server Error` | The engine could not be reached or returned
    an unrecognised status (`Board.Errors.EngineCommunicationError`). |


    **Response Fields:**


    | Field | Description |

    |-------|-------------|

    | `status` | `Succeeded`, `Partial Succeeded` or `Failed` — see below |

    | `message` | A human-readable summary of the outcome |

    | `pinsEscaped` | Pins the engine successfully escaped |

    | `pinsTotal` | Pins on the component |

    | `pinsDeferred` | Pins the engine could not escape on this attempt |

    | `anomalies` | Issues the engine raised, each with `code`, `message`,
    `severity` and `count` |


    **Status values.** All three come back with `200 OK` — branch on `status`,
    not on the HTTP code.


    | `status` | Meaning |

    |----------|---------|

    | `Succeeded` | Every pin was escaped. The board was mutated |

    | `Partial Succeeded` | Some pins were escaped and some deferred. The board
    was mutated |

    | `Failed` | Nothing was escaped. **The board is unchanged** |


    **Zero pin counts are ambiguous.** An engine that omits the pin fields
    yields `pinsEscaped`, `pinsTotal` and

    `pinsDeferred` of `0`, which is indistinguishable from a component that
    genuinely had nothing to escape. Read

    `status` and `anomalies` to tell the two apart rather than inferring from
    the counts.


    `severity` is one of `ERROR`, `WARNING` or `INFO`. `count` is how many times
    the engine raised that anomaly

    and is never below `1`.


    **Where the anomalies persist:** the same rows are written to the board and
    appear in the routing anomalies of

    `GET /api/v1/boards/{boardId}`, tagged with `anomaliesType` of `Fanout`.
    This lets you distinguish them from

    anomalies raised by board checking (`BoardChecker`) or by a processing run
    (`MidJob`).


    **Rate Limiting:** calls are counted per user over a fixed window. When the
    budget is exhausted the request is

    rejected with `429` before any board change or engine call, so a rejected
    call costs nothing and changes

    nothing. Wait the number of seconds in `Retry-After` and retry.



    ---


    ## 3. Board Processing Control


    ### 3.1 Start Processing (Confirm Board)


    **Endpoint:** `PATCH /api/v1/boards/{boardId}/confirm`


    **Purpose:** Start routing or placement processing on a board.


    **How It Works:**


    #### Processing Initialization


    1. **Job Type Selection:**
        - **`jobType`:** Idle (default), Routing, or Placement
        - **Idle** means the board is created
        - **Routing:** Optimize connections
        - **Placement:** Optimize component positions
        - Must be specified here

    2. **Timeout Management:**
       - **`timeout`** (REQUIRED): Maximum processing time in minutes
       - This is the total time the agent will work on your board
       - Processing stops automatically when this time is reached
       - Credits are charged based on actual processing time, not the timeout value

    3. **Batch Configuration:**
       - **`maxBatchTimeout`** (REQUIRED): Time in seconds to wait before sending a batch of revisions
       - Shorter values = more frequent updates, faster feedback
       - Longer values = larger batches, potentially better revisions per batch
       - Recommended: 30-60 seconds for most boards
       - Use `GET /api/v1/boards/{boardId}/recommended-max-batch-timeout` to get a board-specific recommendation

    4. **Inactivity Handling:**
       - **`maxInactivityWaitTimeout`:** How long to wait if no new revisions are generated
       - Default: 2 × `maxBatchTimeout`
       - If the agent doesn’t produce new revisions within this time, processing stops
       - Useful for boards that converge quickly

    5. **Request Timeout:**
       - **`timeToLive`:** How long the API will wait for the job to start
       - Default: 300 seconds (5 minutes)
       - If resources aren’t available within this time, the request fails
       - No credits are charged if the job fails to start

    6. **Constraints:**
       - **Automatic:** Constraints (decoupling capacitor rules and net type classifications) are automatically embedded in the board during creation
       - **Optional Override:** Provide `constraintsFileUrl` to apply custom constraints
       - If a constraint file is provided, it is **merged** into the board JSON
       - Merged constraints replace the automatically extracted ones
       - Constraints guide both the routing and placement agents

    7. **Response Board Format:**
       - Use the `responseBoardFormat` parameter to control the format of the board revisions returned in the response.
       - If `responseBoardFormat` is not specified:
           - The service will use the board’s input format if it is among the supported response formats.
           - Otherwise, the response will default to **JSON**.
       - Supported response formats are:
           - **JSON** (`1`)
           - **JSON (wiring only)** (`2`) — lightweight and faster; excludes placement data
           - **DSN** (`3`) (Specctra design file format)
           - **SES** (`4`) (Specctra Session file format)
           - **KiCad** (`5`) (.kicad_pcb file format)
           - **Zuken** (`6`) (.dsgf or .pcf file format)
           - **RTE** (`7`) (Altium Session file format .rte)
           - **PCBdoc** (`8`) (Altium PCB file format .PCBdoc)

    8. **Configuration Inheritance:**
        - ✨ If `jobType` or `routingType` were set during board creation, you don’t need to specify them again
        - Explicitly providing values here overrides the creation-time settings
        - This allows flexible configuration at creation OR confirmation time

    #### Credit Deduction


    - **When:** Credits are deducted immediately when processing starts

    - **Amount:** Based on estimated processing time (timeout × credit rate)

    - **Refund:** If you stop early, unused credits are refunded


    #### What Happens Next


    1. **Job Start:** Processing begins, state changes to **Running**

    2. **Webhook: `BoardRunStarted`** Confirms processing has begun

    3. **Webhook: `BoardHeartBeat`** Sent periodically to indicate the system is
    still actively processing

    4. **Webhook: `BoardRevisionsBatchGenerated`** Sent periodically with new
    design revisions

    5. **Webhook: `BoardConverged`** Sent when the agent's optimization process
    converges, meaning further iterations won't improve the solution.

    6. **Webhook: `BoardRunCompleted`** Sent when timeout is reached or
    processing finishes

    7. **Webhook: `UserCreditsDeducted`** Details of credit charges


    This list shows the usual order. The order between different webhook events
    is not guaranteed:

    `BoardRevisionsBatchGenerated`, `BoardHeartBeat` or `BoardAnomaly` can
    arrive before `BoardRunStarted`. Order

    events by their payload timestamps and dedupe on the `x-deeppcb-id` header.
    A revision batch is sent before its own

    `BoardConverged` notifications. If the batch delivery fails and is retried,
    it can arrive after them.


    **Important Notes:**


    - **Cannot Start Twice:** A board can only be in the Running state once.
    Wait for completion or stop it first.

    - **Resource Availability:** If no GPU resources are available, the job
    waits until `timeToLive` expires

    - **Convergence:** The agent may converge (find sub-optimal solution) before
    timeout, processing continues to find alternative solutions


    ---


    ### 3.2 Stop Processing


    **Endpoint:** `PATCH /api/v1/boards/{boardId}/stop`


    **Purpose:** Stop active board processing and receive a credit refund for
    unused time.


    **How It Works:**


    1. **Graceful Shutdown:**
       - Processing stops after the current batch is completed
       - Any revisions in progress are saved
       - State changes to **Paused**

    2. **Credit Refund:**
       - Unused credits are calculated: (Timeout - Actual Runtime) × Credit Rate
       - Refund is issued automatically
       - You receive a `UserCreditsRefunded` webhook with details

    3. **Partial Results:**
       - All revisions generated up to the stop point are saved
       - You can download these revisions normally

    4. **Resume Capability:**
       - Board can be resumed later with `PATCH /api/v1/boards/{boardId}/resume`
       - Resumption starts from the last saved state

    **When to Use:**

    - You've found a satisfactory solution before timeout

    - Need to conserve credits

    - Want to change processing parameters


    **Responses:**


    | Status | Meaning |

    |--------|---------|

    | `200 OK` | The stop was accepted. Finalization and any refund arrive over
    the `BoardRunPaused` and `UserCreditsRefunded` webhooks |

    | `404 Not Found` | No board with that id, or it is not yours |

    | `409 Conflict` | The run cannot be stopped right now. The `errorCode` says
    which of the three cases applies |


    **The three 409 error codes:**


    | `errorCode` | Meaning | Retry? |

    |-------------|---------|--------|

    | `Board.Errors.BoardWorkflowMustBeRunning` | No run is active. The board is
    pending, already stopped, finished or failed | **No.** Nothing will change
    on its own. Confirm or resume a run first |

    | `Board.Errors.BoardRunHasNotStarted` | You confirmed a run and the engine
    has not picked it up yet | **Yes.** This is the only code that clears by
    itself. Wait for the run to start, then stop it |

    | `Board.Errors.BoardIsAboutToFinishProcessing` | The run is inside the
    short blackout before its timeout expires | **No.** The run is finishing
    anyway; wait for `BoardRunFinished` |


    A rejected stop changes nothing: no credit is refunded, no credit is
    charged, and the run keeps going.


    **If you cannot stop a run yet:** a confirmed run that the engine never
    picks up does not hang forever. It

    expires on its own within about five minutes (the `timeToLive` you sent on
    confirm, 300 seconds by default)

    and is refunded under the normal failure rules, in full when it never
    started.


    ---


    ### 3.3 Resume Processing


    **Endpoint:** `PATCH /api/v1/boards/{boardId}/resume`


    **Purpose:** Continue processing a previously stopped or completed board.


    **How It Works:**


    #### Resume Logic


    1. **Configuration Inheritance:**
       - ✨ Settings from the original `create` and `confirm` calls are inherited
       - `jobType` must be introduced
       - Explicitly providing values here overrides previous settings

    2. **State Requirements:**
       - Can only resume boards in **Paused**, **Stopped**, or **Completed** states
       - Cannot resume a board that's currently **Running**
       - Cannot resume a **Failed** board (create a new board instead)

    3. **Continuation Strategy:**
       - **For Completed Boards:** Continues optimization from the best solution found
       - **For Stopped Boards:** Resumes from the exact point where processing stopped

    4. **New Timeout:**
       - The `timeout` parameter specifies ADDITIONAL processing time
       - Total processing time = Original runtime + Resume timeout
       - Credits are charged for the new timeout period

    5. **Parameter Changes:**
       - **`jobType`:** Can switch between Routing and Placement
       - **`routingType`:** Can change routing strategy
       - **`maxBatchTimeout`:** Can adjust batch frequency
       - **`responseBoardFormat`:** Can change output format (JSON, WiringJson, DSN, SES, KiCad, Zuken, RTE, PCBdoc)

    6. **Constraint Updates:**
       - Provide new `constraintsFileUrl` to apply different constraints
       - Previous constraints are replaced, not merged

    #### Credit Management on Resume


    - **New Deduction:** Credits deducted based on the new timeout value

    - **Independent from Original:** The resume is treated as a new processing
    session for billing

    - **Refund on Stop:** If you stop again, unused credits from the resume are
    refunded


    **Use Cases:**


    1. **Incremental Optimization:**
       - Run for 30 minutes, review results
       - Resume for another 30 minutes if needed
       - Allows budget-controlled exploration

    2. **Strategy Changes:**
       - Start with EmptyBoard routing
       - Review results
       - Resume with CurrentUnprotectedWiring to refine

    3. **Format Conversion:**
       - Original run generates JSON
       - Resume with `responseBoardFormat: 3` to get DSN output

    4. **Extended Optimization:**
       - Board completed successfully
       - Resume to explore alternative solutions

    **Important Notes:**


    - **Deprecated Parameter:** The `batch` parameter is deprecated and ignored
    (always defaults to 1)

    - **Resource Availability:** Same `timeToLive` logic applies, waits for
    resources

    - **Convergence State:** If the board already converged, resume explores
    alternative solutions

    - **Resume Response Format:** When resuming, if a `responseBoardFormat`
    different from the one specified during confirm is provided, all new
    revisions generated after the resume will use the new format. If no format
    is specified, the response will continue using the same output format used
    during confirm.



    ---


    ## 4. Board Information & Retrieval


    ### 4.1 Find Board by Request ID


    **Endpoint:** `GET /api/v1/boards/requests/{requestId}`


    **Purpose:** Look up the DeepPCB board ID using your custom request
    identifier.


    **How It Works:**


    - **Mapping Service:** Maintains the relationship between your `requestId`
    and our internal `boardId`

    - **Your requestId:** The identifier you provided during board creation

    - **Our boardId:** The UUID we assigned to the board

    - **Why It's Useful:** 
      - Your systems can track boards using your own identifiers
      - No need to store our UUIDs in your database
      - Simplifies integration with existing workflows

    **When to Use:**

    - After board creation in async workflows

    - When your frontend needs to query board status


    ---


    ### 4.2 Get Complete Board Details


    **Endpoint:** `GET /api/v1/boards/{boardId}`


    **Purpose:** Retrieve comprehensive board information including all
    revisions and workflow history.


    **How It Works:**


    - **Complete History:** Returns:
      - Board metadata (name, creation date, status)
      - All workflows (routing/placement runs)
      - All revisions generated across all workflows
      - Current state and last activity

    - **Revision Information:**
      - Revision numbers
      - Generation timestamps
      - Statistics (completion percentages, wire lengths, etc.)
      - Convergence status (whether the revision represents a converged solution)

    - **Workflow Details:**
      - Job types executed
      - Start and end times
      - Credit consumption
      - Final states

    **When to Use:**

    - Building dashboards and monitoring UIs

    - Generating reports

    - Debugging board processing issues


    ---


    ### 4.3 Get Board Metadata


    **Endpoint:** `GET /api/v1/boards/{boardId}/details`


    **Purpose:** Retrieve lightweight board metadata optimized for API
    consumption.


    **How It Works:**


    - **Lightweight Response:** Returns only essential information:
      - Board ID and public ID
      - Board name
      - Current status
      - Creation date
      - Input type
      - Request ID (if provided)
      - Board view URL

    - **No Revisions:** Unlike `/boards/{boardId}`, this endpoint doesn't
    include revision history

    - **Fast Response:** Optimized for quick status checks


    **When to Use:**

    - Polling for status changes

    - Quick validation that a board exists

    - Building board lists or tables

    - Status bar updates in UIs


    ---


    ### 4.4 Get Board JSON


    **Endpoint:** `GET /api/v1/boards/{boardId}/json`


    **Purpose:** Download the raw JSON representation of the board.


    **How It Works:**


    - **Original Board Data:** Returns the exact JSON that was submitted (or
    converted to JSON)

    - **Not a Revision:** This is the input board, not a processed revision

    - **Use for:**
      - Re-processing with different parameters
      - Archival and backup
      - Comparison with processed revisions
      - Integration with external tools

    **When to Use:**

    - Need to re-submit a board with minor changes

    - Building board libraries

    - Exporting boards to other systems


    ---


    ### 4.5 Get Recommended Max Batch Timeout


    **Endpoint:** `GET /api/v1/boards/{boardId}/recommended-max-batch-timeout`


    **Purpose:** Get an AI-calculated recommendation for the optimal
    `maxBatchTimeout` value for this specific board.


    **How It Works:**


    - **Board-Specific Analysis:** Analyzes:
      - Board complexity (number of components, nets, layers)
      - Agent Capabilities

    - **Returns:** Recommended max-batch-timeout in seconds (e.g., 45, 60, 90)


    - **Why It Matters:**
      Balances iteration speed with solution quality

    **When to Use:**

    - Before calling `confirm` or `resume`

    - When you're unsure what timeout to set

    - For automated systems that process various board types


    ---


    ## 5. Board Artifacts & Downloads


    ### 5.1 Get Specific Revision Artifact


    **Endpoint:** `GET /api/v1/boards/{boardId}/revision-artifact`


    **Purpose:** Download a specific revision in a specific format.


    **How It Works:**


    #### Revision Selection


    - **`revision`:** The revision number (1, 2, 3, ...)
      - Revisions are numbered sequentially across all batches

    #### Artifact Type Selection


    - **`type`:** Format of the file to download (see the API reference for the
    full list of accepted values):
      - **JsonFile:** DeepPCB JSON format (complete board data)
      - **DsnFile:** Specctra DSN design format (for import into EDA tools)
      - **SesFile** / **RteFile:** Specctra session formats
      - **ScrFile:** Eagle script format
      - **KicadFile:** KiCad board (`.kicad_pcb`)
      - **ZukenFile:** Zuken design format
      - **AltiumFile:** Altium board (`.PcbDoc`)

    #### Ratsnest Inclusion


    - **`includeRatsNest`:** Whether to include unrouted connections (default:
    true)
      - **true:** Shows which connections are still missing (useful for incomplete routes)
      - **false:** Clean view of only completed wiring

    **When to Use:**

    - Downloading a specific good revision you identified in the webhook

    - Comparing different revisions

    - Exporting to specific EDA tools

    - Generating board preview images


    ---


    ### 5.2 Download Latest Board Artifact (Deprecated)


    **Endpoint:** `GET /api/v1/boards/{boardId}/download-artifact`


    > **Deprecated:** This endpoint only returns the latest revision. Use `GET
    /api/v1/boards/{boardId}/revision-artifact` (section 5.1) with an explicit
    revision number instead.


    **Purpose:** Download the latest (best) revision of the board.


    **How It Works:**


    - **Automatically Selects:** The most recent (best) revision

    - **Format Control:** Use `type` parameter to specify output format (same as
    5.1)

    - **Ratsnest Control:** Use `includeRatsNest` parameter (default: false for
    clean downloads)


    - **"Best" Revision Logic:**
      - The revision with the best statistics (most complete, shortest wire length, etc.)
      - The latest revision in the workflow represents the current best solution

    **When to Use:**

    - Quick download of the final result

    - You don't need to track specific revision numbers

    - Automated download after completion webhook


    ---


    ## 6. Schemas & Constraints


    ### 6.1 Get Board Schema


    **Endpoint:** `GET /api/v1/boards/board-schema`


    **Purpose:** Retrieve the JSON schema that defines valid DeepPCB board
    files.


    **How It Works:**


    - **JSON Schema Standard:** Returns a JSON Schema document describing:
      - Required fields
      - Data types
      - Valid value ranges
      - Nested object structures
      - Array constraints

    - **Use for:**
      - Validating boards before submission
      - Building board creation tools
      - Documentation and integration guides
      - Code generation (TypeScript interfaces, Python dataclasses, etc.)

    **When to Use:**

    - Building board conversion tools

    - Creating board editors

    - Validating generated boards in CI/CD pipelines


    ---


    ### 6.2 Get Constraints Schema


    **Endpoint:** `GET /api/v1/boards/constraints-schema`


    **Purpose:** Retrieve the JSON schema for constraints.


    **How It Works:**


    - **Constraint Types:** Defines schemas for:
      - Component placement regions
      - Keep-out zones
      - Component-to-component spacing rules
      - Edge clearances
      - Layer restrictions
      - **Decoupling capacitor rules**
      - **Net type classifications (routing constraints)**

    - **Net Type Categories:**
      - `ANALOG` - Analog signals requiring noise isolation
      - `HIGH_SPEED` - High-speed digital signals (>100MHz)
      - `MEDIUM_SPEED` - Medium-speed digital signals (10-100MHz)
      - `LOW_SPEED` - Low-speed digital signals (<10MHz)
      - `POWER` - Power distribution nets
      - `GROUND` - Ground reference nets
      - `UNKNOWN` - Unclassified nets

    - **Validation:** Use this schema to validate constraints before submission


    **When to Use:**

    - Building constraint editors

    - Automating constraint generation

    - Validating constraint files


    ---


    > **Note:** Constraints (decoupling capacitor rules and net type
    classifications) are automatically extracted during board creation and
    embedded directly in the board JSON. They can be overridden by providing a
    constraint file during `confirm` or `resume` operations.


    ---


    ## 7. File Management


    ### 7.1 Upload Board File to Temporary Storage


    **Endpoint:** `POST /api/v1/files/uploads/board-file`


    **Purpose:** Upload a board file to temporary storage and get a public URL
    for 24 hours.


    **How It Works:**


    #### Upload Process


    1. **File Upload:** Send your board file (any supported format)

    2. **Storage:** File is stored in secure cloud storage

    3. **URL Generation:** Returns a public URL to the file

    4. **24-Hour Lifetime:** File and URL expire after 24 hours


    #### Use Cases


    **Pattern: Upload Then Create**

    ```

    1. POST /api/v1/files/uploads/board-file
       → Get back: deeppcb-storage/temp/abc123.json

    2. POST /api/v1/boards
       - jsonFileUrl: "deeppcb-storage/temp/abc123.json"
       - requestId: "my-board-001"
    ```


    **Why Use This:**

    - **Large Files:** Your application doesn't need to handle 100MB file
    uploads directly

    - **Async Processing:** Upload file, then create board later

    - **Multiple Operations:** Upload once, use the URL for multiple operations
    (create, check, convert)

    - **Reliability:** We handle file storage, retries, and availability


    **Important Notes:**

    - **24-Hour Expiration:** Plan your workflow accordingly

    - **Max Size:** 100 MB

    - **Supported Formats:** All DeepPCB input formats (.dsn, .dsgf, .pcf, .ftf,
    .rulf, .pcbdoc, .json, .deeppcb, .kicad_pcb, .kicad_pro) including EasyEDA
    (.json)

    - **Security:** URL is public but unguessable (long random ID)


    ---


    ## 8. Metadata & Analytics


    ### 8.1 Submit Board Metadata Event


    **Endpoint:** `POST /api/v1/boards/{boardId}/metadata`


    **Purpose:** Store custom metadata events related to a board.


    **How It Works:**


    - **Event Storage:** Each POST creates a new event entry

    - **JSON Format:** Send any JSON object - we store it as-is

    - **NDJSON File:** Events are appended to a newline-delimited JSON file

    - **Use Cases:**
      - User interactions with board revisions
      - External tool outputs
      - Quality assessments
      - Business workflow tracking

    **Example Events:**

    ```json

    {
      "event": "user_rated_revision",
      "revision": 15,
      "rating": 5,
      "comment": "Perfect for production",
      "timestamp": "2025-11-04T10:30:00Z"
    }

    ```


    ```json

    {
      "event": "exported_to_fabrication",
      "revision": 15,
      "vendor": "JLCPCB",
      "order_id": "JLC-98765",
      "timestamp": "2025-11-04T11:00:00Z"
    }

    ```


    **When to Use:**

    - Tracking board through manufacturing pipeline

    - Recording user feedback on revisions

    - Logging external validation results

    - Building analytics dashboards


    ---


    ### 8.2 Get User Credit Flow


    **Endpoint:** `GET /api/v1/apiuser/credit-flow`


    **Purpose:** Retrieve credit usage history and balance changes for a time
    period.


    **How It Works:**


    #### Query Parameters


    - **`startDate` & `endDate`:** Filter by date range (UTC)
      - If omitted: Returns all-time history
      - Format: ISO 8601 (e.g., "2025-11-01T00:00:00Z")

    - **`webhookUrl` & `webhookToken`:** Optional webhook for async delivery
      - `webhookUrl` must be a public `http` or `https` address, as for board creation
      - Response is sent to your webhook instead of HTTP response
      - The webhook delivers **one page**, the same object as the HTTP response. It does not paginate for you

    - **`pageNumber`:** 1-based page of balance changes. Defaults to `1`. `0` or
    negative returns `400`


    - **`pageSize`:** Balance changes per page, 1 to 100. Defaults to `15`.
    Outside that range returns `400`


    #### Paging


    The response returns **one page** of balance changes, not the whole period.
    Sending no paging parameters

    returns 15 rows.


    | Field | Meaning |

    |-------|---------|

    | `pageNumber` | The page you asked for |

    | `pageSize` | Rows actually returned. Smaller than requested on the last
    page, `0` past the end |

    | `totalSize` | Rows matching your date range across all pages |


    Rows are ordered newest-first. There is no sort parameter. A `pageNumber`
    past the last page returns `200`

    with an empty `balanceChanges` and the correct `totalSize`, so read
    `totalSize` to know when to stop rather

    than waiting for an error.


    **The summary figures do not change with the page.** `usedMinutes`,
    `usedCredits`, `balance`,

    `balanceInMinutes` and `createdBoards` all describe your date range, not the
    rows returned, so page 7 reports

    the same totals as page 1. Do not sum `balanceChanges` to compute a period
    total.


    See [CreditFlowPagingChangelog.md](CreditFlowPagingChangelog.md) for the
    migration steps.


    #### Response Data


    - **Current Balance:** Your available credits right now

    - **Balance Changes:** Array of all credit transactions:
      - **Deductions:** When processing starts
      - **Refunds:** When processing stops early
      - **Purchases:** When you buy credit packages
      - **Adjustments:** Support-issued credits or corrections

    - **Per Transaction:**
      - Amount (positive for credits added, negative for deductions)
      - Reason (board processing, refund, purchase)
      - Associated board ID (if applicable)
      - Timestamp
      - Balance after this transaction

    - **Summary Statistics:**
      - Total credits used in period
      - Number of boards created
      - Average credit per board

    **When to Use:**

    - Building billing dashboards

    - Cost analysis and forecasting

    - Reconciliation with invoices

    - Budget alerts and monitoring


    ---


    ## Webhook Event Reference


    ### Event Categories


    #### Board Creation Events

    - **`BoardCreationSucceeded`** - Board validated and ready for processing

    - **`BoardCreationFailed`** - Validation failed, includes error details


    #### Processing Lifecycle Events

    - **`BoardRunStarted`** - Processing began

    - **`BoardRunResumed`** - Processing resumed after pause/stop

    - **`BoardRunPaused`** - Processing stopped

    - **`BoardRunCompleted`** - Processing finished successfully

    - **`BoardRunFailed`** - Processing encountered an error

    - **`BoardConverged`** - Agent found optimal solution


    #### Start/Resume Failures

    - **`BoardStartFailed`** - Failed to start processing (e.g., no resources
    within timeToLive)

    - **`BoardResumeFailed`** - Failed to resume processing

    - **`BoardStopFailed`** - Failed to stop processing (rare)


    #### Design Events

    - **`BoardRevisionsBatchGenerated`** - New batch of revisions available for
    download

    - **`BoardHeartBeat`** - Periodic signal indicating the system is still
    actively processing the board


    #### Billing Events

    - **`UserCreditsDeducted`** - Credits charged for processing

    - **`UserCreditsRefunded`** - Credits returned (partial or full refund)


    #### Validation Events

    - **`BoardChecked`** - Board validation completed

    - **`ConstraintsChecked`** - Constraints validation completed


    ### Webhook Security


    Always verify webhooks using the `webhookToken` you provided during board
    creation:


    **Your Webhook Endpoint Should:**

    1. Verify the token matches

    2. Respond with 200 OK quickly (< 5 seconds). The platform gives up on a
    call after 30 seconds and retries it

    3. Process the event asynchronously

    4. Be idempotent (handle duplicate deliveries)


    ---


    ## Best Practices


    ### 1. Configuration Strategy


    **Stay Flexible:**

    - Create boards with minimal configuration

    - Decide on processing strategy at `confirm` time

    - Allows dynamic decision-making based on board analysis


    **Or Decide Early, Configure Once:**

    - Set `jobType` and `routingType` during board creation

    - Let `confirm` and `resume` inherit these settings

    - Override only when you need to change strategy


    ### 2. File Upload Strategy


    **For Small Files (< 10MB):**

    - Upload directly in the `POST /api/v1/boards` request

    - Simplest approach, single API call

    - Use `jsonFile` parameter


    **For Large Files (> 10MB):**

    - Use `POST /api/v1/files/uploads/board-file` first

    - Get URL, then create board with `jsonFileUrl`

    - More reliable for large files


    **For Hosted Files:**

    - If your files are already on a public URL, use `jsonFileUrl` directly

    - No upload needed


    **⚠️ Input Validation Rules:**

    - **Exclusive Input:** When an endpoint accepts both file upload and file
    URL parameters (e.g., `jsonFile` and `jsonFileUrl`), you must provide
    **exactly one**, never both or neither

    - **Error Response:** Providing both will return: `"Provide either jsonFile
    or jsonFileUrl, not both."`

    - **Error Response:** Providing neither will return: `"Either jsonFile or
    jsonFileUrl must be provided."`

    - **Affected Endpoints:**
      - `POST /api/v1/boards` (jsonFile/jsonFileUrl)
      - `POST /api/v1/boards/check-board` (jsonFile/jsonFileUrl)
      - `POST /api/v1/boards/check-constraints` (constraintsJsonFile/constraintsFileUrl)

    ### 3. Timeout Tuning


    **Conservative Approach:**

    - Use `GET /api/v1/boards/{boardId}/recommended-max-batch-timeout`

    - Start with recommended value

    - Adjust based on results


    **Aggressive Optimization:**

    - Start with short timeout (30 minutes)

    - Review revisions

    - Resume if needed for more optimization

    - Allows budget control and incremental progress


    ### 4. Webhook Reliability


    **Always Provide Webhooks:**

    - Don't rely on polling for status updates

    - Webhooks are real-time and more efficient

    - Include both `webhookUrl` and `webhookToken`


    **Handle Failures Gracefully:**

    - If webhook delivery fails, we retry after 15 seconds, then double the wait
    each time, up to 10 retries

    - `429 Too Many Requests` uses a slower backoff that starts at 5 minutes

    - `400 Bad Request`, `422 Unprocessable Entity` and `410 Gone` are not
    retried: the event is refused for good

    - Every retry carries the same `x-deeppcb-id` as the first attempt

    - Redirects are not followed: a `3xx` answer counts as a failed delivery, so
    point `webhookUrl` at the final address

    - Your endpoint should be idempotent

    - Store event IDs to detect duplicates


    ### 5. Credit Management


    **Monitor Usage:**

    - Use `GET /api/v1/apiuser/credit-flow` regularly

    - Set up alerts when balance is low

    - Review per-board costs to optimize


    **Stop Early:**

    - Don't let jobs run to full timeout if you're satisfied

    - Use `PATCH /api/v1/boards/{boardId}/stop` to get refunds


    ### 6. Error Handling


    **Validation First:**

    - Always use `POST /api/v1/boards/check-board` before submitting production
    jobs

    - Catches issues early, before consuming credits


    **Handle Failures:**

    - Check for `BoardStartFailed` webhooks

    - Adjust `timeToLive` if resource availability is an issue


    ### 7. Revision Management


    **Download Strategy:**

    - Download revisions as they arrive (from webhooks)

    - Or download a chosen revision using `/revision-artifact` with its revision
    number


    ---


    ## Common Workflows


    ### Workflow 1: Simple Routing Job


    ```

    1. Upload board file
       POST /api/v1/files/uploads/board-file
       
    2. Create board
       POST /api/v1/boards
       - jsonFileUrl: (from step 1)
       - routingType: "EmptyBoard"
       - webhookUrl: "https://myapp.com/webhook"
       
    3. Get recommended max-batch-timeout
       GET /api/v1/boards/{boardId}/recommended-max-batch-timeout
       
    4. Start processing
       PATCH /api/v1/boards/{boardId}/confirm
       - timeout: 60
       - maxBatchTimeout: (from step 3)
       
    5. Wait for webhooks:
       - BoardRunStarted
       - BoardRevisionsBatchGenerated (multiple times)
       - BoardConverged
       - BoardRunCompleted
       
    ```


    ### Workflow 2: Incremental Optimization


    ```

    1. Create and start routing (30 min)
       POST /api/v1/boards
       PATCH /boards/{boardId}/confirm (timeout: 30)
       
    2. Review results in webhook events
       
    3. If not satisfied, resume for 30 more minutes
       PATCH /api/v1/boards/{boardId}/resume
       - timeout: 30
       
    4. If satisfied, stop early to save credits
       PATCH /api/v1/boards/{boardId}/stop
       
    5. Download the chosen revision
       GET /api/v1/boards/{boardId}/revision-artifact?revision={n}&type=JsonFile
    ```


    ### Workflow 3: Placement with Constraints


    ```

    1. Validate constraints
       POST /api/v1/boards/check-constraints
       - constraintsJsonFile: (upload)
       
    2. Create board
       POST /api/v1/boards
       - jsonFile: (upload)
       - webhookUrl: "https://myapp.com/webhook"
       
    3. Start placement with constraints
       PATCH /api/v1/boards/{boardId}/confirm
       - timeout: 120
       - maxBatchTimeout: 45
       - constraintsFileUrl: (URL to validated constraints)
       
    4. Monitor progress via webhooks
       
    ```


    ### Workflow 4: Multi-Strategy Exploration


    ```

    1. Create board
       POST /api/v1/boards (no jobType/routingType)
       
    2. Try empty board routing first
       PATCH /api/v1/boards/{boardId}/confirm
       - jobType: "Routing"
       - routingType: "EmptyBoard"
       - timeout: 30
       
    3. Wait for completion
       
    4. Try with existing wiring protection
       PATCH /api/v1/boards/{boardId}/resume
       - routingType: "CurrentProtectedWiring"
       - timeout: 30
       
    5. Compare results
       GET /api/v1/boards/{boardId} (get all revisions)
       
    6. Choose best strategy and continue
       PATCH /api/v1/boards/{boardId}/resume
       - routingType: (best from comparison)
       - timeout: 60
    ```


    ---

    ---


    # API Changelog


    Changes to the DeepPCB public API, newest first. This page lists only
    changes that affect clients

    authenticating with an API key.


    Version numbers refer to the DeepPCB platform release. The API path version,
    `/api/v1`, is unchanged.


    ### How to read this page


    | Label | Meaning |

    |---|---|

    | **Breaking change** | Existing requests behave differently. Update your
    integration before the release reaches you. |

    | **Addition** | New endpoints, parameters or response fields. Existing
    requests are unaffected. |

    | **Fixed** | A defect corrected on the server. No client change required. |


    New response fields and new optional parameters may be introduced without a
    changelog entry. Treat unrecognised

    response fields as safe to ignore, and do not depend on a field being
    absent.


    ---


    ## Unreleased


    ### Addition: per-pin via at SMD rule in the board format


    **Affects:** board JSON returned by the API and the schema at `GET
    /api/v1/boards/board-schema`.


    **What changed**


    Boards can carry a new design rule, `allowViaAtSmdPerPin`, which allows or
    disallows vias under specific surface

    mount pins: `{"type": "allowViaAtSmdPerPin", "value": true, "subjects":
    [{"id": "U1-4", "type": "pin"}]}`. The rule

    appears only on boards that have a per-pin setting; other boards are
    unchanged.

    DSN exports keep each padstack's own `attach` setting, so per-pin overrides
    are not exported.


    ### Breaking change: Cooper endpoints can answer 403 when Cooper is turned
    off for your account


    **Affects:** API-key clients that call the Cooper conversation,
    chat-completion or chat-file upload endpoints.


    **What changed**


    Cooper can now be switched off per account. While it is off, every Cooper
    endpoint (create, list, get, update and

    delete conversations, read messages, chat completions, and `POST
    /api/v1/files/uploads/chat-file`) answers **403**

    in the usual error body (`statusCode`, `status: "failure"`, `errorCode`,
    `errorMessage`), with

    `errorCode: Common.Errors.FeatureUnavailable` and an `errorMessage` you can
    show. A malformed request still answers 400

    first.


    **What to do**


    Treat a 403 with `Common.Errors.FeatureUnavailable` as "Cooper is not
    available for this account" and stop calling

    Cooper until it is turned back on.


    ### Breaking change: `smartConstraints` is subject to account availability


    **Affects:** `POST /api/v1/boards` and `POST
    /api/v1/boards/convert-to-json`.


    **What changed**


    Smart constraints can now be switched off per account. While they are off:


    - A request without `smartConstraints` runs as `smartConstraints=false`: no
    constraint extraction, and convert also
      skips the schematic conversion. The response does not change.
    - A request with `smartConstraints=true` answers **403** with `errorCode:
    Board.Errors.SmartConstraintsUnavailable`
      in the usual error body. No board is created, so you can retry the same `requestId` with `smartConstraints=false`.
    - A request with `smartConstraints=false` is unaffected.


    Nothing changes for accounts that have smart constraints.


    **What to do**


    If you send `smartConstraints=true`, handle a 403 with
    `Board.Errors.SmartConstraintsUnavailable` by retrying without

    it, or omit the field to get constraints whenever your account has them.


    ### Fixed: board access enforced on recommended max batch timeout


    **Affects:** API-key requests to `GET
    /api/v1/boards/{boardId}/recommended-max-batch-timeout` for a board the
    key's owner does not own.


    **What changed**


    The endpoint returned the recommended timeout for any board ID. It now
    checks that the API key's owner owns the

    board, and returns `401` with `Board.Errors.UnAuthorizedToGetBoard` when
    they don't.


    **What to do**


    Nothing for requests on your own boards.


    ### Fixed: revision batches dropped at the start of a run


    **Affects:** API-key runs whose webhook endpoint answers the
    `BoardRunStarted` or `BoardRunResumed` webhook slowly.


    **What changed**


    The run status webhook was sent before the new status was saved. While your
    endpoint was still answering

    `BoardRunStarted`, the run still looked unstarted, so every revision batch
    that arrived in that window was

    discarded.


    The status is now saved first, and the webhook for each run status the
    engine reports, such as `BoardRunStarted`

    or `BoardRunResumed`, is queued and sent after the save succeeds. A slow
    endpoint no longer delays the run or

    drops revisions. A repeated start signal for a run that has already started

    is ignored and sends no second `BoardRunStarted`.


    **What to do**


    Nothing. Because the status no longer waits for your endpoint,
    `BoardRevisionsBatchGenerated`, `BoardHeartBeat`

    or `BoardAnomaly` can now arrive before `BoardRunStarted`. Order events by
    their payload timestamps and dedupe on

    `x-deeppcb-id`. A revision batch is still sent before its own convergence
    notifications; a batch that fails and is

    retried can arrive after them.


    ### Breaking change: webhook delivery rules


    **Affects:** every webhook sent to your endpoint, run events and the credit
    flow check (`UserCreditFlowCheck`) alike.


    **What changed**


    - **30-second timeout.** The platform stops waiting for your endpoint after
    30 seconds, down from 5 minutes. A
      call that times out is retried like any other failure, with the same `x-deeppcb-id`.
    - **No retry on 400, 422 or 410.** An answer of `400 Bad Request`, `422
    Unprocessable Entity` or `410 Gone` means
      the event is refused for good, so it is not sent again. Other failures (401, 403, 404, 408, 5xx, timeouts,
      connection errors) are still retried: first after 15 seconds, then doubling, up to 10 retries. `429` keeps its
      own slower backoff.
    - **Order between events is not guaranteed.** See the fixed entry above.

    - **Webhook URLs must be public.** Board creation, board check, constraint
    validation and the credit flow request
      reject a `webhookUrl` whose host is `localhost`, ends in `.localhost`, `.local` or `.internal`, or is an IP
      address in a loopback, private, link-local, shared (`100.64.0.0/10`) or unspecified range. The request fails
      with `400` and `Webhook URL must be a public address`.
    - **Credit flow webhook URLs must be well-formed http or https URLs.** The
    credit flow request used to accept any
      absolute URL, including other schemes and URLs with unescaped spaces.
    - **Webhook hosts are checked when each webhook is sent.** A host that
    resolves only to such private addresses
      is not contacted, and the event is not retried. This also applies to boards created before this release.
    - **Redirects are not followed.** A `3xx` answer counts as a failed delivery
    and is retried like other failures.

    - **The webhook URL is sent exactly as given.** Earlier releases dropped
    everything after `?` and collapsed repeated
      slashes at the start of the path (`https://host//hook` went to `/hook`). Check that `webhookUrl` is the address your
      receiver serves.

    **What to do**


    - Answer within a few seconds and process the event afterwards. An endpoint
    that answers after 30 seconds
      receives the same event again.
    - Answer `400`, `422` or `410` only when you never want that event. Answer a
    `5xx` such as `503` for a temporary
      problem on your side.
    - Dedupe on `x-deeppcb-id`.

    - Point `webhookUrl` at a public address of your receiver.


    ### Addition: rating date on the board rating


    **Endpoints:** `GET /api/v1/boards/{boardId}`, `PUT
    /api/v1/boards/{boardId}/rating`


    The board's `ratingsAndFeedback` object carries a new `ratedOn` field: the
    UTC time of the board's latest

    rating, or `null` when the board has no rating or was rated before this
    release. Rating a board sets it;

    rating it again replaces it.


    ---


    ## v4.14.0


    ### Fixed: duplicate and out-of-order revision webhooks


    **Affects:** the `BoardRevisionsBatchGenerated` and `BoardConverged`
    webhooks on API-key runs.


    **What changed**


    A run could deliver the same revision batch twice, under two different
    `eventId` values, after having already

    delivered it in the right order. The notification was sent before the
    database commit. When the engine emitted

    several revisions within milliseconds, the parallel attempts raced on one
    row, and a losing attempt had already

    sent its webhook before failing. The redelivery then sent the same batch
    again with a new `eventId`.


    Notifications are now queued and sent only after the commit succeeds, so a
    losing attempt sends nothing and its

    redelivery sends the batch exactly once. A batch and its convergence
    notifications travel together, so the

    batch still arrives before the convergence notifications that belong to it.


    **What to do**


    Nothing. Treating `eventId` as an idempotency key remains good practice, and
    it is still carried both in the

    payload and in the `x-deeppcb-id` request header.


    ---


    ## v4.13.0


    ### Breaking change: `numVias` removed from revision results


    **Endpoint:** `GET /api/v1/boards/{boardId}`


    **What changed**


    Each entry in `workflow.revisions[].result` previously carried both
    `viaAdded` and `numVias`. Only one was

    ever populated: routed revisions filled `numVias` and left `viaAdded` at
    `0`, while the initial and draft

    revisions did the reverse. The server reconciled the two before serving the
    board, so `viaAdded` already

    held the correct count in every response.


    `numVias` has been removed. `viaAdded` continues to report the board's total
    via count.


    **`viaAdded` can now be `null`**


    It previously always serialised as a number, substituting `0` whenever the
    count was unknown. It is now

    `null` in the two cases where no count exists: revisions created before this
    release recorded no count for

    the initial board (`#00`), and placement runs produce no via count at all. A
    `0` now means the board really

    has no vias. Treat `null` as "not measured" rather than zero.


    **If you read `numVias`**


    Read `viaAdded` instead, and handle `null`. No other field was removed or
    renamed. `numViasToPlanes`,

    `numViasAtSmd`, `differentialPairNumVias` and `numChangeLayerVias` are
    unaffected.


    ---


    ## v4.11.0


    ### Addition: fan out a component's pins


    **Endpoint:** `POST /api/v1/boards/{boardId}/fanout`


    Escapes the pins of a single component on a board and returns the escape
    result. The board is mutated in

    place: the call replaces the board's current per-workflow draft revision
    rather than adding a new one, so

    repeated calls do not accumulate revision history.


    **Request body**


    | Field | Type | Required | Default | Valid range |

    |---|---|---|---|---|

    | `componentId` | string | Yes | — | A component id present on the board,
    for example `U1`. |

    | `maxRetry` | integer | No | `10` | 1 to 20. Values outside this range
    return `400`. |


    **Responses**


    | Status | Meaning |

    |---|---|

    | `200 OK` | The fanout ran. `status` is `Succeeded`, `Partial Succeeded` or
    `Failed` — a `Failed` fanout is still a `200`. |

    | `400 Bad Request` | `componentId` is empty or not on the board, `maxRetry`
    is outside 1 to 20, or the board is running or in a state that cannot be
    mutated. |

    | `401 Unauthorized` | The board does not exist, or is not yours. The two
    are deliberately indistinguishable. |

    | `409 Conflict` | Another setup operation held the board lock for longer
    than 30 seconds (`Board.Errors.BoardSetupLockTimeout`). Retry. |

    | `429 Too Many Requests` | The per-user call budget for the current window
    is exhausted. `Retry-After` gives the seconds to wait. |

    | `500 Internal Server Error` | The engine could not be reached or returned
    an unrecognised status (`Board.Errors.EngineCommunicationError`). |


    **Anomaly rows**


    Each entry in `anomalies` carries `code`, `message`, `severity` (`ERROR`,
    `WARNING` or `INFO`) and `count`,

    where `count` is how many times the engine raised that anomaly and is never
    below `1`. The same rows are

    persisted on the board and appear in the routing anomalies of `GET
    /api/v1/boards/{boardId}` with

    `anomaliesType` of `Fanout`.


    **Rate limiting.** Calls are counted per user over a fixed window. An
    exhausted budget returns `429` with a

    `Retry-After` header; no board change is made and no engine call is issued.


    ### Fixed: `Location` header now uses https


    **Endpoints:** `POST /api/v1/boards`, `PATCH /api/v1/boards/{boardId}/stop`


    The `202 Accepted` responses returned a `Location` header with an `http://`
    URL. TLS terminates at the

    gateway, so the server saw a plain HTTP request and built the header from
    that scheme. The header now uses

    `https://`. Clients that follow `Location` no longer traverse an insecure
    hop. No client change is required.


    ### Fixed: `boardInputType` is no longer validated


    **Endpoints:** `POST /api/v1/boards`, `POST /api/v1/boards/convert-to-json`


    `boardInputType` was deprecated and ignored, but was still declared on the
    request, so an unrecognised value was

    rejected with `400` before the request was processed. The field has been
    removed from the request schema. A

    request that still sends it is accepted and the value ignored. No request
    that previously succeeded is affected.


    The input format is determined by which input you provide — an uploaded
    file, or `jsonFileUrl` on

    `POST /api/v1/boards`. Provide input for exactly one format: no board input
    at all, or input for two different

    formats (including `jsonFile` together with `jsonFileUrl`), returns `400`.


    ---


    ### Fixed: identity-provider throttling returns a named error code


    **Endpoints:** board and user endpoints.


    **What changed**


    When an internal identity-provider lookup was throttled, the request failed
    with an unlabelled `500`. It now

    returns `500` carrying an error code, so a client can tell a transient
    throttle from a server defect.


    | Error code | Condition | Retry |

    |---|---|---|

    | `Identity.Errors.RateLimited` | An internal identity-provider lookup was
    throttled. | Yes, after a short delay. |


    No client change is required. A client that already retries `500` responses
    is unaffected.


    ---


    ## v4.9.0


    ### Breaking change: `credit-flow` returns a single page


    **Endpoint:** `GET /api/v1/apiuser/credit-flow`


    **Also affects:** the `UserCreditFlowCheck` webhook, which delivers the same
    payload.


    **What changed**


    The endpoint previously returned every balance change in the requested
    period in one response. It now returns a

    single page. A request that omits the paging parameters returns **15 rows**,
    where it previously returned the

    complete period.


    **New request parameters**


    | Parameter | Type | Default | Valid range |

    |---|---|---|---|

    | `pageNumber` | integer | `1` | 1 or greater. Lower values return `400`. |

    | `pageSize` | integer | `15` | 1 to 100. Values outside this range return
    `400`. |


    **New response fields**


    | Field | Description |

    |---|---|

    | `pageNumber` | The requested page, echoed back. |

    | `pageSize` | Rows returned in this response. Lower than requested on the
    final page, and `0` beyond the last page. |

    | `totalSize` | Total rows matching the requested period, across all pages.
    |


    No field was removed or renamed. `balanceChanges` retains its name and its
    row structure.


    **Summary fields are unaffected by paging.** `usedMinutes`, `usedCredits`,
    `balance`, `balanceInMinutes` and

    `createdBoards` describe the requested period rather than the returned page.
    Page 7 reports the same

    `usedMinutes` as page 1.


    Requesting a page beyond the last returns `200` with an empty
    `balanceChanges`, `pageSize` of `0`, and the

    correct `totalSize`.


    **Example response**


    ```json

    {
      "balanceInMinutes": 2400,
      "balance": 9600,
      "usedMinutes": 305,
      "usedCredits": 1220,
      "createdBoards": 12,
      "pageNumber": 1,
      "pageSize": 15,
      "totalSize": 142143,
      "balanceChanges": []
    }

    ```


    **Migration**


    1. Replace a single full-period request with a loop: request `pageNumber=1`,
    read `totalSize`, then continue
       requesting until you have retrieved that many rows.
    2. Set `pageSize=100` for bulk history retrieval. This is the maximum.

    3. Read `usedMinutes`, `usedCredits` and `totalSize` from the response
    rather than deriving totals from
       `balanceChanges`. A sum over one page describes that page only.
    4. If you consume the `UserCreditFlowCheck` webhook, its payload is now a
    single page. Pass `pageNumber` and
       `pageSize` alongside `webhookUrl` to select which page is delivered. The webhook is sent once per request and
       does not paginate on your behalf, so poll the endpoint if you require the full period.

    **Unchanged:** the route, HTTP method, authentication, the `startDate`,
    `endDate`, `webhookUrl` and

    `webhookToken` parameters, and newest-first ordering. There is no sort
    parameter.


    ---


    ### Breaking change: stopping a run that has not started returns `409`


    **Endpoint:** `PATCH /api/v1/boards/{boardId}/stop`


    **What changed**


    Stopping a board that had been confirmed but not yet picked up by the
    routing engine previously returned `200`

    without stopping the run. Processing continued and the allocated time
    remained charged. That case now returns

    `409` with error code `Board.Errors.BoardRunHasNotStarted`.


    **Stop conflict codes**


    | Error code | Condition | Retry |

    |---|---|---|

    | `Board.Errors.BoardRunHasNotStarted` | The run is confirmed, and the
    engine has not started it yet. | Yes, after a short delay. |

    | `Board.Errors.BoardWorkflowMustBeRunning` | The run is not in a running
    state. | No. |

    | `Board.Errors.BoardIsAboutToFinishProcessing` | The run is within its
    final seconds. | No. |


    **Migration**


    1. Handle `Board.Errors.BoardRunHasNotStarted` as a retryable condition.

    2. Do not treat a `200` from `stop` as confirmation that processing has
    ended. Confirm through board status or
       the stop webhook, as before.

    A run that the engine never starts is not left pending. It fails once its
    `timeToLive` expires, with reason code

    `BOARD_START_FAILED_BY_EXPIRED_TTL`, and the full allocation is refunded.



    ---

    ---

  version: v1
servers:
  - url: https://api.deeppcb.com
    description: DeepPCB API
security:
  - Api Key: []
paths:
  /api/v1/boards/{boardId}/metadata:
    post:
      tags:
        - Boards
      summary: Submit a board-related metadata event
      description: >-
        This endpoint accepts a single JSON-formatted metadata event related to
        a specific board ID. The event is stored as a new line in an NDJSON file
        in cloud object storage.
      parameters:
        - name: boardId
          in: path
          required: true
          schema:
            type: string
            format: uuid
      requestBody:
        content:
          application/json-patch+json:
            schema:
              type: object
              additionalProperties:
                $ref: '#/components/schemas/JToken'
          application/json:
            schema:
              type: object
              additionalProperties:
                $ref: '#/components/schemas/JToken'
          text/json:
            schema:
              type: object
              additionalProperties:
                $ref: '#/components/schemas/JToken'
          application/*+json:
            schema:
              type: object
              additionalProperties:
                $ref: '#/components/schemas/JToken'
      responses:
        '200':
          description: OK
        '400':
          description: Bad Request
          content:
            text/plain:
              schema:
                $ref: '#/components/schemas/ResultDto'
            application/json:
              schema:
                $ref: '#/components/schemas/ResultDto'
            text/json:
              schema:
                $ref: '#/components/schemas/ResultDto'
        '401':
          description: Unauthorized
        '500':
          description: Internal Server Error
          content:
            text/plain:
              schema:
                $ref: '#/components/schemas/ResultDto'
            application/json:
              schema:
                $ref: '#/components/schemas/ResultDto'
            text/json:
              schema:
                $ref: '#/components/schemas/ResultDto'
components:
  schemas:
    JToken:
      type: object
      items:
        $ref: '#/components/schemas/JToken'
      description: Any JSON value
    ResultDto:
      type: object
      properties:
        statusCode:
          type: integer
          format: int32
          nullable: true
        status:
          type: string
          nullable: true
        errorCode:
          type: string
          nullable: true
        errorMessage:
          type: string
          nullable: true
      additionalProperties: false
  securitySchemes:
    Api Key:
      type: apiKey
      description: Your DeepPCB API key, from the Integration page in the app.
      name: x-deeppcb-api-key
      in: header

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.