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

# Create Integration Config

> Creates a new integration configuration for a specific card workflow

Creates a new integration configuration that links a specific card to workflow settings. This configuration is required before you can send cards through the Integration API and serves as a bridge between your automation workflows and CardClan cards.

## What is an Integration Configuration?

An integration configuration is a record that:

* **Links a card** to integration workflows
* **Defines workflow settings** for automation platforms
* **Enables card sending** through the Integration API
* **Tracks integration usage** and analytics

Think of it as "registering" a card for use in automated workflows.

## Request Parameters

<ParamField body="userId" type="string" required>
  Your CardClan user ID (obtained from authentication)
</ParamField>

<ParamField body="workspaceId" type="string" required>
  Workspace ID containing the card (from Get Workspaces endpoint)
</ParamField>

<ParamField body="cardId" type="string" required>
  ID of the card to configure for integration use
</ParamField>

## Response Details

<ResponseField name="data" type="object">
  The created integration configuration object

  <Expandable title="Configuration object properties">
    <ResponseField name="_id" type="string">
      Unique integration configuration ID (use this as integrationId in other calls)
    </ResponseField>

    <ResponseField name="userId" type="string">
      User ID associated with this configuration
    </ResponseField>

    <ResponseField name="workspaceId" type="string">
      Workspace ID containing the configured card
    </ResponseField>

    <ResponseField name="cardId" type="string">
      Card ID that's been configured for integration use
    </ResponseField>

    <ResponseField name="createdAt" type="string">
      Timestamp when the configuration was created
    </ResponseField>

    <ResponseField name="updatedAt" type="string">
      Timestamp when the configuration was last modified
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="message" type="string">
  Success message confirming the configuration was created
</ResponseField>

## Workflow Integration Process

```mermaid theme={null}
graph TD
    A[Select Card] --> B[Create Integration Config]
    B --> C[Get Integration ID]
    C --> D[Use in Send Card API]
    D --> E[Card Delivered]

    B --> F[Configure Automation Platform]
    F --> G[Map Merge Tags]
    G --> D
```

## Response Example

```json theme={null}
{
  "data": {
    "_id": "60f7b2b5b8f4a20015a4f5a8",
    "userId": "60f7b2b5b8f4a20015a4f5a3",
    "workspaceId": "60f7b2b5b8f4a20015a4f5a4",
    "cardId": "60f7b2b5b8f4a20015a4f5a5",
    "createdAt": "2023-07-20T10:30:00.000Z",
    "updatedAt": "2023-07-20T10:30:00.000Z"
  },
  "message": "Integration configuration created"
}
```


## OpenAPI

````yaml POST /integration/config
openapi: 3.1.0
info:
  title: CardClan Integration API
  description: >-
    The CardClan Integration API enables third-party applications and automation
    platforms to send personalized digital cards, manage workflows, and
    integrate CardClan's functionality into existing systems.
  version: 1.0.0
  license:
    name: MIT
servers:
  - url: https://app.cardclan.io/api
security:
  - bearerAuth: []
paths:
  /integration/config:
    post:
      tags:
        - Configuration
      summary: Create Integration Configuration
      description: Creates a new integration configuration for a specific card workflow
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateConfigRequest'
      responses:
        '201':
          description: Integration configuration created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateConfigResponse'
        '400':
          description: Integration configuration already exists or invalid data
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    CreateConfigRequest:
      type: object
      required:
        - userId
        - workspaceId
        - cardId
      properties:
        userId:
          type: string
          description: User ID
          example: 60f7b2b5b8f4a20015a4f5a3
        workspaceId:
          type: string
          description: Workspace ID
          example: 60f7b2b5b8f4a20015a4f5a4
        cardId:
          type: string
          description: Card ID
          example: 60f7b2b5b8f4a20015a4f5a5
    CreateConfigResponse:
      type: object
      properties:
        data:
          $ref: '#/components/schemas/IntegrationConfig'
        message:
          type: string
          example: Integration configuration created
    Error:
      type: object
      properties:
        error:
          type: string
          example: Bad Request
        message:
          type: string
          example: Card ID is required
        statusCode:
          type: number
          example: 400
        timestamp:
          type: string
          format: date-time
          example: '2024-01-15T10:30:00.000Z'
    IntegrationConfig:
      type: object
      properties:
        _id:
          type: string
          example: 60f7b2b5b8f4a20015a4f5a7
        userId:
          type: string
          example: 60f7b2b5b8f4a20015a4f5a3
        workspaceId:
          type: string
          example: 60f7b2b5b8f4a20015a4f5a4
        cardId:
          type: string
          example: 60f7b2b5b8f4a20015a4f5a5
        createdAt:
          type: string
          format: date-time
          example: '2023-07-20T10:30:00.000Z'
        updatedAt:
          type: string
          format: date-time
          example: '2023-07-20T10:30:00.000Z'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: Enter your CardClan integration key

````