---
updatedAt: 2026-07-26T12:31:37.000Z
agentTools:
  siteIndex: https://docs.jfrog.com/llms.txt
  projectIndex: https://docs.jfrog.com/security/llms.txt
---

# Get Watch

Gets a named Watch by its name.

**Notes:**
- For Xray version 3.21.2 and above with Projects, a Project Admin with Manage Security Assets privilege can get a Watch in the scope of a project by using the `projectKey` query parameter.
- A Watch can include both Global and Project Policies.

Requires the 'Manage Watches' role to be set on the User or Group level.

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "Xray REST APIs",
    "description": "Combined JFrog Xray REST API specification (all endpoints).",
    "version": "3.140"
  },
  "servers": [
    {
      "url": "https://jf.example.com/xray",
      "description": "JFrog Platform (Xray)"
    }
  ],
  "security": [
    {
      "basicAuth": []
    }
  ],
  "paths": {
    "/api/v2/watches/{name}": {
      "get": {
        "operationId": "get-watch_watches-v2-openapi",
        "summary": "Get Watch",
        "description": "Gets a named Watch by its name.\n\n**Notes:**\n- For Xray version 3.21.2 and above with Projects, a Project Admin with Manage Security Assets privilege can get a Watch in the scope of a project by using the `projectKey` query parameter.\n- A Watch can include both Global and Project Policies.\n\nRequires the 'Manage Watches' role to be set on the User or Group level.",
        "tags": [
          "Watches V2"
        ],
        "parameters": [
          {
            "name": "name",
            "in": "path",
            "description": "Name of the Watch to retrieve.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "projectKey",
            "in": "query",
            "description": "Project key for retrieval of a project-scoped Watch.",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success - Watch retrieved",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WatchApiV2Request"
                },
                "example": {
                  "general_data": {
                    "id": "56sdf564b0fe4dc29f64cdfs564",
                    "name": "vuln-prod",
                    "description": "This is a new watch created using API V2",
                    "active": true
                  },
                  "project_resources": {
                    "resources": [
                      {
                        "type": "repository",
                        "bin_mgr_id": "art-prod-eu",
                        "name": "libs-release-local",
                        "filters": [
                          {
                            "type": "regex",
                            "value": ".*"
                          }
                        ]
                      }
                    ]
                  },
                  "assigned_policies": [
                    {
                      "name": "medium_policy",
                      "type": "security"
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Failed to get watch: Watch name is empty",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Failed to get watch: no permissions",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Watch not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Failed to get Watch",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "basicAuth": {
        "type": "http",
        "scheme": "basic",
        "description": "Basic authentication using username/password or API key"
      }
    },
    "schemas": {
      "WatchApiV2Request": {
        "type": "object",
        "description": "Request body for creating or updating a Watch in Xray.",
        "required": [
          "general_data"
        ],
        "properties": {
          "general_data": {
            "type": "object",
            "description": "General information about the Watch.",
            "required": [
              "name"
            ],
            "properties": {
              "name": {
                "type": "string",
                "minLength": 1,
                "maxLength": 255,
                "description": "Name of the Watch. Must be between 1 and 255 characters."
              },
              "description": {
                "type": "string",
                "description": "Description of the Watch."
              },
              "active": {
                "type": "boolean",
                "description": "Indicates if the Watch is active. Defaults to true if project_resources is included, false otherwise."
              }
            }
          },
          "project_resources": {
            "type": "object",
            "description": "Resources the Watch monitors and their filters.",
            "properties": {
              "resources": {
                "type": "array",
                "description": "List of resources to watch.",
                "items": {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "description": "Type of the resource to watch.",
                      "enum": [
                        "repository",
                        "build",
                        "releaseBundle",
                        "releaseBundleV2",
                        "all-repos",
                        "all-builds",
                        "all-releaseBundles",
                        "all-releaseBundlesV2",
                        "all-projects",
                        "project",
                        "gitRepository"
                      ]
                    },
                    "name": {
                      "type": "string",
                      "description": "Name of the resource."
                    },
                    "bin_mgr_id": {
                      "type": "string",
                      "description": "Binary manager ID. Omit or set to default."
                    },
                    "repo_type": {
                      "type": "string",
                      "description": "Type of repository (local or remote). Relevant only for repository resources.",
                      "enum": [
                        "local",
                        "remote"
                      ]
                    },
                    "build_repo": {
                      "type": "string",
                      "description": "The build or bundle repository. Relevant only for resources under a project."
                    },
                    "project": {
                      "type": "string",
                      "description": "Project key for the resource."
                    },
                    "filters": {
                      "type": "array",
                      "description": "Filters to apply to the resource.",
                      "items": {
                        "type": "object",
                        "properties": {
                          "type": {
                            "type": "string",
                            "description": "Filter type. Acceptable types depend on the resource type.",
                            "enum": [
                              "regex",
                              "path-regex",
                              "package-type",
                              "mime-type",
                              "property",
                              "ant-patterns",
                              "path-ant-patterns"
                            ]
                          },
                          "value": {
                            "description": "Filter value. Type depends on filter type: string for regex/path-regex/package-type/mime-type, object with IncludePatterns/ExcludePatterns arrays for ant-patterns/path-ant-patterns, or object with key/value for property."
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "type"
                  ]
                }
              },
              "global_filters": {
                "type": "array",
                "description": "Global filters applied across all resources.",
                "items": {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "description": "Filter type."
                    },
                    "value": {
                      "description": "Filter value."
                    }
                  }
                }
              }
            }
          },
          "assigned_policies": {
            "type": "array",
            "description": "Policies assigned to the Watch.",
            "items": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string",
                  "description": "Name of the policy."
                },
                "type": {
                  "type": "string",
                  "description": "Type of the policy.",
                  "enum": [
                    "security",
                    "license",
                    "operational_risk"
                  ]
                }
              },
              "required": [
                "name",
                "type"
              ]
            }
          },
          "watch_recipients": {
            "type": "array",
            "description": "Email addresses that will receive Watch notifications.",
            "items": {
              "type": "string"
            }
          },
          "create_ticket_enabled": {
            "type": "boolean",
            "description": "Indicates whether Jira ticket creation is enabled for this Watch."
          },
          "ticket_profile": {
            "type": "string",
            "description": "Jira profile name for ticket generation."
          },
          "ticket_generation": {
            "type": "object",
            "description": "Ticket generation settings for the Watch.",
            "properties": {
              "create_duplicate_tickets": {
                "type": "object",
                "description": "Settings for creating duplicate tickets.",
                "properties": {
                  "by_version": {
                    "type": "object",
                    "description": "Settings for creating duplicate tickets by version.",
                    "properties": {
                      "build": {
                        "type": "boolean",
                        "description": "Create duplicate tickets for builds."
                      },
                      "package": {
                        "type": "boolean",
                        "description": "Create duplicate tickets for packages."
                      },
                      "release_bundle": {
                        "type": "boolean",
                        "description": "Create duplicate tickets for release bundles."
                      }
                    }
                  }
                }
              },
              "impact_path_profiles_mapping": {
                "type": "object",
                "description": "Mapping of impact path profiles.",
                "properties": {
                  "include": {
                    "type": "array",
                    "description": "Impact path to Jira profile mappings.",
                    "items": {
                      "type": "object",
                      "properties": {
                        "profile": {
                          "type": "string",
                          "description": "Jira profile name."
                        },
                        "pattern": {
                          "type": "string",
                          "description": "Pattern for the impact path."
                        }
                      },
                      "required": [
                        "profile",
                        "pattern"
                      ]
                    }
                  }
                }
              },
              "create_tickets_for_ignored_violation": {
                "type": "boolean",
                "description": "Whether to create Jira tickets for policy violations that have been marked as ignored."
              }
            }
          }
        }
      }
    }
  },
  "tags": [
    {
      "name": "Watches V2",
      "description": "APIs from Watches V2"
    }
  ]
}
```