Company logoTrust Center Documentation

Create document metadata

Create document metadata without file upload. File must be uploaded separately using the file upload endpoint.

POST
/api/v1/documents

Create document metadata without file upload. File must be uploaded separately using the file upload endpoint.

Authorization

bearerAuth
AuthorizationBearer <token>

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

curl -X POST "https://example.com/api/v1/documents" \  -H "Content-Type: application/json" \  -d '{    "title": "Privacy Policy",    "description": "Company privacy policy document",    "category": "550e8400-e29b-41d4-a716-446655440000",    "access_level": "public"  }'
{
  "success": true,
  "data": {
    "documentId": "4704590c-004e-410d-adf7-acb7ca0a7052",
    "uploadUrl": "/api/v1/documents/doc-123/file"
  }
}
{
  "error": "Invalid input: category: category_must_be_uuid"
}
Empty
{
  "error": "slug_already_exists",
  "fieldErrors": {
    "slug": [
      "slug_already_exists"
    ]
  },
  "duplicateSlugResource": {
    "id": "string",
    "title": "string",
    "type": "document",
    "href": "string"
  }
}
Empty

How is this guide?