# Method: projects.tenants.completeQuery

- [HTTP request](https://docs.cloud.google.com/talent-solution/job-search/docs/reference/rest/v4/projects.tenants/completeQuery#body.HTTP_TEMPLATE)
- [Path parameters](https://docs.cloud.google.com/talent-solution/job-search/docs/reference/rest/v4/projects.tenants/completeQuery#body.PATH_PARAMETERS)
- [Query parameters](https://docs.cloud.google.com/talent-solution/job-search/docs/reference/rest/v4/projects.tenants/completeQuery#body.QUERY_PARAMETERS)
- [Request body](https://docs.cloud.google.com/talent-solution/job-search/docs/reference/rest/v4/projects.tenants/completeQuery#body.request_body)
- [Response body](https://docs.cloud.google.com/talent-solution/job-search/docs/reference/rest/v4/projects.tenants/completeQuery#body.response_body)
  - [JSON representation](https://docs.cloud.google.com/talent-solution/job-search/docs/reference/rest/v4/projects.tenants/completeQuery#body.CompleteQueryResponse.SCHEMA_REPRESENTATION)
- [Authorization scopes](https://docs.cloud.google.com/talent-solution/job-search/docs/reference/rest/v4/projects.tenants/completeQuery#body.aspect)
- [CompletionScope](https://docs.cloud.google.com/talent-solution/job-search/docs/reference/rest/v4/projects.tenants/completeQuery#CompletionScope)
- [CompletionType](https://docs.cloud.google.com/talent-solution/job-search/docs/reference/rest/v4/projects.tenants/completeQuery#CompletionType)
- [CompletionResult](https://docs.cloud.google.com/talent-solution/job-search/docs/reference/rest/v4/projects.tenants/completeQuery#CompletionResult)
  - [JSON representation](https://docs.cloud.google.com/talent-solution/job-search/docs/reference/rest/v4/projects.tenants/completeQuery#CompletionResult.SCHEMA_REPRESENTATION)
- [Try it!](https://docs.cloud.google.com/talent-solution/job-search/docs/reference/rest/v4/projects.tenants/completeQuery#try-it)

Completes the specified prefix with keyword suggestions. Intended for use by a job search auto-complete search box.

### HTTP request

`GET https://jobs.googleapis.com/v4/{tenant=projects/*/tenants/*}:completeQuery`

The URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.

### Path parameters

| Parameters ||
|---|---|
| `tenant` | `string` Required. Resource name of tenant the completion is performed within. The format is "projects/{projectId}/tenants/{tenantId}", for example, "projects/foo/tenants/bar". |

### Query parameters

| Parameters ||
|---|---|
| `query` | `string` Required. The query used to generate suggestions. The maximum number of allowed characters is 255. |
| `languageCodes[]` | `string` The list of languages of the query. This is the BCP-47 language code, such as "en-US" or "sr-Latn". For more information, see [Tags for Identifying Languages](https://tools.ietf.org/html/bcp47). The maximum number of allowed characters is 255. |
| `pageSize` | `integer` Required. Completion result count. The maximum allowed page size is 10. |
| `company` | `string` If provided, restricts completion to specified company. The format is "projects/{projectId}/tenants/{tenantId}/companies/{company_id}", for example, "projects/foo/tenants/bar/companies/baz". |
| `scope` | ``enum (`https://docs.cloud.google.com/talent-solution/job-search/docs/reference/rest/v4/projects.tenants/completeQuery#CompletionScope`)`` The scope of the completion. The defaults is `https://docs.cloud.google.com/talent-solution/job-search/docs/reference/rest/v4/projects.tenants/completeQuery#CompletionScope.ENUM_VALUES.PUBLIC`. |
| `type` | ``enum (`https://docs.cloud.google.com/talent-solution/job-search/docs/reference/rest/v4/projects.tenants/completeQuery#CompletionType`)`` The completion topic. The default is `https://docs.cloud.google.com/talent-solution/job-search/docs/reference/rest/v4/projects.tenants/completeQuery#CompletionType.ENUM_VALUES.COMBINED`. |

### Request body

The request body must be empty.

### Response body

Response of auto-complete query.

If successful, the response body contains data with the following structure:

| JSON representation |
|---|
| ``` { "completionResults": [ { object (`https://docs.cloud.google.com/talent-solution/job-search/docs/reference/rest/v4/projects.tenants/completeQuery#CompletionResult`) } ], "metadata": { object (`https://docs.cloud.google.com/talent-solution/job-search/docs/reference/rest/v4/ResponseMetadata`) } } ``` |

| Fields ||
|---|---|
| `completionResults[]` | ``object (`https://docs.cloud.google.com/talent-solution/job-search/docs/reference/rest/v4/projects.tenants/completeQuery#CompletionResult`)`` Results of the matching job/company candidates. |
| `metadata` | ``object (`https://docs.cloud.google.com/talent-solution/job-search/docs/reference/rest/v4/ResponseMetadata`)`` Additional information for the API invocation, such as the request tracking id. |

### 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/external/authorization-gcp).

## CompletionScope

Enum to specify the scope of completion.

| Enums ||
|---|---|
| `COMPLETION_SCOPE_UNSPECIFIED` | Default value. |
| `TENANT` | Suggestions are based only on the data provided by the client. |
| `PUBLIC` | Suggestions are based on all jobs data in the system that's visible to the client |

## CompletionType

Enum to specify auto-completion topics.

| Enums ||
|---|---|
| `COMPLETION_TYPE_UNSPECIFIED` | Default value. |
| `JOB_TITLE` | Suggest job titles for jobs autocomplete. For `https://docs.cloud.google.com/talent-solution/job-search/docs/reference/rest/v4/projects.tenants/completeQuery#CompletionType.ENUM_VALUES.JOB_TITLE` type, only open jobs with the same `https://docs.cloud.google.com/talent-solution/job-search/docs/reference/rest/v4/projects.tenants/completeQuery#body.QUERY_PARAMETERS.language_codes` are returned. |
| `COMPANY_NAME` | Suggest company names for jobs autocomplete. For `https://docs.cloud.google.com/talent-solution/job-search/docs/reference/rest/v4/projects.tenants/completeQuery#CompletionType.ENUM_VALUES.COMPANY_NAME` type, only companies having open jobs with the same `https://docs.cloud.google.com/talent-solution/job-search/docs/reference/rest/v4/projects.tenants/completeQuery#body.QUERY_PARAMETERS.language_codes` are returned. |
| `COMBINED` | Suggest both job titles and company names for jobs autocomplete. For `https://docs.cloud.google.com/talent-solution/job-search/docs/reference/rest/v4/projects.tenants/completeQuery#CompletionType.ENUM_VALUES.COMBINED` type, only open jobs with the same `https://docs.cloud.google.com/talent-solution/job-search/docs/reference/rest/v4/projects.tenants/completeQuery#body.QUERY_PARAMETERS.language_codes` or companies having open jobs with the same `https://docs.cloud.google.com/talent-solution/job-search/docs/reference/rest/v4/projects.tenants/completeQuery#body.QUERY_PARAMETERS.language_codes` are returned. |

## CompletionResult

Resource that represents completion results.

| JSON representation |
|---|
| ``` { "suggestion": string, "type": enum (`https://docs.cloud.google.com/talent-solution/job-search/docs/reference/rest/v4/projects.tenants/completeQuery#CompletionType`), "imageUri": string } ``` |

| Fields ||
|---|---|
| `suggestion` | `string` The suggestion for the query. |
| `type` | ``enum (`https://docs.cloud.google.com/talent-solution/job-search/docs/reference/rest/v4/projects.tenants/completeQuery#CompletionType`)`` The completion topic. |
| `imageUri` | `string` The URI of the company image for `https://docs.cloud.google.com/talent-solution/job-search/docs/reference/rest/v4/projects.tenants/completeQuery#CompletionType.ENUM_VALUES.COMPANY_NAME`. |