# Method: projects.locations.customClasses.create

- [HTTP request](https://docs.cloud.google.com/speech-to-text/docs/reference/rest/v2/projects.locations.customClasses/create#body.HTTP_TEMPLATE)
- [Path parameters](https://docs.cloud.google.com/speech-to-text/docs/reference/rest/v2/projects.locations.customClasses/create#body.PATH_PARAMETERS)
- [Query parameters](https://docs.cloud.google.com/speech-to-text/docs/reference/rest/v2/projects.locations.customClasses/create#body.QUERY_PARAMETERS)
- [Request body](https://docs.cloud.google.com/speech-to-text/docs/reference/rest/v2/projects.locations.customClasses/create#body.request_body)
- [Response body](https://docs.cloud.google.com/speech-to-text/docs/reference/rest/v2/projects.locations.customClasses/create#body.response_body)
- [Authorization scopes](https://docs.cloud.google.com/speech-to-text/docs/reference/rest/v2/projects.locations.customClasses/create#body.aspect)
- [IAM Permissions](https://docs.cloud.google.com/speech-to-text/docs/reference/rest/v2/projects.locations.customClasses/create#body.aspect_1)

Creates a `https://docs.cloud.google.com/speech-to-text/docs/reference/rest/v2/projects.locations.customClasses#CustomClass`.

### HTTP request

`POST https://speech.googleapis.com/v2/{parent=projects/*/locations/*}/customClasses`

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

### Path parameters

| Parameters ||
|---|---|
| `parent` | `string` Required. The project and location where this CustomClass will be created. The expected format is `projects/{project}/locations/{location}`. |

### Query parameters

| Parameters ||
|---|---|
| `validateOnly` | `boolean` If set, validate the request and preview the CustomClass, but do not actually create it. |
| `customClassId` | `string` The ID to use for the CustomClass, which will become the final component of the CustomClass's resource name. This value should be 4-63 characters, and valid characters are /\[a-z\]\[0-9\]-/. |

### Request body

The request body contains an instance of `https://docs.cloud.google.com/speech-to-text/docs/reference/rest/v2/projects.locations.customClasses#CustomClass`.

### Response body

If successful, the response body contains a newly created instance of `https://docs.cloud.google.com/speech-to-text/docs/reference/rest/Shared.Types/ListOperationsResponse#Operation`.

### Authorization scopes

Requires the following OAuth scope:

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

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

### IAM Permissions

Requires the following [IAM](https://cloud.google.com/iam/docs) permission on the `parent` resource:

- `speech.customClasses.create`

For more information, see the [IAM documentation](https://cloud.google.com/iam/docs).