---
title: "Enroll a contact"
full: true
_openapi:
  method: POST
  toc: []
  structuredData:
    headings: []
    contents:
      - content: "Starts this active automation for a contact. Pass contactId or email (email creates the contact if needed)."
_apiData:
  document: "https://reloop.sh/api/workflow/openapi/json"
  operationData: [{"path":"/api/workflow/v1/automations/{automation_id}/enroll","method":"post"}]
  parameterList: [{"name":"automation_id","type":"string","required":true,"description":"Automation ID (auto_...)","location":"path","minLength":1},{"name":"contactId","type":"string","required":false,"description":"Contact to enroll. Pass this or email.","location":"body"},{"name":"email","type":"string","required":false,"description":"Contact email. Creates the contact if it does not exist yet.","location":"body"},{"name":"firstName","type":"string","required":false,"description":"Used when the contact is created from email","location":"body","maxLength":255},{"name":"lastName","type":"string","required":false,"description":"Used when the contact is created from email","location":"body","maxLength":255}]
  responseMap: {"200":{"description":"Response for status 200","schema":{"enrollment":{"id":"enr_123456789","automationId":"auto_123456789","contactId":"con_123456789","contactEmail":"john.doe@example.com","contactFirstName":"John","contactLastName":"Doe","status":"active","currentNodeId":"start","enrolledAt":"2026-03-23T10:00:00.000Z","completedAt":null,"cancelledAt":null},"contactCreated":false,"delayMs":0}},"400":{"description":"Response for status 400","schema":{"message":"Automation is not active","why":"Only an active automation can enroll contacts.","fix":"Activate the workflow, then enroll the contact."}},"401":{"description":"Response for status 401","schema":{"message":"Authentication required"}},"404":{"description":"Response for status 404","schema":{"message":"Contact not found","why":"No matching contact was found for this organization.","fix":"Create the contact first or pass a valid contactId/email."}},"409":{"description":"Response for status 409","schema":{"message":"Contact already enrolled","why":"This contact is already enrolled (enr_123456789). Automations enroll a contact once.","fix":"Pick a different contact, or inspect the existing enrollment."}},"500":{"description":"Response for status 500","schema":{"message":"Failed to update automation","why":"An unexpected error occurred while updating automation \"auto_123456789\".","fix":"Please try again later or contact support."}}}
  codeSamples:
    - id: node
      lang: javascript
      label: Node.js
      source: |-
        import { Reloop } from "reloop-email";
        
        const reloop = new Reloop({ apiKey: "rl_123456789" });
        
        const { enrollment, enrollmentError } = await reloop.automations.enroll("auto_123456789", {
          email: "john.doe@example.com",
          firstName: "John",
        });
        if (enrollmentError) throw enrollmentError;
    - id: curl
      lang: bash
      label: cURL
      source: |-
        curl -X POST https://reloop.sh/api/workflow/v1/automations/auto_123456789/enroll \
          -H "x-api-key: rl_123456789" \
          -H "Content-Type: application/json" \
          -d '{"email":"john.doe@example.com","firstName":"John"}'
    - id: python
      lang: python
      label: Python
      source: |-
        import requests
        
        res = requests.post(
            "https://reloop.sh/api/workflow/v1/automations/auto_123456789/enroll",
            headers={"x-api-key": "rl_123456789"},
            json={
                "email": "john.doe@example.com",
                "firstName": "John"
            },
        )
        res.raise_for_status()
        print(res.json())
---
> For the complete documentation index, see [llms-docs.txt](/llms-docs.txt) or the site index [llms.txt](/llms.txt). Full docs corpus: [llms-full-docs.txt](/llms-full-docs.txt). Prefer markdown URLs (append `.md`) for agent consumption. Product skill: [skill.md](/skill.md).


{/* This file was generated by the OpenAPI doc generator. Do not edit this file directly. Run `bun run generate:api-docs` to regenerate. */}

<APIPage />
