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

# Create Contract Series

> Create a numbering series used when issuing contracts.

## Method

`POST` `/v1/contract-series`

## Body Parameters

<ParamField name="name" type="string" required>Display name for the series.</ParamField>
<ParamField name="prefix" type="string">Optional prefix prepended to generated numbers (e.g., `CNT`).</ParamField>
<ParamField name="pattern" type="string" required>Pattern string, e.g., `CNT-{year}-{sequence}`.</ParamField>
<ParamField name="resetPeriod" type="string" required>One of `year`, `quarter`, `month`, or `never`.</ParamField>
<ParamField name="startValue" type="integer">Starting sequence value (defaults to `1`).</ParamField>
<ParamField name="enforceGapless" type="boolean">Require gapless numbering (defaults to `true`).</ParamField>
<ParamField name="enforceMonotonicDates" type="boolean">Require contracts to have non-decreasing issue dates (defaults to `true`).</ParamField>
<ParamField name="active" type="boolean">Whether the series is active (defaults to `true`).</ParamField>
<ParamField name="defaultForBe" type="boolean">Set as default for booking engine issuance (defaults to `false`).</ParamField>

## Headers

<ParamField header="Authorization" type="string">Bearer token (requires `contract-series:write`).</ParamField>
<ParamField header="content-type" type="string">`application/json`</ParamField>

## Request Example

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST "https://api.voyantcloud.com/v1/contract-series" \
    -H "Authorization: Bearer $VOYANT_API_KEY" \
    -H "content-type: application/json" \
    -d '{
      "name": "Core Contracts",
      "prefix": "CNT",
      "pattern": "CNT-{year}-{sequence}",
      "resetPeriod": "year",
      "startValue": 100,
      "enforceGapless": true,
      "enforceMonotonicDates": true,
      "active": true,
      "defaultForBe": true
    }'
  ```

  ```javascript Node.js theme={null}
  const res = await fetch("https://api.voyantcloud.com/v1/contract-series", {
    method: "POST",
    headers: {
      Authorization: `Bearer ${process.env.VOYANT_API_KEY}`,
      "content-type": "application/json",
    },
    body: JSON.stringify({
      name: "Supplier Contracts",
      prefix: "SUP",
      pattern: "SUP-{year}-{sequence}",
      resetPeriod: "quarter",
    }),
  })
  const body = await res.json()
  ```

  ```python Python theme={null}
  import os, requests

  payload = {
    "name": "Customer Agreements",
    "pattern": "AGR-{year}-{sequence}",
    "resetPeriod": "month",
    "defaultForBe": False
  }

  resp = requests.post(
    "https://api.voyantcloud.com/v1/contract-series",
    headers={
      "Authorization": f"Bearer {os.environ['VOYANT_API_KEY']}",
      "content-type": "application/json",
    },
    json=payload,
  )
  series = resp.json()
  ```
</RequestExample>

## Response

<ResponseExample>
  ```json 201 Created theme={null}
  {
    "series": {
      "id": "cs_01HZYQ0RN0AT4Z2ZEYQXT4S1B2",
      "workspaceId": "ws_01HZYPM2QF2R8X9SZQ0J9SYBCN",
      "name": "Core Contracts",
      "prefix": "CNT",
      "pattern": "CNT-{year}-{sequence}",
      "resetPeriod": "year",
      "startValue": 100,
      "enforceGapless": true,
      "enforceMonotonicDates": true,
      "active": true,
      "defaultForBe": true,
      "createdAt": "2025-01-06T10:14:32.000Z",
      "updatedAt": "2025-01-06T10:14:32.000Z"
    }
  }
  ```
</ResponseExample>

<Tip>
  When `defaultForBe` is `true`, the previous default series (if any) is automatically unflagged.
</Tip>
