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

# Close Origination

> Record the final outcome for an enrolled application and cancel its active/paused call, SMS and email cadences and pending communications atomically. No lender-side writes. Same-reason retries reassert closure; conflicting outcomes and active funded loans return 409. Queue-claimed calls remain owned by delivery/recovery and are excluded from cancelledCalls. In-progress communications cannot be recalled.

Close an enrolled application's origination outreach when it has been funded,
withdrawn, or rejected. Use the external application reference (`loanId` from
enrollment) as `{id}`, with the same company's `X-API-Key`.

```bash theme={null}
curl --request POST 'https://api.finosu.com/originations/APPLICATION-123/close' \
  --header 'X-API-Key: YOUR_API_KEY' \
  --header 'Content-Type: application/json' \
  --data '{"reason":"FUNDED"}'
```

## Required reason

| Reason | Meaning |
| - | - |
| `FUNDED` | The lender has funded the application. |
| `WITHDRAWN` | The application has been withdrawn. |
| `REJECTED` | The application has been declined or rejected. |

The body and `reason` are required. Values are case-sensitive. Retrieve the
catalog with [List Origination Close Reasons](/api-reference/origination/close-reasons).
Collections reasons such as `PAID_OFF` and `BANKRUPTCY` are not accepted.

## Effect and response

The operation records the final application outcome, closes its active or paused
call/email/SMS cadences and their pending work in one transaction. Other
applications and loans belonging to the customer are unaffected. This records
an outcome reported by the lender; it does not fund, withdraw, or reject the
application in the lender's LMS. Calls and
messages already in progress cannot be recalled. Queue-claimed calls remain
owned by the delivery worker and are excluded from `cancelledCalls`; the parent
cadence is closed, and pending delivery is subject to the existing eligibility
checks. Closure does not erase queue claims or processing leases.

```json theme={null}
{
  "id": "APPLICATION-123",
  "status": "CLOSED",
  "reason": "FUNDED",
  "cancelledCallSchedules": 1,
  "cancelledEmailSchedules": 0,
  "cancelledSmsSchedules": 0,
  "cancelledCalls": 4,
  "cancelledEmails": 0,
  "cancelledSms": 0
}
```

Retry with the same reference and reason after an uncertain response; no
`Idempotency-Key` is required. A repeat returns `CLOSED` and the same reason,
with counts of items cancelled by that request (normally zero). It also closes
any active or paused cadences that have reappeared. A different final reason
returns `409` and does not overwrite the existing outcome. This endpoint does
not reopen an application; a new enrollment cannot restart the closed application.

## Errors

| Status | Meaning |
| - | - |
| `401` | Missing, invalid, or inactive API key. |
| `404` | No non-deleted application with that reference exists in your company. |
| `409` | Ambiguous reference, missing recorded origination enrollment, a funded active loan, a changed scope, or a different existing final outcome. |
| `422` | Missing body/reason, invalid reason, or unexpected fields. |
| `500` | Operation failed; transaction rolled back. Retry the same request. |

A funded loan that is already active in collections is rejected even if it has
origination history. Use the collections API for collections lifecycle changes.


## OpenAPI

````yaml POST /originations/{id}/close
openapi: 3.1.0
info:
  title: Finosu API
  description: Finosu API
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://api.finosu.com
security:
  - apiKeyAuth: []
paths:
  /originations/{id}/close:
    post:
      summary: Close origination
      description: >-
        Record the final outcome for an enrolled application and cancel its
        active/paused call, SMS and email cadences and pending communications
        atomically. No lender-side writes. Same-reason retries reassert closure;
        conflicting outcomes and active funded loans return 409. Queue-claimed
        calls remain owned by delivery/recovery and are excluded from
        cancelledCalls. In-progress communications cannot be recalled.
      parameters:
        - name: id
          in: path
          required: true
          description: External application reference (loanId from enrollment)
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CloseOriginationRequest'
            example:
              reason: FUNDED
      responses:
        '200':
          description: Origination closed; counts reflect work cancelled by this request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CloseOriginationResponse'
        '401':
          description: Missing, invalid, or inactive API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Application not found in the authenticated company
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '409':
          description: >-
            Ambiguous reference, no origination enrollment, active funded loan,
            changed scope, or conflicting final outcome
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: Missing or invalid body/reason, or unexpected fields
          content:
            application/json:
              schema:
                type: object
                required:
                  - detail
                properties:
                  detail:
                    type: array
                    items:
                      type: object
        '500':
          description: Internal server error; transaction rolled back
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    CloseOriginationRequest:
      type: object
      additionalProperties: false
      required:
        - reason
      properties:
        reason:
          $ref: '#/components/schemas/OriginationCloseReason'
    CloseOriginationResponse:
      type: object
      required:
        - id
        - reason
        - cancelledCallSchedules
        - cancelledEmailSchedules
        - cancelledSmsSchedules
        - cancelledCalls
        - cancelledEmails
        - cancelledSms
      properties:
        id:
          type: string
        status:
          type: string
          const: CLOSED
          default: CLOSED
        reason:
          $ref: '#/components/schemas/OriginationCloseReason'
        cancelledCallSchedules:
          type: integer
        cancelledEmailSchedules:
          type: integer
        cancelledSmsSchedules:
          type: integer
        cancelledCalls:
          type: integer
        cancelledEmails:
          type: integer
        cancelledSms:
          type: integer
    Error:
      type: object
      required:
        - detail
      description: >-
        HTTP error envelope. Most errors contain a message; structured
        application errors may contain an object or array.
      properties:
        detail:
          oneOf:
            - type: string
            - additionalProperties: true
              type: object
            - type: array
              items: {}
    OriginationCloseReason:
      type: string
      enum:
        - FUNDED
        - WITHDRAWN
        - REJECTED
      title: OriginationCloseReason
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.