Skip to main content
GET
/
v0
/
documents
JavaScript
import Avido from 'avido';

const client = new Avido({
  apiKey: process.env['AVIDO_API_KEY'], // This is the default and can be omitted
  applicationID: process.env['AVIDO_APPLICATION_ID'], // This is the default and can be omitted
});

// Automatically fetches more pages as needed.
for await (const documentListResponse of client.documents.list()) {
  console.log(documentListResponse.id);
}
{
  "data": [
    {
      "id": "123e4567-e89b-12d3-a456-426614174000",
      "createdAt": "2024-01-05T12:34:56.789Z",
      "modifiedAt": "2024-01-05T12:34:56.789Z",
      "orgId": "org_123456789",
      "assignee": "user_123456789",
      "type": "KNOWLEDGE",
      "optimized": false,
      "versions": [
        {
          "id": "321e4567-e89b-12d3-a456-426614174001",
          "createdAt": "2024-01-05T12:34:56.789Z",
          "modifiedAt": "2024-01-05T12:34:56.789Z",
          "orgId": "org_123456789",
          "title": "API Documentation",
          "content": "This document describes the API endpoints...",
          "metadata": {},
          "originalSentences": [
            "This is the first sentence.",
            "This is the second sentence."
          ],
          "language": "english",
          "status": "APPROVED",
          "type": "KNOWLEDGE",
          "versionNumber": 1,
          "documentId": "123e4567-e89b-12d3-a456-426614174000",
          "applicationId": "456e4567-e89b-12d3-a456-426614174000"
        }
      ],
      "title": "<string>",
      "content": "<string>",
      "tags": [
        {
          "id": "123e4567-e89b-12d3-a456-426614174000",
          "name": "API Documentation",
          "color": "#3B82F6"
        }
      ],
      "applicationId": "456e4567-e89b-12d3-a456-426614174000",
      "scrapeJob": {
        "id": "123e4567-e89b-12d3-a456-426614174000",
        "createdAt": "2024-01-05T12:34:56.789Z",
        "modifiedAt": "2024-01-05T12:34:56.789Z",
        "orgId": "org_123",
        "initiatedBy": "user_123",
        "name": "Documentation Scrape",
        "url": "https://example.com",
        "status": "PENDING",
        "applicationId": "456e4567-e89b-12d3-a456-426614174000",
        "pages": [
          {
            "url": "https://example.com/page1",
            "title": "Page 1",
            "description": "This is the first page of the documentation.",
            "category": "Documentation"
          },
          {
            "url": "https://example.com/page2"
          }
        ]
      },
      "scrapeJobId": "321e4567-e89b-12d3-a456-426614174000",
      "quickstartId": "456e7890-e89b-12d3-a456-426614174000",
      "topicId": "789e1234-e89b-12d3-a456-426614174000"
    }
  ],
  "pagination": {
    "skip": 0,
    "limit": 25,
    "total": 100,
    "totalPages": 4,
    "totalCount": 100
  }
}

Authorizations

x-api-key
string
header
required

Your unique Avido API key

x-application-id
string
header
required

Your unique Avido Application ID

Query Parameters

skip
integer
default:0

Number of items to skip before starting to collect the result set.

Required range: 0 <= x <= 9007199254740991
Example:

0

limit
integer

Number of items to include in the result set.

Required range: 1 <= x <= 100
Example:

25

orderBy
string
default:createdAt

Field to order by in the result set.

Example:

"createdAt"

orderDir
enum<string>
default:desc

Order direction.

Available options:
asc,
desc
Example:

"desc"

type
enum<string>

Filter by document type. Defaults to KNOWLEDGE if not specified.

Available options:
KNOWLEDGE,
POLICY
Example:

"KNOWLEDGE"

status
enum<string>[]

Filter by document version status (filters documents by their active version status). Supports multiple values.

Status of the document. Valid options: DRAFT, REVIEW, APPROVED, ARCHIVED, ACTIVE.

Available options:
DRAFT,
REVIEW,
APPROVED,
ARCHIVED,
ACTIVE
Example:

"APPROVED"

tagId
string[]

Filter documents by tag ID

Example:

"789e4567-e89b-12d3-a456-426614174000"

Search in document version title and content

Example:

"API documentation"

scrapeJobId
string<uuid>[]

Filter by scrape job ID. Supports multiple values.

Pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
Example:

"321e4567-e89b-12d3-a456-426614174000"

assignee
string

Filter by assignee user ID

Example:

"user_123456789"

startDate
string<date-time>

Filter documents created after this date (inclusive).

Pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
Example:

"2024-01-01T00:00:00.000Z"

endDate
string<date-time>

Filter documents created before this date (inclusive).

Pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
Example:

"2024-12-31T23:59:59.999Z"

Response

Successfully retrieved documents

Paginated response containing documents

data
object[]
required
pagination
PaginationResponse · object
required

Pagination metadata returned in a paginated response.