API ReferenceDocument types

Create a new document type

POST
/api/document-types

Creates a new document type.

Non-admin users:

  • isPublic is forced to false
  • source is set to USER
  • codeType must be prefixed with the organization slug (e.g., orgname_my_type)
  • At least 3 characters required after the prefix

Admin users:

  • Can set isPublic to true
  • source defaults to ADMIN
  • No prefix requirement on codeType

Authorization

ApiKeyAuth
AuthorizationBearer <token>

Bearer token for API authentication

In: header

Request Body

application/json

name*string

Document type name

Length2 <= length
codeType*string

Unique code identifier. Non-admin users must prefix with organization slug.

Match^[a-z0-9_]+$
description*string

Document type description (required)

Length1 <= length
jsonSchema*object

JSON Schema for document validation

isDraft?boolean

Whether the document type is a draft

Defaulttrue
promptHints?string

Hints for the OCR prompt

identifyPromptHints?string

Hints for the document identification prompt

conversionMode?string

Conversion mode

Default"json"
Value in"json" | "toon" | "multi_prompt"
keepPropertyOrdering?boolean

Whether to preserve property ordering in schema

Defaultfalse
isPublic?boolean

Whether the document type is public (admin only)

Response Body

application/json

curl -X POST "https://app.docutray.com/api/document-types" \  -H "Content-Type: application/json" \  -d '{    "name": "string",    "codeType": "string",    "description": "string",    "jsonSchema": {}  }'
{
  "data": {
    "id": "string",
    "codeType": "string",
    "name": "string",
    "description": "string",
    "isPublic": true,
    "isDraft": true,
    "status": "string",
    "createdAt": "2019-08-24T14:15:22Z",
    "updatedAt": "2019-08-24T14:15:22Z"
  }
}
Empty
Empty
Empty
Empty
Empty