Create Document from Webpage

POST /documents/webpage

Create a document with a webpage URL.


Webpage must be publicly accessible without a login. If request fails with 400 error code, check if your firewall is blocking requests.

application/json

Body

  • folder_id string
  • url string(uri)

    Valid and publicly accessible webpage URL.

Responses

  • 200 application/json
    Hide response attribute Show response attribute object
    • data object
      Hide data attributes Show data attributes object
      • id string
      • name string
      • status string

        Learning status of the document, Synced means the document has been learned.

        Values are syncing, synced, or sync_failed.

      • content_url string(url)

        URL to download the content as html file.

      • folder_id string
      • created_at integer(int64)
  • 400 application/json

    Webpage was in-accessible.

    Hide response attribute Show response attribute object
    • message string
  • 422 application/json

    Request validation errors.

    Hide response attributes Show response attributes object
    • message string
    • errors object
      Hide errors attributes Show errors attributes object
      • folder_id array[string]
      • key array[string]
      • file_size array[string]
      • file_name array[string]
      • content_type array[string]
POST /documents/webpage
curl \
 --request POST 'https://getcody.ai/api/v1/documents/webpage' \
 --header "Authorization: Bearer $ACCESS_TOKEN" \
 --header "Content-Type: application/json" \
 --data '{"folder_id":"string","url":"https://example.com"}'
Request examples
{
  "folder_id": "string",
  "url": "https://example.com"
}
Response examples (200)
{
  "data": {
    "id": "string",
    "name": "string",
    "status": "syncing",
    "content_url": "string",
    "folder_id": "string",
    "created_at": 42
  }
}
Response examples (400)
{
  "message": "string"
}
Response examples (422)
{
  "message": "string",
  "errors": {
    "folder_id": [
      "string"
    ],
    "key": [
      "string"
    ],
    "file_size": [
      "string"
    ],
    "file_name": [
      "string"
    ],
    "content_type": [
      "string"
    ]
  }
}