> For the complete documentation index, see [llms.txt](https://guardian.hedera.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://guardian.hedera.com/docs/3.7.0/developer-tools-and-resources/api-reference/schema-creation-using-apis.md).

# Schema APIs

Endpoints for creating, retrieving, updating, publishing, and deleting schemas in Guardian. Schemas define the structure of verifiable credential documents used in policies.

**Authentication:** Bearer token required (`Authorization: Bearer <token>`)

***

| Method   | Endpoint                                    | Description                                        | Auth Required |
| -------- | ------------------------------------------- | -------------------------------------------------- | ------------- |
| `GET`    | `/api/v1/schemas`                           | Returns all schemas accessible to the current user | Yes           |
| `POST`   | `/api/v1/schemas`                           | Creates a new schema                               | Yes           |
| `PUT`    | `/api/v1/schemas/{schemaId}`                | Updates a schema                                   | Yes           |
| `DELETE` | `/api/v1/schemas/{schemaId}`                | Deletes a schema                                   | Yes           |
| `PUT`    | `/api/v1/schemas/{schemaId}/publish`        | Publishes a schema                                 | Yes           |
| `POST`   | `/api/v1/schemas/import/message`            | Imports a schema from an IPFS message ID           | Yes           |
| `POST`   | `/api/v1/schemas/import/file`               | Imports a schema from a ZIP file                   | Yes           |
| `POST`   | `/api/v1/schemas/import/message/preview`    | Previews a schema from an IPFS message ID          | Yes           |
| `POST`   | `/api/v1/schemas/import/file/preview`       | Previews a schema from a ZIP file                  | Yes           |
| `GET`    | `/api/v1/schemas/{schemaId}/export/message` | Returns the schema IPFS message ID                 | Yes           |
| `GET`    | `/api/v1/schemas/{schemaId}/export/file`    | Exports a schema as a ZIP file                     | Yes           |
| `GET`    | `/api/v1/schemas/{topicId}`                 | Returns all schemas for the specified topic        | Yes           |
| `POST`   | `/api/v1/schemas/{topicId}`                 | Creates a schema under the specified topic         | Yes           |
| `GET`    | `/api/v1/schemas/{schemaId}/sub-schemas`    | Returns all child schemas                          | Yes           |
| `GET`    | `/api/v1/schemas/{schemaId}`                | Returns a schema by ID                             | Yes           |
| `GET`    | `/api/v1/schemas/{schemaId}/example`        | Returns a sample payload for the schema            | Yes           |
| `DELETE` | `/api/v1/schemas/{topicId}/all`             | Deletes all schemas under the topic                | Yes           |

## Endpoints

* [Returns All Schemas](https://guardian.hedera.com/docs/3.7.0/developer-tools-and-resources/api-reference/schema-creation-using-apis/creation-of-a-schema-1.md)
* [Creation of a Schema Related to the Topic](https://guardian.hedera.com/docs/3.7.0/developer-tools-and-resources/api-reference/schema-creation-using-apis/creation-of-schema-related-to-the-topic.md)
* [Updating Schema](https://guardian.hedera.com/docs/3.7.0/developer-tools-and-resources/api-reference/schema-creation-using-apis/updating-schema.md)
* [Deleting a Schema](https://guardian.hedera.com/docs/3.7.0/developer-tools-and-resources/api-reference/schema-creation-using-apis/deleting-a-schema.md)
* [Publishing Schema Based on Schema ID](https://guardian.hedera.com/docs/3.7.0/developer-tools-and-resources/api-reference/schema-creation-using-apis/publishing-schema-based-on-schema-id.md)
* [Importing Schema from IPFS](https://guardian.hedera.com/docs/3.7.0/developer-tools-and-resources/api-reference/schema-creation-using-apis/importing-schema-from-ipfs.md)
* [Importing ZIP File Containing Schema](https://guardian.hedera.com/docs/3.7.0/developer-tools-and-resources/api-reference/schema-creation-using-apis/importing-zip-file-containing-schema.md)
* [Schema Preview from IPFS](https://guardian.hedera.com/docs/3.7.0/developer-tools-and-resources/api-reference/schema-creation-using-apis/schema-preview-from-ipfs.md)
* [Schema Preview from ZIP](https://guardian.hedera.com/docs/3.7.0/developer-tools-and-resources/api-reference/schema-creation-using-apis/schema-preview-from-zip.md)
* [Export a Schema (Message ID)](https://guardian.hedera.com/docs/3.7.0/developer-tools-and-resources/api-reference/schema-creation-using-apis/export-a-schema.md)
* [Export a Schema (File)](https://guardian.hedera.com/docs/3.7.0/developer-tools-and-resources/api-reference/schema-creation-using-apis/export-a-schema-1.md)
* [Returns All Schemas Related to the Topic](https://guardian.hedera.com/docs/3.7.0/developer-tools-and-resources/api-reference/schema-creation-using-apis/returns-all-schemas-related-to-the-topic.md)
* [Returning Schema by Schema ID](https://guardian.hedera.com/docs/3.7.0/developer-tools-and-resources/api-reference/schema-creation-using-apis/returning-schema-by-schemaid.md)
* [Returns All Child Schemas](https://guardian.hedera.com/docs/3.7.0/developer-tools-and-resources/api-reference/schema-creation-using-apis/returns-all-child-schemas.md)
* [Returns a Sample Payload for the Schema](https://guardian.hedera.com/docs/3.7.0/developer-tools-and-resources/api-reference/schema-creation-using-apis/returns-a-sample-payload-for-the-schema-by-schema-id..md)
* [Previews List of Schema Duplicates](https://guardian.hedera.com/docs/3.7.0/developer-tools-and-resources/api-reference/schema-creation-using-apis/previews-list-of-schemas-duplicates.md)
* [Deletes All Schemas by Topic ID](https://guardian.hedera.com/docs/3.7.0/developer-tools-and-resources/api-reference/schema-creation-using-apis/deletes-all-schemas-by-topic-id.-only-users-with-the-standard-registry-are-allowed..md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://guardian.hedera.com/docs/3.7.0/developer-tools-and-resources/api-reference/schema-creation-using-apis.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
