> ## 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.

# API

> API reference for Docmosis: every `docmosis.api.*` operation with input and output types.

Every `docmosis.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas.

<Info>
  **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling).
</Info>

## 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 | — |

<AccordionGroup>
  <Accordion title="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
      }
    }
    ```
  </Accordion>
</AccordionGroup>

***

### 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 | — |

<AccordionGroup>
  <Accordion title="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
      }
    }
    ```
  </Accordion>
</AccordionGroup>

***

### 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 | — |

<AccordionGroup>
  <Accordion title="queue full type">
    ```ts theme={null}
    {
      rejected?: boolean,
      availablePct?: number,
      delaySeconds?: number
    }
    ```
  </Accordion>
</AccordionGroup>

***

### 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 | — |

<AccordionGroup>
  <Accordion title="renderTags full type">
    ```ts theme={null}
    {
      year?: number | string,
      month?: number | string,
      tags?: {
        name?: string,
        countPages?: number | string,
        countDocuments?: number | string
      }[]
    }[]
    ```
  </Accordion>
</AccordionGroup>

***

### 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 | — |

<AccordionGroup>
  <Accordion title="imageList full type">
    ```ts theme={null}
    {
      name?: string,
      lastModifiedMillisSinceEpoch?: number,
      lastModifiedISO8601?: string,
      sizeBytes?: number,
      md5?: string
    }[]
    ```
  </Accordion>
</AccordionGroup>

***

## 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 | — |

<AccordionGroup>
  <Accordion title="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
    }
    ```
  </Accordion>
</AccordionGroup>

***

### 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` | `object` | No | — |
| `templateDetails` | `object` | No | — |

<AccordionGroup>
  <Accordion title="templateSampleData full type">
    ```ts theme={null}
    {
    } | string
    ```
  </Accordion>

  <Accordion title="templateDetails full type">
    ```ts theme={null}
    {
      templateHasErrors?: boolean,
      templateFirstError?: string
    }
    ```
  </Accordion>
</AccordionGroup>

***

### 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` | No | — |

<AccordionGroup>
  <Accordion title="templateStructure full type">
    ```ts theme={null}
    {
      type?: string,
      text?: string,
      dataRefs?: string[],
      fieldIdx?: number,
      repeatIdx?: number,
      conditionIdx?: number,
      contains?: lazy
    }[] | string
    ```
  </Accordion>
</AccordionGroup>

***

### 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 | — |

<AccordionGroup>
  <Accordion title="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
    }[]
    ```
  </Accordion>
</AccordionGroup>

***

### 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` | `object` | Yes | — |
| `outputName` | `string` | Yes | — |
| `outputFormat` | `string` | No | — |
| `devMode` | `boolean \| y \| yes \| true \| n \| no \| false` | No | — |
| `tags` | `string` | No | — |

<AccordionGroup>
  <Accordion title="data full type">
    ```ts theme={null}
    string | {
    }
    ```
  </Accordion>
</AccordionGroup>

**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.