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

# Enroll a single contact

> Schedule one outbound sequence per request. This is the recommended endpoint for real-time, per-contact integrations (CRM webhooks, lead capture forms, etc.). For batch imports, use the bulk endpoint.

You can also send a `HEAD` request to this URL to verify your API key and agent ID without scheduling anything (returns 200 if reachable).



## OpenAPI

````yaml /openapi.json post /agents/{agentId}/schedule/sequence
openapi: 3.1.0
info:
  title: Julian API
  version: 1.0.0
  description: >-
    API for Julian, 11x's AI calling platform. Programmatically enroll contacts
    into agent calling sequences, manage sequences, and track credit usage. All
    requests are authenticated with an organization API key in the `x-api-key`
    header and rate limited to 10 requests per second per key (HTTP 429 when
    exceeded).
servers:
  - url: https://julian.11x.ai/api/v1
security:
  - apiKeyAuth: []
tags:
  - name: Scheduling
    description: Enroll contacts into an agent's calling sequence.
  - name: Sequences
    description: Manage active sequences.
  - name: Agents
    description: Read agent configuration.
  - name: Conversation Meetings
    description: >-
      Manage the meeting booked during a conversation — list its attendees, add
      attendees before it starts, and cancel it. Every endpoint is addressed by
      an `entityId` that identifies the conversation. Today only voice calls are
      supported, with the form of the call prefix followed by the call ID (e.g.
      `call.abc123`). The meeting is resolved from the calendar booking created
      during the conversation, and the calendar provider remains the source of
      truth.
  - name: Conversation Metadata
    description: >-
      Retrieve completed conversation data asynchronously — designed for batch
      ingestion, backfills, and reconciliation jobs that pull conversation
      metadata instead of receiving it through a webhook.


      **Recommended batch ingestion flow:**


      1. Call `GET /conversations/search/{agentId}` with the time window you
      want to ingest (e.g. yesterday or the last seven days).

      2. Iterate through the returned `sequenceIds`.

      3. For each sequence ID, call `GET /conversations/metadata/{sequenceId}`.

      4. Store the returned `metadata` array in your warehouse.

      5. Use `limit`, `offset`, and `hasMore` to paginate through larger
      backfills.
  - name: Credits
    description: Track credit utilization.
  - name: Webhooks
    description: Events Julian sends to your endpoint.
paths:
  /agents/{agentId}/schedule/sequence:
    post:
      tags:
        - Scheduling
      summary: Enroll a single contact
      description: >-
        Schedule one outbound sequence per request. This is the recommended
        endpoint for real-time, per-contact integrations (CRM webhooks, lead
        capture forms, etc.). For batch imports, use the bulk endpoint.


        You can also send a `HEAD` request to this URL to verify your API key
        and agent ID without scheduling anything (returns 200 if reachable).
      operationId: scheduleSequence
      parameters:
        - $ref: '#/components/parameters/AgentId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ScheduleSequenceRequest'
      responses:
        '201':
          description: Sequence scheduled.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ScheduleSequenceResponse'
        '400':
          description: >-
            Validation error. `error` is one of: `NO_DATA_PROVIDED` (empty
            body), `MISSING_NAME`, `MISSING_PHONENUMBER`,
            `MISSING_CUSTOM_VARIABLES` (one or more required custom input
            variables missing), `INVALID_PHONE_NUMBER`, `INVALID_EMAIL_ADDRESS`
            (malformed `toEmailAddress`, or missing for an agent with email
            steps), `INVALID_TIMEZONE` (not a valid IANA timezone),
            `INVALID_SCHEDULED_AT` (not valid ISO 8601 or in the past).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          description: >-
            Phone number cannot be called. `error` is `DO_NOT_CALL` (number is
            on the do-not-call list) or `CALIFORNIA_RESTRICTION` (number's area
            code or ZIP is in California).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          $ref: '#/components/responses/AgentNotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'
components:
  parameters:
    AgentId:
      name: agentId
      in: path
      required: true
      description: ID of the agent, e.g. `agent.abc123`.
      schema:
        type: string
  schemas:
    ScheduleSequenceRequest:
      type: object
      required:
        - name
        - phoneNumber
      description: >-
        In addition to the fields below, include every **custom input variable**
        required by the agent as a top-level string property (e.g.
        `prospect_name`, `account_id`). The exact set varies per agent and is
        configured on the agent's prompt template.
      properties:
        name:
          type: string
          description: Contact's full name.
          example: John Doe
        phoneNumber:
          type: string
          description: Contact's phone number in E.164 format.
          example: '+15551234567'
        toEmailAddress:
          type: string
          format: email
          description: >-
            Recipient email address. Required when the agent's sequence contains
            email steps.
        timezone:
          type: string
          description: >-
            IANA timezone (e.g. `America/New_York`). If omitted, inferred from
            the phone number's area code, falling back to the agent's first
            configured timezone.
        scheduledAt:
          type: string
          format: date-time
          description: >-
            Schedule the call for a specific future time (ISO 8601). Validated
            against the same timezone the scheduler uses for execution.
        bypassAllowedCallWindow:
          type: boolean
          default: false
          description: Bypass the agent's allowed call windows for this sequence.
        groupByField:
          type: string
          description: >-
            Group this contact with others sharing the same value of the named
            custom variable. Used for contact chaining — only the first contact
            per group is scheduled; the rest are chained automatically when the
            previous call ends without success.
          example: account_id
      additionalProperties:
        type: string
        description: Custom input variables defined on the agent.
    ScheduleSequenceResponse:
      type: object
      required:
        - sequence
      properties:
        sequence:
          type: object
          properties:
            sequenceId:
              type: string
              example: call-sequence.abc123
            name:
              type: string
              example: John Doe
            phoneNumber:
              type: string
              example: '+15551234567'
            scheduledAt:
              type: string
              format: date-time
            toEmailAddress:
              type: string
              format: email
            customInputVariables:
              type: object
              additionalProperties:
                type: string
            timezone:
              type: string
              example: America/New_York
            scheduledBy:
              type: string
              example: API
            steps:
              type: array
              items:
                type: object
                properties:
                  stepType:
                    type: string
                    enum:
                      - CALL
                      - EMAIL
                    example: CALL
                  delaySeconds:
                    type: integer
                    example: 0
    Error:
      type: object
      required:
        - error
        - message
      properties:
        error:
          type: string
          description: Machine-readable error code.
          example: INVALID_PHONE_NUMBER
        message:
          type: string
          description: Human-readable explanation.
  responses:
    Unauthorized:
      description: >-
        `UNAUTHORIZED` or `INVALID_API_KEY` — API key missing, invalid, or not
        authorized for this agent's organization.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            missingApiKey:
              summary: Missing API key
              value:
                error: UNAUTHORIZED
                message: >-
                  API key is required. Please provide your API key in the
                  x-api-key header.
            invalidApiKey:
              summary: Invalid API key
              value:
                error: INVALID_API_KEY
                message: The provided API key is invalid.
    AgentNotFound:
      description: >-
        `AGENT_NOT_FOUND` — agent ID does not exist or is not owned by your
        organization.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    InternalServerError:
      description: >-
        `INTERNAL_SERVER_ERROR` — unexpected server error. Retry with backoff
        and contact the 11x team if it persists.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: INTERNAL_SERVER_ERROR
            message: Internal Server Error. Please contact 11x team.
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: Organization API key. Get it from the 11x team or from the platform.

````