> 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/develop/guardian/standard-registry/schemas/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](/docs/develop/guardian/standard-registry/schemas/schema-creation-using-apis/creation-of-a-schema-1.md)
* [Creation of a Schema Related to the Topic](/docs/develop/guardian/standard-registry/schemas/schema-creation-using-apis/creation-of-schema-related-to-the-topic.md)
* [Updating Schema](/docs/develop/guardian/standard-registry/schemas/schema-creation-using-apis/updating-schema.md)
* [Deleting a Schema](/docs/develop/guardian/standard-registry/schemas/schema-creation-using-apis/deleting-a-schema.md)
* [Publishing Schema Based on Schema ID](/docs/develop/guardian/standard-registry/schemas/schema-creation-using-apis/publishing-schema-based-on-schema-id.md)
* [Importing Schema from IPFS](/docs/develop/guardian/standard-registry/schemas/schema-creation-using-apis/importing-schema-from-ipfs.md)
* [Importing ZIP File Containing Schema](/docs/develop/guardian/standard-registry/schemas/schema-creation-using-apis/importing-zip-file-containing-schema.md)
* [Schema Preview from IPFS](/docs/develop/guardian/standard-registry/schemas/schema-creation-using-apis/schema-preview-from-ipfs.md)
* [Schema Preview from ZIP](/docs/develop/guardian/standard-registry/schemas/schema-creation-using-apis/schema-preview-from-zip.md)
* [Export a Schema (Message ID)](/docs/develop/guardian/standard-registry/schemas/schema-creation-using-apis/export-a-schema.md)
* [Export a Schema (File)](/docs/develop/guardian/standard-registry/schemas/schema-creation-using-apis/export-a-schema-1.md)
* [Returns All Schemas Related to the Topic](/docs/develop/guardian/standard-registry/schemas/schema-creation-using-apis/returns-all-schemas-related-to-the-topic.md)
* [Returning Schema by Schema ID](/docs/develop/guardian/standard-registry/schemas/schema-creation-using-apis/returning-schema-by-schemaid.md)
* [Returns All Child Schemas](/docs/develop/guardian/standard-registry/schemas/schema-creation-using-apis/returns-all-child-schemas.md)
* [Returns a Sample Payload for the Schema](/docs/develop/guardian/standard-registry/schemas/schema-creation-using-apis/returns-a-sample-payload-for-the-schema-by-schema-id..md)
* [Previews List of Schema Duplicates](/docs/develop/guardian/standard-registry/schemas/schema-creation-using-apis/previews-list-of-schemas-duplicates.md)
* [Deletes All Schemas by Topic ID](/docs/develop/guardian/standard-registry/schemas/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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://guardian.hedera.com/docs/develop/guardian/standard-registry/schemas/schema-creation-using-apis.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
