---
title: "POST /v1/{+parent}/backends"
method: POST
path: "/v1/{+parent}/backends"
tags: ["projects"]
---

# POST /v1/{+parent}/backends

`POST /v1/{+parent}/backends`

Creates a new backend in a given project and location.

## Path parameters

- `parent` string, required

## Query parameters

- `backendId` string
- `requestId` string
- `validateOnly` boolean

## Request body

- Backend — A backend is the primary resource of App Hosting.
  - `deleteTime` string, google-datetime — Output only. Time at which the backend was deleted.
  - `requestLogsDisabled` boolean — Optional. A field that, if true, indicates that incoming request logs are disabled for this backend. Incoming request logs are enabled by default.
  - `etag` string — Output only. Server-computed checksum based on other values; may be sent on update or delete to ensure operation is done on expected resource.
  - `uri` string — Output only. The primary URI to communicate with the backend.
  - `createTime` string, google-datetime — Output only. Time at which the backend was created.
  - `updateTime` string, google-datetime — Output only. Time at which the backend was last updated.
  - `annotations` object — Optional. Unstructured key value map that may be set by external tools to store and arbitrary metadata. They are not queryable and should be preserved when modifying objects.
  - `managedResources` ManagedResource[] — Output only. A list of the resources managed by this backend.
    - `runService` RunService — A managed Cloud Run [`service`](https://cloud.google.com/run/docs/reference/rest/v2/projects.locations.services#resource:-service).
      - `service` string — Optional. The name of the Cloud Run [`service`](https://cloud.google.com/run/docs/reference/rest/v2/projects.locations.services#resource:-service), in the format: `projects/{project}/locations/{location}/services/{serviceId}`
  - `displayName` string — Optional. Human-readable name. 63 character limit.
  - `codebase` Codebase — The connection to an external source repository to watch for event-driven updates to the backend.
    - `repository` string — Required. The resource name for the Developer Connect [`gitRepositoryLink`](https://cloud.google.com/developer-connect/docs/api/reference/rest/v1/projects.locations.connections.gitRepositoryLinks) connected to this backend, in the format: `projects/{project}/locations/{location}/connections/{connection}/gitRepositoryLinks/{repositoryLink}` The connection for the `gitRepositoryLink` must made be using the Firebase App Hosting GitHub App via the Firebase Console.
    - `rootDirectory` string — Optional. If `repository` is provided, the directory relative to the root of the repository to use as the root for the deployed web app. Defaults to use the root of the repository if not provided. If deploying a [monorepo](https://firebase.google.com/docs/app-hosting/monorepos), this should be the directory that contains the `package.json` or `apphosting.yaml` file.
  - `mode` string — Optional. Deprecated: Use `environment` instead.
  - `servingLocality` 'SERVING_LOCALITY_UNSPECIFIED' | 'REGIONAL_STRICT' | 'GLOBAL_ACCESS' — Required. Immutable. Specifies how App Hosting will serve the content for this backend. It will either be contained to a single region (REGIONAL_STRICT) or allowed to use App Hosting's global-replicated serving infrastructure (GLOBAL_ACCESS).
  - `name` string — Identifier. The resource name of the backend. Format: `projects/{project}/locations/{locationId}/backends/{backendId}`.
  - `environment` string — Optional. The environment name of the backend, used to load environment variables from environment specific configuration.
  - `serviceAccount` string — Required. The name of the service account used for Cloud Build and Cloud Run. Should have the role roles/firebaseapphosting.computeRunner or equivalent permissions.
  - `uid` string — Output only. System-assigned, unique identifier.
  - `reconciling` boolean — Output only. A field that, if true, indicates that the system is working to make adjustments to the backend during a LRO.
  - `labels` object — Optional. Unstructured key value map that can be used to organize and categorize objects.
  - `appId` string — Optional. The [ID of a Web App](https://firebase.google.com/docs/reference/firebase-management/rest/v1beta1/projects.webApps#WebApp.FIELDS.app_id) associated with the backend.

## Response `200`

Successful response

---

[API](https://skmtc.dev/google/apis/firebaseapphosting.md) · [All operations](https://skmtc.dev/google/apis/firebaseapphosting/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/google/firebaseapphosting/revisions/487a88f26666/schema)
