openapi: 3.0.3
info:
  title: CONFIRM Partner API
  version: '2026-07-24'
  description: |
    The CONFIRM Partner API lets registry and staffing platforms provision
    workspaces, push applicants to CONFIRM, have them screened by AI voice calls,
    and consume structured results, interview bookings, and background-check
    statuses — programmatically and via signed webhooks.

    ## Base URL

    ```
    https://api.confirm.global/partner/v1
    ```

    All paths in this document are relative to that base URL.

    To generate a client, [download the OpenAPI spec](/partner-guides/openapi-spec).
    It is the complete definition, including response headers such as
    `X-Request-Id`.

    ## Authentication

    Authenticate every request with a partner API key in the `Authorization`
    header:

    ```
    Authorization: Bearer cfk_...
    ```

    Keys are partner-level: one key sees every registry linked to your partner
    account and nothing else. CONFIRM issues them — there is no self-serve key
    dashboard — and each key is shown to you exactly once at creation, because
    only a hash of it is stored. A lost key is replaced, not recovered.

    Revoking a key takes effect on the very next request; there is no cache to
    wait out.

    ### Sandbox

    Development happens against a full replica of the platform with its own base
    URL and its own key:

    ```
    https://api-staging.confirm.global/partner/v1
    ```

    Telephony in the sandbox is restricted to an explicit allowlist of phone
    numbers you give us, so test applicants can be created freely with no risk of
    calling or texting a real person. Everything else behaves identically —
    screening runs, statuses advance, webhooks fire. Moving to production is a
    credentials-and-URL swap.

    ## Identifiers and idempotency

    You never have to invent an idempotency key, because the API is keyed on
    identifiers you already own:

    | Your identifier | Sent as | Maps to |
    |---|---|---|
    | Registry / business ID | `external_ref` on `POST /organizations` | A CONFIRM workspace |
    | Location ID | `external_ref` on `POST /locations` | A CONFIRM job |
    | Applicant ID | `external_ref` on `POST /candidates` | A CONFIRM candidate |

    Re-sending a request with the same reference returns the existing record
    instead of creating a second one. `POST /candidates` returns `deduped: true`
    and the original IDs; it never returns a conflict and never creates a second
    application on the same job. **Queue-and-retry is a fully supported
    strategy** — replaying your outbox is safe.

    Every response echoes your `external_ref` back, so you can correlate without
    storing CONFIRM IDs (though storing `candidate_id` is recommended — it is
    what deep links are built from).

    ## Rate limits

    600 requests per minute per key, with a burst allowance of 100 requests per
    10 seconds. Exceeding the limit returns `429` with a `Retry-After` header.

    ## Pagination

    List endpoints are cursor-paginated. Pass `limit` (max 100) and `cursor`;
    responses have the shape `{ "data": [...], "has_more": bool, "next_cursor":
    string|null }`. Pass `next_cursor` back as `cursor` to fetch the next page.

    ## Errors

    All errors use a single envelope:

    ```json
    {
      "error": {
        "type": "not_found_error",
        "code": "unknown_location_ref",
        "message": "No location is registered with ref \"loc_88213\". Create it via POST /locations, then retry this request.",
        "request_id": "8fK2nQpW-4c1a-4e77-b0d2-9f3a1c5e7b21",
        "location_ref": "loc_88213"
      }
    }
    ```

    `type` is one of `authentication_error`, `invalid_request_error`,
    `not_found_error`, `conflict_error`, `rate_limit_error`, `api_error`.
    Branch on `code` — those values are stable contract. `request_id` appears on
    every error; quote it when contacting CONFIRM support.

    A body that isn't valid JSON is `400 invalid_request`; a body over the size
    limit is `413 request_too_large`. An unexpected failure on our side is
    `500` with `type: api_error` and `code: internal_error`; it is safe to retry
    with the same body.

    The codes a webhook URL can be refused with are listed in the
    [webhooks guide](/partner-guides/webhooks#rules-for-the-url).

    ### Request IDs

    Every response, success or error, carries an `X-Request-Id` header. On an
    error it is the same value as `request_id` in the body. This header is
    stable and supported: log it next to your own record of the call, and quote
    it when contacting CONFIRM support so we can find the exact request.

    You can send your own `X-Request-Id` on a request. We use it as that
    request's ID and return it unchanged, in the header and in any error body,
    so you can correlate on an ID you already track. Keep it unique per request
    (a UUID works). If you don't send one, we generate one.

    ### Optional fields and `null`

    Sending `null` for an optional field is the same as leaving it out: the
    field is treated as not supplied. It never clears a stored value unless the
    field's description says it does (for example `auth` on
    `POST /organizations`, where `null` means the default sign-in server).

    Errors are loud by design. A `POST /candidates` naming a `location_ref` we
    don't recognise fails with `404 unknown_location_ref` rather than silently
    dropping the applicant, and the same request succeeds on retry once the
    location exists.

    ## Tenancy and isolation

    One registry is one CONFIRM workspace; one location is one job. A key can
    only ever reach registries linked to its own partner account — an
    `external_ref` belonging to another partner is indistinguishable from one
    that does not exist. Cross-business access is prevented structurally, not by
    a policy setting.

    ## Deep links

    Every candidate has a portal URL:

    ```
    https://app.confirm.global/c/{workspace}/candidates/{candidate_id}?applicationId={application_id}
            └── portal host ──┘   └── one per ──┘        └── one per ──┘               └── one per ──┘
                                      registry                applicant                     location
    ```

    `{workspace}` is returned when the registry is provisioned; `{candidate_id}`
    and `{application_id}` are returned when the applicant is ingested. The
    `applicationId` part opens the page on that location's application, so a
    link about one location never shows another. In practice you never construct
    it: **`POST /candidates` returns the complete `portal_url`** — store it as an
    opaque string on your applicant record and render it as your "View Full
    Details" link.

    ## Webhooks

    Webhooks are **per applicant** by default. Send a `webhook_url` with each
    `POST /candidates` and that applicant's lifecycle events are POSTed to that
    exact URL. There is nothing to register and no endpoint ID to keep in sync —
    append your own tracking identifier to the URL and every delivery arrives
    already correlated to your record.

    This means routing is yours to control: send a different URL per
    environment, per developer tunnel, or per applicant, and events follow.

    ### The registry default endpoint

    Per-applicant URLs cannot cover applicants **CONFIRM** sources — someone who
    applies through a job board never passes through `POST /candidates`, so
    there is no request on which to send a URL. For those, set a default
    endpoint per registry:

    ```
    PUT /organizations/{ref}/webhook   { "url": "https://..." }
    GET /organizations/{ref}/webhook
    DELETE /organizations/{ref}/webhook
    ```

    Resolution is **applicant URL first, registry default second, nothing
    third**. Setting a default never overrides an applicant's own URL, so your
    per-environment routing is unaffected.

    Deliveries are signed with HMAC-SHA256. Each request carries a
    `Confirm-Signature: t=<unix_ts>,v1=<hex hmac of "<t>.<raw body>">` header
    computed with your partner signing secret (`cfwh_...`, issued alongside your
    API key). Reject deliveries where `|now - t|` exceeds 5 minutes. Delivery is
    at-least-once with exponential backoff for up to 24 hours on non-2xx
    responses; ordering is **not** guaranteed — use the event's `created_at`
    timestamp and idempotent handling keyed on the event `id`.

    ### Events

    Six event types are delivered today. Every event is about **one
    application**, which means one applicant at one location: `data` always
    carries that location's `location_ref` and `application_id`. An applicant
    at several locations has a separate status at each, and gets separate
    events for each.

    * `candidate.created` — **CONFIRM found an applicant you have not seen.**
      Only fires for applicants we sourced (job board, career site), never for
      ones you sent us — you already hold both IDs from the `POST /candidates`
      response. Carries the person (name, phone, email, `source`) plus our
      `candidate_id` / `application_id`, so you can create your side of the
      record. `external_ref` is `null`, because you have no ID for them yet; to
      complete the pairing, POST the applicant to `/candidates` with your own
      `external_ref` and the same phone — ingest binds it to the existing
      candidate instead of creating a second one.
    * `candidate.status_changed` — the applicant's status changed. `data.status`
      is one of five coarse values: `screening`, `review`, `interview`, `hired`,
      `rejected`. This deliberately does **not** expose CONFIRM's internal
      pipeline stages, which differ per registry and change as the product
      changes; the five-value enum is the stable contract. Movements that don't
      change the coarse status are suppressed. An outcome you set yourself
      with `PATCH /candidates/{external_ref}` also fires this event, so expect
      the echo of your own change and deduplicate it.
    * `screening.completed` — an AI screening finished AND its analysis is
      ready. Carries `result` (`passed` | `failed` | `incomplete`), `tier`
      (`strong` | `moderate` | `limited` | `pending` | `ineligible`), and
      `transcript_url` / `recording_url` — which are **portal links, not
      content**. Transcripts and recordings stay behind portal authentication.
    * `candidate.placed` — the registry office chose this location for the
      applicant in CONFIRM. Carries `placed_at` and `placed_via`. Fires once
      per application. It does not close the applicant's other locations.
    * `candidate.location_added` — the applicant now also has an application
      at another location, added with
      `POST /candidates/{external_ref}/locations`. Carries `screening` and
      `screening_source_application_id`.
    * `candidate.location_changed` — the applicant was moved from one location
      to another. Carries `from_location_ref` / `to_location_ref` and
      `from_application_id` / `to_application_id`. A move sends no `rejected`
      for the location they left.

    Everything else in the `EventType` enum is committed roadmap. Write your
    handler to ignore types it doesn't recognise.

    ### Envelope

    ```json
    {
      "id": "0f9d3c14-8a2b-4e77-b6c1-5d2e8a4f1093",
      "type": "candidate.status_changed",
      "created_at": "2026-07-28T14:03:22.481Z",
      "data": {
        "candidate_id": "9f4c2e81-6d3a-4b7e-a1c2-8e5f0d743b16",
        "application_id": "51c0a7de-2f18-4a3e-96b7-1d0c8b2e4a77",
        "external_ref": "cl_app_84321",
        "location_ref": "cl_loc_88213",
        "org_ref": "cl_reg_4471",
        "portal_url": "https://app.confirm.global/c/suncoast-nurse-registry/candidates/9f4c2e81-6d3a-4b7e-a1c2-8e5f0d743b16?applicationId=51c0a7de-2f18-4a3e-96b7-1d0c8b2e4a77",
        "status": "review",
        "previous_status": "screening",
        "occurred_at": "2026-07-28T14:03:22.402Z"
      }
    }
    ```

    Deduplicate on `id`. Every `data` block carries both systems' identifiers,
    so no event needs a lookup to interpret.

    ### Retries

    Non-2xx, a 10s timeout, or a connection failure is retried at roughly
    1 min → 5 min → 30 min → 2 h → 6 h → 15 h, then abandoned after ~24 hours
    (and CONFIRM engineering is alerted). A retried delivery carries the payload
    as it was when the event fired, not an updated one. Bulk actions on the
    registry side are dispatched in small batches rather than as a burst.
servers:
  - url: https://api.confirm.global/partner/v1
security:
  - partnerKey: []
tags:
  - name: Organizations
    description: Provision and manage the registries (child organizations) under your partner account.
  - name: Locations
    description: A registry's locations. One location is one screening-ready job, geocoded from its street address.
  - name: Users
    description: Pre-create and update registry user accounts so their first sign-in is instant.
  - name: Candidates
    description: >
      Ingest applicants from your platform, at one location or several, add or
      move their locations, and report your own outcome (withdrawn, not hired,
      hired) for each location.
  - name: Webhooks
    description: >
      Signed event delivery. There are no endpoints to manage — you supply a
      `webhook_url` per applicant on `POST /candidates` and we deliver that
      applicant's events to it.
  - name: Events
    description: Partner-wide event log for recovery, audit, and replay.
paths:
  /whoami:
    get:
      operationId: whoami
      tags:
        - Organizations
      summary: Check your credentials
      description: |
        Returns the partner your key belongs to, the environment it is bound to,
        and every registry it can reach. No side effects.

        The fastest way to confirm a key works and is pointed at the right
        environment — worth making the first call in any integration, and the
        first thing to try when something 401s or 403s.
      responses:
        '200':
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
          description: The identity behind this key.
          content:
            application/json:
              schema:
                type: object
                properties:
                  partner:
                    type: string
                    description: Your partner slug.
                    example: carelink
                  name:
                    type: string
                    example: CareLink
                  environment:
                    type: string
                    enum: [production, sandbox]
                    description: >
                      The environment this key is bound to. A key presented to
                      any other environment is refused with `wrong_environment`.
                    example: sandbox
                  organizations:
                    type: array
                    description: Every registry this key can reach, by your own reference.
                    items:
                      type: object
                      properties:
                        external_ref:
                          type: string
                          example: cl_biz_4471
              examples:
                whoami:
                  value:
                    partner: carelink
                    name: CareLink
                    environment: sandbox
                    organizations:
                      - external_ref: cl_biz_4471
                      - external_ref: cl_biz_5522
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
          description: The key is valid but bound to a different environment.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /organizations:
    post:
      operationId: createOrganization
      tags:
        - Organizations
      summary: Provision a registry workspace
      description: |
        Provisions a complete CONFIRM workspace for one of your registries: the
        organization, its cloned AI screening agent, and registry-branded
        candidate messaging. Call it when a business is created on your side, or
        when they enable recruiting.

        Returns the **workspace identifier** — the one-per-business value you
        store and use to recognise and build CONFIRM links.

        Idempotent on `external_ref`: calling it again returns the existing
        workspace with `created: false` and the same body, so your job never has
        to branch on whether it has run before.

        A dedicated phone number with caller-ID registration is provisioned
        separately by CONFIRM, since it requires carrier registration that
        cannot complete synchronously.

        **A new workspace has no calendar, so its screening calls are held.**
        The response carries `calendar.connected`. While it is `false`,
        `warnings` says so and screening calls in the workspace wait. Send a
        calendar-connect link with
        [`POST /organizations/{ref}/calendar-invite`](/partner-api/organizations/create-calendar-invite);
        held calls go out once a calendar is connected. See the
        [calendar guide](/partner-guides/calendar).
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - external_ref
                - name
              properties:
                external_ref:
                  type: string
                  description: Your registry/business identifier. The key this workspace is correlated on, forever.
                  example: cl_biz_4471
                name:
                  type: string
                  description: Display name of the registry. Appears in the portal and in candidate-facing messaging.
                  example: Suncoast Nurse Registry
                primary_contact_email:
                  type: string
                  format: email
                  description: Registry's primary contact. Used for administrative correspondence, not candidate messaging.
                  example: admin@suncoastnurses.com
                details:
                  type: object
                  description: Optional profile enrichment used in screening context and job copy.
                  properties:
                    timezone:
                      type: string
                      description: IANA timezone used for call windows and scheduling.
                      example: America/New_York
                    website:
                      type: string
                      example: https://suncoastnurses.com
                    industry:
                      type: string
                      example: Home Health Care
                    description:
                      type: string
                      example: Nurse registry serving Pinellas and Hillsborough counties.
                auth:
                  type: object
                  nullable: true
                  description: >-
                    **Sandbox only.** Which CareLink auth server this workspace's
                    users sign in against. Omit it to use the default (your
                    staging auth server in sandbox). `auth: null` and `auth: {}`
                    both mean the default sign-in server, the same as sending
                    `base_url: null`. In production it is ignored
                    with a warning, since production workspaces always use the
                    production auth server.
                  properties:
                    base_url:
                      type: string
                      format: uri
                      nullable: true
                      description: >-
                        Origin of the auth server: HTTPS, no path or query. Must be
                        one of your developer auth tunnels
                        (`<name>-web-auth.carelinkhc-dev.com`) or your staging auth
                        server (`https://auth-stage.carelinkhc.com`, the default);
                        anything else returns `400` with
                        `details[].field = auth.base_url`. Posting the same
                        `external_ref` again with a different value re-points the
                        workspace, so a developer can move to a new tunnel without
                        tearing it down. Send `null` (or your staging auth server)
                        to put the workspace back on the default. Leaving `auth` out
                        keeps whatever is set, so replays are safe. Users are identified by this server plus
                        their `sub`, so the same user ID on two developers' servers
                        is two different people.
                      example: https://jeremy-web-auth.carelinkhc-dev.com
            examples:
              created:
                summary: Provision a registry
                value:
                  external_ref: cl_biz_4471
                  name: Suncoast Nurse Registry
                  primary_contact_email: admin@suncoastnurses.com
                  details:
                    timezone: America/New_York
                    website: https://suncoastnurses.com
      responses:
        '201':
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
          description: >-
            Workspace provisioned. Posting an `external_ref` that already exists returns **200** with the same workspace and `created: false`, so replays never create a second workspace.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PartnerOrganization'
              examples:
                created:
                  value:
                    organization_id: 9f4c2e81-6d3a-4b7e-a1c2-8e5f0d743b16
                    external_ref: cl_biz_4471
                    name: Suncoast Nurse Registry
                    workspace: suncoast-nurse-registry
                    workspace_url: https://app.confirm.global/c/suncoast-nurse-registry
                    created: true
                    calendar:
                      connected: false
                    warnings:
                      - No calendar connected — screening calls are held until someone in this workspace connects a calendar. Use POST /organizations/{ref}/calendar-invite.
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/RateLimited'
    get:
      operationId: listOrganizations
      tags:
        - Organizations
      summary: List registries
      description: >
        Returns every registry linked to your partner account, with the
        workspace identifier and URL for each, and `calendar.connected`. Use it
        to reconcile your side against ours, and to find workspaces whose
        screening calls are held for want of a calendar.
      responses:
        '200':
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
          description: The registries this key can reach.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/PartnerOrganization'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/RateLimited'
  /organizations/{external_ref}:
    delete:
      operationId: deleteOrganization
      tags:
        - Organizations
      summary: Delete a development workspace
      description: |
        Tears down a workspace you created, so a development environment can be
        reset and rebuilt. Built for exactly one job: letting your developers
        create and destroy throwaway registries while they build against us.

        **Sandbox only.** This endpoint is not enabled in production and answers
        `403 delete_disabled` there. Production workspaces hold real candidates;
        removing one is a support request, not an API call.

        Three conditions must all hold or nothing is touched:

        1. The workspace is linked to your partner account.
        2. **You created it through `POST /organizations`.** A workspace CONFIRM
           linked to your account by hand — a real registry — can never be
           deleted here, and answers `403 not_partner_created`.
        3. Deletion is enabled in the environment you are calling.

        The workspace and everything in it (candidates, locations, the screening
        agent) is soft-deleted and can be restored by CONFIRM support. Nothing
        shared between registries is affected.

        **The `external_ref` is released.** Calling `POST /organizations` again
        with the same reference provisions a *new* workspace rather than
        returning the deleted one, so teardown-and-recreate works as many times
        as you need it to.
      parameters:
        - name: external_ref
          in: path
          required: true
          schema:
            type: string
          description: The registry reference you provisioned the workspace with.
          example: cl_biz_dev_kyle
      responses:
        '200':
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
          description: Workspace deleted.
          content:
            application/json:
              schema:
                type: object
                properties:
                  organization_id:
                    type: string
                    format: uuid
                  external_ref:
                    type: string
                  name:
                    type: string
                  deleted:
                    type: boolean
                    example: true
                  deleted_items:
                    type: object
                    description: What the teardown removed, for your logs.
                    properties:
                      candidates:
                        type: integer
                      jobs:
                        type: integer
                      users:
                        type: integer
                      agent_configs:
                        type: integer
                      queued_calls_cancelled:
                        type: integer
                        description: >-
                          Screening calls that were queued for this workspace's
                          applicants and are now cancelled, so a deleted
                          workspace never dials anyone. Calls already in
                          progress are left to finish.
              examples:
                deleted:
                  value:
                    organization_id: 9f4c2e81-6d3a-4b7e-a1c2-8e5f0d743b16
                    external_ref: cl_biz_dev_kyle
                    name: Kyle Dev Registry
                    deleted: true
                    deleted_items:
                      candidates: 0
                      jobs: 2
                      users: 0
                      agent_configs: 3
                      queued_calls_cancelled: 1
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
          description: >
            Deletion refused. `code` says which condition failed:
            `delete_disabled` (not available in this environment) or
            `not_partner_created` (the workspace was not created through this
            API).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                not_partner_created:
                  summary: Not yours to delete
                  value:
                    error:
                      type: authentication_error
                      code: not_partner_created
                      message: This organization was not created through the Partner API and cannot be deleted here. Contact CONFIRM support if it really should be removed.
                      request_id: req_01HZY8K3M4N5P6Q7R8S9T0
                delete_disabled:
                  summary: Not available in this environment
                  value:
                    error:
                      type: authentication_error
                      code: delete_disabled
                      message: Organization deletion is disabled in this environment. It is available on staging only.
                      request_id: req_01HZY8K3M4N5P6Q7R8S9T0
        '404':
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
          description: No workspace with that reference belongs to your partner account.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                unknown:
                  value:
                    error:
                      type: not_found_error
                      code: unknown_organization_ref
                      message: No organization is registered with that reference for this partner.
                      request_id: req_01HZY8K3M4N5P6Q7R8S9T0
        '429':
          $ref: '#/components/responses/RateLimited'
  /organizations/{ref}/webhook:
    put:
      operationId: setOrgWebhookEndpoint
      tags:
        - Webhooks
      summary: Set the registry's default webhook endpoint
      description: |
        Sets (or replaces) the fallback delivery target for this registry.

        It is used for any applicant that has **no** `webhook_url` of their own —
        in practice, everyone CONFIRM sourced. Applicants you sent us keep using
        the URL you supplied with them; this never overrides that.

        Idempotent: sending the same URL twice returns the same record. There is
        exactly one endpoint per registry, so there is no endpoint ID for you to
        store.

        The URL is held to the same rules as a per-applicant `webhook_url`:
        HTTPS, a public host that exists in DNS, no embedded credentials, 2048
        characters at most. A URL that breaks a rule returns `400` with one of
        the codes in the
        [webhooks guide](/partner-guides/webhooks#rules-for-the-url):
        `invalid_webhook_url`, `webhook_url_not_https`,
        `webhook_url_forbidden_host`, `webhook_url_too_long`, or
        `webhook_url_unresolvable`.
      parameters:
        - name: ref
          in: path
          required: true
          description: Your registry identifier (the `external_ref` you created it with).
          schema:
            type: string
          example: cl_reg_4471
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - url
              properties:
                url:
                  type: string
                  format: uri
                  maxLength: 2048
                  description: HTTPS endpoint that receives this registry's fallback deliveries.
                  example: https://hooks.example.com/confirm/registry/4471
      responses:
        '201':
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
          description: >-
            Default endpoint created. Sending again for a registry that already has one returns **200** and replaces the URL.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OrgWebhookEndpoint'
        '400':
          $ref: '#/components/responses/WebhookUrlRejected'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/UnknownOrganizationRef'
        '429':
          $ref: '#/components/responses/RateLimited'
    get:
      operationId: getOrgWebhookEndpoint
      tags:
        - Webhooks
      summary: Read the registry's default webhook endpoint
      parameters:
        - name: ref
          in: path
          required: true
          schema:
            type: string
          example: cl_reg_4471
      responses:
        '200':
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
          description: The configured endpoint.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OrgWebhookEndpoint'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
          description: >-
            This registry has no default endpoint (`no_webhook_endpoint`), or no
            registry is registered with that ref (`unknown_organization_ref`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                no_webhook_endpoint:
                  summary: No default endpoint set
                  value:
                    error:
                      type: not_found_error
                      code: no_webhook_endpoint
                      message: This registry has no default webhook endpoint. Set one with PUT /organizations/{ref}/webhook.
                      request_id: 3cV8pLwQ-7e2b-4a91-8d05-1f6b9c2e4a70
                      organization_ref: cl_reg_4471
                unknown_organization_ref:
                  summary: Unknown registry
                  value:
                    error:
                      type: not_found_error
                      code: unknown_organization_ref
                      message: No registry is registered with ref "cl_reg_9999".
                      request_id: 5dR2hNkT-1a9c-4f37-b6e8-0c4d7a2f9b15
                      organization_ref: cl_reg_9999
        '429':
          $ref: '#/components/responses/RateLimited'
    delete:
      operationId: deleteOrgWebhookEndpoint
      tags:
        - Webhooks
      summary: Remove the registry's default webhook endpoint
      description: >
        Stops fallback deliveries for this registry. Applicants that carry their
        own `webhook_url` are unaffected — this only removes the fallback.

        Idempotent: it returns `204` whether or not a default endpoint was set,
        so your sync can repeat it freely. The only `404` is for a registry ref
        we don't know (`unknown_organization_ref`).
      parameters:
        - name: ref
          in: path
          required: true
          schema:
            type: string
          example: cl_reg_4471
      responses:
        '204':
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
          description: Endpoint removed, or there was no default endpoint to remove.
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/UnknownOrganizationRef'
        '429':
          $ref: '#/components/responses/RateLimited'
  /organizations/{ref}/calendar-invite:
    post:
      operationId: createCalendarInvite
      tags:
        - Organizations
      summary: Send a calendar-connect link
      description: |
        Issues a link that lets someone connect a calendar to this registry's
        workspace without a CONFIRM login.

        **Why it matters.** Screening calls in a workspace are held while it
        has no connected calendar, because an applicant who passes is sent a
        booking link on that calendar. A workspace you provision starts
        without one (`calendar.connected: false` on the organization). Held
        calls go out once a calendar is connected; nothing needs to be
        re-sent.

        **What the invitee does.** They open `invite_url` and connect their
        Google or Outlook calendar. They never create a password or sign in
        to the portal. If the workspace has no calendar yet, the one they
        connect becomes the workspace calendar.

        **Email.** By default CONFIRM emails the link to `email`. Send
        `send_email: false` to deliver `invite_url` yourself (for example,
        inside your own product). `emailed` in the response says whether the
        email went out: it is `false` when you turned it off, and also when
        sending failed, in which case the link still works and you should
        deliver it yourself.

        **Idempotent per address.** `201` creates a new link. `200` returns
        the still-pending, unexpired link already issued to the same address
        in this workspace, with its original `expires_at` (and emails it
        again unless `send_email` is `false`). A link is valid for 7 days and
        works once.

        **Existing accounts.** An address that already has a CONFIRM account
        returns `409 email_has_account`: an account belongs to one workspace,
        so the link could not be redeemed. Invite a different address. Someone
        who already has an account in this workspace can connect a calendar
        from Settings → Integrations in the portal.
      parameters:
        - name: ref
          in: path
          required: true
          description: Your registry identifier (the `external_ref` you created it with).
          schema:
            type: string
          example: cl_biz_4471
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - email
              properties:
                email:
                  type: string
                  format: email
                  maxLength: 254
                  description: Who should connect the calendar. Usually the registry's scheduler or office manager.
                  example: scheduling@suncoastnurses.com
                first_name:
                  type: string
                  nullable: true
                  maxLength: 200
                  description: Used to greet the invitee in the email. Omit it or send `null` if unknown; a blank string is rejected.
                  example: Dana
                last_name:
                  type: string
                  nullable: true
                  maxLength: 200
                  description: The invitee's last name. Omit it or send `null` if unknown; a blank string is rejected.
                  example: Whitfield
                send_email:
                  type: boolean
                  nullable: true
                  default: true
                  description: >-
                    `false` to skip CONFIRM's email and deliver `invite_url`
                    yourself. Omitted or `null` means `true`.
            examples:
              emailed:
                summary: CONFIRM emails the link
                value:
                  email: scheduling@suncoastnurses.com
                  first_name: Dana
                  last_name: Whitfield
              self_delivered:
                summary: You deliver the link
                value:
                  email: scheduling@suncoastnurses.com
                  send_email: false
      responses:
        '201':
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
          description: >-
            Link created. When a pending, unexpired link already exists for this
            address in this workspace, you get **200** with that link instead.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CalendarInvite'
              examples:
                emailed:
                  value:
                    invite_url: https://app.confirm.global/calendar-connect/4b9e2c71-0d5a-4f83-9a16-7e2c5d8b1f40
                    email: scheduling@suncoastnurses.com
                    expires_at: '2026-10-13T15:20:41.512Z'
                    emailed: true
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/UnknownOrganizationRef'
        '409':
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
          description: >-
            The address already has a CONFIRM account (`email_has_account`),
            either in another workspace or as a regular user in this one. Invite
            a different address.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                other_workspace:
                  summary: Account in another workspace
                  value:
                    error:
                      type: conflict_error
                      code: email_has_account
                      message: dana@example.com already has a CONFIRM account in another workspace, and an account belongs to one workspace. Invite a different address.
                      request_id: 4nT6cWqB-8a2f-4d17-b3e9-6f0c1a5d7e28
                      organization_ref: cl_biz_4471
                same_workspace:
                  summary: Already a user in this workspace
                  value:
                    error:
                      type: conflict_error
                      code: email_has_account
                      message: dana@suncoastnurses.com already has an account in this workspace. That person can sign in and connect a calendar from Settings → Integrations, or invite a different address.
                      request_id: 1sJ9eHvM-5c3b-4a60-8f27-2d4e9b7c0a15
                      organization_ref: cl_biz_4471
        '429':
          $ref: '#/components/responses/RateLimited'
  /locations:
    post:
      operationId: createLocation
      tags:
        - Locations
      summary: Create a location
      description: |
        Creates a screening-ready job for one of a registry's locations. Call it
        when a location is added on your side.

        **Send a real street address.** CONFIRM's distance screening measures a
        candidate's commute against it, so a location without one is created
        successfully but screens nobody on distance — the response says so in
        `warnings`.

        **You do not have to supply the job.** Omit `title` and `description`
        and CONFIRM scaffolds its standard caregiver role for you — title,
        responsibilities, requirements and benefits — so your location-created
        job can post the address and nothing else. Supply them only when the
        location hires for something other than the default role.

        **Titles.** Without a `title`, the job is titled "Caregiver — " followed
        by the location's `name` — or, when there is no `name`, its city, then
        the registry's name. A `title` you send is stored exactly as you send
        it, here or on `PATCH /locations/{ref}`; nothing is added to it. So you
        never need to send the "Caregiver — " prefix yourself. If you rename a
        location with `PATCH` and want to keep that style, send the whole title
        you want, e.g. `"Caregiver — Denver North"`.

        **Send the pay rate.** The screening call tells applicants what the
        location pays. A location without `pay` is created, but the response
        carries the warning "No pay rate set — the pay question will be skipped
        on screening calls for this location." See `pay` below for the rules.

        **Idempotent on `external_ref`** within the registry. Posting a ref that
        already exists returns `200` with the existing location and
        `created: false`, and changes nothing: a new `name`, `title`, address or
        `pay` in the body is ignored, and the response reports the pay the
        location already has. Use `PATCH /locations/{ref}` to change a
        location.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - external_ref
                - organization_ref
              properties:
                external_ref:
                  type: string
                  description: Your location identifier. Referenced later as `location_ref` when ingesting applicants.
                  example: cl_loc_88213
                organization_ref:
                  type: string
                  description: The registry this location belongs to (the `external_ref` you provisioned it with).
                  example: cl_biz_4471
                name:
                  type: string
                  description: >
                    The location's own name. Used to title the scaffolded job
                    ("Caregiver — Clearwater") when you don't supply `title`.
                    Without a `name`, the title uses the city, then the registry
                    name.
                  example: Clearwater
                title:
                  type: string
                  minLength: 1
                  description: >
                    The job title for this location, stored exactly as you send
                    it. Optional — omit it and the default caregiver role is
                    used, titled "Caregiver — {name}".
                  example: Certified Nursing Assistant — Clearwater
                description:
                  type: string
                  description: >
                    Role description. Used in candidate-facing copy and
                    screening context. Optional — omit it and the default
                    caregiver description is used.
                employment_type:
                  type: string
                  description: Defaults to `full-time` when omitted.
                  example: full-time
                address:
                  $ref: '#/components/schemas/StreetAddress'
                pay:
                  $ref: '#/components/schemas/LocationPayInput'
            examples:
              scaffolded:
                summary: Add a location, let CONFIRM write the job
                value:
                  external_ref: cl_loc_88213
                  organization_ref: cl_biz_4471
                  name: Clearwater
                  address:
                    street: 1100 Cleveland St
                    city: Clearwater
                    state: FL
                    postal_code: '33755'
                    country: US
                  pay:
                    min: 17
                    max: 21
                    period: hourly
              explicit:
                summary: Add a location with your own job copy
                value:
                  external_ref: cl_loc_88213
                  organization_ref: cl_biz_4471
                  title: Certified Nursing Assistant — Clearwater
                  description: Provide direct resident care under an RN's supervision…
                  employment_type: part-time
                  address:
                    street: 1100 Cleveland St
                    city: Clearwater
                    state: FL
                    postal_code: '33755'
                    country: US
      responses:
        '201':
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
          description: >-
            Location created, with its job scaffolded. Posting an `external_ref` that already exists returns **200** with the existing location and `created: false`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PartnerLocation'
              examples:
                scaffolded:
                  value:
                    location_id: 2b7f91a4-33cd-4a02-9e61-70c8d4e1a55f
                    external_ref: cl_loc_88213
                    organization_ref: cl_biz_4471
                    title: Caregiver — Clearwater
                    status: active
                    geocoded: true
                    created: true
                    pay:
                      min: 17
                      max: 21
                      period: hourly
                      text: null
                explicit:
                  value:
                    location_id: 2b7f91a4-33cd-4a02-9e61-70c8d4e1a55f
                    external_ref: cl_loc_88213
                    organization_ref: cl_biz_4471
                    title: Certified Nursing Assistant — Clearwater
                    status: active
                    geocoded: true
                    created: true
                    pay: null
                    warnings:
                      - No pay rate set — the pay question will be skipped on screening calls for this location.
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
          description: >-
            No registry is registered with that `organization_ref`
            (`unknown_organization_ref`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          $ref: '#/components/responses/RateLimited'
    get:
      operationId: listLocations
      tags:
        - Locations
      summary: List locations
      description: >
        Returns the locations visible to your key. Pass `organization_ref` to
        scope the list to a single registry. Each location carries its `pay`
        (or `null`) and its standing `warnings`, including the no-pay warning
        for a location with no pay rate.
      parameters:
        - name: organization_ref
          in: query
          required: false
          schema:
            type: string
          description: Limit results to one registry.
      responses:
        '200':
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
          description: Locations.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/PartnerLocation'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
          description: Unknown `organization_ref`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          $ref: '#/components/responses/RateLimited'
  /locations/{ref}:
    patch:
      operationId: updateLocation
      tags:
        - Locations
      summary: Update or close a location
      description: |
        Updates a location's title, description, address, or pay, or closes it
        to new applicants with `status: closed`. Omitted fields are unchanged;
        closing a location leaves existing candidates and their in-flight
        screenings untouched.

        **Pay.** `pay` replaces the stored pay rate as a whole: a key you leave
        out is cleared, not kept. `pay: null` clears the pay rate; leaving `pay`
        out leaves it alone. A location with no pay after the update answers
        with the no-pay warning in `warnings`.

        **Closing.** While a location is closed, `POST /candidates` to it returns
        `409 location_closed` for new applicants. An applicant you sent before
        closing still returns `200` with `deduped: true`, so replaying a retry
        queue is safe. Set `status: active` to accept applicants again. Closing
        and reopening don't touch the address or coordinates, so distance
        screening resumes as it was.

        **Address.** `address` replaces the stored address as a whole: a field
        you leave out is cleared, not kept. Send the full address every time.
        The location is re-geocoded, and the previous coordinates are cleared
        first so a stale fix can never outlive the address it came from. An
        address without a street still geocodes, to the centre of the city or
        ZIP, and the response carries a warning saying so.

        **`geocoded`** always reflects the location's coordinates after the
        update, including on updates that don't change the address.

        **Same ref in several registries.** Location refs only need to be unique
        within a registry. If you use the same ref in more than one, pass
        `organization_ref` to say which; without it the request returns
        `409 ambiguous_location_ref`.
      parameters:
        - name: ref
          in: path
          required: true
          schema:
            type: string
          description: Your location identifier (`external_ref`).
          example: cl_loc_88213
        - name: organization_ref
          in: query
          required: false
          schema:
            type: string
          description: >
            The registry the location belongs to. Only required when the same
            location ref exists in more than one of your registries.
          example: cl_biz_4471
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                title:
                  type: string
                  minLength: 1
                  description: >
                    Replaces the title, stored exactly as you send it. No
                    "Caregiver — " prefix is added; to keep that style, send the
                    whole title, e.g. `"Caregiver — Denver North"`.
                  example: Caregiver — Denver North
                description:
                  type: string
                employment_type:
                  type: string
                address:
                  $ref: '#/components/schemas/StreetAddress'
                  description: Replaces the stored address as a whole. Fields left out are cleared.
                status:
                  type: string
                  enum: [active, closed]
                  description: >
                    Set `closed` to stop accepting new applicants at this
                    location (`POST /candidates` returns `409 location_closed`),
                    and `active` to reopen it.
                pay:
                  allOf:
                    - $ref: '#/components/schemas/LocationPayInput'
                  nullable: true
                  description: >
                    Replaces the location's pay rate as a whole (keys left out
                    are cleared). `null` clears the pay rate; omit the field to
                    leave it unchanged.
            examples:
              set_pay:
                summary: Set an hourly pay range
                value:
                  pay:
                    min: 18
                    max: 22
                    period: hourly
              clear_pay:
                summary: Clear the pay rate
                value:
                  pay: null
      responses:
        '200':
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
          description: The updated location.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PartnerLocation'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
          description: >-
            No location is registered with that ref (`unknown_location_ref`), or
            `organization_ref` is not one of your registries
            (`unknown_organization_ref`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '409':
          $ref: '#/components/responses/AmbiguousLocationRef'
        '429':
          $ref: '#/components/responses/RateLimited'
  /users:
    put:
      operationId: upsertUser
      tags:
        - Users
      summary: Create or update a registry user
      description: |
        Keeps registry user accounts in sync with yours, so a user's first
        sign-in to CONFIRM is instant rather than provisioned on the spot.

        **Also reactivates.** Sending a user you deactivated with
        `DELETE /users/{external_user_ref}` brings back the same account
        (`200`, `created: false`).

        **Users in several registries.** Send the user once per registry, with
        the same `external_user_ref` and a different `organization_ref`. Each
        call adds that registry to the same account; nothing is moved, and a
        single CareLink sign-in reaches every registry the user belongs to.
        Signing in through a registry's link opens that registry; a user who
        isn't a member of it is told they don't have access.
        `DELETE /users/{external_user_ref}?organization_ref=` removes one
        registry and leaves the others.

        **Identity is keyed on your user ID.** Matching is by
        `external_user_ref` first, then by email (case-insensitive). That
        ordering is what makes an email or name change on your side *update* the
        existing account — this endpoint can never produce a duplicate.

        **Permissions are not synced.** Your system tells us who a user is and
        which registry they belong to; what they can do inside CONFIRM is
        governed by CONFIRM roles, managed in the portal. Role changes on your
        side are deliberately ignored.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - external_user_ref
                - organization_ref
                - email
              properties:
                external_user_ref:
                  type: string
                  description: Your identifier for this user. The primary identity key.
                  example: cl_user_5512
                organization_ref:
                  type: string
                  description: >
                    A registry this user belongs to. Sending the same user for
                    another registry adds that registry; it doesn't move them.
                  example: cl_biz_4471
                email:
                  type: string
                  format: email
                  example: jeff@suncoastnurses.com
                first_name:
                  type: string
                  example: Jeff
                last_name:
                  type: string
                  example: Cortland
      responses:
        '201':
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
          description: >-
            Account created. Sending an existing `external_user_ref` or email returns **200** and updates that account.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PartnerUser'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
          description: Unknown `organization_ref`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          $ref: '#/components/responses/RateLimited'
  /users/{external_user_ref}:
    delete:
      operationId: deactivateUser
      tags:
        - Users
      summary: Remove a user from a registry
      description: |
        Takes a user's access to one registry away when they leave it or are
        deactivated on your side. Their access ends on their next request; an
        open session does not keep working until it expires.

        **One registry at a time.** For a user in several registries, this
        removes only the registry named by `organization_ref`; they keep the
        others. When it removes their last registry, the account is
        deactivated.

        **Reversible.** The account is kept as it is (email, your user ID,
        workspace). To give the user that registry back, send them again with
        `PUT /users` for it: you get the **same** account back (`200`,
        `created: false`).

        Idempotent: deactivating a user who is already deactivated also
        returns `204`, so your sync can replay it freely.

        The user is identified within the registry named by
        `organization_ref`, using that registry's auth server, the same way
        `PUT /users` identifies them. It never affects a user in another
        registry.
      parameters:
        - name: external_user_ref
          in: path
          required: true
          description: Your user ID (the `external_user_ref` you sent to `PUT /users`). Must not be blank.
          schema:
            type: string
            minLength: 1
          example: cl_user_5512
        - name: organization_ref
          in: query
          required: true
          description: The registry the user belongs to (its `external_ref`).
          schema:
            type: string
          example: cl_biz_4471
      responses:
        '204':
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
          description: Removed from the registry (or already removed).
        '400':
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
          description: >-
            `invalid_request`: `organization_ref` is missing, or the user ref in
            the path is blank.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
          description: >-
            `unknown_organization_ref` (no registry with that ref) or
            `unknown_user_ref` (no such user in that registry).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          $ref: '#/components/responses/RateLimited'
  /candidates:
    post:
      operationId: createCandidate
      tags:
        - Candidates
      summary: Ingest an applicant
      description: |
        Ingests an applicant from your platform and starts screening. The
        applicant's registry is resolved from `location_ref`, so you do not pass
        an organization — one call, one applicant, wherever they applied.

        **Several locations at once.** Send `location_refs` (an array of 1–20
        location refs) instead of `location_ref` to put one applicant at
        several locations in one call. Send exactly one of the two. You get
        one candidate with one application per location, and the response
        lists them in `applications[]`. The applicant is screened **once**: one
        heads-up SMS and one screening call cover every location named in the
        request. All the locations must be in the same registry, or the
        request fails with `400 location_refs_span_organizations` and nothing
        is created. See the
        [multiple locations guide](/partner-guides/multiple-locations).

        **What happens next.** The applicant receives a heads-up SMS
        immediately and an AI screening call a few minutes later. Results land
        in the registry's CONFIRM portal, at the `portal_url` in the response.

        **Store two things:** `candidate_id` and `portal_url`. The first is the
        durable correlation key; the second is your "View Full Details" link.

        **Idempotency.** Re-submitting the same applicant returns the existing
        IDs with `deduped: true` and a `200`. A duplicate never conflicts and
        never creates a second application on the same location. Matching is by your
        `external_ref` first, then by email, then by phone number with a matching
        name (same last name, and the same first name or first initial). A US
        number with or without the leading 1 is the same number. So an
        applicant who reaches a registry through both your intake form and a job
        board resolves to one person, not two.

        **A re-send never overwrites contact details.** When the applicant
        already exists, their name, email and phone stay as they are. Blank
        fields are filled in, and a new email or phone is kept as an extra
        contact for that person.

        **Shared phones and emails stay separate people.** A phone or email match
        only links to a candidate you have not already sent under a *different*
        `external_ref` (in practice, someone who applied through a job board).
        Two applicants you send with different refs are always two candidates,
        even when they share a household phone or email, and neither one's
        details are changed by the other.

        **Consent governs contact.** `consent.contact` must be `true` for
        CONFIRM to text or call. Send `false` (or omit it) and the applicant is
        still created and visible in the portal, but no outreach happens and the
        response returns `screening: "skipped_no_consent"`. This is the TCPA
        boundary: we contact within minutes of ingest, so consent is not
        something to assume.

        **Consent (or a phone) sent later starts screening.** If you first send
        an applicant without consent, or without a usable phone, and later
        re-send them with it, that re-send starts screening: `200`,
        `deduped: true`, `screening: "enqueued"`. This happens once, and only
        while the applicant is still new: if a recruiter has already moved them
        on in CONFIRM, the re-send changes nothing about their screening.

        **Unknown locations fail loudly.** A `location_ref` we don't recognise
        returns `404 unknown_location_ref` rather than dropping the applicant.
        The same request succeeds on retry once the location exists.

        **Closed locations take no new applicants.** A location closed with
        `PATCH /locations/{ref}` returns `409 location_closed` for someone new.
        An applicant you sent before it closed still returns `200` with
        `deduped: true`. With `location_refs`, one closed location the
        applicant is not already at fails the whole request with
        `409 location_closed` before anything is created; reopen it or leave
        it out, then retry.

        **Distance at intake.** Send the applicant's `address` and CONFIRM
        measures their commute to each location. A location they live too far
        from (beyond its maximum commute distance) is ruled out straight away: that
        application gets `screening: "skipped_ruled_out"`, its status becomes
        `rejected`, and it is left out of the screening call. Other locations
        are unaffected.

        **A location sent after the call.** If the applicant's screening call
        has not been placed yet, a new location joins it. If the call has
        already happened, the new location gets a short follow-up call that
        asks only the questions the applicant has not already answered, with
        no second heads-up SMS. If nothing is left to ask, no call is placed
        and the outcome at the new location is decided from the earlier
        answers. If the first call is still in progress, the new location
        waits for it. In each case the response reports `screening: "enqueued"`,
        and the result arrives as `screening.completed` and
        `candidate.status_changed` for that location. See
        [follow-up calls](/partner-guides/multiple-locations#follow-up-calls-for-locations-added-later).

        **Held for a calendar.** Screening calls are held while the registry's
        workspace has no connected calendar. When `screening` is `enqueued` and
        the workspace has none, `screening_hold` is `"calendar_not_connected"`;
        the call goes out once a calendar is connected. See the
        [calendar guide](/partner-guides/calendar).

        **Same location ref in several registries.** If you use one location ref
        in more than one registry, pass `organization_ref` to say which;
        without it the request returns `409 ambiguous_location_ref`.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              description: >
                Send exactly one of `location_ref` and `location_refs`. Both, or
                neither, is a `400 invalid_request`.
              required:
                - external_ref
              properties:
                external_ref:
                  type: string
                  description: >
                    Your identifier for this applicant. Stored on the candidate and
                    echoed on every response and webhook, and the primary key for
                    idempotent re-submission.
                  example: cl_app_84321
                location_ref:
                  type: string
                  description: >
                    The location the applicant applied to (the `external_ref` you
                    created it with). Resolves both the registry and the role.
                    Send this or `location_refs`, not both.
                  example: cl_loc_88213
                location_refs:
                  type: array
                  minItems: 1
                  maxItems: 20
                  items:
                    type: string
                    minLength: 1
                  description: >
                    Several locations for the same applicant, in place of
                    `location_ref`. 1–20 non-blank refs; a ref repeated in the
                    list is used once, in the order first given. Every ref must
                    be in the same registry, else
                    `400 location_refs_span_organizations`. The response then
                    has `applications[]` with one entry per location instead of a
                    single `application_id`.
                  example: [cl_loc_88213, cl_loc_88214]
                organization_ref:
                  type: string
                  description: >
                    The registry the location belongs to. Only required when the
                    same location ref exists in more than one of your registries.
                    With `location_refs`, it applies to every ref in the list.
                  example: cl_biz_4471
                address:
                  $ref: '#/components/schemas/ApplicantAddress'
                first_name:
                  type: string
                  minLength: 1
                  maxLength: 200
                  description: Optional. If sent, must not be blank.
                  example: Maria
                last_name:
                  type: string
                  minLength: 1
                  maxLength: 200
                  description: Optional. If sent, must not be blank.
                  example: Alvarez
                email:
                  type: string
                  format: email
                  maxLength: 254
                  description: Required unless `phone` is supplied. Both is ideal.
                  example: maria.alvarez@example.com
                phone:
                  type: string
                  description: >
                    Required unless `email` is supplied. E.164 preferred; other
                    common formats are normalised. Screening calls need a phone —
                    without one the response returns `screening: "skipped_no_phone"`.
                    A phone that isn't a valid number is a `400` when there is
                    no `email`. With a valid `email` the applicant is still
                    accepted: the phone is dropped, the response carries a
                    `warnings` entry saying so, and `screening` is
                    `skipped_no_phone`.
                  example: '+18135550172'
                consent:
                  type: object
                  description: What the applicant agreed to at intake.
                  properties:
                    contact:
                      type: boolean
                      default: false
                      description: >
                        True when the applicant consented to be contacted by SMS and
                        phone. Governs whether CONFIRM makes contact at all.
                      example: true
                webhook_url:
                  type: string
                  format: uri
                  maxLength: 2048
                  description: >
                    Where to POST this applicant's lifecycle events. Append your own
                    tracking identifier to it and every delivery arrives already
                    correlated to your record — you never need a CONFIRM ID to match
                    an event. Must be HTTPS, on a public host that exists in DNS,
                    with no credentials in the URL, and at most 2048 characters.
                    A URL that breaks a rule is rejected with `400` and one of the
                    codes in the
                    [webhooks guide](/partner-guides/webhooks#rules-for-the-url),
                    before the applicant is created. Omit it and this applicant
                    emits no webhooks at all. Re-sending the applicant with a
                    different `webhook_url` re-points them; omitting the field,
                    or sending `null`, on a re-send leaves the stored URL
                    unchanged.
                  nullable: true
                  example: https://hooks.example.com/confirm/8f2c41aa-1d64-4f0b-9c33-2a7e5b104db8
            examples:
              enqueued:
                summary: Applicant with consent and a phone number
                value:
                  external_ref: cl_app_84321
                  location_ref: cl_loc_88213
                  first_name: Maria
                  last_name: Alvarez
                  email: maria.alvarez@example.com
                  phone: '+18135550172'
                  consent:
                    contact: true
                  webhook_url: https://hooks.example.com/confirm/8f2c41aa-1d64-4f0b-9c33-2a7e5b104db8
              no_consent:
                summary: Applicant who did not consent to contact
                value:
                  external_ref: cl_app_84322
                  location_ref: cl_loc_88213
                  first_name: Dana
                  last_name: Whitfield
                  email: dana.w@example.com
                  consent:
                    contact: false
              multi_location:
                summary: One applicant at two locations
                value:
                  external_ref: cl_app_84323
                  location_refs: [cl_loc_88213, cl_loc_88214]
                  first_name: Rosa
                  last_name: Delgado
                  email: rosa.delgado@example.com
                  phone: '+18135550188'
                  address:
                    street: 412 Druid Rd E
                    city: Clearwater
                    state: FL
                    postal_code: '33756'
                    country: US
                  consent:
                    contact: true
                  webhook_url: https://hooks.example.com/confirm/2d9e7b10-5c4a-4f3e-8a61-0b7c3e9f4d22
      responses:
        '201':
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
          description: >-
            Applicant created. If the person already exists (matched on your `external_ref`, then on phone or email — but only against a candidate not already sent under a different ref), you get **200** with the original IDs and `deduped: true`. No second application is created, and `screening` reports the existing application's state rather than a new call.
            With `location_refs` the body is a multi-location result: `201` when at least one application was created, `200` when every one already existed.
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/CandidateIngestResult'
                  - $ref: '#/components/schemas/MultiLocationIngestResult'
              examples:
                enqueued:
                  summary: Screening started
                  value:
                    candidate_id: 9f4c2e81-6d3a-4b7e-a1c2-8e5f0d743b16
                    application_id: 51c0a7de-2f18-4a3e-96b7-1d0c8b2e4a77
                    external_ref: cl_app_84321
                    deduped: false
                    screening: enqueued
                    screening_hold: null
                    portal_url: https://app.confirm.global/c/suncoast-nurse-registry/candidates/9f4c2e81-6d3a-4b7e-a1c2-8e5f0d743b16?applicationId=51c0a7de-2f18-4a3e-96b7-1d0c8b2e4a77
                    webhook_url: https://hooks.example.com/confirm/8f2c41aa-1d64-4f0b-9c33-2a7e5b104db8
                held_for_calendar:
                  summary: Screening queued, held until a calendar is connected
                  value:
                    candidate_id: 9f4c2e81-6d3a-4b7e-a1c2-8e5f0d743b16
                    application_id: 51c0a7de-2f18-4a3e-96b7-1d0c8b2e4a77
                    external_ref: cl_app_84321
                    deduped: false
                    screening: enqueued
                    screening_hold: calendar_not_connected
                    portal_url: https://app.confirm.global/c/suncoast-nurse-registry/candidates/9f4c2e81-6d3a-4b7e-a1c2-8e5f0d743b16?applicationId=51c0a7de-2f18-4a3e-96b7-1d0c8b2e4a77
                    webhook_url: https://hooks.example.com/confirm/8f2c41aa-1d64-4f0b-9c33-2a7e5b104db8
                no_consent:
                  summary: Created, but no outreach without consent
                  value:
                    candidate_id: 3a7d1f92-88b4-4c05-a2ee-6b91d3c07f14
                    application_id: c81e5b30-9a72-4d16-8f43-2e0b7a94d5c8
                    external_ref: cl_app_84322
                    deduped: false
                    screening: skipped_no_consent
                    screening_hold: null
                    portal_url: https://app.confirm.global/c/suncoast-nurse-registry/candidates/3a7d1f92-88b4-4c05-a2ee-6b91d3c07f14?applicationId=c81e5b30-9a72-4d16-8f43-2e0b7a94d5c8
                multi_location:
                  summary: Two locations, one screening call
                  value:
                    candidate_id: 6e1b4d27-90af-4c38-b5d2-7a3f8c1e0b94
                    external_ref: cl_app_84323
                    deduped: false
                    portal_url: https://app.confirm.global/c/suncoast-nurse-registry/candidates/6e1b4d27-90af-4c38-b5d2-7a3f8c1e0b94
                    applications:
                      - location_ref: cl_loc_88213
                        application_id: a3c58e19-4b7d-4e02-9f61-2d8b0c7e5a13
                        deduped: false
                        screening: enqueued
                        screening_hold: null
                        webhook_url: https://hooks.example.com/confirm/2d9e7b10-5c4a-4f3e-8a61-0b7c3e9f4d22
                      - location_ref: cl_loc_88214
                        application_id: f70d2b64-1e9c-4a85-b3d7-5c6e8a2f9014
                        deduped: false
                        screening: enqueued
                        screening_hold: null
                        webhook_url: https://hooks.example.com/confirm/2d9e7b10-5c4a-4f3e-8a61-0b7c3e9f4d22
        '400':
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
          description: |-
            The request failed validation. `code` says why:

            | `code` | Meaning |
            |---|---|
            | `invalid_request` | A field is missing or malformed — including sending both `location_ref` and `location_refs`, or neither. `details` lists each one. |
            | `location_refs_span_organizations` | The refs in `location_refs` belong to more than one registry. The error lists each ref with its `organization_ref`. Send one request per registry. |
            | `invalid_webhook_url` | The webhook URL is empty, isn't an absolute URL, has no host, or contains credentials (`user:pass@`). |
            | `webhook_url_not_https` | The webhook URL doesn't use `https`. |
            | `webhook_url_forbidden_host` | The host is private or internal: `localhost`, a private or reserved IP address, an internal name such as `*.local` or `*.internal`, a cloud metadata endpoint, or a name that resolves to one of these. |
            | `webhook_url_too_long` | The webhook URL is over 2048 characters. |
            | `webhook_url_unresolvable` | The host doesn't exist in DNS (for example, anything under `.invalid`). |

            Nothing is created on any `400`. See
            [Rules for the URL](/partner-guides/webhooks#rules-for-the-url).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                location_refs_span_organizations:
                  summary: Locations in more than one registry
                  value:
                    error:
                      type: invalid_request_error
                      code: location_refs_span_organizations
                      message: All location_refs must belong to the same registry. Send one request per registry.
                      request_id: 3kP8wLmQ-6e2b-4a91-8d47-1f5c9b0e7a36
                      locations:
                        - location_ref: cl_loc_88213
                          organization_ref: cl_biz_4471
                        - location_ref: cl_loc_90120
                          organization_ref: cl_biz_5520
                not_https:
                  summary: Webhook URL is not HTTPS
                  value:
                    error:
                      type: invalid_request_error
                      code: webhook_url_not_https
                      message: webhook_url must use https. Payloads carry applicant PII and are never sent in the clear.
                      request_id: 7aM4tQzK-2f8d-4b63-9c10-6e5a3d1b8f24
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
          description: >-
            No location is registered with that `location_ref` — or, with
            `location_refs`, with one of the refs in the list
            (`unknown_location_ref`, naming that ref). Nothing is created.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error:
                  type: not_found_error
                  code: unknown_location_ref
                  message: >-
                    No location is registered with ref "cl_loc_99999". Create it
                    via POST /locations, then retry this request.
                  request_id: 8fK2nQpW-4c1a-4e77-b0d2-9f3a1c5e7b21
                  location_ref: cl_loc_99999
        '409':
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
          description: >-
            The location is closed (`location_closed`), or its ref exists in
            more than one of your registries and no `organization_ref` said
            which (`ambiguous_location_ref`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                location_closed:
                  summary: Location is closed
                  value:
                    error:
                      type: conflict_error
                      code: location_closed
                      message: >-
                        Location "cl_loc_88213" is closed and is not taking new
                        applicants. Reopen it with PATCH /locations/cl_loc_88213
                        and status "active" to accept applicants again.
                      request_id: 2hQ7mRtX-9b3e-4f10-a6c4-5d8e2f1b7c90
                      location_ref: cl_loc_88213
                ambiguous_location_ref:
                  summary: Ref exists in more than one registry
                  value:
                    error:
                      type: conflict_error
                      code: ambiguous_location_ref
                      message: >-
                        Location ref "cl_loc_88213" exists in more than one of
                        your registries. Send organization_ref to say which one.
                      request_id: 6tB1kVzN-3d7a-4c82-9e15-0a4f6b2d8e33
                      location_ref: cl_loc_88213
                      organization_refs: [cl_biz_4471, cl_biz_5520]
        '429':
          $ref: '#/components/responses/RateLimited'
  /candidates/{external_ref}/locations:
    post:
      operationId: addCandidateLocation
      tags:
        - Candidates
      summary: Add or move an applicant's location
      description: |
        Puts an applicant you already sent at another location in the same
        registry, or moves them there from a location they are at.

        **Add.** Send `location_ref` alone. The applicant gets a new
        application at that location; their other applications are
        unchanged. You receive `candidate.location_added`.

        **Move.** Also send `move_from_location_ref`. The new application is
        created as for an add, and the application at the old location is
        closed. A move is not a rejection: you receive one
        `candidate.location_changed` and **no** `candidate.status_changed` →
        `rejected` for the location they left. The applicant gets no message
        about the closed application.

        **Idempotent.** `201` when a new application was created; `200` with
        `created: false` when the applicant already had one at that location,
        in which case nothing about that application changes. Replaying a move
        is safe: if the old location's application is still open, the replay
        closes it.

        **Screening is reused, and only the gaps are asked.** The new
        application copies the applicant's completed screening when it covers
        the new location. `screening` in the response says which case applied:

        | `screening` | Meaning |
        |---|---|
        | `reused` | The applicant **passed** a screening in this registry that asked every question the new location asks. The new application starts at the step after screening, as if they had passed there, and that step's usual messages are sent (for example, an interview booking link). No call is placed. |
        | `pending` | The applicant has a completed screening in this registry, but it failed or was partial, or the new location asks questions it did not cover. The new application starts at screening, and a follow-up call covers what is missing (below). A failed screening elsewhere does not by itself reject the applicant here: knockouts are per location, and an earlier failed answer counts here only when this location asks the same question in the same words with the same knockout rule. |
        | `none` | No screening to reuse: the applicant has no completed screening in this registry yet, or the application already existed (`created: false`). A new application starts at the beginning of the pipeline, and is screened as described below. |

        **Follow-up calls.** For a new application with `screening` `pending`
        or `none`, CONFIRM works out what is still unanswered:

        - If the applicant's screening call has not been placed yet, the new
          location joins it.
        - If a call for another of their locations is in progress, the new
          location waits for it to finish, then continues below.
        - Otherwise a short follow-up call asks only the questions the
          applicant has not already answered. Earlier answers carry over only
          when the question is asked exactly the same way: a question that
          names a different address, for example, is asked again.
        - If nothing is left to ask, no call is placed: the outcome at the new
          location is decided from the earlier answers.

        There is no second heads-up SMS. The applicant must have given contact
        consent and have a valid phone, as for any call. The result arrives as
        `screening.completed` and `candidate.status_changed` for the new
        location. `screening` in the response does not change with any of
        this. See
        [follow-up calls](/partner-guides/multiple-locations#follow-up-calls-for-locations-added-later).

        **Callback URL.** The new application keeps the `webhook_url` the
        applicant was posted with (on a move, the old location's), so its events
        reach the same place.

        **Paused locations are fine; closed ones are not.** A target location
        closed with `PATCH /locations/{ref}` returns `409 location_closed`,
        unless the applicant already has an application there (`200`).
      # TODO(confirm): when the target location is closed and the applicant is
      # already there, the route returns 200 with `moved_from: null` and does NOT
      # close the move source (candidate-actions.ts closed-location branch runs
      # before addLocation). Confirm this is intended before documenting it.
      parameters:
        - name: external_ref
          in: path
          required: true
          schema:
            type: string
          description: Your applicant identifier (the `external_ref` you sent to `POST /candidates`).
          example: cl_app_84321
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - location_ref
              properties:
                location_ref:
                  type: string
                  minLength: 1
                  description: The location to add the applicant to (its `external_ref`).
                  example: cl_loc_88214
                organization_ref:
                  type: string
                  minLength: 1
                  description: >
                    The registry the location belongs to. Only required when the
                    same location ref exists in more than one of your registries.
                    The applicant is looked up in that registry.
                  example: cl_biz_4471
                move_from_location_ref:
                  type: string
                  minLength: 1
                  description: >
                    Set to move instead of add: the location the applicant is
                    leaving. Must be in the same registry as `location_ref`, the
                    applicant must have an application there, and it must differ
                    from `location_ref`.
                  example: cl_loc_88213
            examples:
              add:
                summary: Add a second location
                value:
                  location_ref: cl_loc_88214
              move:
                summary: Move to another location
                value:
                  location_ref: cl_loc_88214
                  move_from_location_ref: cl_loc_88213
      responses:
        '201':
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
          description: >-
            Application created at the location. If the applicant already had
            one there you get **200** with `created: false` and that
            application.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CandidateLocationResult'
              examples:
                add:
                  summary: Location added, screening reused
                  value:
                    candidate_id: 9f4c2e81-6d3a-4b7e-a1c2-8e5f0d743b16
                    application_id: 0b6e3f72-5a19-4d8c-a2e4-7c1d9f8b3a60
                    external_ref: cl_app_84321
                    location_ref: cl_loc_88214
                    created: true
                    status: interview
                    screening: reused
                    moved_from: null
                    portal_url: https://app.confirm.global/c/suncoast-nurse-registry/candidates/9f4c2e81-6d3a-4b7e-a1c2-8e5f0d743b16
                move:
                  summary: Moved, waiting on screening for the new location
                  value:
                    candidate_id: 9f4c2e81-6d3a-4b7e-a1c2-8e5f0d743b16
                    application_id: 0b6e3f72-5a19-4d8c-a2e4-7c1d9f8b3a60
                    external_ref: cl_app_84321
                    location_ref: cl_loc_88214
                    created: true
                    status: screening
                    screening: pending
                    moved_from:
                      location_ref: cl_loc_88213
                      application_id: 51c0a7de-2f18-4a3e-96b7-1d0c8b2e4a77
                    portal_url: https://app.confirm.global/c/suncoast-nurse-registry/candidates/9f4c2e81-6d3a-4b7e-a1c2-8e5f0d743b16
        '400':
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
          description: >-
            `invalid_request`: a field is missing or blank (`details` lists
            each one), or `move_from_location_ref` is the same location as
            `location_ref`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
          description: |-
            | `code` | Meaning |
            |---|---|
            | `unknown_location_ref` | No location with `location_ref` — or, on a move, no location with `move_from_location_ref` in the same registry. The error names the ref. |
            | `unknown_organization_ref` | `organization_ref` is not one of your registries. |
            | `unknown_candidate_ref` | No applicant with that `external_ref` in the location's registry. Create them with `POST /candidates`. |
            | `no_application_at_location` | On a move: the applicant has no application at `move_from_location_ref`. |
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                unknown_candidate_ref:
                  summary: Applicant not found
                  value:
                    error:
                      type: not_found_error
                      code: unknown_candidate_ref
                      message: No applicant is registered with ref "cl_app_99999". Create them via POST /candidates.
                      request_id: 4nT6pXcV-8a3d-4e19-b7f2-2c9e5d1a0b48
                      external_ref: cl_app_99999
                no_application_at_location:
                  summary: Nothing to move from
                  value:
                    error:
                      type: not_found_error
                      code: no_application_at_location
                      message: Applicant "cl_app_84321" has no application at location "cl_loc_88213".
                      request_id: 1gH5sWdB-0f7c-4b26-9a83-6e4d2c8f1b57
                      external_ref: cl_app_84321
                      location_ref: cl_loc_88213
        '409':
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
          description: >-
            The target location is closed and the applicant is not already at
            it (`location_closed`), or its ref exists in more than one of your
            registries and no `organization_ref` said which
            (`ambiguous_location_ref`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error:
                  type: conflict_error
                  code: location_closed
                  message: Location "cl_loc_88214" is closed and is not taking new applicants.
                  request_id: 9cJ3rFyM-5b8e-4d70-a1c6-3f0a7e2d9b81
                  location_ref: cl_loc_88214
        '429':
          $ref: '#/components/responses/RateLimited'
  /candidates/{external_ref}:
    patch:
      operationId: setCandidateOutcome
      tags:
        - Candidates
      summary: Set your outcome for an applicant at one location
      description: |
        Records your own decision about an applicant at **one** location:

        | `outcome` | Use it when | Resulting `status` |
        |---|---|---|
        | `withdrawn` | The applicant pulled out of this location. | `rejected` |
        | `not_hired` | The office decided not to hire them for this location. | `rejected` |
        | `hired` | The office hired them for this location. | `hired` |

        Only these final outcomes can be set. Screening and review steps are
        run by CONFIRM and can't be set from outside.

        **One location at a time.** Name the location with the `location_ref`
        query parameter. The applicant's applications at other locations are
        not touched. There is no `DELETE`: to take an applicant off one
        location, set `withdrawn` (their choice) or `not_hired` (the office's
        choice).

        **No messages to the applicant.** CONFIRM sends the applicant nothing
        about an outcome you set; you made the decision and own that
        conversation.

        **You get your own change back as a webhook.** When the outcome changes
        the applicant's status at that location, CONFIRM fires
        `candidate.status_changed` (`rejected` or `hired`) to the applicant's
        callback URL, like any other status change. Expect it and deduplicate
        it against the change you just made.

        **Idempotent.** Setting the outcome the application already has returns
        `200` with `changed: false` and fires nothing. A different outcome
        replaces the earlier one. Switching between `withdrawn` and `not_hired`
        updates the recorded reason and returns `changed: true`, but the status
        stays `rejected`, so no new `candidate.status_changed` fires.

        **Do-not-contact is final.** An applicant CONFIRM has marked
        do-not-contact can't take an outcome: `409 outcome_conflict`.
      parameters:
        - name: external_ref
          in: path
          required: true
          schema:
            type: string
          description: Your applicant identifier (the `external_ref` you sent to `POST /candidates`).
          example: cl_app_84321
        - name: location_ref
          in: query
          required: true
          schema:
            type: string
            minLength: 1
          description: The location the outcome applies to (its `external_ref`).
          example: cl_loc_88213
        - name: organization_ref
          in: query
          required: false
          schema:
            type: string
          description: >
            The registry the location belongs to. Only required when the same
            location ref exists in more than one of your registries.
          example: cl_biz_4471
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - outcome
              properties:
                outcome:
                  type: string
                  enum: [withdrawn, not_hired, hired]
                  description: Your decision for this applicant at this location.
                reason:
                  type: string
                  maxLength: 1000
                  description: >
                    Optional free text, kept with the change in CONFIRM's
                    history for this application. For `withdrawn` and `not_hired` it is
                    recorded as the reason the applicant is no longer
                    progressing.
                  example: Accepted a position closer to home.
            examples:
              withdrawn:
                summary: The applicant withdrew from this location
                value:
                  outcome: withdrawn
                  reason: Accepted a position closer to home.
              hired:
                summary: Hired at this location
                value:
                  outcome: hired
      responses:
        '200':
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
          description: "The outcome is recorded (or was already in place: `changed` is false)."
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CandidateOutcomeResult'
              examples:
                withdrawn:
                  value:
                    candidate_id: 9f4c2e81-6d3a-4b7e-a1c2-8e5f0d743b16
                    application_id: 51c0a7de-2f18-4a3e-96b7-1d0c8b2e4a77
                    external_ref: cl_app_84321
                    location_ref: cl_loc_88213
                    outcome: withdrawn
                    status: rejected
                    changed: true
                hired:
                  value:
                    candidate_id: 9f4c2e81-6d3a-4b7e-a1c2-8e5f0d743b16
                    application_id: 51c0a7de-2f18-4a3e-96b7-1d0c8b2e4a77
                    external_ref: cl_app_84321
                    location_ref: cl_loc_88213
                    outcome: hired
                    status: hired
                    changed: true
        '400':
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
          description: >-
            `invalid_request`: the `location_ref` query parameter is missing, or
            the body failed validation (an unknown `outcome`, or a `reason` over
            1000 characters). `details` lists each problem.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
          description: |-
            | `code` | Meaning |
            |---|---|
            | `unknown_location_ref` | No location with that `location_ref`. |
            | `unknown_organization_ref` | `organization_ref` is not one of your registries. |
            | `unknown_candidate_ref` | No applicant with that `external_ref` in the location's registry. |
            | `no_application_at_location` | The applicant has no application at that location. |
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '409':
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
          description: >-
            The applicant can't take that outcome in their current state, for
            example because CONFIRM marked them do-not-contact
            (`outcome_conflict`), or the location ref exists in more than one
            of your registries and no `organization_ref` said which
            (`ambiguous_location_ref`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error:
                  type: conflict_error
                  code: outcome_conflict
                  message: This applicant cannot take that outcome in their current state.
                  request_id: 2fL9vQnR-7c4a-4b13-8e56-0d2b6f9a3c71
                  external_ref: cl_app_84321
                  location_ref: cl_loc_88213
        '429':
          $ref: '#/components/responses/RateLimited'
components:
  securitySchemes:
    partnerKey:
      type: http
      scheme: bearer
      description: >
        Partner API key sent as `Authorization: Bearer cfk_...`. Keys are
        partner-level — one key reaches every registry linked to your partner
        account and nothing else. CONFIRM issues and revokes them; a key is shown
        exactly once at creation because only its hash is stored, and revocation
        takes effect on the next request. Develop against the sandbox base URL
        with a sandbox key, where telephony is restricted to an allowlist you
        provide.
  parameters:
    IdempotencyKey:
      name: Idempotency-Key
      in: header
      required: false
      description: >
        Unique key (e.g. a UUID) making this POST safe to retry. Replays within 24
        hours return the original response without repeating side effects.
      schema:
        type: string
        maxLength: 255
    Limit:
      name: limit
      in: query
      description: Page size, 1–100.
      schema:
        type: integer
        minimum: 1
        maximum: 100
        default: 20
    Cursor:
      name: cursor
      in: query
      description: Opaque cursor from a previous response's `next_cursor`.
      schema:
        type: string
    OrgId:
      name: org_id
      in: path
      required: true
      description: Organization ID (`org_...`).
      schema:
        type: string
        example: org_4Nv8sJqKfH
    JobId:
      name: job_id
      in: path
      required: true
      description: Job ID (`job_...`).
      schema:
        type: string
        example: job_2VbY6mQwXs
    CandId:
      name: cand_id
      in: path
      required: true
      description: Candidate ID (`cand_...`).
      schema:
        type: string
        example: cand_5DkW9rTzPe
    ScrId:
      name: scr_id
      in: path
      required: true
      description: Screening ID (`scr_...`).
      schema:
        type: string
        example: scr_7Hq2mNfA8b
    IntId:
      name: int_id
      in: path
      required: true
      description: Interview ID (`int_...`).
      schema:
        type: string
        example: int_6PzR3wLnUd
    BgcId:
      name: bgc_id
      in: path
      required: true
      description: Background check ID (`bgc_...`).
      schema:
        type: string
        example: bgc_8XwT2nVqLm
    EvtId:
      name: evt_id
      in: path
      required: true
      description: Event ID (`evt_...`).
      schema:
        type: string
        example: evt_9TqLp4XcRr
  headers:
    XRequestId:
      description: >-
        The ID of this request. On an error it equals `request_id` in the body.
        If you sent an `X-Request-Id`, it is your value, returned unchanged.
        Log it, and quote it when contacting CONFIRM support.
      schema:
        type: string
        example: 8fK2nQpW-4c1a-4e77-b0d2-9f3a1c5e7b21
  responses:
    WebhookUrlRejected:
      description: |-
        The request failed validation. `code` says why:

        | `code` | Meaning |
        |---|---|
        | `invalid_request` | A field is missing or malformed. `details` lists each one. |
        | `invalid_webhook_url` | The webhook URL is empty, isn't an absolute URL, has no host, or contains credentials (`user:pass@`). |
        | `webhook_url_not_https` | The webhook URL doesn't use `https`. |
        | `webhook_url_forbidden_host` | The host is private or internal: `localhost`, a private or reserved IP address, an internal name such as `*.local` or `*.internal`, a cloud metadata endpoint, or a name that resolves to one of these. |
        | `webhook_url_too_long` | The webhook URL is over 2048 characters. |
        | `webhook_url_unresolvable` | The host doesn't exist in DNS (for example, anything under `.invalid`). |

        See [Rules for the URL](/partner-guides/webhooks#rules-for-the-url).
      headers:
        X-Request-Id:
          $ref: '#/components/headers/XRequestId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            not_https:
              summary: Webhook URL is not HTTPS
              value:
                error:
                  type: invalid_request_error
                  code: webhook_url_not_https
                  message: webhook_url must use https. Payloads carry applicant PII and are never sent in the clear.
                  request_id: 7aM4tQzK-2f8d-4b63-9c10-6e5a3d1b8f24
            unresolvable:
              summary: Webhook host does not exist
              value:
                error:
                  type: invalid_request_error
                  code: webhook_url_unresolvable
                  message: webhook_url host "hooks.example.invalid" does not resolve. Use a publicly resolvable HTTPS endpoint.
                  request_id: 9bW6kRyP-4c1e-4d85-a2f7-8e0b5c3d1a46
    UnknownOrganizationRef:
      description: >-
        No registry is registered with that ref for your partner account
        (`unknown_organization_ref`).
      headers:
        X-Request-Id:
          $ref: '#/components/headers/XRequestId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              type: not_found_error
              code: unknown_organization_ref
              message: No registry is registered with ref "cl_reg_9999".
              request_id: 5dR2hNkT-1a9c-4f37-b6e8-0c4d7a2f9b15
              organization_ref: cl_reg_9999
    BadRequest:
      description: >-
        Invalid request (`error.type: invalid_request_error`, `code: invalid_request`)
        — missing or malformed fields. `details` lists each offending field.
      headers:
        X-Request-Id:
          $ref: '#/components/headers/XRequestId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            validation:
              value:
                error:
                  type: invalid_request_error
                  code: invalid_request
                  message: Request body failed validation.
                  request_id: 8fK2nQpW-4c1a-4e77-b0d2-9f3a1c5e7b21
                  details:
                    - field: address.postal_code
                      message: Required
                    - field: organization_ref
                      message: Required
    Unauthorized:
      headers:
        X-Request-Id:
          $ref: '#/components/headers/XRequestId'
      description: 'Missing, malformed, or revoked API key (`error.type: authentication_error`).'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    NotFound:
      headers:
        X-Request-Id:
          $ref: '#/components/headers/XRequestId'
      description: 'The resource does not exist under your partner account (`error.type: not_found_error`).'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Conflict:
      headers:
        X-Request-Id:
          $ref: '#/components/headers/XRequestId'
      description: 'The request conflicts with current resource state (`error.type: conflict_error`).'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    AmbiguousLocationRef:
      headers:
        X-Request-Id:
          $ref: '#/components/headers/XRequestId'
      description: >-
        The location ref exists in more than one of your registries and no
        `organization_ref` said which (`ambiguous_location_ref`). The error
        lists the matching `organization_refs`.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              type: conflict_error
              code: ambiguous_location_ref
              message: >-
                Location ref "cl_loc_88213" exists in more than one of your
                registries. Send organization_ref to say which one.
              request_id: 6tB1kVzN-3d7a-4c82-9e15-0a4f6b2d8e33
              location_ref: cl_loc_88213
              organization_refs: [cl_biz_4471, cl_biz_5520]
    RateLimited:
      description: >-
        Rate limit exceeded (`error.type: rate_limit_error`). Design target: 600
        requests/min per key, burst 100/10s. Honor the `Retry-After` header.
      headers:
        X-Request-Id:
          $ref: '#/components/headers/XRequestId'
        Retry-After:
          description: Seconds to wait before retrying.
          schema:
            type: integer
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  schemas:
    StreetAddress:
      type: object
      description: >
        A real street address. Distance screening measures a candidate's commute
        against it, so the more complete it is, the better location fit works.
      properties:
        street:
          type: string
          example: 1100 Cleveland St
        city:
          type: string
          example: Clearwater
        state:
          type: string
          description: State or region.
          example: FL
        postal_code:
          type: string
          example: '33755'
        country:
          type: string
          example: US
    ApplicantAddress:
      type: object
      description: |
        The applicant's home address, used to measure their commute to each
        location at intake. Optional.

        It is stored only when it pins down a real place: it needs a
        `postal_code`, or a `city` with its `state`, and it must match a real
        location. Otherwise nothing is stored, distance screening stays off for
        this applicant, and the response says why in `warnings`:

        - "address was not stored: it needs a postal_code, or a city with its
          state, to measure commute distance. Distance screening is inactive
          for this applicant."
        - "address could not be matched to a real location and was not
          stored. Distance screening is inactive for this applicant."
        - When it only partly matched, the address is stored and the warning
          names the place distances are measured from.

        For an applicant CONFIRM already has an address for, the stored
        address is kept and the one you send is ignored.
      properties:
        street:
          type: string
          maxLength: 500
          example: 412 Druid Rd E
        city:
          type: string
          maxLength: 200
          example: Clearwater
        state:
          type: string
          maxLength: 100
          description: State or region.
          example: FL
        postal_code:
          type: string
          maxLength: 40
          example: '33756'
        country:
          type: string
          maxLength: 100
          example: US
    LocationPayInput:
      type: object
      description: |
        The location's pay rate, as you send it. Every key is optional, but:

        - include at least one of `min`, `max` or `text`;
        - `period` is required when `min` or `max` is given;
        - `min` may not be greater than `max`.

        Breaking a rule is a `400 invalid_request`. The screening call uses
        the pay rate to answer the pay question; a location without one skips
        it.
      properties:
        min:
          type: number
          minimum: 0
          maximum: 99999999
          description: Lowest pay, per `period`.
          example: 17
        max:
          type: number
          minimum: 0
          maximum: 99999999
          description: Highest pay, per `period`.
          example: 21
        period:
          type: string
          enum: [hourly, yearly]
          description: What `min` and `max` are quoted per.
          example: hourly
        text:
          type: string
          maxLength: 500
          description: >
            Free-text pay description, for pay that isn't a simple range
            (for example "$18/hr + $2 weekend differential"). Trimmed; an empty
            string counts as not sent.
          example: $17–$21/hr, plus weekend differential
    LocationPay:
      type: object
      description: >
        A location's stored pay rate. Every key is present; values that
        weren't set are `null`. `period` is `null` unless `min` or `max` is
        set.
      properties:
        min:
          type: number
          nullable: true
          example: 17
        max:
          type: number
          nullable: true
          example: 21
        period:
          type: string
          nullable: true
          enum: [hourly, yearly]
          example: hourly
        text:
          type: string
          nullable: true
          example: null
    PartnerOrganization:
      type: object
      description: A registry workspace, correlated to your business record.
      required:
        - organization_id
        - external_ref
        - name
        - workspace
        - workspace_url
      properties:
        organization_id:
          type: string
          format: uuid
          description: CONFIRM's identifier for the registry.
        external_ref:
          type: string
          description: Your registry/business identifier, echoed back.
          example: cl_biz_4471
        name:
          type: string
          example: Suncoast Nurse Registry
        workspace:
          type: string
          description: >
            The workspace identifier — store this per business. It is the
            `{workspace}` segment of every CONFIRM deep link.
          example: suncoast-nurse-registry
        workspace_url:
          type: string
          format: uri
          description: Base URL of the registry's workspace.
          example: https://app.confirm.global/c/suncoast-nurse-registry
        created:
          type: boolean
          description: False when the registry was already provisioned and this call was a no-op.
        status:
          type: string
          example: active
        auth:
          type: object
          description: >-
            Present when the workspace has its own auth server (sandbox), on both
            `POST` and `GET`. A `POST` that sent `auth` always echoes it, with
            `base_url: null` when the workspace is on the default server.
          properties:
            base_url:
              type: string
              nullable: true
              description: The stored auth server origin, or null for the default.
              example: https://jeremy-web-auth.carelinkhc-dev.com
        calendar:
          type: object
          description: >-
            Whether the workspace has a connected calendar, on both `POST` and
            `GET`. Screening calls in the workspace are held while `connected`
            is `false`; connect one with
            [`POST /organizations/{ref}/calendar-invite`](/partner-api/organizations/create-calendar-invite).
            Left out on the rare response where the check itself could not be
            made, rather than guessing.
          required:
            - connected
          properties:
            connected:
              type: boolean
              description: >-
                `true` when the workspace has a calendar with working
                credentials, so screening calls are not held.
              example: false
        warnings:
          type: array
          description: >-
            Non-fatal notes about the provisioning run, when any apply (`POST`
            only). Includes a note that screening calls are held while the
            workspace has no connected calendar.
          items:
            type: string
    CalendarInvite:
      type: object
      description: A calendar-connect link for a registry's workspace.
      required:
        - invite_url
        - email
        - expires_at
        - emailed
      properties:
        invite_url:
          type: string
          format: uri
          description: >-
            The link the invitee opens to connect a Google or Outlook calendar.
            No CONFIRM login is needed. Works once.
          example: https://app.confirm.global/calendar-connect/4b9e2c71-0d5a-4f83-9a16-7e2c5d8b1f40
        email:
          type: string
          format: email
          description: The invited address, lowercased.
          example: scheduling@suncoastnurses.com
        expires_at:
          type: string
          format: date-time
          description: When the link stops working, 7 days after it was first issued.
          example: '2026-10-13T15:20:41.512Z'
        emailed:
          type: boolean
          description: >-
            `true` when CONFIRM emailed the link. `false` when you sent
            `send_email: false`, or when the email could not be sent; deliver
            `invite_url` yourself in either case.
    PartnerLocation:
      type: object
      description: A registry location, backed by one screening-ready job.
      required:
        - location_id
        - external_ref
        - title
        - status
      properties:
        location_id:
          type: string
          format: uuid
          description: CONFIRM's identifier for the location's job.
        external_ref:
          type: string
          description: Your location identifier, echoed back. Pass it as `location_ref` when ingesting applicants.
          example: cl_loc_88213
        organization_ref:
          type: string
          description: The registry this location belongs to.
          example: cl_biz_4471
        title:
          type: string
          example: Certified Nursing Assistant — Clearwater
        status:
          type: string
          enum: [active, closed]
        geocoded:
          type: boolean
          description: >
            True when the location has coordinates. False means distance
            screening is inactive for this location — check `warnings`. An
            address without a street geocodes to the centre of the city or ZIP;
            `warnings` says so when that happens.
        address:
          type: string
          nullable: true
          description: The stored single-line address.
        created:
          type: boolean
          description: False when the location already existed and this call was a no-op.
        pay:
          allOf:
            - $ref: '#/components/schemas/LocationPay'
          nullable: true
          description: >
            The location's pay rate, or `null` when it has none. With `null`,
            `warnings` includes "No pay rate set — the pay question will be
            skipped on screening calls for this location."
        warnings:
          type: array
          items:
            type: string
    CandidateIngestResult:
      type: object
      description: The result of ingesting an applicant.
      required:
        - candidate_id
        - application_id
        - external_ref
        - deduped
        - screening
        - portal_url
      properties:
        candidate_id:
          type: string
          format: uuid
          description: CONFIRM's identifier for the applicant. Store it on your applicant record.
        application_id:
          type: string
          format: uuid
          description: The application opened at this location.
        external_ref:
          type: string
          description: Your applicant identifier, echoed back.
          example: cl_app_84321
        deduped:
          type: boolean
          description: >
            True when this applicant already existed and the original IDs are being
            returned. No second application was created.
        screening:
          type: string
          description: |
            What happened to screening for this applicant. The checks run in
            this order, and the first one that stops the call is the value you
            get.

            - `enqueued` — consent given and a valid phone on file: the heads-up
              SMS is sent and the AI screening call is queued for a few minutes
              later.
            - `skipped_no_consent` — `consent.contact` was not `true`. Nothing is
              sent and no call is made; the applicant is still visible in the
              portal.
            - `skipped_no_phone` — consent given, but there is no valid phone
              number (none was sent, or the one sent was dropped as invalid), so
              no call can be placed.
            - `skipped_not_entitled` — consent and phone are fine, but no call
              could be queued, most often because the registry's account can't
              place calls right now. The applicant is kept in the portal, where
              a recruiter can follow up.
            - `skipped_ruled_out` — you sent the applicant's `address`, and
              they live too far from this location (beyond its maximum commute
              distance). The application is ruled out at intake: its status is
              `rejected`, no call is queued for this location, and a
              `candidate.status_changed` webhook says so. Their other locations
              are unaffected.

            On a deduped re-send (`deduped: true`) no new call is queued, and
            `screening` reports what happened to the existing application:
            `enqueued` means a call was queued for it at some point (it may
            already have taken place), and a `skipped_` value says why none
            was. The one exception: a re-send that supplies consent or a phone
            the first submission lacked starts screening then, and returns
            `enqueued`.
          enum:
            - enqueued
            - skipped_no_consent
            - skipped_no_phone
            - skipped_not_entitled
            - skipped_ruled_out
        screening_hold:
          type: string
          nullable: true
          enum:
            - calendar_not_connected
          description: |
            Why a queued screening call is not going out yet, or `null`.

            - `calendar_not_connected` — `screening` is `enqueued`, but the
              registry's workspace has no connected calendar at the time of
              this request. Screening calls are held until it has one (an
              applicant who passes is sent a booking link on that calendar),
              then go out without you re-sending anything. Connect one with
              [`POST /organizations/{ref}/calendar-invite`](/partner-api/organizations/create-calendar-invite).
            - `null` — every other case, including any `skipped_` value.
        portal_url:
          type: string
          format: uri
          description: >
            Complete deep link to the applicant in the registry's portal, opening
            on this application (it ends with `?applicationId=<application_id>`).
            Store it as an opaque string and render it as your "View Full
            Details" link.
          example: https://app.confirm.global/c/suncoast-nurse-registry/candidates/9f4c2e81-6d3a-4b7e-a1c2-8e5f0d743b16?applicationId=51c0a7de-2f18-4a3e-96b7-1d0c8b2e4a77
        webhook_url:
          type: string
          format: uri
          nullable: true
          description: >
            The callback URL now stored against this application — echoed so you can
            confirm exactly what we will deliver to, including on a deduped re-post
            where the URL you just sent replaced the previous one. `null` when this
            applicant has no callback.
          example: https://hooks.example.com/confirm/8f2c41aa-1d64-4f0b-9c33-2a7e5b104db8
        warnings:
          type: array
          description: >
            Non-fatal notes about the request, present only when any apply — for
            example, a phone number that was dropped because it isn't a valid
            number.
          items:
            type: string
    MultiLocationIngestResult:
      type: object
      description: >
        The result of ingesting an applicant with `location_refs`: one
        candidate, and one entry in `applications` per location, in the order
        you sent them.
      required:
        - candidate_id
        - external_ref
        - deduped
        - portal_url
        - applications
      properties:
        candidate_id:
          type: string
          format: uuid
          description: CONFIRM's identifier for the applicant. The same for every location.
        external_ref:
          type: string
          description: Your applicant identifier, echoed back.
          example: cl_app_84323
        deduped:
          type: boolean
          description: >
            True only when **every** application already existed. Each entry in
            `applications` has its own `deduped`.
        portal_url:
          type: string
          format: uri
          description: Complete deep link to the applicant in the registry's portal.
        applications:
          type: array
          items:
            $ref: '#/components/schemas/LocationApplicationResult'
        warnings:
          type: array
          description: Non-fatal notes about the request, present only when any apply.
          items:
            type: string
    LocationApplicationResult:
      type: object
      description: The applicant's application at one location.
      required:
        - location_ref
        - application_id
        - deduped
        - screening
      properties:
        location_ref:
          type: string
          description: The location, as you named it in `location_refs`.
          example: cl_loc_88213
        application_id:
          type: string
          format: uuid
          description: >
            The application at this location. Every webhook about this
            applicant at this location carries it.
        deduped:
          type: boolean
          description: True when the applicant already had an application at this location.
        screening:
          type: string
          description: >
            Same values and meaning as `screening` on a single-location
            ingest, for this location. With one screening call covering every
            location, each location that is in the call reports `enqueued`.
          enum:
            - enqueued
            - skipped_no_consent
            - skipped_no_phone
            - skipped_not_entitled
            - skipped_ruled_out
        screening_hold:
          type: string
          nullable: true
          enum:
            - calendar_not_connected
          description: >
            Same values and meaning as `screening_hold` on a single-location
            ingest, for this location: `calendar_not_connected` when this
            location's `screening` is `enqueued` and the workspace has no
            connected calendar, otherwise `null`.
        webhook_url:
          type: string
          format: uri
          nullable: true
          description: The callback URL now stored against this application, or `null`.
    CandidateLocationResult:
      type: object
      description: The result of adding an applicant to a location, or moving them to it.
      required:
        - candidate_id
        - application_id
        - external_ref
        - location_ref
        - created
        - screening
      properties:
        candidate_id:
          type: string
          format: uuid
        application_id:
          type: string
          format: uuid
          description: The application at `location_ref`.
        external_ref:
          type: string
          description: Your applicant identifier, echoed back.
          example: cl_app_84321
        location_ref:
          type: string
          description: The location, echoed back.
          example: cl_loc_88214
        created:
          type: boolean
          description: False when the applicant already had an application at this location.
        status:
          type: string
          nullable: true
          enum: [screening, review, interview, hired, rejected]
          description: The applicant's coarse status at this location.
        screening:
          type: string
          enum: [reused, pending, none]
          description: >
            How much of an existing screening the application reuses, at the
            moment it was created. See the table in the endpoint description.
            For `pending` and `none`, a follow-up call (or the applicant's
            not-yet-placed screening call) covers the rest; this value does not
            change when it does.
        moved_from:
          type: object
          nullable: true
          description: On a move, the location the applicant left and its now-closed application. `null` on an add.
          properties:
            location_ref:
              type: string
              example: cl_loc_88213
            application_id:
              type: string
              format: uuid
        portal_url:
          type: string
          format: uri
          nullable: true
          description: Complete deep link to the applicant in the registry's portal.
    CandidateOutcomeResult:
      type: object
      description: The result of setting your outcome for an applicant at one location.
      required:
        - candidate_id
        - application_id
        - external_ref
        - location_ref
        - outcome
        - changed
      properties:
        candidate_id:
          type: string
          format: uuid
        application_id:
          type: string
          format: uuid
          description: The application at `location_ref`.
        external_ref:
          type: string
          example: cl_app_84321
        location_ref:
          type: string
          example: cl_loc_88213
        outcome:
          type: string
          enum: [withdrawn, not_hired, hired]
          description: The outcome you sent, echoed back.
        status:
          type: string
          nullable: true
          enum: [screening, review, interview, hired, rejected]
          description: The applicant's coarse status at this location after the change.
        changed:
          type: boolean
          description: False when the application already had this outcome and nothing changed.
    PartnerUser:
      type: object
      description: A registry user account.
      required:
        - user_id
        - external_user_ref
        - email
      properties:
        user_id:
          type: string
          format: uuid
        external_user_ref:
          type: string
          description: Your user identifier, echoed back.
          example: cl_user_5512
        organization_ref:
          type: string
          example: cl_biz_4471
        email:
          type: string
          format: email
        created:
          type: boolean
          description: False when an existing account was updated instead.
    Error:
      type: object
      description: Single error envelope used by every non-2xx response.
      required:
        - error
      properties:
        error:
          type: object
          required:
            - type
            - code
            - message
            - request_id
          properties:
            type:
              type: string
              description: Broad error category.
              enum:
                - authentication_error
                - invalid_request_error
                - not_found_error
                - conflict_error
                - rate_limit_error
                - api_error
            code:
              type: string
              description: >-
                Machine-readable error code, e.g. `invalid_request`,
                `unknown_location_ref` or `wrong_environment`. Branch on this; the
                strings are contract.
            message:
              type: string
              description: Human-readable explanation.
            details:
              type: array
              description: >-
                Present on `invalid_request` (400): one entry per field that failed
                validation.
              items:
                type: object
                required:
                  - field
                  - message
                properties:
                  field:
                    type: string
                    description: Dotted path to the offending field, e.g. `address.postal_code`.
                    example: address.postal_code
                  message:
                    type: string
                    description: Why that field was rejected.
                    example: Required
            location_ref:
              type: string
              description: Present on `unknown_location_ref` (404) — the reference that wasn't found.
            organization_ref:
              type: string
              description: >-
                Present on `unknown_organization_ref` (404) — the reference that
                wasn't found — and on `email_has_account` (409) — the registry
                the invitation was for.
            external_ref:
              type: string
              description: >-
                Present on workspace-teardown refusals (403) — the workspace you
                asked to delete — and on applicant errors
                (`unknown_candidate_ref`, `no_application_at_location`,
                `outcome_conflict`) — the applicant ref.
            organization_refs:
              type: array
              description: Present on `ambiguous_location_ref` (409) — the registries the ref exists in.
              items:
                type: string
            locations:
              type: array
              description: >-
                Present on `location_refs_span_organizations` (400) — each ref
                you sent with the registry it belongs to.
              items:
                type: object
                properties:
                  location_ref:
                    type: string
                  organization_ref:
                    type: string
                    nullable: true
            request_id:
              type: string
              description: >-
                Identifier for this request — the same value as the response's
                `X-Request-Id` header. Include it when contacting CONFIRM support.
    Location:
      type: object
      description: City/state/ZIP location.
      required:
        - city
        - state
        - zip
      properties:
        city:
          type: string
          example: Tampa
        state:
          type: string
          description: Two-letter US state code.
          example: FL
        zip:
          type: string
          example: '33602'
    PayRange:
      type: object
      description: Pay range advertised for the job.
      properties:
        min:
          type: number
          example: 17
        max:
          type: number
          example: 21
        currency:
          type: string
          example: USD
        period:
          type: string
          description: Unit the range is quoted per.
          enum:
            - hour
            - year
          example: hour
    Metadata:
      type: object
      description: >
        Flat string-to-string map of your own data, up to 20 keys. Stored verbatim
        and echoed back on the candidate and in webhook payloads.
      maxProperties: 20
      additionalProperties:
        type: string
      example:
        county: Hillsborough
        shift_preference: weekends
    StageSlug:
      type: string
      description: >
        Candidate lifecycle stage slug (v4). Rides along on screenings as `stage` for
        partners who want full lifecycle granularity; most integrations only need the
        simplified partner screening status.
      enum:
        - applied
        - awaiting_screening
        - ineligible_for_screening
        - passed_screening_awaiting_scheduling
        - failed_screening
        - client_screening
        - client_request_interview
        - pending_evaluation
        - interview_scheduled
        - reschedule_requested
        - no_show
        - past_interview
        - awaiting_recruiter_action
        - failed_interview
        - hired
        - client_rejected
        - dnc
        - refused_recording
    PartnerScreeningStatus:
      type: string
      description: >
        Simplified partner-facing screening status. Flow: `pending_contact` →
        `contacting` → terminal (`completed`, `no_answer_exhausted`,
        `declined_recording`, `opted_out`, `withdrawn`). When `completed`, see
        `outcome` for `passed` vs `failed_knockout`. The candidate's full v4 stage
        slug rides along as `stage`.
      enum:
        - pending_contact
        - contacting
        - completed
        - no_answer_exhausted
        - declined_recording
        - opted_out
        - withdrawn
    ScreeningOutcome:
      type: string
      nullable: true
      description: Set only when the screening status is `completed`.
      enum:
        - passed
        - failed_knockout
    JobStatus:
      type: string
      enum:
        - active
        - paused
        - closed
    OrganizationStatus:
      type: string
      description: '`provisioning` while asynchronous setup (e.g. phone number assignment) completes, then `active`.'
      enum:
        - provisioning
        - active
    Organization:
      type: object
      description: A registry organization under your partner account.
      properties:
        id:
          type: string
          description: Organization ID (`org_...`).
          example: org_4Nv8sJqKfH
        name:
          type: string
          example: Suncoast Nurse Registry
        status:
          $ref: '#/components/schemas/OrganizationStatus'
        location:
          $ref: '#/components/schemas/Location'
        timezone:
          type: string
          description: IANA timezone used for call windows and scheduling.
          example: America/New_York
        template_id:
          type: string
          description: Screening template the organization was provisioned from.
          example: tpl_fl_caregiver_registry
        caller_id_name:
          type: string
          description: Caller-ID display name on outbound screening calls.
          example: Suncoast Registry
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
    Template:
      type: object
      description: A screening template available to your partner account.
      properties:
        id:
          type: string
          description: Template ID (`tpl_...`).
          example: tpl_fl_caregiver_registry
        name:
          type: string
          example: Caregiver — Florida Registry
        description:
          type: string
          nullable: true
          example: AI voice prescreen for Florida in-home caregiver registries (CNA/HHA).
        questions:
          type: array
          description: Read-only summary of the template's screening questions.
          items:
            $ref: '#/components/schemas/ScreeningQuestion'
        knockout_summary:
          type: string
          description: Plain-language summary of the template's knockout criteria.
          example: Requires an active Florida CNA or HHA license and availability for in-home shifts.
    ScreeningQuestion:
      type: object
      description: Read-only summary of a screening question.
      properties:
        position:
          type: integer
          description: 1-based order the AI agent asks the question in.
          example: 1
        question:
          type: string
          example: Do you have an active Florida CNA or HHA license?
        knockout:
          type: boolean
          description: Whether a failing answer ends the candidate's screening as `failed_knockout`.
          example: true
    Job:
      type: object
      description: A role candidates are screened against.
      properties:
        id:
          type: string
          description: Job ID (`job_...`).
          example: job_2VbY6mQwXs
        org_id:
          type: string
          example: org_4Nv8sJqKfH
        template_id:
          type: string
          description: Template the job was created from.
          example: tpl_fl_caregiver_registry
        title:
          type: string
          example: In-Home Caregiver (CNA/HHA) — Tampa
        location:
          $ref: '#/components/schemas/Location'
        pay_range:
          $ref: '#/components/schemas/PayRange'
        status:
          $ref: '#/components/schemas/JobStatus'
        screening_questions:
          type: array
          description: Read-only summary of the questions asked on screenings for this job, including knockout flags.
          items:
            $ref: '#/components/schemas/ScreeningQuestion'
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
    Consent:
      type: object
      description: Consent attestation captured by your platform at application time.
      required:
        - tcpa
        - captured_at
      properties:
        tcpa:
          type: boolean
          description: >
            Must be `true`. CONFIRM places AI voice calls and sends SMS; setting this
            attests the applicant consented to be contacted when they applied on your
            platform.
        captured_at:
          type: string
          format: date-time
          description: When the consent was captured (ISO 8601).
        fcra_disclosure:
          type: boolean
          description: >
            Whether the applicant received the FCRA disclosure and authorized a
            background check. Not required for screening, but must be `true` before
            a background check can be ordered.
    Candidate:
      type: object
      description: An applicant ingested from your platform.
      properties:
        id:
          type: string
          description: Candidate ID (`cand_...`).
          example: cand_5DkW9rTzPe
        org_id:
          type: string
          example: org_4Nv8sJqKfH
        job_id:
          type: string
          example: job_2VbY6mQwXs
        external_ref:
          type: string
          nullable: true
          description: Your platform's identifier for this applicant; echoed on every related API response and webhook.
          example: cl_app_84321
        first_name:
          type: string
          example: Maria
        last_name:
          type: string
          example: Alvarez
        phone:
          type: string
          description: E.164.
          example: '+18135550172'
        email:
          type: string
          format: email
          nullable: true
        source:
          type: string
          nullable: true
          example: registry-platform
        status:
          $ref: '#/components/schemas/PartnerScreeningStatus'
        stage:
          $ref: '#/components/schemas/StageSlug'
        consent:
          $ref: '#/components/schemas/Consent'
        resume_url:
          type: string
          format: uri
          nullable: true
        metadata:
          $ref: '#/components/schemas/Metadata'
        withdrawn_at:
          type: string
          format: date-time
          nullable: true
          description: Set when the candidate was withdrawn via the withdraw endpoint.
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
    Screening:
      type: object
      description: An AI voice screening of a candidate against a job.
      properties:
        id:
          type: string
          description: Screening ID (`scr_...`).
          example: scr_7Hq2mNfA8b
        candidate_id:
          type: string
          example: cand_5DkW9rTzPe
        external_ref:
          type: string
          nullable: true
          description: The candidate's `external_ref`, echoed for correlation.
          example: cl_app_84321
        job_id:
          type: string
          example: job_2VbY6mQwXs
        status:
          $ref: '#/components/schemas/PartnerScreeningStatus'
        stage:
          $ref: '#/components/schemas/StageSlug'
        attempt_count:
          type: integer
          description: Outbound contact attempts made so far (voicemails and no-answers included).
          example: 1
        next_attempt_at:
          type: string
          format: date-time
          nullable: true
          description: When the next automatic contact attempt is scheduled, if any.
        started_at:
          type: string
          format: date-time
          nullable: true
          description: When the candidate first connected to the AI screening call.
        completed_at:
          type: string
          format: date-time
          nullable: true
        outcome:
          $ref: '#/components/schemas/ScreeningOutcome'
        result:
          $ref: '#/components/schemas/ScreeningResult'
    ScreeningResult:
      type: object
      nullable: true
      description: >
        Structured result, present once the screening status is `completed`. Signals
        are item-level only — the Partner API intentionally exposes no composite or
        overall score.
      properties:
        answers:
          type: array
          items:
            $ref: '#/components/schemas/Answer'
        summary:
          type: string
          description: AI-written debrief of the screening conversation.
        signals:
          $ref: '#/components/schemas/Signals'
    Answer:
      type: object
      description: One question-and-answer pair from the screening call.
      properties:
        question:
          type: string
          example: Do you have an active Florida CNA or HHA license?
        answer_text:
          type: string
          description: The candidate's answer, normalized from the transcript.
        knockout:
          type: boolean
          description: Whether this was a knockout question.
        knockout_passed:
          type: boolean
          nullable: true
          description: '`true`/`false` for knockout questions; `null` for non-knockout questions.'
        audio_url:
          type: string
          format: uri
          description: Signed, expiring URL to the audio clip of this answer. Fetch on demand; do not store.
    Signals:
      type: object
      description: >
        Item-level screening signals. Each signal carries its own rating and
        rationale. **There is no composite or overall score anywhere in the Partner
        API — this is a deliberate product decision; evaluate signals item by item.**
      properties:
        resume_fit:
          $ref: '#/components/schemas/Signal'
        employment_stability:
          $ref: '#/components/schemas/Signal'
    Signal:
      type: object
      description: A single item-level signal.
      properties:
        rating:
          type: string
          description: Item-level rating label for this signal (e.g. `strong`, `moderate`, `weak`).
          example: strong
        rationale:
          type: string
          description: Short explanation of why the rating was assigned.
    Interview:
      type: object
      description: An interview scheduled in CONFIRM. Read-only for partners in v1.
      properties:
        id:
          type: string
          description: Interview ID (`int_...`).
          example: int_6PzR3wLnUd
        candidate_id:
          type: string
          example: cand_5DkW9rTzPe
        external_ref:
          type: string
          nullable: true
          description: The candidate's `external_ref`, echoed for correlation.
          example: cl_app_84321
        status:
          type: string
          enum:
            - scheduled
            - rescheduled
            - completed
            - cancelled
            - no_show
        start:
          type: string
          format: date-time
          description: Interview start (ISO 8601, with offset).
        end:
          type: string
          format: date-time
          description: Interview end (ISO 8601, with offset).
        timezone:
          type: string
          description: IANA timezone the interview was booked in.
          example: America/New_York
        interviewer:
          type: object
          properties:
            name:
              type: string
            email:
              type: string
              format: email
        location_or_link:
          type: string
          description: Physical address or video-call link.
        booked_by:
          type: string
          description: Who booked the slot.
          enum:
            - agent
            - recruiter
            - candidate
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
    BackgroundCheck:
      type: object
      description: >
        A background-check order. Results are eligibility-style determinations, not
        raw records (FCRA). For FL AHCA Level 2 / Clearinghouse items, CONFIRM tracks
        orchestration status only — determinations flow to AHCA and the provider,
        never through CONFIRM.
      properties:
        id:
          type: string
          description: Background check ID (`bgc_...`).
          example: bgc_8XwT2nVqLm
        candidate_id:
          type: string
          example: cand_5DkW9rTzPe
        external_ref:
          type: string
          nullable: true
          description: The candidate's `external_ref`, echoed for correlation.
          example: cl_app_84321
        package:
          type: string
          enum:
            - fl_registry_hire
        status:
          type: string
          description: 'Order lifecycle: `ordered` → `in_progress` → `completed` or `action_required`.'
          enum:
            - ordered
            - in_progress
            - completed
            - action_required
        checks:
          type: array
          items:
            $ref: '#/components/schemas/CheckItem'
        ordered_at:
          type: string
          format: date-time
        completed_at:
          type: string
          format: date-time
          nullable: true
    CheckItem:
      type: object
      description: >
        One check within a background-check package. `result` is an
        eligibility-style determination (`eligible` or `review`), never raw records.
        For `fl_ahca_level2_clearinghouse`, `result` is always `null` and
        `clearinghouse_status` reports orchestration only — Level 2 determinations
        flow legally to AHCA and the provider, never through CONFIRM.
      properties:
        type:
          type: string
          enum:
            - sex_offender_registry
            - oig_leie_exclusion
            - fl_license_verification
            - reference_check
            - fl_ahca_level2_clearinghouse
        status:
          type: string
          enum:
            - pending
            - in_progress
            - completed
        result:
          type: string
          nullable: true
          description: '`null` until completed, and always `null` for `fl_ahca_level2_clearinghouse`.'
          enum:
            - eligible
            - review
        clearinghouse_status:
          type: string
          nullable: true
          description: Present only on `fl_ahca_level2_clearinghouse` items. Orchestration status only.
          enum:
            - initiated
            - screening_in_progress
            - determination_received
    OrgWebhookEndpoint:
      type: object
      description: A registry's default (fallback) webhook endpoint.
      properties:
        organization_ref:
          type: string
          description: Your registry identifier, echoed back.
          example: cl_reg_4471
        url:
          type: string
          format: uri
          example: https://hooks.example.com/confirm/registry/4471
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
    EventType:
      type: string
      description: >
        Event type. **Six are delivered today**: `candidate.created`,
        `candidate.status_changed`, `screening.completed`, `candidate.placed`,
        `candidate.location_added`, and `candidate.location_changed`. The rest
        are the committed roadmap and are listed so you can write a
        forward-compatible handler — ignore unknown types.
      enum:
        - candidate.created
        - candidate.reapplied
        - candidate.status_changed
        - candidate.placed
        - candidate.location_added
        - candidate.location_changed
        - candidate.withdrawn
        - screening.started
        - screening.attempt_failed
        - screening.completed
        - screening.contact_exhausted
        - interview.scheduled
        - interview.rescheduled
        - interview.cancelled
        - interview.no_show
        - interview.completed
        - background_check.completed
        - background_check.action_required
        - ping
    Event:
      type: object
      description: >
        Event envelope. Delivery is at-least-once and unordered — deduplicate on
        `id` and order by `created_at`. The `data` payload of each v1 event type
        is documented in the API introduction.
      properties:
        id:
          type: string
          description: Event ID (`evt_...`).
          example: evt_9TqLp4XcRr
        type:
          $ref: '#/components/schemas/EventType'
        created_at:
          type: string
          format: date-time
          description: When the event occurred.
        org_id:
          type: string
          description: Organization the event belongs to.
          example: org_4Nv8sJqKfH
        external_ref:
          type: string
          nullable: true
          description: The related candidate's `external_ref`, echoed on every event for correlation; `null` for `ping`.
          example: cl_app_84321
        data:
          type: object
          properties:
            object:
              type: object
              description: The full resource the event describes.
      example:
        id: evt_9TqLp4XcRr
        type: screening.completed
        created: '2026-06-11T14:11:48Z'
        org_id: org_4Nv8sJqKfH
        external_ref: cl_app_84321
        data:
          object:
            id: scr_7Hq2mNfA8b
            candidate_id: cand_5DkW9rTzPe
            external_ref: cl_app_84321
            job_id: job_2VbY6mQwXs
            status: completed
            stage: passed_screening_awaiting_scheduling
            attempt_count: 1
            next_attempt_at: null
            started_at: '2026-06-11T14:03:22Z'
            completed_at: '2026-06-11T14:11:47Z'
            outcome: passed
            result:
              answers:
                - question: Do you have an active Florida CNA or HHA license?
                  answer_text: >-
                    Yes — I've held my Florida CNA license since 2021, it's current
                    and in good standing.
                  knockout: true
                  knockout_passed: true
                - question: >-
                    Are you able to work in clients' homes in the Tampa area,
                    including weekend shifts?
                  answer_text: Yes, I'm available weekends and have reliable transportation.
                  knockout: true
                  knockout_passed: true
                - question: Tell me about your most recent caregiving role.
                  answer_text: >-
                    I spent the last three years with a private-duty agency in
                    Brandon, mostly long-term dementia-care clients.
                  knockout: false
                  knockout_passed: null
              summary: >-
                Maria holds an active Florida CNA license (since 2021), is available
                for weekend in-home shifts in the Tampa area, and has three years of
                recent private-duty dementia-care experience. She passed both
                knockout questions and was engaged and clear throughout the call.
              signals:
                resume_fit:
                  rating: strong
                  rationale: >-
                    Three years of private-duty dementia care closely matches the
                    in-home caregiver role requirements.
                employment_stability:
                  rating: strong
                  rationale: Two employers over five years with no unexplained gaps.
    UsageReport:
      type: object
      description: Monthly usage rollup for wholesale billing reconciliation.
      properties:
        month:
          type: string
          description: '`YYYY-MM`.'
          example: '2026-06'
        totals:
          $ref: '#/components/schemas/UsageCounts'
        organizations:
          type: array
          description: Per-organization breakdown.
          items:
            allOf:
              - type: object
                properties:
                  org_id:
                    type: string
                    example: org_4Nv8sJqKfH
              - $ref: '#/components/schemas/UsageCounts'
    UsageCounts:
      type: object
      properties:
        candidates_ingested:
          type: integer
          example: 412
        screenings_initiated:
          type: integer
          example: 398
        screenings_completed:
          type: integer
          example: 301
        background_checks_ordered:
          type: integer
          example: 87
    OrganizationList:
      type: object
      description: Cursor-paginated list of organizations.
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/Organization'
        has_more:
          type: boolean
        next_cursor:
          type: string
          nullable: true
    TemplateList:
      type: object
      description: Cursor-paginated list of templates.
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/Template'
        has_more:
          type: boolean
        next_cursor:
          type: string
          nullable: true
    JobList:
      type: object
      description: Cursor-paginated list of jobs.
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/Job'
        has_more:
          type: boolean
        next_cursor:
          type: string
          nullable: true
    CandidateList:
      type: object
      description: Cursor-paginated list of candidates.
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/Candidate'
        has_more:
          type: boolean
        next_cursor:
          type: string
          nullable: true
    ScreeningList:
      type: object
      description: Cursor-paginated list of screenings.
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/Screening'
        has_more:
          type: boolean
        next_cursor:
          type: string
          nullable: true
    InterviewList:
      type: object
      description: Cursor-paginated list of interviews.
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/Interview'
        has_more:
          type: boolean
        next_cursor:
          type: string
          nullable: true
    EventList:
      type: object
      description: Cursor-paginated list of events.
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/Event'
        has_more:
          type: boolean
        next_cursor:
          type: string
          nullable: true
