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

# closeUnderwritingAccount

> Closes an underwriting account with a closing comment. Closing cannot be undone, and it is refused while a review of the account is in progress. An account the caller cannot see is reported as not found.

`Mutation`

## Arguments

**input** `CloseUnderwritingAccountInput!` *required*

**child attributes**

**comment** `Max1000Text!` *required*

Why the account is being closed. Recorded on the account's events and shown to everyone who can see the account.

**id** `UUID!` *required*

The unique identifier of the account to close.

## Return type

`CloseUnderwritingAccountPayload!`

**errors** `[CloseUnderwritingAccountError!]`

Errors that occurred during the mutation, if any. Null or empty indicates success.

**Possible types**

**BadRequestError**

**advice** `String!` *required*

**code** `CommonErrorCode!` *required*

See [CommonErrorCode](https://docs.tesouro.com/underwriting/reference/graphql/types/common-error-code.md)

**message** `String!` *required*

**InvalidActorError**

**advice** `String!` *required*

**code** `CommonErrorCode!` *required*

See [CommonErrorCode](https://docs.tesouro.com/underwriting/reference/graphql/types/common-error-code.md)

**message** `String!` *required*

**NotFoundError**

**advice** `String!` *required*

**code** `CommonErrorCode!` *required*

See [CommonErrorCode](https://docs.tesouro.com/underwriting/reference/graphql/types/common-error-code.md)

**message** `String!` *required*

**resourceId** `String`

**resourceName** `String`

**ServerError**

**advice** `String!` *required*

**code** `CommonErrorCode!` *required*

See [CommonErrorCode](https://docs.tesouro.com/underwriting/reference/graphql/types/common-error-code.md)

**message** `String!` *required*

**UnderwritingAccountClosureRefusedError**

The underwriting account cannot be closed in its current state; nothing was changed.

**code** `UnderwritingAccountClosureRefusedErrorCode!` *required*

A static code for tying the response back programmatically.

**Possible enum values**

**ACCOUNT\_CLOSED** `enum`

The account is already closed. A closed account stays closed.

**REVIEW\_IN\_PROGRESS** `enum`

A review of the account is in progress. Approve, decline or withdraw it before closing the account.

**message** `String!` *required*

A helpful message describing why the account was not closed.

**underwritingAccount** `UnderwritingAccount`

The closed account. Null when the account was not closed.

**child attributes**

**activeReviewId** `UUID`

The unique identifier of the review application in progress on the account. Null when no review is in progress.

**currentApplication** `UnderwritingApplication`

The most recently approved application, which holds the account's current details.

See [UnderwritingApplication](https://docs.tesouro.com/underwriting/reference/graphql/types/underwriting-application.md)

**events** `UnderwritingAccountEventCollection!` *required*

The events recorded on the account, newest first.

See [UnderwritingAccountEventCollection](https://docs.tesouro.com/underwriting/reference/graphql/types/underwriting-account-event-collection.md)

**id** `UUID!` *required*

The unique identifier of the account.

**status** `UnderwritingAccountStatus!` *required*

The status of the account.

See [UnderwritingAccountStatus](https://docs.tesouro.com/underwriting/reference/graphql/types/underwriting-account-status.md)

```graphql Operation lines expandable theme={null}
mutation CloseUnderwritingAccount($input: CloseUnderwritingAccountInput!) {
  closeUnderwritingAccount(input: $input) {
    errors {
      ... on BadRequestError {
        advice
        code
        message
      }
      ... on InvalidActorError {
        advice
        code
        message
      }
      ... on NotFoundError {
        advice
        code
        message
        resourceId
        resourceName
      }
      ... on ServerError {
        advice
        code
        message
      }
      ... on UnderwritingAccountClosureRefusedError {
        code
        message
      }
    }
    underwritingAccount {
      activeReviewId
      currentApplication {
        applicationStatus
        createdDateTime
        declineComment
        id
        informationRequestStatus
        kind
        queue
        submissionAttemptedDateTime
        submissionSuccessfulDateTime
        updatedDateTime
      }
      events {

      }
      id
      status
    }

}
}

```

```json Variables lines expandable theme={null}
{
  "input": {
    "comment": "example",
    "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
  }
}
```

```bash cURL lines expandable theme={null}
curl --request POST \
  --url https://api.sandbox.com/graphql \
  --header 'Content-Type: application/json' \
  --header 'Authorization: Bearer <YOUR_ACCESS_TOKEN>' \
  --data '{
  "query": "mutation CloseUnderwritingAccount($input: CloseUnderwritingAccountInput!) {\n  closeUnderwritingAccount(input: $input) {\n    errors {\n      ... on BadRequestError {\n        advice\n        code\n        message\n      }\n      ... on InvalidActorError {\n        advice\n        code\n        message\n      }\n      ... on NotFoundError {\n        advice\n        code\n        message\n        resourceId\n        resourceName\n      }\n      ... on ServerError {\n        advice\n        code\n        message\n      }\n      ... on UnderwritingAccountClosureRefusedError {\n        code\n        message\n      }\n    }\n    underwritingAccount {\n      activeReviewId\n      currentApplication {\n        applicationStatus\n        createdDateTime\n        declineComment\n        id\n        informationRequestStatus\n        kind\n        queue\n        submissionAttemptedDateTime\n        submissionSuccessfulDateTime\n        updatedDateTime\n      }\n      events {\n\n      }\n      id\n      status\n    }\n  }\n}",
  "variables": {
    "input": {
      "comment": "example",
      "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
    }
  }
}'
```

```json Response lines expandable theme={null}
{
  "data": {
    "closeUnderwritingAccount": {
      "errors": [
        {
          "__typename": "BadRequestError",
          "advice": "example",
          "code": "BAD_REQUEST",
          "message": "example"
        }
      ],
      "underwritingAccount": {
        "activeReviewId": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
        "currentApplication": {
          "applicationEvents": "example",
          "applicationIdentity": "example",
          "applicationStatus": "APPROVED",
          "assignee": "example",
          "attachments": [
            "example"
          ],
          "bankAccounts": [
            "example"
          ],
          "comments": [
            "example"
          ],
          "createdBy": "example",
          "createdDateTime": "2026-01-15T14:30:00Z",
          "decisionComponents": [
            "example"
          ],
          "declineComment": "example",
          "declineReasons": [
            "example"
          ],
          "dynamicField": "example",
          "dynamicFields": [
            "example"
          ],
          "id": "c9a1e2d3-4b5f-6789-0abc-def123456789",
          "informationRequests": [
            "example"
          ],
          "informationRequestStatus": "AWAITING_INFORMATION",
          "kind": "MAINTENANCE_REVIEW",
          "participants": [
            "example"
          ],
          "primaryUnderwriter": "example",
          "processingActivity": "example",
          "queue": "PARTNER",
          "relationshipProcessingActivity": "example",
          "schema": "example",
          "secondaryUnderwriter": "example",
          "stakeholders": [
            "example"
          ],
          "submissionAttemptedDateTime": "2026-01-15T14:30:00Z",
          "submissionSuccessfulDateTime": "2026-01-15T14:30:00Z",
          "updatedBy": "example",
          "updatedDateTime": "2026-01-15T14:30:00Z"
        },
        "events": {
          "items": [
            "example"
          ],
          "pageInfo": "example"
        },
        "id": "d8b2f3e4-5c6a-7890-1bcd-ef2345678901",
        "status": "CLOSED"
      }
    }
  }
}
```


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