{
  "openapi": "3.1.0",
  "info": {
    "title": "Nexus CI API",
    "version": "1.1.0",
    "description": "Write test design, execution, deployment, environment and test-data evidence to one Nexus Jira project. Copy the installation-specific CI API URL from Nexus Project Settings → CI and use it as the server URL. The endpoint is a Forge web trigger with a static response: it answers only with the fixed bodies below and never returns data. Per-operation outcomes are in Project Settings → CI → CI API log. Read data through Jira's own REST API with your own Jira credentials.\n\n**Results upload (a separate URL).** Test report files go to the Results URL (the `automation-results` web trigger), not to this CI API. That endpoint accepts a raw report or the JSON upload envelope described by the `UploadEnvelope` schema. Send XML inside the envelope: the Forge web trigger platform strips raw line breaks from a request body before Nexus receives it (confirmed live 28/09/2026), so a raw XML stack trace arrives as one line. The Nexus CLI, runner and reporters send the envelope for you. See the `x-nexus-results-upload` extension and the CI guide.",
    "license": {
      "name": "Proprietary",
      "identifier": "LicenseRef-Proprietary"
    }
  },
  "servers": [
    {
      "url": "https://replace-with-your-project-ci-api-url",
      "description": "Replace with the CI API URL shown in Nexus Project Settings"
    }
  ],
  "tags": [
    {
      "name": "CI operations",
      "description": "A bounded batch of write operations. Operation-level outcomes appear in the Nexus CI operation log."
    }
  ],
  "paths": {
    "/": {
      "post": {
        "operationId": "submitCiOperations",
        "summary": "Submit CI operations",
        "tags": [
          "CI operations"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "project",
            "in": "query",
            "required": true,
            "description": "Jira project key. It must match the API key's project.",
            "schema": {
              "type": "string",
              "pattern": "^[A-Z][A-Z0-9_]{1,9}$"
            }
          },
          {
            "$ref": "#/components/parameters/NexusTimestamp"
          },
          {
            "$ref": "#/components/parameters/NexusNonce"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CiBatch"
              },
              "examples": {
                "createAndReport": {
                  "summary": "Create a test and record a result",
                  "value": {
                    "operations": [
                      {
                        "op": "create-test-case",
                        "summary": "Login with valid credentials",
                        "automationKey": "AUTH-LOGIN-01",
                        "externalKey": "build-4821-login"
                      },
                      {
                        "op": "report-result",
                        "automationKey": "AUTH-LOGIN-01",
                        "status": "passed",
                        "environment": "staging"
                      }
                    ]
                  }
                },
                "setFixedInBuild": {
                  "summary": "Record the build that fixes two Bugs",
                  "value": {
                    "operations": [
                      {
                        "op": "set-fixed-in-build",
                        "bugKeys": [
                          "NEX-812",
                          "NEX-815"
                        ],
                        "build": "2026.09.28-4",
                        "commit": "3f9c2e1"
                      }
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted. Check the Nexus CI operation log for operation-level outcomes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AcceptedResponse"
                },
                "example": {
                  "status": "accepted"
                }
              }
            }
          },
          "400": {
            "description": "Invalid JSON or operation shape, a malformed replay header, a reused nonce or a timestamp more than 5 minutes out. Nothing is dispatched.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RejectedResponse"
                },
                "example": {
                  "status": "rejected",
                  "reason": "invalid payload"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or wrong-project API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RejectedResponse"
                },
                "example": {
                  "status": "rejected",
                  "reason": "unauthorized"
                }
              }
            }
          },
          "413": {
            "description": "The body is over 512 KB, the 25-operation work budget is exceeded, or the per-project rate guard was hit. Nothing is dispatched.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RejectedResponse"
                },
                "example": {
                  "status": "rejected",
                  "reason": "payload too large"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected failure, or the same batch (or Idempotency-Key) is still being processed: send it again shortly.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "status": "error"
                }
              }
            }
          }
        },
        "description": "Runs a batch of up to 25 operations (a work budget; see `CiBatch`). The answer is one of the fixed bodies below; each operation's outcome is written to the CI API log. Without a nonce, an identical batch sent again while the first is running answers 500 (send again shortly), and within 60 seconds of it finishing answers `accepted` without running again."
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "description": "Project-specific Nexus API key"
      }
    },
    "schemas": {
      "CiBatch": {
        "type": "object",
        "additionalProperties": true,
        "required": [
          "operations"
        ],
        "properties": {
          "operations": {
            "type": "array",
            "minItems": 1,
            "maxItems": 25,
            "items": {
              "$ref": "#/components/schemas/Operation"
            }
          }
        },
        "description": "One POST carries 1–25 operations. The 25 is a work budget: each case key in `add-cases-to-cycle` and each Bug key in `set-fixed-in-build` counts one, every other operation counts one. Over 25 is refused whole (413) before anything runs. Every operation is a strict allow-list: one unknown field or bad value refuses the whole batch (400)."
      },
      "Operation": {
        "oneOf": [
          {
            "$ref": "#/components/schemas/CreateTestCase"
          },
          {
            "$ref": "#/components/schemas/UpdateTestCase"
          },
          {
            "$ref": "#/components/schemas/AddToCycle"
          },
          {
            "$ref": "#/components/schemas/AddCasesToCycle"
          },
          {
            "$ref": "#/components/schemas/SetRunAssignee"
          },
          {
            "$ref": "#/components/schemas/SetFixedInBuild"
          },
          {
            "$ref": "#/components/schemas/ReportResult"
          },
          {
            "$ref": "#/components/schemas/RecordDeployment"
          },
          {
            "$ref": "#/components/schemas/RecordEnvironmentEvent"
          },
          {
            "$ref": "#/components/schemas/RecordConfiguration"
          },
          {
            "$ref": "#/components/schemas/ReserveDataRows"
          },
          {
            "$ref": "#/components/schemas/ConsumeDataRows"
          },
          {
            "$ref": "#/components/schemas/ReleaseDataRows"
          }
        ],
        "discriminator": {
          "propertyName": "op",
          "mapping": {
            "create-test-case": "#/components/schemas/CreateTestCase",
            "update-test-case": "#/components/schemas/UpdateTestCase",
            "add-to-cycle": "#/components/schemas/AddToCycle",
            "add-cases-to-cycle": "#/components/schemas/AddCasesToCycle",
            "set-run-assignee": "#/components/schemas/SetRunAssignee",
            "set-fixed-in-build": "#/components/schemas/SetFixedInBuild",
            "report-result": "#/components/schemas/ReportResult",
            "record-deployment": "#/components/schemas/RecordDeployment",
            "record-environment-event": "#/components/schemas/RecordEnvironmentEvent",
            "record-configuration": "#/components/schemas/RecordConfiguration",
            "reserve-data-rows": "#/components/schemas/ReserveDataRows",
            "consume-data-rows": "#/components/schemas/ConsumeDataRows",
            "release-data-rows": "#/components/schemas/ReleaseDataRows"
          }
        }
      },
      "Step": {
        "type": "object",
        "additionalProperties": true,
        "properties": {
          "action": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 4000
          },
          "data": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 4000
          },
          "expected": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 4000
          }
        }
      },
      "CreateTestCase": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "op",
          "summary"
        ],
        "properties": {
          "op": {
            "const": "create-test-case"
          },
          "summary": {
            "type": "string",
            "minLength": 1,
            "maxLength": 255
          },
          "steps": {
            "type": "array",
            "maxItems": 100,
            "items": {
              "$ref": "#/components/schemas/Step"
            }
          },
          "preconditions": {
            "type": "string",
            "minLength": 1,
            "maxLength": 4000
          },
          "automationKey": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "externalKey": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200,
            "description": "Caller-supplied idempotency key."
          }
        }
      },
      "UpdateTestCase": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "op",
          "testCaseKey"
        ],
        "properties": {
          "op": {
            "const": "update-test-case"
          },
          "testCaseKey": {
            "$ref": "#/components/schemas/IssueKey"
          },
          "steps": {
            "type": "array",
            "maxItems": 100,
            "items": {
              "$ref": "#/components/schemas/Step"
            },
            "description": "Replaces the complete step table when supplied."
          },
          "preconditions": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 4000,
            "description": "Replaces the preconditions. An empty or blank string, or null, clears them (since 28/09/2026; before, it refused the whole batch). Leave the field out to keep them."
          },
          "automationKey": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          }
        },
        "description": "Updates a Test Case in the key's project. A part you leave out is kept (since 28/09/2026). `steps` replaces the whole step table; `preconditions` replaces the preconditions (`\"\"` or null clears them). Preconditions alone on an unstructured or checklist design fail with `no-step-table`. A Test Case with a finished run is step-locked (`update-failed`) until it is moved to In Repair."
      },
      "AddToCycle": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "op",
          "testSetKey",
          "testCaseKey"
        ],
        "properties": {
          "op": {
            "const": "add-to-cycle"
          },
          "testSetKey": {
            "$ref": "#/components/schemas/IssueKey"
          },
          "testCaseKey": {
            "$ref": "#/components/schemas/IssueKey"
          }
        }
      },
      "AddCasesToCycle": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "op",
          "testSetKey",
          "testCaseKeys"
        ],
        "properties": {
          "op": {
            "const": "add-cases-to-cycle"
          },
          "testSetKey": {
            "$ref": "#/components/schemas/IssueKey"
          },
          "testCaseKeys": {
            "type": "array",
            "minItems": 1,
            "maxItems": 25,
            "uniqueItems": true,
            "items": {
              "$ref": "#/components/schemas/IssueKey"
            }
          }
        },
        "description": "Adds 1–25 Test Cases to one cycle. Each case key counts one against the 25-operation work budget; one log outcome per case."
      },
      "SetRunAssignee": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "op",
          "runKey",
          "accountId"
        ],
        "properties": {
          "op": {
            "const": "set-run-assignee"
          },
          "runKey": {
            "$ref": "#/components/schemas/IssueKey"
          },
          "accountId": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 128,
            "description": "Atlassian account id, or null to unassign.",
            "pattern": "^[A-Za-z0-9:_-]{1,128}$"
          }
        }
      },
      "ReportResult": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "op",
          "automationKey",
          "status"
        ],
        "properties": {
          "op": {
            "const": "report-result"
          },
          "automationKey": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "status": {
            "type": "string",
            "enum": [
              "passed",
              "failed",
              "skipped",
              "blocked"
            ]
          },
          "actualResult": {
            "type": "string",
            "maxLength": 4000
          },
          "environment": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100
          },
          "testSetKey": {
            "$ref": "#/components/schemas/IssueKey"
          },
          "configurationId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          }
        }
      },
      "RecordDeployment": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "op",
          "environment",
          "version",
          "status",
          "externalId"
        ],
        "properties": {
          "op": {
            "const": "record-deployment"
          },
          "environment": {
            "$ref": "#/components/schemas/Environment"
          },
          "version": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100
          },
          "status": {
            "type": "string",
            "enum": [
              "success",
              "failed",
              "rolled_back"
            ]
          },
          "externalId": {
            "$ref": "#/components/schemas/ExternalId128"
          },
          "release": {
            "type": "string",
            "maxLength": 100
          },
          "component": {
            "type": "string",
            "maxLength": 80
          },
          "build": {
            "type": "string",
            "maxLength": 100
          },
          "commit": {
            "type": "string",
            "maxLength": 40
          },
          "deployedAt": {
            "type": "string",
            "format": "date-time",
            "maxLength": 40,
            "description": "ISO-8601 timestamp, no more than five minutes in the future."
          },
          "evidenceUrl": {
            "type": "string",
            "format": "uri",
            "maxLength": 512,
            "pattern": "^[Hh][Tt][Tt][Pp][Ss]://"
          }
        }
      },
      "RecordEnvironmentEvent": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "op",
          "environment",
          "type",
          "externalId"
        ],
        "properties": {
          "op": {
            "const": "record-environment-event"
          },
          "environment": {
            "$ref": "#/components/schemas/Environment"
          },
          "type": {
            "type": "string",
            "enum": [
              "refresh",
              "outage_start",
              "outage_end",
              "config_change",
              "health"
            ]
          },
          "externalId": {
            "$ref": "#/components/schemas/ExternalId128"
          },
          "healthState": {
            "type": "string",
            "enum": [
              "healthy",
              "degraded",
              "down",
              "unknown"
            ]
          },
          "invalidatesResults": {
            "type": "boolean"
          },
          "occurredAt": {
            "type": "string",
            "format": "date-time",
            "maxLength": 40,
            "description": "ISO-8601 timestamp, no more than five minutes in the future."
          },
          "note": {
            "type": "string",
            "maxLength": 500
          }
        },
        "allOf": [
          {
            "if": {
              "properties": {
                "type": {
                  "const": "health"
                }
              },
              "required": [
                "type"
              ]
            },
            "then": {
              "required": [
                "healthState"
              ],
              "properties": {
                "healthState": {
                  "type": "string",
                  "enum": [
                    "healthy",
                    "degraded",
                    "down",
                    "unknown"
                  ]
                }
              }
            },
            "else": {
              "properties": {
                "healthState": false
              }
            }
          }
        ]
      },
      "RecordConfiguration": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "op",
          "environment",
          "entries",
          "externalId"
        ],
        "properties": {
          "op": {
            "const": "record-configuration"
          },
          "environment": {
            "$ref": "#/components/schemas/Environment"
          },
          "entries": {
            "type": "object",
            "maxProperties": 100,
            "propertyNames": {
              "pattern": "^[A-Za-z0-9][A-Za-z0-9._:/-]{0,63}$",
              "maxLength": 64
            },
            "additionalProperties": {
              "type": "string",
              "maxLength": 256,
              "minLength": 1,
              "pattern": "^[^\\u0000-\\u001f\\u007f]+$"
            },
            "minProperties": 0
          },
          "externalId": {
            "$ref": "#/components/schemas/ExternalId128"
          },
          "merge": {
            "type": "boolean"
          },
          "capturedAt": {
            "type": "string",
            "format": "date-time",
            "maxLength": 40,
            "description": "ISO-8601 timestamp, no more than five minutes in the future."
          },
          "note": {
            "type": "string",
            "maxLength": 500
          }
        },
        "allOf": [
          {
            "if": {
              "properties": {
                "merge": {
                  "const": true
                }
              },
              "required": [
                "merge"
              ]
            },
            "then": {
              "properties": {
                "entries": {
                  "minProperties": 1
                }
              }
            }
          }
        ]
      },
      "ReserveDataRows": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "op",
          "execution",
          "dataSet",
          "externalId"
        ],
        "properties": {
          "op": {
            "const": "reserve-data-rows"
          },
          "execution": {
            "$ref": "#/components/schemas/IssueKey"
          },
          "dataSet": {
            "$ref": "#/components/schemas/Uuid"
          },
          "externalId": {
            "$ref": "#/components/schemas/ExternalId100"
          },
          "count": {
            "type": "integer",
            "minimum": 1,
            "maximum": 200
          },
          "rowKeys": {
            "$ref": "#/components/schemas/RowKeys"
          },
          "environment": {
            "$ref": "#/components/schemas/Environment"
          }
        },
        "description": "Supply exactly one of count or rowKeys.",
        "oneOf": [
          {
            "required": [
              "count"
            ],
            "properties": {
              "count": {
                "type": "integer",
                "minimum": 1,
                "maximum": 200
              },
              "rowKeys": false
            }
          },
          {
            "required": [
              "rowKeys"
            ],
            "properties": {
              "count": false,
              "rowKeys": {
                "$ref": "#/components/schemas/RowKeys"
              }
            }
          }
        ]
      },
      "ConsumeDataRows": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "op",
          "execution",
          "dataSet",
          "externalId"
        ],
        "properties": {
          "op": {
            "const": "consume-data-rows"
          },
          "execution": {
            "$ref": "#/components/schemas/IssueKey"
          },
          "dataSet": {
            "$ref": "#/components/schemas/Uuid"
          },
          "externalId": {
            "$ref": "#/components/schemas/ExternalId100"
          },
          "rowKeys": {
            "$ref": "#/components/schemas/RowKeys"
          }
        }
      },
      "ReleaseDataRows": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "op",
          "execution",
          "dataSet",
          "externalId"
        ],
        "properties": {
          "op": {
            "const": "release-data-rows"
          },
          "execution": {
            "$ref": "#/components/schemas/IssueKey"
          },
          "dataSet": {
            "$ref": "#/components/schemas/Uuid"
          },
          "externalId": {
            "$ref": "#/components/schemas/ExternalId100"
          },
          "rowKeys": {
            "$ref": "#/components/schemas/RowKeys"
          }
        }
      },
      "IssueKey": {
        "type": "string",
        "pattern": "^[A-Z][A-Z0-9_]+-\\d+$"
      },
      "Environment": {
        "type": "string",
        "minLength": 1,
        "maxLength": 100
      },
      "ExternalId128": {
        "type": "string",
        "minLength": 1,
        "maxLength": 128
      },
      "ExternalId100": {
        "type": "string",
        "pattern": "^[A-Za-z0-9._-]{1,100}$"
      },
      "Uuid": {
        "type": "string",
        "format": "uuid"
      },
      "RowKeys": {
        "type": "array",
        "minItems": 1,
        "maxItems": 200,
        "uniqueItems": true,
        "items": {
          "type": "string",
          "pattern": "^[A-Za-z0-9][A-Za-z0-9_.-]{0,63}$"
        }
      },
      "AcceptedResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "status"
        ],
        "properties": {
          "status": {
            "const": "accepted"
          }
        }
      },
      "RejectedResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "status",
          "reason"
        ],
        "properties": {
          "status": {
            "const": "rejected"
          },
          "reason": {
            "type": "string",
            "enum": [
              "invalid payload",
              "unauthorized",
              "payload too large"
            ]
          }
        }
      },
      "ErrorResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "status"
        ],
        "properties": {
          "status": {
            "const": "error"
          }
        }
      },
      "SetFixedInBuild": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "op",
          "bugKeys",
          "build"
        ],
        "description": "Records the build that fixes one or more Bugs (the `fixedInBuild` issue property), or clears it with `build: null`. Each Bug must be in the API key's project and be a Bug (work type Bug, or the project's configured defect work type). Each Bug key counts one against the 25-operation work budget. One log outcome per Bug: `ok`, or `failed` with `invalid-key`, `invalid-project`, `not-found`, `not-a-bug` or `unexpected`.",
        "properties": {
          "op": {
            "const": "set-fixed-in-build"
          },
          "bugKeys": {
            "type": "array",
            "minItems": 1,
            "maxItems": 25,
            "items": {
              "$ref": "#/components/schemas/IssueKey"
            },
            "description": "Duplicates are ignored."
          },
          "build": {
            "type": [
              "string",
              "null"
            ],
            "minLength": 1,
            "maxLength": 100,
            "pattern": "^[^\\u0000-\\u001f\\u007f]+$",
            "description": "The build (printable characters, trimmed), or null to clear. Required, so an omitted value is never read as \"clear\"."
          },
          "commit": {
            "type": "string",
            "pattern": "^[0-9A-Fa-f]{7,40}$",
            "description": "Optional commit SHA (7–40 hex characters, stored lower-case). Not allowed with `build: null`."
          }
        },
        "if": {
          "properties": {
            "build": {
              "type": "null"
            }
          }
        },
        "then": {
          "not": {
            "required": [
              "commit"
            ]
          }
        }
      },
      "UploadEnvelope": {
        "type": "object",
        "additionalProperties": true,
        "required": [
          "encoding",
          "content"
        ],
        "description": "Body for the **Results URL** (`automation-results` web trigger), not the CI API. Send it with `Content-Type: application/json`. A body is treated as an envelope only when it is a JSON object with both `encoding` and `content`; any other body is processed as a raw report, exactly as before. A malformed envelope (unknown encoding, bad base64, empty content, unknown format) is refused with 400 and nothing is recorded. The query parameters are unchanged. A Nexus from before 28/09/2026 answers 400 to an envelope; the Nexus clients then send the raw file once.",
        "properties": {
          "encoding": {
            "type": "string",
            "enum": [
              "base64",
              "text"
            ],
            "description": "`base64` (preferred: survives any whitespace or character normalisation) or `text` (the report as a JSON string, for when base64 would pass the 5 MB cap)."
          },
          "content": {
            "type": "string",
            "minLength": 1,
            "description": "The report itself. Unwrapped, it may be at most 5 MB. For `base64`, standard base64 with padding and no line breaks."
          },
          "format": {
            "type": "string",
            "description": "Optional: one of the `&format=` names. `&format=` in the query wins, then this, then the unwrapped content is sniffed.",
            "enum": [
              "junit-xml",
              "json",
              "cucumber-json",
              "xunit-xml",
              "mocha-json",
              "playwright-json",
              "robot-xml",
              "nunit-xml",
              "testng-xml",
              "mochawesome-json",
              "newman-json"
            ]
          }
        },
        "examples": [
          {
            "format": "junit-xml",
            "encoding": "base64",
            "content": "PHRlc3RzdWl0ZT48L3Rlc3RzdWl0ZT4="
          }
        ]
      }
    },
    "parameters": {
      "NexusTimestamp": {
        "name": "X-Nexus-Timestamp",
        "in": "header",
        "required": false,
        "description": "When the request was sent: Unix seconds or milliseconds, or ISO-8601. Refused (400) when more than 5 minutes from Nexus's clock.",
        "schema": {
          "type": "string",
          "maxLength": 64
        }
      },
      "NexusNonce": {
        "name": "X-Nexus-Nonce",
        "in": "header",
        "required": false,
        "description": "A one-time value, new for every HTTP send (a retry included). Refused (400) when this API key already sent it.",
        "schema": {
          "type": "string",
          "pattern": "^[A-Za-z0-9._:-]{16,128}$"
        }
      },
      "IdempotencyKey": {
        "name": "Idempotency-Key",
        "in": "header",
        "required": false,
        "description": "The same value on every retry of the same request. For 24 hours after the batch finished, a repeat answers `accepted` without running again (still running: 500, send again shortly). Bound to the request: a different body or query under a used key is a new request.",
        "schema": {
          "type": "string",
          "pattern": "^[A-Za-z0-9._:-]{16,128}$"
        }
      }
    }
  },
  "x-nexus-results-upload": {
    "description": "The Results URL (Project Settings → CI) is a separate Forge web trigger. POST a test report to `<Results URL>?project=<KEY>` with `Authorization: Bearer <API key>`. Body: a raw report (`Content-Type: application/xml` or `application/json`), or the `UploadEnvelope`. Raw XML loses its line breaks in the Forge web trigger platform (confirmed live on 28/09/2026: `lf=0` on arrival), so stack traces and `<system-out>` arrive as one line; the envelope keeps them. Answers: 202 `{\"status\":\"accepted\"}`, 202 `{\"status\":\"partial\",...}` (send the same upload again to continue), 400 (also any method but POST: the trigger is static and cannot send 405), 401, 413 (over 5 MiB, or the per-project rate guard; platform-level 413 and 500 for a body the Forge platform itself refuses carry Atlassian's own body), 500.",
    "requestSchema": {
      "$ref": "#/components/schemas/UploadEnvelope"
    },
    "curlExample": "printf '{\"format\":\"junit-xml\",\"encoding\":\"base64\",\"content\":\"%s\"}' \"$(base64 < results.xml | tr -d '\\r\\n')\" > envelope.json && curl --fail --silent --show-error -X POST \"$NEXUS_URL?project=NEX\" -H \"Authorization: Bearer $NEXUS_API_KEY\" -H \"Content-Type: application/json\" --data-binary @envelope.json"
  }
}
