---
title: "Update a schema"
method: PUT
path: "/groups/{groupId}/apps/{appId}/schemas/{schemaId}"
tags: ["schemas"]
---

# Update a schema

`PUT /groups/{groupId}/apps/{appId}/schemas/{schemaId}`

Replace an existing [schema](https://www.mongodb.com/docs/atlas/app-services/schemas) with a new one.

## Request body

- FullSchema
  - `metadata` SchemaMetadata — Metadata that describes which linked collection the schema applies to.
    - `data_source` string — The data source name.
    - `database` string — The database name.
    - `collection` string — The collection name.
  - `schema` SchemaDefinition — A valid [schema](https://www.mongodb.com/docs/atlas/app-services/schemas) for the collection.
    - `bsonType` 'object' | 'array' | 'string' | 'number' | 'int' | 'long' | 'double' | 'decimal' | 'date' | 'timestamp' | 'bool' | 'null' | 'regex' | 'objectId' | 'binary' | 'uuid' | 'function' | 'javascript' | 'symbol' | 'minKey' | 'maxKey' — The [BSON type](https://www.mongodb.com/docs/atlas/app-services/schemas/types/#std-label-schema-types) of the field.
    - `title` string — A human-readable title for the schema.
    - `required` string[] — For `object` schemas, an array of field names that are required in instances of the object.
    - `properties` object — An object where each field name is a property in the schema. The corresponding value is a [schema](https://www.mongodb.com/docs/atlas/app-services/schemas/types/#std-label-schema-types) definition for that field.
  - `relationships` SchemaRelationships — Relationships to foreign collections. Each field name is a property in the schema. The corresponding value is a [relationship](https://www.mongodb.com/docs/atlas/app-services/schemas/relationships/) definition for that field.

## Response `204`

No Content

---

[API](https://skmtc.net/mongodb/apis/mongodb-atlas-app-services-admin-api.md) · [All operations](https://skmtc.net/mongodb/apis/mongodb-atlas-app-services-admin-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/mongodb/mongodb-atlas-app-services-admin-api/revisions/1365ab72bc03/schema)
