---
title: "Auto-create App route for document"
method: POST
path: "/api/v1/apps/{appId}/routes/auto"
tags: ["Apps & Publishing"]
---

# Auto-create App route for document

`POST /api/v1/apps/{appId}/routes/auto`

## Request

- Base URL: `https://app.promptingco.com`
- URL: `https://app.promptingco.com/api/v1/apps/{appId}/routes/auto`
- Auth: one of:
  - API key in header `x-api-key`
  - HTTP bearer
  - API key in cookie `better-auth.session_token`

## Path parameters

- `appId` string, required

## Request body

- object
  - `targetId` string, required

## Response `200`

Successful response

- object
  - `ok` true, required
  - `data` object, required
    - `id` string, required
    - `appId` string, required
    - `path` string, required
    - `targetType` 'product_document', required
    - `targetId` string, required
    - `createdAt` string, date-time, required
    - `updatedAt` string, date-time, required
    - `target` object, nullable, required
      - `id` string, required
      - `title` string, required
      - `filePath` string, required
      - `sourceUrl` string, required
      - `status` string, required
      - `type` string, required
      - `redirectToUrl` string, nullable, required
      - `productId` string, required
    - `product` object, nullable, required
      - `id` string, required
      - `name` string, required
      - `slug` string, nullable, required

## Other responses

- `400`: Bad request
- `401`: Authentication required
- `403`: Forbidden
- `404`: Not found
- `422`: Validation failed
- `500`: Internal server error

---

[API](https://skmtc.dev/promptingcompany/apis/the-prompting-company-api.md) - [All operations](https://skmtc.dev/promptingcompany/apis/the-prompting-company-api/llms.txt) - [OpenAPI document](https://skmtc.dev/promptingcompany/apis/the-prompting-company-api/revisions/c0451ea10e9a?raw)
