{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/currents-dev/json-schema/currents-dev-create-run-context-links-response-schema.json",
  "title": "CreateRunContextLinksResponse",
  "x-generated": "2026-11-04",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/currents-dev-openapi.yml#/components/schemas/CreateRunContextLinksResponse",
  "type": "object",
  "properties": {
    "status": {
      "type": "string",
      "enum": [
        "OK"
      ]
    },
    "data": {
      "type": "object",
      "properties": {
        "runId": {
          "type": "string"
        },
        "links": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "instanceId",
              "testId",
              "url"
            ],
            "oneOf": [
              {
                "title": "Link",
                "required": [
                  "expiresAt"
                ],
                "properties": {
                  "url": {
                    "type": "string"
                  }
                },
                "not": {
                  "required": [
                    "reason"
                  ]
                }
              },
              {
                "title": "No link",
                "required": [
                  "reason"
                ],
                "properties": {
                  "url": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "enum": [
                      null
                    ]
                  }
                },
                "not": {
                  "required": [
                    "expiresAt"
                  ]
                }
              }
            ],
            "properties": {
              "instanceId": {
                "type": "string"
              },
              "testId": {
                "type": "string"
              },
              "url": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Link to the failure context, in markdown; null with a `reason`"
              },
              "expiresAt": {
                "type": "string",
                "format": "date-time"
              },
              "reason": {
                "type": "string",
                "enum": [
                  "not_found",
                  "not_complete",
                  "not_failed"
                ],
                "description": "Why the test got no link. `not_found`: the ids name different tests, or the test was recorded more than 24 hours ago. `not_complete`: still running or not recorded yet; ask again after `Retry-After`. `not_failed`: the test didn't fail."
              }
            }
          }
        }
      }
    }
  }
}