Skip to content

Commit 9e311d5

Browse files
KT-Doanunatasha8wassimoo
authored
docs: document deleting custom identity schemas (ory#2539)
* docs: document deleting custom identity schemas * Apply suggestions from code review Co-authored-by: unatasha8 <una.cogavin@ory.sh> * docs: clarify project-attachment constraint * docs: address review on schema deletion constraints Drop "currently" from the Console disabled-button note (an attachment is permanent for the project's lifetime, so it is never merely current) and replace "still in use" with the explicit "used by a project or referenced by an identity" condition. * docs: wrap long line to satisfy prettier --------- Co-authored-by: unatasha8 <una.cogavin@ory.sh> Co-authored-by: Wassim Bougarfa <12980387+wassimoo@users.noreply.github.com>
1 parent 55e65ba commit 9e311d5

1 file changed

Lines changed: 35 additions & 0 deletions

File tree

docs/identities/model/manage-identity-schema.mdx

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,41 @@ However, you can use the existing schema as a template to create a new schema. S
9898
It's recommended to manage identity schemas in version control. Learn more about
9999
[managing Ory Network configuration in git](../../guides/gitops).
100100

101+
## Delete a custom schema
102+
103+
You can delete a custom schema that you no longer need if the schema is not being used by a project or referenced by an identity.
104+
You can switch which schema your project uses, but a schema that has already been added to a project remains referenced by it.
105+
That reference is what blocks deletion.
106+
107+
Presets cannot be deleted.
108+
109+
<Tabs>
110+
<TabItem value="console" label="Ory Console" default>
111+
112+
1. Go to <ConsoleLink route="project.identitySchema" />.
113+
2. Find the schema you want to delete in the **Custom schemas** section.
114+
3. Open the row menu (three dots) and select **Delete schema**.
115+
4. Confirm the deletion in the dialog.
116+
117+
If **Delete schema** is disabled, the schema is attached to a project and cannot be deleted.
118+
119+
</TabItem>
120+
<TabItem value="curl" label="cURL">
121+
122+
Delete a schema through the Ory Network Console API using a
123+
[workspace API key](../../concepts/personal-access-token.mdx#authorizing-ory-network-workspace-admin-apis):
124+
125+
```shell
126+
curl -X DELETE "https://api.console.ory.sh/identity-schemas/$SCHEMA_ID" \
127+
-H "Authorization: Bearer $ORY_WORKSPACE_API_KEY"
128+
```
129+
130+
If the schema is used by a project or referenced by an identity, the API returns `409 Conflict` with the number of projects that
131+
reference it.
132+
133+
</TabItem>
134+
</Tabs>
135+
101136
## Update identities to use a new schema
102137

103138
Updating the identity schema of a project can result in inconsistencies between the new schema and the identities created with the

0 commit comments

Comments
 (0)