Skip to main content
POST
/
public
/
v1
/
docs
Create Document
curl --request POST \
  --url https://api.copera.ai/public/v1/docs/ \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "title": "<string>",
  "parent": "<string>",
  "content": "<string>"
}
'
{
  "_id": "<string>",
  "title": "<string>",
  "owner": "<string>",
  "createdAt": "<string>",
  "updatedAt": "<string>",
  "icon": {
    "type": "<string>",
    "value": "<string>"
  },
  "cover": {
    "type": "<string>",
    "value": "<string>"
  },
  "starred": true,
  "parent": "<string>"
}

Overview

Creates a new document in the workspace. The authenticated user becomes the owner of the document.

Request Body

  • title (required): The title of the document.
  • parent (optional): The ID of a parent document to nest this document under.

Response

Returns the newly created document object with generated ID and timestamps.

Authorizations

Authorization
string
header
required

Bearer token

Body

application/json
title
string
required

Document title

parent
string

Parent document ID for nesting

Pattern: ^[0-9a-fA-F]{24}$
content
string

Initial markdown content

Response

Default Response

_id
string
required
title
string
required
owner
string
required
createdAt
string
required
updatedAt
string
required
icon
object
cover
object
starred
boolean
parent
string