Skip to main content

Create from Template

POST/api/v1/workflow/create/template

Create a new workflow from a natural language template request. The agent content is generated with the organization's configured BYOK LLM, then wrapped in a validated starter workflow graph. Args: request: The template creation request with call_type, use_case, and activity_description user: The authenticated user Returns: The created workflow Raises: HTTPException: If the configured LLM is missing or generation fails

cURL example

curl -X POST \
  'https://app.intracord.hu/api/v1/workflow/create/template' \
  -H "X-API-Key: $INTRACORD_API_KEY" \
  -H 'Content-Type: application/json' \
  --data-binary @request.json

Parameters

NameLocationTypeDescription
authorizationheaderobject
X-API-Keyheaderobject

Request body

application/json
View schema
{
  "properties": {
    "call_type": {
      "type": "string",
      "enum": [
        "inbound",
        "outbound"
      ],
      "title": "Call Type"
    },
    "use_case": {
      "type": "string",
      "title": "Use Case"
    },
    "activity_description": {
      "type": "string",
      "title": "Activity Description"
    }
  },
  "type": "object",
  "required": [
    "call_type",
    "use_case",
    "activity_description"
  ],
  "title": "CreateWorkflowTemplateRequest"
}

Responses

200Successful Response
application/json
View schema
{
  "properties": {
    "id": {
      "type": "integer",
      "title": "Id"
    },
    "name": {
      "type": "string",
      "title": "Name"
    },
    "status": {
      "type": "string",
      "title": "Status"
    },
    "created_at": {
      "type": "string",
      "format": "date-time",
      "title": "Created At"
    },
    "workflow_definition": {
      "additionalProperties": true,
      "type": "object",
      "title": "Workflow Definition"
    },
    "current_definition_id": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Current Definition Id"
    },
    "template_context_variables": {
      "anyOf": [
        {
          "additionalProperties": true,
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "title": "Template Context Variables"
    },
    "call_disposition_codes": {
      "anyOf": [
        {
          "$ref": "#/components/schemas/CallDispositionCodes"
        },
        {
          "type": "null"
        }
      ]
    },
    "total_runs": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Total Runs"
    },
    "workflow_configurations": {
      "anyOf": [
        {
          "additionalProperties": true,
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "title": "Workflow Configurations"
    },
    "version_number": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Version Number"
    },
    "version_status": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Version Status"
    },
    "workflow_uuid": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Workflow Uuid"
    }
  },
  "type": "object",
  "required": [
    "id",
    "name",
    "status",
    "created_at",
    "workflow_definition",
    "current_definition_id"
  ],
  "title": "WorkflowResponse"
}
404Not found
422Validation Error
application/json
View schema
{
  "properties": {
    "detail": {
      "items": {
        "$ref": "#/components/schemas/ValidationError"
      },
      "type": "array",
      "title": "Detail"
    }
  },
  "type": "object",
  "title": "HTTPValidationError"
}