DocuTray

Shared Types

Shared TypeScript types in the Docutray Node.js SDK — upload MIME types, pagination wrappers, rate-limit info, and error-detail models with fields.

These types are reused across every method of the Docutray Node.js SDK: the MIME types you may upload, the pagination envelope wrapping list responses, rate-limit metadata read from response headers, and the error shapes surfaced when a request fails. They are all exported from the package for direct import:

import type { ImageContentType, PaginatedResponse } from 'docutray';

For the full error class hierarchy that wraps ErrorDetail and QuotaExceededInfo, see Errors.

ImageContentType

The set of file MIME types accepted by upload-based operations such as Convert and Identify. Passing any other content type is rejected before the request is sent.

type ImageContentType =
  | 'image/png'
  | 'image/jpeg'
  | 'image/tiff'
  | 'image/webp'
  | 'application/pdf';

Pagination

Pagination metadata returned by the API — the current page, page size, and total count. It lets you compute how many more pages remain when iterating list endpoints.

Prop

Type

PaginatedResponse

The generic wrapper around every list response: the array of items plus the Pagination block above. List methods like client.documentTypes.list() resolve to this shape.

Prop

Type

RateLimitInfo

Rate-limit state parsed from the API response headers — remaining requests and the reset window. Read it to back off proactively before hitting a 429.

Prop

Type

QuotaExceededInfo

The details attached to a 429 quota response — which limit was exceeded and when it resets. Surfaced on the corresponding SDK error so you can retry after the reset.

Prop

Type

ErrorDetail

A single structured error entry from a failed API response, carrying the field, code, and message. The typed SDK errors expose an array of these for validation failures.

Prop

Type

On this page