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

# Create an enrollment

> Locks the employer's plan selection against a quote. Requires an unexpired `ready` quote and an enrollment-ready census: every active member needs `firstName`, `lastName`, and `email` (failures come back as `invalid_request` with per-member details). Prescience provisions the company (state `sandbox`), materializes the census, and starts the onboarding pipeline. On the hosted pathway (default) the signatory is also provisioned as an employer portal admin and receives a set-password invite; in test mode the invite email is suppressed (`employerPortal.inviteSuppressed: true`). Fires the `enrollment.created` webhook.



## OpenAPI

````yaml /api-reference/openapi.json post /groups/{groupId}/enrollments
openapi: 3.1.0
info:
  title: Prescience Partner API
  version: 1.1.0
  description: >-
    Create employer groups, submit census records, generate indicative quotes,
    create enrollments, and read aggregate account data.


    Money is always integer cents. Dates are `YYYY-MM-DD`; timestamps are ISO
    8601 UTC. Quotes are indicative pending underwriting confirmation. A BAA and
    data processing agreement are executed before live mode is enabled.
  contact:
    name: Prescience partner engineering
    email: partners@getprescience.com
servers:
  - url: https://www.getprescience.com/api/partner/v1
    description: >-
      Production. Test and live traffic share this host; mode comes from your
      API key.
security:
  - bearerAuth: []
tags:
  - name: Health
    description: Connectivity and key checks.
  - name: Plans
    description: Static plan metadata.
  - name: Groups
    description: 'Employer groups: the root resource of every integration.'
  - name: Census
    description: Pre-enrollment census intake and ongoing member sync.
  - name: Quotes
    description: Deterministic, synchronous quotes. Indicative pending underwriting.
  - name: Enrollments
    description: Plan selection and employer provisioning.
  - name: Account
    description: Aggregate, de-identified employer account data.
  - name: Webhooks
    description: Signed event delivery (standard-webhooks scheme).
paths:
  /groups/{groupId}/enrollments:
    post:
      tags:
        - Enrollments
      summary: Create an enrollment
      description: >-
        Locks the employer's plan selection against a quote. Requires an
        unexpired `ready` quote and an enrollment-ready census: every active
        member needs `firstName`, `lastName`, and `email` (failures come back as
        `invalid_request` with per-member details). Prescience provisions the
        company (state `sandbox`), materializes the census, and starts the
        onboarding pipeline. On the hosted pathway (default) the signatory is
        also provisioned as an employer portal admin and receives a set-password
        invite; in test mode the invite email is suppressed
        (`employerPortal.inviteSuppressed: true`). Fires the
        `enrollment.created` webhook.
      operationId: createEnrollment
      parameters:
        - $ref: '#/components/parameters/GroupId'
        - $ref: '#/components/parameters/IdempotencyKey'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EnrollmentCreateRequest'
            example:
              quoteId: qt_5b9e2c7f10ad
              signatory:
                name: Dana Park
                email: dana@acme.com
                title: Head of People
      responses:
        '201':
          description: Enrollment created. The group status moves to `enrolled`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Enrollment'
              example:
                id: enr_3f7a92c81b40
                groupId: grp_8c2f41d09a3e
                mode: test
                status: onboarding
                quoteId: qt_5b9e2c7f10ad
                startDate: '2026-09-01'
                companyDomain: acme.com
                companyState: sandbox
                onboardingMode: hosted
                employerPortal:
                  provisioned: true
                  signinUrl: https://www.getprescience.com/signin
                  inviteSuppressed: true
                onboarding:
                  percentComplete: 0
                  blockingRemaining: 0
                nextSteps:
                  - Prescience onboarding call scheduled with the employer
                  - Employer completes KYB + plan setup in the Prescience portal
                  - Prescience activates the group (state -> prod)
                createdAt: '2026-06-12T09:14:32Z'
        '400':
          description: Census not enrollment-ready. One detail entry per failing member.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error: invalid_request
                message: 2 members are missing fields required for enrollment.
                details:
                  - field: email
                    message: email is required for enrollment
                    index: 3
                  - field: lastName
                    message: lastName is required for enrollment
                    index: 9
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          description: >-
            Conflict: the group already has an active enrollment, an enrolled
            group already exists for this domain, or the quote is still
            `in_review`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error: conflict
                message: Group grp_8c2f41d09a3e already has an active enrollment.
        '410':
          description: >-
            The quote has expired (default 30-day window). Create a new quote
            and retry.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error: quote_expired
                message: >-
                  Quote qt_5b9e2c7f10ad expired on 2026-07-10. Create a new
                  quote.
        '429':
          $ref: '#/components/responses/RateLimited'
        '500':
          $ref: '#/components/responses/ServerError'
components:
  parameters:
    GroupId:
      name: groupId
      in: path
      required: true
      description: Group ID, e.g. `grp_8c2f41d09a3e`.
      schema:
        type: string
        pattern: ^grp_[0-9a-f]{12}$
      example: grp_8c2f41d09a3e
    IdempotencyKey:
      name: Idempotency-Key
      in: header
      required: false
      description: >-
        Any unique string (UUIDs work well). Replaying the same key within 24
        hours returns the stored response instead of re-executing the request.
      schema:
        type: string
        maxLength: 255
      example: 9f3b2c61-4a8d-4e2f-b1c7-d5a90e8f1a23
  schemas:
    EnrollmentCreateRequest:
      type: object
      required:
        - quoteId
        - signatory
      properties:
        quoteId:
          type: string
          example: qt_5b9e2c7f10ad
        startDate:
          type: string
          format: date
          description: Defaults to the quote's `planYearStartDate`.
          example: '2026-09-01'
        onboardingMode:
          type: string
          enum:
            - hosted
            - embedded
          default: hosted
          description: >-
            How post-enrollment onboarding runs. `hosted` (default): Prescience
            provisions the signatory as an employer portal admin and runs
            onboarding, KYB, banking, and plan setup in the Prescience employer
            portal; track progress via `GET
            /groups/{groupId}/enrollments/{enrollmentId}` or webhooks.
            `embedded`: onboarding rendered in your own UI when enabled for the
            integration.
        signatory:
          type: object
          required:
            - name
            - email
          description: >-
            The employer admin who selected the plan. On the hosted pathway,
            provisioned as the company's admin in the Prescience employer
            portal.
          properties:
            name:
              type: string
              example: Dana Park
            email:
              type: string
              format: email
              example: dana@acme.com
            title:
              type: string
              example: Head of People
    Enrollment:
      type: object
      required:
        - id
        - groupId
        - mode
        - status
        - quoteId
        - startDate
        - companyDomain
        - companyState
        - onboardingMode
        - onboarding
        - nextSteps
        - createdAt
      properties:
        id:
          type: string
          example: enr_3f7a92c81b40
        groupId:
          type: string
          example: grp_8c2f41d09a3e
        mode:
          type: string
          enum:
            - test
            - live
        status:
          type: string
          enum:
            - onboarding
            - active
          description: '`active` once Prescience flips the company to `prod`.'
        quoteId:
          type: string
          example: qt_5b9e2c7f10ad
        startDate:
          type: string
          format: date
          example: '2026-09-01'
        companyDomain:
          type: string
          example: acme.com
        companyState:
          type: string
          enum:
            - sandbox
            - prod
        onboardingMode:
          type: string
          enum:
            - hosted
            - embedded
          description: >-
            How post-enrollment onboarding runs. Stamped at creation; defaults
            to `hosted`.
        employerPortal:
          type: object
          description: >-
            Provisioning summary for the signatory's employer portal account.
            Present whenever the signatory was provisioned as an employer portal
            admin (always on the hosted pathway).
          required:
            - provisioned
            - signinUrl
            - inviteSuppressed
          properties:
            provisioned:
              type: boolean
              description: >-
                Whether the portal account was provisioned. `false` indicates a
                provisioning failure; the enrollment itself stands and
                Prescience follows up.
            signinUrl:
              type: string
              format: uri
              example: https://www.getprescience.com/signin
            inviteSuppressed:
              type: boolean
              description: >-
                `true` when the invite email was not sent. Always `true` in test
                mode: test mode never sends outbound email.
        onboarding:
          type: object
          description: Recomputed from the live onboarding checklist on every read.
          properties:
            percentComplete:
              type: integer
              minimum: 0
              maximum: 100
            blockingRemaining:
              type: integer
        nextSteps:
          type: array
          items:
            type: string
        createdAt:
          type: string
          format: date-time
    Error:
      type: object
      required:
        - error
        - message
      properties:
        error:
          type: string
          enum:
            - unauthorized
            - live_mode_disabled
            - forbidden
            - not_found
            - invalid_request
            - conflict
            - quote_expired
            - census_required
            - rate_limited
            - server_error
            - not_configured
          description: Stable machine-readable error code.
        message:
          type: string
          description: >-
            Human-readable explanation. Wording may change; branch on `error`,
            not `message`.
        details:
          type: array
          description: Present on `invalid_request`. One entry per failed field.
          items:
            type: object
            required:
              - field
              - message
            properties:
              field:
                type: string
                example: zip
              message:
                type: string
                example: zip must be a 5-digit ZIP code
              index:
                type: integer
                description: >-
                  For array payloads (census rows), the zero-based index of the
                  failing row.
                example: 7
  responses:
    Unauthorized:
      description: Missing, malformed, or revoked API key.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: unauthorized
            message: >-
              Provide a valid partner API key as `Authorization: Bearer
              psk_...`.
    NotFound:
      description: >-
        No such resource in this mode. Test keys only see test resources; live
        keys only see live resources.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: not_found
            message: No group grp_8c2f41d09a3e found.
    RateLimited:
      description: Rate limit exceeded. Honor `Retry-After`.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: rate_limited
            message: Rate limit exceeded. Retry after 12 seconds.
      headers:
        Retry-After:
          description: Seconds to wait before retrying.
          schema:
            type: integer
          example: 12
    ServerError:
      description: >-
        Something failed on our side. Safe to retry with the same
        `Idempotency-Key`.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: server_error
            message: Internal error. The request was not applied.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Partner API key. `psk_test_<32 hex>` for test mode, `psk_live_<32 hex>`
        for live mode. Keys are stored hashed and cannot be recovered; store
        them in your secrets manager on issue.

````