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

# Settle an attempt

> How the attempt ended: `done`, `failed` or `unknown_outcome`. Only `failed` opens a new attempt.



## OpenAPI

````yaml openapi/en/cell.json POST /v1/coordination/effects/{effect_id}/settle
openapi: 3.1.0
info:
  title: Niadra data API
  version: '1'
  description: >-
    Writing, context, history, objects, identity, privacy and governance of one
    space. Every space has a stable address, with the space and the region in
    its name.
servers:
  - url: https://{space}.{region}.api.niadra.com
    variables:
      space:
        default: acme-prod
        description: The space, which comes in the source key.
      region:
        default: us-east-2
        description: The region of the space, which also comes in the key.
security: []
paths:
  /v1/coordination/effects/{effect_id}/settle:
    post:
      tags:
        - coordination
      summary: Settle an attempt
      description: >-
        How the attempt the caller holds ended: `done`, `failed` or
        `unknown_outcome` (the request was sent and nobody confirmed it). Only
        `failed` opens a new attempt; an ambiguous effect is never sent again on
        its own. A settlement of an older attempt is refused.


        **Authentication.** Source key: `Authorization: Bearer nia_sk_...`.
        Required scope: `coordinate`. It answers only in a space with the
        `coordination` feature on (the `features` document); in a space without
        it, 404.
      operationId: settle_effect_v1_coordination_effects__effect_id__settle_post
      parameters:
        - in: path
          name: effect_id
          required: true
          schema:
            title: Effect Id
            type: string
        - in: header
          name: Idempotency-Key
          required: true
          schema:
            maxLength: 256
            minLength: 1
            title: Idempotency-Key
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EffectSettle'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Effect'
          description: The effect as it stands after the settlement.
        '422':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
          description: The request does not match the contract.
      security:
        - sourceKey: []
components:
  schemas:
    EffectSettle:
      additionalProperties: false
      properties:
        attempt:
          minimum: 1
          title: Attempt
          type: integer
        state:
          enum:
            - done
            - failed
            - unknown_outcome
          title: State
          type: string
      required:
        - state
        - attempt
      title: EffectSettle
      type: object
    Effect:
      additionalProperties: false
      description: >-
        `effect_id` is the key's keyed hash: it names the effect in paths, where
        the key itself, which may

        carry a conversation id, never goes.
      properties:
        attempt:
          title: Attempt
          type: integer
        done_at:
          anyOf:
            - format: date-time
              type: string
            - type: 'null'
          title: Done At
        effect_id:
          pattern: ^[A-Za-z0-9_-]{43}$
          title: Effect Id
          type: string
        reserved_at:
          format: date-time
          title: Reserved At
          type: string
        state:
          enum:
            - reserved
            - done
            - failed
            - unknown_outcome
          title: State
          type: string
      required:
        - effect_id
        - state
        - attempt
        - reserved_at
      title: Effect
      type: object
    Problem:
      additionalProperties: false
      description: RFC 9457 problem details; `code` comes from the versioned error catalog.
      properties:
        code:
          title: Code
          type: string
        detail:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          title: Detail
        request_id:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          title: Request Id
        status:
          title: Status
          type: integer
        title:
          title: Title
          type: string
        type:
          default: about:blank
          title: Type
          type: string
      required:
        - title
        - status
        - code
      title: Problem
      type: object
  securitySchemes:
    sourceKey:
      type: http
      scheme: bearer
      description: nia_sk_...

````