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

# Share published documents via public links

> Create share tokens that give anyone view access to a published document without a login, and revoke them instantly when access is no longer needed.

Share tokens give anyone with the link read-only access to a published document. No DocInject account required. Use them to share SOPs with external contractors, embed documents in other tools, or distribute guides across your organization without managing permissions.

## How share tokens work

Each share token is a unique string tied to a single document. The public URL follows this format:

```
https://app.docinject.com/embed/{org_slug}/{token}
```

Anyone who has this URL can view the document. The link remains active as long as the token exists and the document is published.

<Note>
  Each document can have only one active share token at a time. Creating a new token replaces the existing one and immediately invalidates the old URL.
</Note>

## Create a share link

<Steps>
  <Step title="Open a published document">
    Navigate to the document. It must have a **Published** status. Draft and archived documents cannot have share tokens.
  </Step>

  <Step title="Click Embed">
    Click **Embed** in the document toolbar.
  </Step>

  <Step title="Create the link">
    If no token exists, click **Create embed link**. DocInject creates a token and displays the public URL alongside an iframe snippet.
  </Step>

  <Step title="Copy and share the URL">
    Copy the **Embed URL** and send it to anyone who needs access.
  </Step>
</Steps>

## Find your share links

All active share links for your organization appear on the **Dashboard** under the **Shareable links** section. Each entry shows the document title and the full URL, with a one-click copy button.

## Revoke a share link

Open the **Embed** modal and click **Remove link**. The token is deleted immediately. Anyone who tries to open the old URL will see a "document not available" message.

The public endpoint returns the full document JSON without requiring authentication:

```bash theme={null}
GET https://app.docinject.com/embed/{org_slug}/{token}
```

### Example response

```json theme={null}
{
  "id": "doc_01abc123",
  "title": "Employee Onboarding Checklist",
  "version": "2.1",
  "department": "People Ops",
  "status": "published",
  "nodes": [
    {
      "id": "node_01",
      "node_type": "section",
      "title": "Before Day One",
      "content": null,
      "order": 0,
      "children": [
        {
          "id": "node_02",
          "node_type": "step",
          "title": "Send welcome email",
          "content": { "type": "doc", "content": [] },
          "order": 0,
          "children": [
            {
              "id": "node_03",
              "node_type": "sub_step",
              "title": "Attach equipment order form",
              "content": null,
              "order": 0,
              "children": []
            }
          ]
        }
      ]
    }
  ]
}
```

The `nodes` array is a tree of sections, steps, and sub-steps. Each node has a `node_type` of `"section"`, `"step"`, or `"sub_step"`, a `title`, optional rich-text `content`, an `order` index, and a `children` array for nested nodes.

<Info>
  If the token is invalid, the document is not published, or the org slug does not match, the endpoint returns `404`.
</Info>
