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

# Create Flow Config

> Create or update a flow configuration for the authenticated client.

This endpoint allows partners to programmatically create flow configurations
with custom branding. The logo is fetched from the provided URL, optimized
for display (resized to max 400x400 pixels), and stored in S3.

If config_name already exists, updates the existing configuration.

Args:
    body: Flow configuration details including company name, logo URL, etc.
    client_id: Authenticated client ID from JWT token

Returns:
    Created or updated flow configuration with S3 logo URL and preview link

Raises:
    400: Invalid request (bad config name, unreachable logo, unsupported image type)
    500: S3 upload failure



## OpenAPI

````yaml /openapi/link.json post /configs
openapi: 3.1.0
info:
  title: Emerge API
  version: 1.0.0
  description: >-
    Privacy-first API for accessing consented user data. Emerge provides two
    main services: **Link** for collecting user consent and **Query** for
    retrieving user data.
  contact:
    name: Emerge Support
    email: account@emergedata.ai
servers:
  - url: https://link.emergedata.ai
    description: Link API - Consent collection
security:
  - bearerAuth: []
tags:
  - name: Link
    description: Consent flow configuration and status
paths:
  /configs:
    post:
      tags:
        - Link
      summary: Create Flow Config
      description: >-
        Create or update a flow configuration for the authenticated client.


        This endpoint allows partners to programmatically create flow
        configurations

        with custom branding. The logo is fetched from the provided URL,
        optimized

        for display (resized to max 400x400 pixels), and stored in S3.


        If config_name already exists, updates the existing configuration.


        Args:
            body: Flow configuration details including company name, logo URL, etc.
            client_id: Authenticated client ID from JWT token

        Returns:
            Created or updated flow configuration with S3 logo URL and preview link

        Raises:
            400: Invalid request (bad config name, unreachable logo, unsupported image type)
            500: S3 upload failure
      operationId: create_flow_config_configs_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateFlowConfigRequest'
        required: true
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FlowConfigResponse'
              examples:
                default:
                  summary: Created config
                  value:
                    config_id: cfg_30bfe2ca
                    config_name: default
                    company_name: Wonderful AI
                    logo_url: https://assets.emergedata.ai/logo/wonderful-ai.png
                    privacy_policy_url: https://wonderful.ai/privacy
                    webhook_url: https://api.wonderful.ai/webhooks/emerge
                    flow_version: emerge
                    is_default: true
                    preview_url: >-
                      https://link.emergedata.ai/preview/ck_live_123?flow_config=default
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
              example:
                detail:
                  - loc:
                      - query
                      - uid
                    msg: Field required
                    type: missing
      security:
        - bearerAuth: []
components:
  schemas:
    CreateFlowConfigRequest:
      properties:
        config_name:
          type: string
          title: Config Name
        company_name:
          type: string
          title: Company Name
        logo_url:
          type: string
          title: Logo Url
        privacy_policy_url:
          type: string
          title: Privacy Policy Url
        webhook_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Webhook Url
        flow_version:
          type: string
          title: Flow Version
          default: lm
        is_default:
          type: boolean
          title: Is Default
          default: false
      type: object
      required:
        - config_name
        - company_name
        - logo_url
        - privacy_policy_url
      title: CreateFlowConfigRequest
      description: Request to create a new flow configuration via API.
    FlowConfigResponse:
      properties:
        config_id:
          type: string
          title: Config Id
        config_name:
          type: string
          title: Config Name
        company_name:
          type: string
          title: Company Name
        logo_url:
          type: string
          title: Logo Url
        privacy_policy_url:
          type: string
          title: Privacy Policy Url
        webhook_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Webhook Url
        flow_version:
          type: string
          title: Flow Version
        is_default:
          type: boolean
          title: Is Default
        preview_url:
          type: string
          title: Preview Url
      type: object
      title: FlowConfigResponse
      description: Response after creating a flow configuration.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        API token from the Control Room. Include as `Authorization: Bearer
        <token>`

````