# Method: projects.jobs.searchForAlert

- [HTTP request](https://docs.cloud.google.com/talent-solution/job-search/v3/docs/reference/rest/v3p1beta1/projects.jobs/searchForAlert#body.HTTP_TEMPLATE)
- [Path parameters](https://docs.cloud.google.com/talent-solution/job-search/v3/docs/reference/rest/v3p1beta1/projects.jobs/searchForAlert#body.PATH_PARAMETERS)
- [Request body](https://docs.cloud.google.com/talent-solution/job-search/v3/docs/reference/rest/v3p1beta1/projects.jobs/searchForAlert#body.request_body)
  - [JSON representation](https://docs.cloud.google.com/talent-solution/job-search/v3/docs/reference/rest/v3p1beta1/projects.jobs/searchForAlert#body.request_body.SCHEMA_REPRESENTATION)
- [Response body](https://docs.cloud.google.com/talent-solution/job-search/v3/docs/reference/rest/v3p1beta1/projects.jobs/searchForAlert#body.response_body)
- [Authorization Scopes](https://docs.cloud.google.com/talent-solution/job-search/v3/docs/reference/rest/v3p1beta1/projects.jobs/searchForAlert#body.aspect)
- [Try it!](https://docs.cloud.google.com/talent-solution/job-search/v3/docs/reference/rest/v3p1beta1/projects.jobs/searchForAlert#try-it)

Searches for jobs using the provided `SearchJobsRequest`.

This API call is intended for the use case of targeting passive job seekers (for example, job seekers who have signed up to receive email alerts about potential job opportunities), and has different algorithmic adjustments that are targeted to passive job seekers.

This call constrains the `https://docs.cloud.google.com/talent-solution/job-search/v3/docs/reference/rest/v3p1beta1/projects.jobs#Job.FIELDS.visibility` of jobs present in the database, and only returns jobs the caller has permission to search against.

### HTTP request

`POST https://jobs.googleapis.com/v3p1beta1/{parent=projects/*}/jobs:searchForAlert`

The URL uses [gRPC Transcoding](https://github.com/googleapis/googleapis/blob/master/google/api/http.proto) syntax.

### Path parameters

| Parameters ||
|---|---|
| `parent` | `string` Required. The resource name of the project to search within. The format is "projects/{projectId}", for example, "projects/api-test-project". |

### Request body

The request body contains data with the following structure:

| JSON representation ||
|---|---|
| ``` { "searchMode": enum (`https://docs.cloud.google.com/talent-solution/job-search/v3/docs/reference/rest/v3p1beta1/SearchMode`), "requestMetadata": { object (`https://docs.cloud.google.com/talent-solution/job-search/v3/docs/reference/rest/v3p1beta1/RequestMetadata`) }, "jobQuery": { object (`https://docs.cloud.google.com/talent-solution/job-search/v3/docs/reference/rest/v3p1beta1/JobQuery`) }, "enableBroadening": boolean, "requirePreciseResultSize": boolean, "histogramFacets": { object (`https://docs.cloud.google.com/talent-solution/job-search/v3/docs/reference/rest/v3p1beta1/HistogramFacets`) }, "histogramQueries": [ { object (`https://docs.cloud.google.com/talent-solution/job-search/v3/docs/reference/rest/v3p1beta1/HistogramQuery`) } ], "jobView": enum (`https://docs.cloud.google.com/talent-solution/job-search/v3/docs/reference/rest/v3p1beta1/JobView`), "offset": integer, "pageSize": integer, "pageToken": string, "orderBy": string, "diversificationLevel": enum (`https://docs.cloud.google.com/talent-solution/job-search/v3/docs/reference/rest/v3p1beta1/DiversificationLevel`), "customRankingInfo": { object (`https://docs.cloud.google.com/talent-solution/job-search/v3/docs/reference/rest/v3p1beta1/CustomRankingInfo`) }, "disableKeywordMatch": boolean } ``` |

| Fields ||
|---|---|
| `searchMode` | ``enum (`https://docs.cloud.google.com/talent-solution/job-search/v3/docs/reference/rest/v3p1beta1/SearchMode`)`` Optional. Mode of a search. Defaults to `https://docs.cloud.google.com/talent-solution/job-search/v3/docs/reference/rest/v3p1beta1/SearchMode#ENUM_VALUES.JOB_SEARCH`. |
| `requestMetadata` | ``object (`https://docs.cloud.google.com/talent-solution/job-search/v3/docs/reference/rest/v3p1beta1/RequestMetadata`)`` Required. The meta information collected about the job searcher, used to improve the search quality of the service. The identifiers (such as `userId`) are provided by users, and must be unique and consistent. |
| `jobQuery` | ``object (`https://docs.cloud.google.com/talent-solution/job-search/v3/docs/reference/rest/v3p1beta1/JobQuery`)`` Optional. Query used to search against jobs, such as keyword, location filters, etc. |
| `enableBroadening` | `boolean` Optional. Controls whether to broaden the search when it produces sparse results. Broadened queries append results to the end of the matching results list. Defaults to false. |
| `requirePreciseResultSize (deprecated)` | `boolean` This field is deprecated. |
| `histogramFacets` | ``object (`https://docs.cloud.google.com/talent-solution/job-search/v3/docs/reference/rest/v3p1beta1/HistogramFacets`)`` Optional. Histogram requests for jobs matching `https://docs.cloud.google.com/talent-solution/job-search/v3/docs/reference/rest/v3p1beta1/JobQuery`. |
| `histogramQueries[]` | ``object (`https://docs.cloud.google.com/talent-solution/job-search/v3/docs/reference/rest/v3p1beta1/HistogramQuery`)`` Optional. Expression based histogram requests for jobs matching `https://docs.cloud.google.com/talent-solution/job-search/v3/docs/reference/rest/v3p1beta1/JobQuery`. |
| `jobView` | ``enum (`https://docs.cloud.google.com/talent-solution/job-search/v3/docs/reference/rest/v3p1beta1/JobView`)`` Optional. The desired job attributes returned for jobs in the search response. Defaults to \[JobView.SMALL\]\[\] if no value is specified. |
| `offset` | `integer` Optional. An integer that specifies the current offset (that is, starting result location, amongst the jobs deemed by the API as relevant) in search results. This field is only considered if `https://docs.cloud.google.com/talent-solution/job-search/v3/docs/reference/rest/v3p1beta1/projects.jobs/search#body.request_body.FIELDS.page_token` is unset. The maximum allowed value is 5000. Otherwise an error is thrown. For example, 0 means to return results starting from the first matching job, and 10 means to return from the 11th job. This can be used for pagination, (for example, pageSize = 10 and offset = 10 means to return from the second page). |
| `pageSize` | `integer` Optional. A limit on the number of jobs returned in the search results. Increasing this value above the default value of 10 can increase search response time. The value can be between 1 and 100. |
| `pageToken` | `string` Optional. The token specifying the current offset within search results. See `https://docs.cloud.google.com/talent-solution/job-search/v3/docs/reference/rest/v3p1beta1/SearchJobsResponse#FIELDS.next_page_token` for an explanation of how to obtain the next set of query results. |
| `orderBy` | `string` Optional. The criteria determining how search results are sorted. Default is "relevance desc". Supported options are: - `"relevance desc"`: By relevance descending, as determined by the API algorithms. Relevance thresholding of query results is only available with this ordering. - `"postingPublishTime desc"`: By `https://docs.cloud.google.com/talent-solution/job-search/v3/docs/reference/rest/v3p1beta1/projects.jobs#Job.FIELDS.posting_publish_time` descending. - `"postingUpdateTime desc"`: By `https://docs.cloud.google.com/talent-solution/job-search/v3/docs/reference/rest/v3p1beta1/projects.jobs#Job.FIELDS.posting_update_time` descending. - `"title"`: By `https://docs.cloud.google.com/talent-solution/job-search/v3/docs/reference/rest/v3p1beta1/projects.jobs#Job.FIELDS.title` ascending. - `"title desc"`: By `https://docs.cloud.google.com/talent-solution/job-search/v3/docs/reference/rest/v3p1beta1/projects.jobs#Job.FIELDS.title` descending. - `"annualized_base_compensation"`: By job's `https://docs.cloud.google.com/talent-solution/job-search/v3/docs/reference/rest/v3p1beta1/projects.jobs#CompensationInfo.FIELDS.annualized_base_compensation_range` ascending. Jobs whose annualized base compensation is unspecified are put at the end of search results. - `"annualized_base_compensation desc"`: By job's `https://docs.cloud.google.com/talent-solution/job-search/v3/docs/reference/rest/v3p1beta1/projects.jobs#CompensationInfo.FIELDS.annualized_base_compensation_range` descending. Jobs whose annualized base compensation is unspecified are put at the end of search results. - `"annualized_total_compensation"`: By job's `https://docs.cloud.google.com/talent-solution/job-search/v3/docs/reference/rest/v3p1beta1/projects.jobs#CompensationInfo.FIELDS.annualized_total_compensation_range` ascending. Jobs whose annualized base compensation is unspecified are put at the end of search results. - `"annualized_total_compensation desc"`: By job's `https://docs.cloud.google.com/talent-solution/job-search/v3/docs/reference/rest/v3p1beta1/projects.jobs#CompensationInfo.FIELDS.annualized_total_compensation_range` descending. Jobs whose annualized base compensation is unspecified are put at the end of search results. - `"custom_ranking desc"`: By the relevance score adjusted to the \[SearchJobsRequest.custom_ranking_info.ranking_expression\]\[\] with weight factor assigned by \[SearchJobsRequest.custom_ranking_info.importance_level\]\[\] in descending order. - Location sorting: Use the special syntax to order jobs by distance: "`distance_from('Hawaii')`": Order by distance from Hawaii. "`distance_from(19.89, 155.5)`": Order by distance from a coordinate. "`distance_from('Hawaii'), distance_from('Puerto Rico')`": Order by multiple locations. See details below. "`distance_from('Hawaii'), distance_from(19.89, 155.5)`": Order by multiple locations. See details below. The string can have a maximum of 256 characters. When multiple distance centers are provided, a job that is close to any of the distance centers would have a high rank. When a job has multiple locations, the job location closest to one of the distance centers will be used. Jobs that don't have locations will be ranked at the bottom. Distance is calculated with a precision of 11.3 meters (37.4 feet). Diversification strategy is still applied unless explicitly disabled in `https://docs.cloud.google.com/talent-solution/job-search/v3/docs/reference/rest/v3p1beta1/projects.jobs/search#body.request_body.FIELDS.diversification_level`. |
| `diversificationLevel` | ``enum (`https://docs.cloud.google.com/talent-solution/job-search/v3/docs/reference/rest/v3p1beta1/DiversificationLevel`)`` Optional. Controls whether highly similar jobs are returned next to each other in the search results. Jobs are identified as highly similar based on their titles, job categories, and locations. Highly similar results are clustered so that only one representative job of the cluster is displayed to the job seeker higher up in the results, with the other jobs being displayed lower down in the results. Defaults to `https://docs.cloud.google.com/talent-solution/job-search/v3/docs/reference/rest/v3p1beta1/DiversificationLevel#ENUM_VALUES.SIMPLE` if no value is specified. |
| `customRankingInfo` | ``object (`https://docs.cloud.google.com/talent-solution/job-search/v3/docs/reference/rest/v3p1beta1/CustomRankingInfo`)`` Optional. Controls over how job documents get ranked on top of existing relevance score (determined by API algorithm). |
| `disableKeywordMatch` | `boolean` Optional. Controls whether to disable exact keyword match on \[Job.job_title\]\[\], `https://docs.cloud.google.com/talent-solution/job-search/v3/docs/reference/rest/v3p1beta1/projects.jobs#Job.FIELDS.description`, `https://docs.cloud.google.com/talent-solution/job-search/v3/docs/reference/rest/v3p1beta1/projects.jobs#Job.FIELDS.company_display_name`, \[Job.locations\]\[0\], `https://docs.cloud.google.com/talent-solution/job-search/v3/docs/reference/rest/v3p1beta1/projects.jobs#Job.FIELDS.qualifications`. When disable keyword match is turned off, a keyword match returns jobs that do not match given category filters when there are matching keywords. For example, the query "program manager," a result is returned even if the job posting has the title "software developer," which does not fall into "program manager" ontology, but does have "program manager" appearing in its description. For queries like "cloud" that does not contain title or location specific ontology, jobs with "cloud" keyword matches are returned regardless of this flag's value. Please use \[Company.keyword_searchable_custom_fields\]\[\] or \[Company.keyword_searchable_custom_attributes\]\[\] if company specific globally matched custom field/attribute string values is needed. Enabling keyword match improves recall of subsequent search requests. Defaults to false. |

### Response body

If successful, the response body contains an instance of `https://docs.cloud.google.com/talent-solution/job-search/v3/docs/reference/rest/v3p1beta1/SearchJobsResponse`.

### Authorization Scopes

Requires one of the following OAuth scopes:

- `https://www.googleapis.com/auth/jobs`
- `https://www.googleapis.com/auth/cloud-platform`

For more information, see the [Authentication Overview](https://cloud.google.com/docs/authentication/).