---
title: "POST /v1/projects/{projectsId}/locations/{locationsId}/hostProjectRegistrations"
method: POST
path: "/v1/projects/{projectsId}/locations/{locationsId}/hostProjectRegistrations"
tags: ["projects"]
---

# POST /v1/projects/{projectsId}/locations/{locationsId}/hostProjectRegistrations

`POST /v1/projects/{projectsId}/locations/{locationsId}/hostProjectRegistrations`

## Request

- Base URL: `https://apihub.googleapis.com`
- URL: `https://apihub.googleapis.com/v1/projects/{projectsId}/locations/{locationsId}/hostProjectRegistrations`
- Auth: one of:
  - OAuth 2 and OAuth 2
    - Implicit: `https://accounts.google.com/o/oauth2/auth`
    - Scopes: `https://www.googleapis.com/auth/apihub.readwrite`
    - Authorization code: `https://accounts.google.com/o/oauth2/auth`
    - Token URL: `https://accounts.google.com/o/oauth2/token` scopes: `https://www.googleapis.com/auth/apihub.readwrite`
  - OAuth 2 and OAuth 2
    - Implicit: `https://accounts.google.com/o/oauth2/auth`
    - Scopes: `https://www.googleapis.com/auth/cloud-platform`
    - Authorization code: `https://accounts.google.com/o/oauth2/auth`
    - Token URL: `https://accounts.google.com/o/oauth2/token` scopes: `https://www.googleapis.com/auth/cloud-platform`
- TypeScript: <https://skmtc.dev/google/apis/apihub/docs/v1/projects/:projectsId/locations/:locationsId/hostProjectRegistrations/post.ts> (a function with typed inputs; its response is checked against the schema)

Create a host project registration. A Google cloud project can be registered as a host project if it is not attached as a runtime project to another host project. A project can have only one host project registration at a time. Subsequent register calls for the same project will fail until the existing registration is deleted.

## Path parameters

- `projectsId` string, required
- `locationsId` string, required

## Query parameters

- `hostProjectRegistrationId` string

## Request body

- GoogleCloudApihubV1HostProjectRegistration: Host project registration refers to the registration of a Google cloud project with Api Hub as a host project. This is the project where Api Hub is provisioned. It acts as the consumer project for the Api Hub instance provisioned. Multiple runtime projects can be attached to the host project and these attachments define the scope of Api Hub.
  - `createTime` string, google-datetime: Output only. The time at which the host project registration was created.
  - `gcpProject` string: Required. Immutable. Google cloud project name in the format: "projects/abc" or "projects/123". As input, project name with either project id or number are accepted. As output, this field will contain project number.
  - `name` string: Identifier. The name of the host project registration. Format: "projects/{project}/locations/{location}/hostProjectRegistrations/{host_project_registration}".

## Response `200`

Successful response

- GoogleCloudApihubV1HostProjectRegistration: Host project registration refers to the registration of a Google cloud project with Api Hub as a host project. This is the project where Api Hub is provisioned. It acts as the consumer project for the Api Hub instance provisioned. Multiple runtime projects can be attached to the host project and these attachments define the scope of Api Hub.
  - `createTime` string, google-datetime: Output only. The time at which the host project registration was created.
  - `gcpProject` string: Required. Immutable. Google cloud project name in the format: "projects/abc" or "projects/123". As input, project name with either project id or number are accepted. As output, this field will contain project number.
  - `name` string: Identifier. The name of the host project registration. Format: "projects/{project}/locations/{location}/hostProjectRegistrations/{host_project_registration}".

## Changes

- **2026-11-08** `09b6c7d2247b`: 4 info
  - the security scope `https://www.googleapis.com/auth/apihub.readwrite` was added to the endpoint's security scheme `Oauth2`
  - the security scope `https://www.googleapis.com/auth/apihub.readwrite` was added to the endpoint's security scheme `Oauth2c`
  - the security scope `https://www.googleapis.com/auth/cloud-platform` was removed from the endpoint's security scheme `Oauth2`
  - the security scope `https://www.googleapis.com/auth/cloud-platform` was removed from the endpoint's security scheme `Oauth2c`

[Operation history](https://skmtc.dev/google/apis/apihub/changes/v1/projects/:projectsId/locations/:locationsId/hostProjectRegistrations/post.md)

---

[API](https://skmtc.dev/google/apis/apihub.md) - [All operations](https://skmtc.dev/google/apis/apihub/llms.txt) - [OpenAPI document](https://skmtc.dev/google/apis/apihub/revisions/09b6c7d2247b?raw)
