---
title: "Create API Package Document"
method: POST
path: "/v3/api-packages/{packageId}/documents"
tags: ["API Package Documentation"]
---

# Create API Package Document

`POST /v3/api-packages/{packageId}/documents`

Publish a new document attached to an API Package.

All configuration options may be provided in the frontmatter section of `content`. If you set values in both the `POST` request _and_ in the frontmatter, the values in the `POST` request will take precedence.

## Request body

- object
  - `id` string, uuid — The API document identifier.
  - `content` string, required — Raw markdown content to display in your Portal
  - `title` string — The title of the document. Used to populate the `<title>` tag for the page
  - `slug` string — The `slug` is used in generated URLs to provide human readable paths. Defaults to `slugify(title)`
  - `status` 'published' | 'unpublished' — If `status=published` the document will be visible in your live portal
  - `parent_document_id` string, uuid, nullable — API Documents may be rendered as a tree of files. Specify the `id` of another API Document as the `parent_document_id` to add some heirarchy do your documents.
  - `created_at` string, date-time — An ISO-8601 timestamp representation of entity creation date.
  - `updated_at` string, date-time — An ISO-8601 timestamp representation of entity update date.

## Response `201`

API Package document

- object
  - `id` string, uuid, required — The API document identifier.
  - `content` string, required — Raw markdown content to display in your Portal
  - `title` string, required — The title of the document. Used to populate the `<title>` tag for the page
  - `slug` string, required — The `slug` is used in generated URLs to provide human readable paths. Defaults to `slugify(title)`
  - `status` 'published' | 'unpublished', required — If `status=published` the document will be visible in your live portal
  - `parent_document_id` string, uuid, nullable, required — API Documents may be rendered as a tree of files. Specify the `id` of another API Document as the `parent_document_id` to add some heirarchy do your documents.
  - `created_at` string, date-time, required — An ISO-8601 timestamp representation of entity creation date.
  - `updated_at` string, date-time, required — An ISO-8601 timestamp representation of entity update date.

## Other responses

- `400` — Bad Request
- `401` — ApiUnauthorized
- `403` — ApiForbidden
- `404` — Not Found
- `409` — Conflict - `slug` property must be unique
- `415` — Unsupported Media Type

---

[API](https://skmtc.net/kong/apis/konnect-api-go-sdk.md) · [All operations](https://skmtc.net/kong/apis/konnect-api-go-sdk/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/kong/konnect-api-go-sdk/versions/f920f418f552/schema)
