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

# Report a task's outcome

> Tell Navige whether a task did what it was for, using the transactionId Navige returned.

Navige knows whether a call was allowed and what it cost. It does not know whether the task succeeded, so you report it here. Until you do, the task is unjudged, which is counted as neither a success nor a failure. [Transactions](https://docs.navige.ai/concepts/transactions.md#status-and-outcome-are-different-questions) explains how outcomes are used.

Use this endpoint when you have the `transactionId` from [Ask for a decision](https://docs.navige.ai/reference/enforce.md). If you grouped calls with your own workflow and reference instead, use [Report an outcome by your reference](https://docs.navige.ai/reference/outcome-by-ref.md).

> [!NOTE]
>
> The key field is filled with a public demo key, so you can send a request without signing up. It reaches a shared demo workspace that resets every night, so do not send anything private. To call your own workspace, replace it with your key from Agents in the console.

You can report an outcome again to correct it. Each report replaces the last one, including `errorClass`: a report without it clears an earlier one.

## Status codes

`200` with the fields described below. A body Navige refuses, or an `id` that is not a valid UUID, gets `400` with `{ "error": "…" }`. A task that does not exist, or belongs to another organisation, gets `404` with `{ "error": "no such transaction" }`. A key that is missing or not valid gets `401`, and an agent that is inactive or expired gets `403`.

```bash cURL theme={null}
curl -X POST https://api.navige.ai/v1/transactions/01937c4e-9d1e-7a2b-8c3d-4e5f6a7b8c9d/outcome \
  -H "x-navige-key: $NAVIGE_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "succeeded": false, "errorClass": "wrong_category" }'
```

```powershell PowerShell theme={null}
$transactionId = "01937c4e-9d1e-7a2b-8c3d-4e5f6a7b8c9d"
$body = @'
{ "succeeded": false, "errorClass": "wrong_category" }
'@
Invoke-RestMethod -Method Post -Uri "https://api.navige.ai/v1/transactions/$transactionId/outcome" `
  -Headers @{ "x-navige-key" = $env:NAVIGE_KEY } `
  -ContentType "application/json" -Body $body
```

```python Python theme={null}
import os, requests

transaction_id = "01937c4e-9d1e-7a2b-8c3d-4e5f6a7b8c9d"
r = requests.post(
    f"https://api.navige.ai/v1/transactions/{transaction_id}/outcome",
    headers={"x-navige-key": os.environ["NAVIGE_KEY"]},
    json={"succeeded": False, "errorClass": "wrong_category"},
)
print(r.json())
```

```json Recorded theme={null}
{ "ok": true, "transactionId": "01937c4e-9d1e-7a2b-8c3d-4e5f6a7b8c9d", "succeeded": false }
```

```json Not a boolean theme={null}
{ "error": "`succeeded` must be a boolean — true or false, not a string or a number" }
```

```json Not found theme={null}
{ "error": "no such transaction" }
```


## OpenAPI

````yaml POST /v1/transactions/{id}/outcome
openapi: 3.1.0
info:
  title: Navige API
  version: 1.0.0
  description: >-
    The gateway's public API: ask for a decision before an agent acts, report
    usage and outcomes, and read what a task usually costs.
servers:
  - url: https://api.navige.ai
security:
  - navigeKey: []
  - bearer: []
tags:
  - name: Decisions
    description: Ask before an agent acts, and read what applies to your calls.
  - name: Usage and tasks
    description: Report what happened, and read what a task costs.
paths:
  /v1/transactions/{id}/outcome:
    post:
      tags:
        - Usage and tasks
      summary: Report a task's outcome
      description: Record whether a task did what it was for, by Navige's `transactionId`.
      operationId: reportOutcome
      parameters:
        - schema:
            type: string
            format: uuid
            x-default: 01937c4e-9d1e-7a2b-8c3d-4e5f6a7b8c9d
          example: 01937c4e-9d1e-7a2b-8c3d-4e5f6a7b8c9d
          in: path
          name: id
          required: true
          description: The task's `transactionId`.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - succeeded
              properties:
                succeeded:
                  type: boolean
                  description: >-
                    true if the task did what it was for, false if not. Must be
                    a JSON boolean: the string "false" or the number 0 is
                    refused.
                errorClass:
                  type: string
                  maxLength: 64
                  examples:
                    - wrong_category
                  description: >-
                    With a failure, a short class for what went wrong, such as
                    `wrong_category`. Up to 64 characters after leading and
                    trailing spaces are removed; an empty value is treated as
                    not sent. Send a class, not an error message.
            example:
              succeeded: true
      responses:
        '200':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                required:
                  - ok
                  - transactionId
                  - succeeded
                additionalProperties: false
                properties:
                  ok:
                    type: boolean
                    description: Always true on a 200.
                    enum:
                      - true
                  transactionId:
                    type: string
                    format: uuid
                    description: The task the outcome was recorded on.
                  succeeded:
                    type: boolean
                    description: The outcome recorded.
        '400':
          description: The body was refused, or `id` is not a valid UUID.
          content:
            application/json:
              schema:
                type: object
                required:
                  - error
                additionalProperties: false
                properties:
                  error:
                    type: string
                    description: What was wrong, in words.
        '401':
          description: The key is missing (`missing`) or not valid (`invalid_key`).
          content:
            application/json:
              schema:
                type: object
                required:
                  - error
                additionalProperties: false
                properties:
                  error:
                    type: string
                    description: What was wrong, in words.
        '403':
          description: >-
            The key's agent is inactive (`agent_inactive`) or expired
            (`agent_expired`).
          content:
            application/json:
              schema:
                type: object
                required:
                  - error
                additionalProperties: false
                properties:
                  error:
                    type: string
                    description: What was wrong, in words.
        '404':
          description: 'No such task in your organisation: `no such transaction`.'
          content:
            application/json:
              schema:
                type: object
                required:
                  - error
                additionalProperties: false
                properties:
                  error:
                    type: string
                    description: What was wrong, in words.
components:
  securitySchemes:
    navigeKey:
      type: apiKey
      in: header
      name: x-navige-key
      description: >-
        Your agent's Navige key, from Agents in the console. The docs fill in a
        public demo key that reaches a shared demo workspace, reset every night;
        paste your own to call your workspace.
      x-default: nv_docs_demo_nuJM-1NFjNqDKAeGoZ5-QaAfFAdVXv79
    bearer:
      type: http
      scheme: bearer
      description: >-
        The same key as `Authorization: Bearer <key>`. Used only when
        `x-navige-key` is absent.

````

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