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

# Create Client Connection Request



## OpenAPI

````yaml /api-reference/openapi.json post /v1/workflow/client-connection-requests
openapi: 3.1.0
info:
  title: Diga API
  version: 0.1.0
servers:
  - url: https://api.diga.io
    description: Production
security: []
paths:
  /v1/workflow/client-connection-requests:
    post:
      tags:
        - Workflows - Client Connections
      summary: Create Client Connection Request
      operationId: >-
        create_client_connection_request_v1_workflow_client_connection_requests_post
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateClientConnectionRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClientConnectionRequestWithLinkResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - CustomHTTPBearer: []
components:
  schemas:
    CreateClientConnectionRequest:
      properties:
        piece_name:
          type: string
          maxLength: 255
          minLength: 1
          title: Piece Name
        piece_version:
          type: string
          maxLength: 100
          minLength: 1
          title: Piece Version
        display_name:
          type: string
          maxLength: 255
          minLength: 1
          title: Display Name
        purpose:
          anyOf:
            - type: string
              maxLength: 2000
            - type: 'null'
          title: Purpose
        auth_method:
          $ref: '#/components/schemas/ClientConnectionAuthMethod'
        expires_in_days:
          type: integer
          maximum: 30
          minimum: 1
          title: Expires In Days
          default: 7
        target_connection_external_id:
          anyOf:
            - type: string
              maxLength: 255
            - type: 'null'
          title: Target Connection External Id
        locale:
          anyOf:
            - type: string
              pattern: ^[a-z]{2}$
            - type: 'null'
          title: Locale
          description: Language for the service's own field labels and instructions
      type: object
      required:
        - piece_name
        - piece_version
        - display_name
        - auth_method
      title: CreateClientConnectionRequest
    ClientConnectionRequestWithLinkResponse:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        resource_type:
          type: string
          title: Resource Type
          default: CLIENT_CONNECTION_REQUEST
        piece_name:
          type: string
          title: Piece Name
        piece_version:
          type: string
          title: Piece Version
        piece_display_name:
          type: string
          title: Piece Display Name
        piece_logo_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Piece Logo Url
        display_name:
          type: string
          title: Display Name
        purpose:
          anyOf:
            - type: string
            - type: 'null'
          title: Purpose
        requester_name:
          type: string
          title: Requester Name
        requester_company_name:
          type: string
          title: Requester Company Name
        auth_property_index:
          type: integer
          title: Auth Property Index
        connection_type:
          $ref: '#/components/schemas/ClientConnectionType'
        oauth_grant_type:
          anyOf:
            - $ref: '#/components/schemas/OAuthGrantType'
            - type: 'null'
        status:
          $ref: '#/components/schemas/ClientConnectionStatus'
        expires_at:
          type: string
          format: date-time
          title: Expires At
        target_connection_external_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Target Connection External Id
        result_connection_external_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Result Connection External Id
        safe_identity:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Safe Identity
        last_error_code:
          anyOf:
            - type: string
            - type: 'null'
          title: Last Error Code
        last_error_message:
          anyOf:
            - type: string
            - type: 'null'
          title: Last Error Message
        created_at:
          type: string
          format: date-time
          title: Created At
        updated_at:
          type: string
          format: date-time
          title: Updated At
        opened_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Opened At
        authentication_started_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Authentication Started At
        completed_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Completed At
        events:
          anyOf:
            - items:
                $ref: '#/components/schemas/ClientConnectionEventResponse'
              type: array
            - type: 'null'
          title: Events
        link:
          type: string
          title: Link
      type: object
      required:
        - id
        - piece_name
        - piece_version
        - piece_display_name
        - piece_logo_url
        - display_name
        - purpose
        - requester_name
        - requester_company_name
        - auth_property_index
        - connection_type
        - oauth_grant_type
        - status
        - expires_at
        - target_connection_external_id
        - result_connection_external_id
        - safe_identity
        - last_error_code
        - last_error_message
        - created_at
        - updated_at
        - opened_at
        - authentication_started_at
        - completed_at
        - link
      title: ClientConnectionRequestWithLinkResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ClientConnectionAuthMethod:
      properties:
        auth_property_index:
          type: integer
          minimum: 0
          title: Auth Property Index
        connection_type:
          $ref: '#/components/schemas/ClientConnectionType'
        oauth_grant_type:
          anyOf:
            - $ref: '#/components/schemas/OAuthGrantType'
            - type: 'null'
      type: object
      required:
        - auth_property_index
        - connection_type
      title: ClientConnectionAuthMethod
    ClientConnectionType:
      type: string
      enum:
        - OAUTH2
        - PLATFORM_OAUTH2
        - CLOUD_OAUTH2
        - SECRET_TEXT
        - BASIC_AUTH
        - CUSTOM_AUTH
      title: ClientConnectionType
    OAuthGrantType:
      type: string
      enum:
        - AUTHORIZATION_CODE
        - CLIENT_CREDENTIALS
      title: OAuthGrantType
    ClientConnectionStatus:
      type: string
      enum:
        - AWAITING_CLIENT
        - CONNECTED
        - EXPIRED
        - REVOKED
        - CONNECTION_ERROR
        - RECONNECTION_REQUESTED
      title: ClientConnectionStatus
    ClientConnectionEventResponse:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        event_type:
          type: string
          title: Event Type
        data:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Data
        created_at:
          type: string
          format: date-time
          title: Created At
      type: object
      required:
        - id
        - event_type
        - created_at
      title: ClientConnectionEventResponse
    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:
    CustomHTTPBearer:
      type: http
      scheme: bearer

````

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