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

# Add prospects enrollments

> Add enrollments for prospects

## Description

The Prospect Events Enrollment endpoint enables you to monitor specific prospects for professional changes and milestones. This "subscription" approach automates tracking of individual career movements such as job changes, role changes, and work anniversaries.
When you enroll, the system will continuously monitor for new events related to your specified prospects. These events can be retrieved later or delivered via webhook, depending on your integration preferences.

### Important Considerations for Enrollments

* Multiple event types can be monitored for the same set of prospects.
* Each enrollment is uniquely identified by its enrollment\_key.
* Events are collected in the background, optimizing API usage and ensuring you don't miss important updates.

<AccordionGroup>
  <Accordion title="How It Works">
    **Input**: Define parameters including prospect\_ids, event\_types, and ttl\_days.
    **Processing**: The system registers your enrollment and begins monitoring for events.
    **Output**: A confirmation response containing your enrollment\_id for future reference.
  </Accordion>

  <Accordion title="Query Parameters">
    | Field           | Type   | Description                                                                            |
    | :-------------- | :----- | :------------------------------------------------------------------------------------- |
    | enrollment\_key | String | A unique identifier for this enrollment                                                |
    | prospect\_ids   | Array  | List of Prospect IDs to monitor for events                                             |
    | event\_types    | Array  | Types of events to monitor (e.g., prospect\_changed\_role, prospect\_changed\_company) |
  </Accordion>

  <Accordion title="Example Request (cURL)">
    ```shell Bash theme={null}
    curl -X POST \
      "https://api.explorium.ai/v1/prospects/events/enrollments" \
      -H "API_KEY: your_api_key_here" \
      -H "Content-Type: application/json" \
      -d '{
      "enrollment_key": "tech_executives_monitor",
      "prospect_ids": [
        "20ae6cbf564ee683e66685e429844a5ff8ffc30f",
        "4c485f009d59e319dc039cdf3e935b85014e6a33"
      ],
      "event_types": [
        "prospect_changed_role",
        "prospect_changed_company"
      ],
      "ttl_days": 365
    }'
    ```
  </Accordion>

  <Accordion title="Example Response">
    ```json JSON theme={null}
    {
      "request_context": {
        "correlation_id": "1234",
        "request_status": "success",
        "time_took_in_seconds": 0.515
      },
      "enrollment_key": "tech_executives_monitor",
      "enrollment_id": "en_8d52c3f1"
    }
    ```
  </Accordion>

  <Accordion title="Best Practices">
    * Use descriptive enrollment\_key values to easily identify different monitoring setups.
    * Group prospects by industry, seniority, or target accounts for organized monitoring.
    * Combine with webhook registration for real-time notifications of career changes.
  </Accordion>
</AccordionGroup>

<Icon icon="thumbtack" iconType="solid" color="red" /> **For detailed endpoint explanations, request examples, and integration tips, explore the documentation sections above.**


## OpenAPI

````yaml post /v1/prospects/events/enrollments
openapi: 3.1.0
info:
  title: Partner Service
  version: 0.2.349
servers:
  - url: https://api.explorium.ai
    description: AgentSource Server
security: []
paths:
  /v1/prospects/events/enrollments:
    post:
      tags:
        - Prospects
      summary: Add Prospects Enrollments
      description: Add enrollments for prospects
      operationId: add_prospects_enrollments
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ProspectsEnrollmentsAddRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProspectsEnrollmentsAddResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - APIKeyHeader: []
        - APIKeyHeader: []
components:
  schemas:
    ProspectsEnrollmentsAddRequest:
      properties:
        request_context:
          type: object
          title: Request Context
          example: null
          nullable: true
        enrollment_key:
          type: string
          minLength: 4
          title: Enrollment Key
        event_types:
          items:
            $ref: '#/components/schemas/ProspectsEventIdentifier'
          type: array
          minItems: 1
        prospect_ids:
          items:
            type: string
            pattern: ^[a-f0-9]{40}$
          type: array
          maxItems: 20
          minItems: 1
          title: Prospect Ids
      additionalProperties: false
      type: object
      required:
        - enrollment_key
        - event_types
        - prospect_ids
      title: ProspectsEnrollmentsAddRequest
    ProspectsEnrollmentsAddResponse:
      properties:
        response_context:
          $ref: '#/components/schemas/ResponseContext'
        enrollment_key:
          type: string
          minLength: 4
          title: Enrollment Key
        enrollment_id:
          type: string
          title: Enrollment Id
      type: object
      required:
        - response_context
        - enrollment_key
        - enrollment_id
      title: ProspectsEnrollmentsAddResponse
      description: 'This is base response model for all responses in partner service. '
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ProspectsEventIdentifier:
      type: string
      enum:
        - prospect_changed_role
        - prospect_changed_company
        - prospect_job_start_anniversary
      title: ProspectsEventIdentifier
      description: >-
        The `ProspectsEventIdentifier` class is an enumeration that defines
        event identifiers related to prospects.


        This enum is used to categorize and track events associated with
        prospects, such as:

        - Role changes (e.g., when a prospect changes their role within a
        company)

        - Company changes (e.g., when a prospect moves to a new company)

        - Job anniversaries (e.g., celebrating the anniversary of a prospect's
        job start date)


        These identifiers ensure consistent handling and classification of
        prospect-related events across the application.
    ResponseContext:
      properties:
        correlation_id:
          type: string
          title: Correlation Id
        request_status:
          $ref: '#/components/schemas/RequestStatus'
        time_took_in_seconds:
          type: number
          title: Time Took In Seconds
      type: object
      required:
        - correlation_id
        - request_status
        - time_took_in_seconds
      title: ResponseContext
    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
    RequestStatus:
      type: string
      enum:
        - success
        - miss
        - failure
      title: RequestStatus
      description: >-
        The `RequestStatus` class is an enumeration that defines the possible
        statuses of a request.


        This enum is used to indicate whether a request was successful, missed,
        or failed. It ensures

        consistent handling of request statuses across the application.


        Attributes:
            SUCCESS: Indicates that the request was successfully processed.
            MISS: Indicates that the request did not find any matching data.
            FAILURE: Indicates that the request encountered an error or failure.
  securitySchemes:
    APIKeyHeader:
      type: apiKey
      in: header
      name: api_key

````