Create Document

POST /documents

Create new document with text or html.

You can use a format like this with explicit start and end to get the best results:

<h2>What do you call a bear with no teeth?</h2>
<p>You'd call it a "gummy bear," just like those chewy, toothless candies that don't bite back.</p>

<h2>Why did the math book look sad?</h2>
<p>The math book seemed down in the dumps because it was overwhelmed by countless problems, equations, and algebraic mysteries.</p>

<h2>What's orange and sounds like a parrot?</h2>
<p>An item that's both orange and mimics a parrot's squawk is a "carrot," although you wouldn't expect vegetables to talk!</p>
application/json

Body


You can send up to 768 KB of text or html in the content field, content larger than that needs to be uploaded as a file.

Responses

  • 200 application/json

    OK

    Hide response attribute Show response attribute object
    • data object
      Hide data attributes Show data attributes object
  • 422 application/json

    Request validation failure.

    Hide response attributes Show response attributes object
POST /documents
curl \
 -X POST https://getcody.ai/api/v1/documents \
 -H "Authorization: Bearer $ACCESS_TOKEN" \
 -H "Content-Type: application/json" \
 -d '{"name":"string","folder_id":"string","content":"string"}'
Request example
{
  "name": "string",
  "folder_id": "string",
  "content": "string"
}
Response examples (200)
{
  "data": {
    "id": "string",
    "name": "string",
    "status": "syncing",
    "content_url": "string",
    "folder_id": "string",
    "created_at": 42
  }
}
Response examples (422)
{
  "message": "string",
  "errors": {
    "name": [
      "string"
    ],
    "folder_id": [
      "string"
    ],
    "content": [
      "string"
    ]
  }
}