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

# POST /v1/{+parent}/schemas

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

Creates a new Schema in a given project and location. Only creation of `schemas/main` is supported and calling create with any other schema ID will result in an error.

## Path parameters

- `parent` string, required

## Query parameters

- `requestId` string
- `schemaId` string
- `validateOnly` boolean

## Request body

- Schema — The application schema of a Firebase SQL Connect service.
  - `createTime` string, google-datetime — Output only. [Output only] Create time stamp.
  - `uid` string — Output only. System-assigned, unique identifier.
  - `source` Source — Used to represent a set of source files.
    - `files` File[] — Required. The files that comprise the source set.
      - `content` string — Required. The file's textual content.
      - `path` string — Required. The file name including folder path, if applicable. The path should be relative to a local workspace (e.g. dataconnect/(schema|connector)/*.gql) and not an absolute path (e.g. /absolute/path/(schema|connector)/*.gql).
  - `name` string — Identifier. The relative resource name of the schema, in the format: ``` projects/{project}/locations/{location}/services/{service}/schemas/{schema} ``` Right now, the only supported schema is "main".
  - `labels` object — Optional. Labels as key value pairs.
  - `etag` string — Output only. This checksum is computed by the server based on the value of other fields, and may be sent on update and delete requests to ensure the client has an up-to-date value before proceeding. [AIP-154](https://google.aip.dev/154)
  - `datasources` Datasource[] — Required. The data sources linked in the schema.
    - `postgresql` PostgreSql — Settings for PostgreSQL data source.
      - `schemaValidation` 'SQL_SCHEMA_VALIDATION_UNSPECIFIED' | 'NONE' | 'STRICT' | 'COMPATIBLE' — Optional. Configure how much PostgreSQL schema validation to perform against the live database before deploying the FDC schema.
      - `schemaMigration` 'SQL_SCHEMA_MIGRATION_UNSPECIFIED' | 'MIGRATE_COMPATIBLE' — Optional. Configure how to perform automatic PostgreSQL schema migration before deploying the FDC schema. This is an additive-only operation.
      - `ephemeral` boolean — Output only. Ephemeral is true if this SQL Connect service is served from temporary in-memory emulation of Postgres. While Cloud SQL is being provisioned, the SQL Connect service provides the ephemeral service to help developers get started. Once the Cloud SQL is provisioned, SQL Connect service will transfer its data on a best-effort basis to the Cloud SQL instance. WARNING: Ephemeral data sources will expire after 24 hour. The data will be lost if they aren't transferred to the Cloud SQL instance. WARNING: When `ephemeral=true`, mutations to the database are not guaranteed to be durably persisted, even if an OK status code is returned. All or parts of the data may be lost or reverted to earlier versions.
      - `schema` string — Optional. User-configured PostgreSQL schema. Defaults to "public" if not specified.
      - `database` string — Required. Name of the PostgreSQL database.
      - `unlinked` boolean — No Postgres data source is linked. If set, don't allow `database` and `schema_validation` to be configured.
      - `cloudSql` CloudSqlInstance — Settings for CloudSQL instance configuration.
        - `instance` string — Required. Name of the CloudSQL instance, in the format: ``` projects/{project}/locations/{location}/instances/{instance} ```
    - `httpGraphql` HttpGraphql — Settings for HTTP GraphQL server webhook.
      - `timeout` string, google-duration — Optional. Timeout duration for the HTTP request.
      - `uri` string — Required. The endpoint of the HTTP GraphQL server.
  - `annotations` object — Optional. Stores small amounts of arbitrary data.
  - `updateTime` string, google-datetime — Output only. [Output only] Update time stamp.
  - `reconciling` boolean — Output only. A field that if true, indicates that the system is working to compile and deploy the schema.
  - `displayName` string — Optional. Mutable human-readable name. 63 character limit.

## Response `200`

Successful response

---

[API](https://skmtc.net/google/apis/firebasedataconnect.md) · [All operations](https://skmtc.net/google/apis/firebasedataconnect/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/google/firebasedataconnect/versions/dda665bc52bd/schema)
