> ## Documentation Index
> Fetch the complete documentation index at: https://docs.corsair.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Docmosis API reference

> API reference for the Docmosis plugin in Corsair: every `docmosis.api.*` operation with its input and output types, taken from the plugin's Zod schemas.

> [!NOTE]
>
> **New to Corsair?** See [API access](https://docs.corsair.dev/concepts/api.md), [authentication](https://docs.corsair.dev/concepts/auth.md), and [error handling](https://docs.corsair.dev/concepts/error-handling).

## Admin

### environmentReady

`admin.environmentReady`

Check whether the environment is active and ready to render

**Risk:** `read`

```ts theme={null}
await corsair.docmosis.api.admin.environmentReady({});
```

**Input:** *empty object*

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `succeeded` | `boolean` | Yes | — |
| `shortMsg` | `string` | No | — |
| `longMsg` | `string` | No | — |

***

### environmentSummary

`admin.environmentSummary`

Get environment status, plan details, and quota usage

**Risk:** `read`

```ts theme={null}
await corsair.docmosis.api.admin.environmentSummary({});
```

**Input:** *empty object*

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `succeeded` | `boolean` | Yes | — |
| `shortMsg` | `string` | No | — |
| `longMsg` | `string` | No | — |
| `accountEnvironmentSummary` | `object` | No | — |

> [accordion] accountEnvironmentSummary full type
>
> ```ts theme={null}
> {
>   ready?: boolean | string,
>   accountEnvDetails?: {
>     name?: string,
>     description?: string,
>     isActivated?: boolean | string,
>     isDisabled?: boolean | string,
>     isDeleted?: boolean | string,
>     auditInfo?: {
>       lastUpdatedByUser?: string,
>       lastUpdatedTime?: number
>     }
>   },
>   pageQuota?: {
>     used?: number | string,
>     quota?: number | string,
>     pctUsed?: number | string,
>     pctUsedStr?: string,
>     isHardLimited?: boolean | string
>   },
>   plan?: {
>     name?: string
>   }
> }
> ```

***

### getBatchUploadStatus

`admin.getBatchUploadStatus`

Check status for a template batch upload job

**Risk:** `read`

```ts theme={null}
await corsair.docmosis.api.admin.getBatchUploadStatus({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `userJobId` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `succeeded` | `boolean` | Yes | — |
| `shortMsg` | `string` | No | — |
| `longMsg` | `string` | No | — |
| `jobStatus` | `object` | No | — |

> [accordion] jobStatus full type
>
> ```ts theme={null}
> {
>   userJobId?: string,
>   isEnded?: boolean,
>   status?: string,
>   type?: string,
>   processingMsg?: string,
>   startedTime?: number,
>   finishedTime?: number,
>   duration?: number,
>   pctComplete?: number,
>   jobResult?: {
>     errorsDetected?: boolean,
>     uploadedIntoFolder?: string,
>     devMode?: boolean,
>     uploadedTotalCount?: number,
>     processedWithErrorsCount?: number,
>     processedWithoutErrorsCount?: number
>   }
> }
> ```

***

### getRenderQueue

`admin.getRenderQueue`

Get current render queue utilization and delay

**Risk:** `read`

```ts theme={null}
await corsair.docmosis.api.admin.getRenderQueue({});
```

**Input:** *empty object*

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `succeeded` | `boolean` | Yes | — |
| `shortMsg` | `string` | No | — |
| `longMsg` | `string` | No | — |
| `queue` | `object` | No | — |

> [accordion] queue full type
>
> ```ts theme={null}
> {
>   rejected?: boolean,
>   availablePct?: number,
>   delaySeconds?: number
> }
> ```

***

### getRenderTags

`admin.getRenderTags`

Get monthly render statistics grouped by custom tags

**Risk:** `read`

```ts theme={null}
await corsair.docmosis.api.admin.getRenderTags({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `tags` | `string` | Yes | — |
| `year` | `number \| string` | No | — |
| `month` | `number \| string` | No | — |
| `nMonths` | `number \| string` | No | — |
| `padBlanks` | `boolean \| y \| yes \| true \| n \| no \| false` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `succeeded` | `boolean` | Yes | — |
| `shortMsg` | `string` | No | — |
| `longMsg` | `string` | No | — |
| `renderTags` | `object[]` | No | — |

> [accordion] renderTags full type
>
> ```ts theme={null}
> {
>   year?: number | string,
>   month?: number | string,
>   tags?: {
>     name?: string,
>     countPages?: number | string,
>     countDocuments?: number | string
>   }[]
> }[]
> ```

***

### ping

`admin.ping`

Check basic connectivity to the Docmosis API

**Risk:** `read`

```ts theme={null}
await corsair.docmosis.api.admin.ping({});
```

**Input:** *empty object*

**Output:** *empty object*

***

### pingService

`admin.pingService`

Verify that Docmosis service listeners are online

**Risk:** `read`

```ts theme={null}
await corsair.docmosis.api.admin.pingService({});
```

**Input:** *empty object*

**Output:** *empty object*

***

## Auth

### getApiKey

`auth.getApiKey`

Confirm a Docmosis access key is configured and return a masked preview of it

**Risk:** `read`

```ts theme={null}
await corsair.docmosis.api.auth.getApiKey({});
```

**Input:** *empty object*

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `configured` | `boolean` | Yes | Whether a Docmosis access key is configured |
| `keyPreview` | `string` | Yes | Last 4 characters of the configured access key |

***

## Images

### delete

`images.delete`

Delete one or more stored images

**Risk:** `destructive` · **Irreversible**

```ts theme={null}
await corsair.docmosis.api.images.delete({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `imageName` | `string \| string[]` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `succeeded` | `boolean` | Yes | — |
| `shortMsg` | `string` | No | — |
| `longMsg` | `string` | No | — |

***

### get

`images.get`

Download one or more uploaded images

**Risk:** `read`

```ts theme={null}
await corsair.docmosis.api.images.get({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `imageName` | `string \| string[]` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `contentType` | `string` | Yes | — |
| `dataBase64` | `string` | Yes | — |
| `byteLength` | `number` | Yes | — |

***

### list

`images.list`

List available stored images, optionally by folder

**Risk:** `read`

```ts theme={null}
await corsair.docmosis.api.images.list({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `folder` | `string` | No | — |
| `includeSubFolders` | `boolean \| y \| yes \| true \| n \| no \| false` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `succeeded` | `boolean` | Yes | — |
| `shortMsg` | `string` | No | — |
| `longMsg` | `string` | No | — |
| `imageListStale` | `boolean` | No | — |
| `imageList` | `object[]` | No | — |

> [accordion] imageList full type
>
> ```ts theme={null}
> {
>   name?: string,
>   lastModifiedMillisSinceEpoch?: number,
>   lastModifiedISO8601?: string,
>   sizeBytes?: number,
>   md5?: string
> }[]
> ```

***

## Templates

### delete

`templates.delete`

Delete one or more templates from the environment

**Risk:** `destructive` · **Irreversible**

```ts theme={null}
await corsair.docmosis.api.templates.delete({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `templateName` | `string \| string[]` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `succeeded` | `boolean` | Yes | — |
| `shortMsg` | `string` | No | — |
| `longMsg` | `string` | No | — |

***

### get

`templates.get`

Download one or more template files

**Risk:** `read`

```ts theme={null}
await corsair.docmosis.api.templates.get({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `templateName` | `string \| string[]` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `contentType` | `string` | Yes | — |
| `dataBase64` | `string` | Yes | — |
| `byteLength` | `number` | Yes | — |

***

### getDetails

`templates.getDetails`

Get metadata details for a specific template

**Risk:** `read`

```ts theme={null}
await corsair.docmosis.api.templates.getDetails({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `templateName` | `string` | Yes | — |
| `stringify` | `boolean \| y \| yes \| true \| n \| no \| false` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `succeeded` | `boolean` | Yes | — |
| `shortMsg` | `string` | No | — |
| `longMsg` | `string` | No | — |
| `templateDetails` | `object` | No | — |

> [accordion] templateDetails full type
>
> ```ts theme={null}
> {
>   name?: string,
>   lastModifiedMillisSinceEpoch?: number,
>   lastModifiedISO8601?: string,
>   sizeBytes?: number,
>   md5?: string,
>   templatePlainTextFieldPrefix?: string,
>   templatePlainTextFieldSuffix?: string,
>   templateHasErrors?: boolean,
>   templateDevMode?: boolean,
>   templateDescription?: string
> }
> ```

***

### getSampleData

`templates.getSampleData`

Generate sample JSON or XML data from a template structure

**Risk:** `read`

```ts theme={null}
await corsair.docmosis.api.templates.getSampleData({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `templateName` | `string` | Yes | — |
| `stringify` | `boolean \| y \| yes \| true \| n \| no \| false` | No | — |
| `format` | `json \| xml` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `succeeded` | `boolean` | Yes | — |
| `shortMsg` | `string` | No | — |
| `longMsg` | `string` | No | — |
| `templateSampleData` | `Record<string, JsonValue> \| string` | No | — |
| `templateDetails` | `object` | No | — |

> [accordion] templateDetails full type
>
> ```ts theme={null}
> {
>   templateHasErrors?: boolean,
>   templateFirstError?: string
> }
> ```

***

### getStructure

`templates.getStructure`

Get parsed field and structure metadata for a template

**Risk:** `read`

```ts theme={null}
await corsair.docmosis.api.templates.getStructure({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `templateName` | `string` | Yes | — |
| `stringify` | `boolean \| y \| yes \| true \| n \| no \| false` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `succeeded` | `boolean` | Yes | — |
| `shortMsg` | `string` | No | — |
| `longMsg` | `string` | No | — |
| `templateHasErrors` | `boolean` | No | — |
| `templateErrorMessage` | `string` | No | — |
| `templateStructure` | `object[] \| string` | No | — |

> [accordion] templateStructure full type
>
> ```ts theme={null}
> {
>   type?: string,
>   text?: string,
>   dataRefs?: string[],
>   fieldIdx?: number,
>   repeatIdx?: number,
>   conditionIdx?: number,
>   contains?: {
>     type?: string,
>     text?: string,
>     dataRefs?: string[],
>     fieldIdx?: number,
>     repeatIdx?: number,
>     conditionIdx?: number,
>     contains?: (recursive)
>   }[]
> }[] | string
> ```

***

### list

`templates.list`

List templates with optional folder and paging filters

**Risk:** `read`

```ts theme={null}
await corsair.docmosis.api.templates.list({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `includeDetail` | `boolean \| y \| yes \| true \| n \| no \| false` | No | — |
| `folder` | `string` | No | — |
| `includeSubFolders` | `boolean \| y \| yes \| true \| n \| no \| false` | No | — |
| `paging` | `boolean \| y \| yes \| true \| n \| no \| false` | No | — |
| `pageToken` | `string` | No | — |
| `pageSize` | `number \| string` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `succeeded` | `boolean` | Yes | — |
| `shortMsg` | `string` | No | — |
| `longMsg` | `string` | No | — |
| `templateListStale` | `boolean` | No | — |
| `nextPageToken` | `string` | No | — |
| `pageSize` | `number` | No | — |
| `templateList` | `object[]` | No | — |

> [accordion] templateList full type
>
> ```ts theme={null}
> {
>   name?: string,
>   lastModifiedMillisSinceEpoch?: number,
>   lastModifiedISO8601?: string,
>   sizeBytes?: number,
>   md5?: string,
>   templatePlainTextFieldPrefix?: string,
>   templatePlainTextFieldSuffix?: string,
>   templateHasErrors?: boolean,
>   templateDevMode?: boolean,
>   templateDescription?: string
> }[]
> ```

***

### render

`templates.render`

Generate a document from a template and JSON/XML data

**Risk:** `write`

```ts theme={null}
await corsair.docmosis.api.templates.render({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `templateName` | `string` | Yes | — |
| `data` | `string \| Record<string, JsonValue>` | Yes | — |
| `outputName` | `string` | Yes | — |
| `outputFormat` | `string` | No | — |
| `devMode` | `boolean \| y \| yes \| true \| n \| no \| false` | No | — |
| `tags` | `string` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `contentType` | `string` | Yes | — |
| `dataBase64` | `string` | Yes | — |
| `byteLength` | `number` | Yes | — |

***


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.