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

# Ask to close a held outbound message, or to declare its outcome

> A message whose time ran out after a put whose outcome is unknown stays SUBMITTED, held for an answer the câmara may never send, and the rail never fails it alone. Records this operator's request, with the evidence in reason, to close it as failed. Nothing changes until a second, different operator approves. 403 for a machine credential: the close is for people. A câmara answer parked for the message blocks the plain close, since it may say the message settled. When the rail refused that answer on content (it never replays; see the DLQ status SEMANTIC_REJECTED), the operator reads it and declares the outcome it states by passing its id in parkedAnswerId: outcome FAILED for the message's E twin (the approval ends the send REFUSED and emits the refusal fact), outcome SETTLED with settledAt for the R1 of an LTR0002 or LTR0008 (the approval ends it ANSWERED and emits the answered fact the câmara's own answer would have). For the R1 of a PAG transfer the operator also types numCtrl (NumCtrlPAG) and situation (SitLancPAG), read in the answer, and settledAt is its DtHrSit; the second operator types the same values to approve, and the answered fact carries declaredByOperators. The other R1 legs (queries, lists and the LDL answers) cannot be declared. 409 when the message is not held, a request already awaits its approval, an answer that can still replay is parked, or parkedAnswerId does not name a refused answer of this message that states the declared outcome. 422 when outcome, settledAt, numCtrl or situation is missing, misplaced, outside the answer's official facets or (settledAt) in the future.



## OpenAPI

````yaml /pt/openapi/v3-current/siloc.yaml post /api/v1/siloc/outbound/messages/{id}/close-request
openapi: 3.1.0
info:
  description: >-
    OpenAPI 3.1 surface for Lerian SILOC, the participant-side rail connecting
    the institution to Núclea's SILOC deferred-net interbank settlement.
  title: Lerian SILOC API
  version: 1.0.0
servers:
  - url: https://api.example.com
    description: >-
      Replace the example host with the URL provided during environment
      onboarding.
security: []
paths:
  /api/v1/siloc/outbound/messages/{id}/close-request:
    post:
      tags:
        - Schedule
      summary: Ask to close a held outbound message, or to declare its outcome
      description: >-
        A message whose time ran out after a put whose outcome is unknown stays
        SUBMITTED, held for an answer the câmara may never send, and the rail
        never fails it alone. Records this operator's request, with the evidence
        in reason, to close it as failed. Nothing changes until a second,
        different operator approves. 403 for a machine credential: the close is
        for people. A câmara answer parked for the message blocks the plain
        close, since it may say the message settled. When the rail refused that
        answer on content (it never replays; see the DLQ status
        SEMANTIC_REJECTED), the operator reads it and declares the outcome it
        states by passing its id in parkedAnswerId: outcome FAILED for the
        message's E twin (the approval ends the send REFUSED and emits the
        refusal fact), outcome SETTLED with settledAt for the R1 of an LTR0002
        or LTR0008 (the approval ends it ANSWERED and emits the answered fact
        the câmara's own answer would have). For the R1 of a PAG transfer the
        operator also types numCtrl (NumCtrlPAG) and situation (SitLancPAG),
        read in the answer, and settledAt is its DtHrSit; the second operator
        types the same values to approve, and the answered fact carries
        declaredByOperators. The other R1 legs (queries, lists and the LDL
        answers) cannot be declared. 409 when the message is not held, a request
        already awaits its approval, an answer that can still replay is parked,
        or parkedAnswerId does not name a refused answer of this message that
        states the declared outcome. 422 when outcome, settledAt, numCtrl or
        situation is missing, misplaced, outside the answer's official facets or
        (settledAt) in the future.
      operationId: requestOutboundMessageClose
      parameters:
        - description: >-
            Idempotency key for this state-changing request (required, max 255
            characters).
          in: header
          name: X-Idempotency
          required: true
          schema:
            description: >-
              Idempotency key for this state-changing request (required, max 255
              characters).
            maxLength: 255
            type: string
        - description: Outbound message id.
          in: path
          name: id
          required: true
          schema:
            description: Outbound message id.
            format: uuid
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CloseRequestInputBody'
        required: true
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OutboundCloseRequestResponse'
          description: Created
        '422':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Detail'
          description: Unprocessable Entity
        '500':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Detail'
          description: Internal Server Error
        default:
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Detail'
          description: Error
      security:
        - BearerAuth: []
components:
  schemas:
    CloseRequestInputBody:
      additionalProperties: false
      properties:
        numCtrl:
          description: >-
            The câmara's control number the operator read in the refused R1
            (NumCtrlPAG, 1 to 20 characters); required for SETTLED of a PAG
            transfer, refused otherwise.
          type: string
        outcome:
          description: >-
            What that answer states: FAILED for the message's E twin, SETTLED
            for the R1 of an LTR0002, LTR0008 or a PAG transfer. Required with
            parkedAnswerId, refused without it.
          enum:
            - SETTLED
            - FAILED
          type: string
        parkedAnswerId:
          description: >-
            The id of the refused (SEMANTIC_REJECTED) câmara answer parked for
            this message, which the operator read; required when such an answer
            blocks the close.
          format: uuid
          type: string
        reason:
          description: >-
            The evidence that the câmara will not answer: what was checked and
            with whom.
          maxLength: 500
          minLength: 1
          type: string
        settledAt:
          description: >-
            The settlement instant the operator confirmed, in the past; required
            for SETTLED, refused otherwise.
          format: date-time
          type: string
        situation:
          description: >-
            The situation (SitLancPAG, up to 3 characters) the operator read in
            the refused R1; required for SETTLED of a PAG transfer, refused
            otherwise.
          type: string
      required:
        - reason
      type: object
    OutboundCloseRequestResponse:
      additionalProperties: false
      properties:
        id:
          description: Close request id.
          format: uuid
          type: string
        messageId:
          description: The outbound message the request is about.
          format: uuid
          type: string
        numCtrl:
          description: >-
            The câmara's own control number (NumCtrlPAG) the first operator read
            in the answer, for a SETTLED declaration of a PAG transfer; omitted
            otherwise.
          type: string
        outcome:
          description: >-
            What the operators declared from that answer; omitted for a close
            with no parked answer.
          enum:
            - SETTLED
            - FAILED
          type: string
        parkedAnswerId:
          description: >-
            The refused câmara answer the operators declared the outcome from;
            omitted for a close with no parked answer.
          format: uuid
          type: string
        reason:
          description: The evidence the first operator gave.
          type: string
        requestedAt:
          description: When the request was made.
          format: date-time
          type: string
        requestedBy:
          description: The operator who asked, as the audit trail names them.
          type: string
        settledAt:
          description: >-
            The settlement instant the operators confirmed for a SETTLED
            declaration; omitted otherwise.
          format: date-time
          type: string
        situation:
          description: >-
            The situation (SitLancPAG) the first operator read in the answer,
            for a SETTLED declaration of a PAG transfer; omitted otherwise.
          type: string
        status:
          description: >-
            PENDING until a second operator approves; APPROVED once the message
            is closed.
          enum:
            - PENDING
            - APPROVED
          type: string
      required:
        - id
        - messageId
        - requestedBy
        - reason
        - requestedAt
        - status
      type: object
    Detail:
      additionalProperties: true
      properties:
        code:
          description: >-
            Stable, machine-readable domain error code scoped to the emitting
            service (format: <SERVICE>-NNNN).
          type: string
        detail:
          description: >-
            A human-readable explanation specific to this occurrence of the
            problem.
          examples:
            - Property foo is required but is missing.
          type: string
        errors:
          description: Optional list of individual error details
          items:
            $ref: '#/components/schemas/ErrorDetail'
          type:
            - array
            - 'null'
        instance:
          description: >-
            A URI reference that identifies the specific occurrence of the
            problem.
          examples:
            - https://example.com/error-log/abc123
          format: uri
          type: string
        status:
          description: HTTP status code
          examples:
            - 400
          format: int64
          type: integer
        title:
          description: >-
            A short, human-readable summary of the problem type. This value
            should not change between occurrences of the error.
          examples:
            - Bad Request
          type: string
        type:
          default: about:blank
          description: A URI reference to human-readable documentation for the error.
          examples:
            - https://example.com/errors/example
          format: uri
          type: string
        upstream:
          $ref: '#/components/schemas/Upstream'
          description: >-
            RFC 9457 extension member: the error a proxied third-party provider
            reported. Absent unless the emitting service explicitly surfaced
            one.
      type: object
    ErrorDetail:
      additionalProperties: false
      properties:
        location:
          description: >-
            Where the error occurred, e.g. 'body.items[3].tags' or
            'path.thing-id'
          type: string
        message:
          description: Error message text
          type: string
        value:
          description: The value at the given location
      type: object
    Upstream:
      additionalProperties: false
      properties:
        code:
          description: The upstream provider's own error code, verbatim.
          examples:
            - E4001
          type: string
        message:
          description: >-
            The upstream provider's own error message, verbatim (bounded, never
            its raw response body).
          examples:
            - account not found at provider
          type: string
      type: object
  securitySchemes:
    BearerAuth:
      bearerFormat: JWT
      description: JWT bearer token issued by the identity provider.
      scheme: bearer
      type: http

````

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