> ## Documentation Index
> Fetch the complete documentation index at: https://docs.sublay.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Publish Entity

> Publish a draft entity, making it publicly visible

> [!NOTE]
>
> **Requires the `entities` bundle.** A project without the entities bundle returns `403 database/tables-not-available`. See [Bundles](https://docs.sublay.io/v7/bundles.md).

Publishes a draft entity. After publishing, the entity appears in normal feeds and is visible to all users. The entity's `isDraft` field is set to `false` and `createdAt` is reset to the current time.

**Authentication required.** Only the entity's author, or a request with a service key, can publish a draft.

## Path Parameters

**entityId** `string` *required*

The UUID of the draft entity to publish.

## Response

Returns the published [Entity](https://docs.sublay.io/v7/data-models/entity.md) object with `isDraft: false`.

> [!NOTE]
>
> Publishing resets `createdAt` to the current time, so the entity appears as "new" in chronological feeds regardless of when the draft was created.

> [!NOTE]
>
> Mention notifications are sent when publishing, not when the draft is created. Users mentioned in the entity receive notifications at publish time.

## Error Responses

> [accordion] Not Found — 404
>
> ```json theme={null}
> { "error": "Draft entity not found", "code": "entity/not-found" }
> ```
>
> Returned when no draft with this ID exists (or the entity is not a draft).

> [accordion] Unauthorized — 403
>
> ```json theme={null}
> { "error": "Not authorized to publish this draft.", "code": "entity/unauthorized" }
> ```

> [accordion] Rejected by Validation Webhook — 400
>
> ```json theme={null}
> { "error": "Not now", "code": "entity/validation-failed" }
> ```
>
> Returned when your `entity.created` [validation webhook](https://docs.sublay.io/v7/webhooks.md) rejects the publish. `error` carries the `message` your webhook returned. The entity stays a draft.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.