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

# Send to Workflow

> Enroll a lead into an automated journey. If the lead isn't on file yet, it's created from `record` and enrolled. If it's already on file, it's enrolled **as-is**.

**POST never modifies an existing lead.** When a lead matching `lead_id` or `record.phone` already exists, every other field in `record` is ignored and the journey runs with the data already on file. To update the lead before enrolling it, use [Update & Send to Workflow](/api-reference/workflows/update-and-send-to-workflow) (`PATCH`).

**Note:** Provide either `record` or `lead_id`, never both. When you send `record`, the lead is matched by `phone`.

**Finding your Journey ID:** Extract it from your workspace URL: `app.plura.ai/[workspace]/journey/[JOURNEY-ID]/flow/[flow-id]`. The Journey ID is the UUID after `/journey/`. Use the Journey ID, not the Flow ID.

**POST vs. PATCH**

| | Lead not on file | Lead already on file |
|---|---|---|
| `POST` | Created from `record`, then enrolled | Enrolled with the data on file. `record` is ignored. |
| `PATCH` | Created from `record`, then enrolled | Fields you send are updated, then enrolled |




## OpenAPI

````yaml POST /lead/sendtoworkflow
openapi: 3.0.3
info:
  title: Plura AI API
  description: >-
    Complete REST API reference for building powerful integrations with Plura
    AI.
  version: '1.8'
  contact:
    url: https://docs.plura.ai
servers:
  - url: https://api.plura.ai/v1
    description: Production
security:
  - bearerAuth: []
paths:
  /lead/sendtoworkflow:
    post:
      tags:
        - Workflows
      summary: Send to Workflow
      description: >
        Enroll a lead into an automated journey. If the lead isn't on file yet,
        it's created from `record` and enrolled. If it's already on file, it's
        enrolled **as-is**.


        **POST never modifies an existing lead.** When a lead matching `lead_id`
        or `record.phone` already exists, every other field in `record` is
        ignored and the journey runs with the data already on file. To update
        the lead before enrolling it, use [Update & Send to
        Workflow](/api-reference/workflows/update-and-send-to-workflow)
        (`PATCH`).


        **Note:** Provide either `record` or `lead_id`, never both. When you
        send `record`, the lead is matched by `phone`.


        **Finding your Journey ID:** Extract it from your workspace URL:
        `app.plura.ai/[workspace]/journey/[JOURNEY-ID]/flow/[flow-id]`. The
        Journey ID is the UUID after `/journey/`. Use the Journey ID, not the
        Flow ID.


        **POST vs. PATCH**


        | | Lead not on file | Lead already on file |

        |---|---|---|

        | `POST` | Created from `record`, then enrolled | Enrolled with the data
        on file. `record` is ignored. |

        | `PATCH` | Created from `record`, then enrolled | Fields you send are
        updated, then enrolled |
      operationId: sendToWorkflow
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - workflow_id
              properties:
                workflow_id:
                  type: string
                  description: Journey ID from your workspace URL (not the Flow ID)
                  example: 98249779-79ae-462f-a0cf-7ce5129cc093
                record:
                  $ref: '#/components/schemas/LeadRecord'
                  description: >-
                    Lead data. The lead is matched by `phone`. If no match is
                    found, a new lead is created from these fields. If a match
                    is found, these fields are ignored and the existing lead is
                    enrolled unchanged. Provide this OR lead_id, not both.
                lead_id:
                  type: string
                  description: Existing lead UUID. Provide this OR record, not both.
                  example: 307fc241-8398-4740-8122-cf6a59f3b86e
            examples:
              new_lead:
                summary: Create new lead and enroll
                value:
                  workflow_id: 98249779-79ae-462f-a0cf-7ce5129cc093
                  record:
                    phone: '17145551234'
                    first_name: John
                    last_name: Smith
                    email: johnsmith@mail.com
                    company: Acme Corp
              existing_lead:
                summary: Enroll existing lead
                value:
                  workflow_id: 98249779-79ae-462f-a0cf-7ce5129cc093
                  lead_id: 307fc241-8398-4740-8122-cf6a59f3b86e
      responses:
        '200':
          description: Lead enrolled successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    example: success
                  lead_id:
                    type: string
                    example: 307fc241-8398-4740-8122-cf6a59f3b86e
                  workflow_assigned:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: Lead successfully added to workflow
        '400':
          description: Bad request. Check JSON format and required fields.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                status: failed
                message: Could not find or create lead, please try again!
        '401':
          description: Unauthorized. Verify your API key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Journey not found. Check your workflow_id.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    LeadRecord:
      type: object
      required:
        - phone
      properties:
        phone:
          type: string
          description: Phone number in E.164 format (digits only, with country code)
          example: '17145551234'
        first_name:
          type: string
          example: John
        last_name:
          type: string
          example: Smith
        email:
          type: string
          format: email
          example: johnsmith@mail.com
        company:
          type: string
          example: Acme Corp
    Error:
      type: object
      properties:
        status:
          type: string
          example: failed
        message:
          type: string
          example: Human-readable error description
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: API key from Settings → API Keys in your workspace

````

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