> ## 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.

# Ask for a decision

> Describe an action your agent is about to take. Navige answers allow, deny or pending.

Navige decides before your agent acts and records the decision. It never sees what happens next, so your code must act on the answer. [Decision API](https://docs.navige.ai/connect/enforce.md) explains how to handle each answer.

> [!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.

## Status codes

`200` for `allow`, `deny`, `pending`, `approved`, `rejected` and `expired`: a refusal is a normal answer, not an HTTP error. `error` comes back with `400` when your request is wrong, or `503` with `"unavailable": true` when Navige could not decide. A body without a string `tool` gets `400` with ``{ "error": "body must include a string `tool` field" }``. 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/enforce \
  -H "x-navige-key: $NAVIGE_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "tool": "issue_refund",
    "system": "stripe",
    "classification": "financial",
    "arguments": { "amount_usd": 1240, "customer": "cus_PZ8" },
    "transaction": { "workflowKey": "billing.refund", "externalRef": "ticket-88412" },
    "wait": false
  }'
```

```powershell PowerShell theme={null}
$body = @'
{
  "tool": "issue_refund",
  "system": "stripe",
  "classification": "financial",
  "arguments": { "amount_usd": 1240, "customer": "cus_PZ8" },
  "transaction": { "workflowKey": "billing.refund", "externalRef": "ticket-88412" },
  "wait": false
}
'@
Invoke-RestMethod -Method Post -Uri https://api.navige.ai/enforce `
  -Headers @{ "x-navige-key" = $env:NAVIGE_KEY } `
  -ContentType "application/json" -Body $body
```

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

r = requests.post(
    "https://api.navige.ai/enforce",
    headers={"x-navige-key": os.environ["NAVIGE_KEY"]},
    json={
        "tool": "issue_refund",
        "system": "stripe",
        "classification": "financial",
        "arguments": {"amount_usd": 1240, "customer": "cus_PZ8"},
        "transaction": {"workflowKey": "billing.refund", "externalRef": "ticket-88412"},
        "wait": False,
    },
)
print(r.json()["decision"])
```

```json Deny theme={null}
{ "decision": "deny", "reason": "Refunds over $500 require a human", "code": "policy", "transactionId": "01937c4f-…" }
```

```json Allow theme={null}
{ "decision": "allow", "transactionId": "01937c4f-…" }
```

```json Pending theme={null}
{ "decision": "pending", "approvalId": "01937c4e-…", "expiresAt": "2026-10-14T09:12:00Z" }
```

```json Not enforced theme={null}
{ "decision": "allow", "enforced": false, "wouldHaveBeen": "deny", "code": "policy", "reason": "Refunds over $500 require a human" }
```

```json Navige unavailable theme={null}
{ "decision": "error", "reason": "approval required, but recording the request failed", "unavailable": true }
```


## OpenAPI

````yaml POST /enforce
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:
  /enforce:
    post:
      tags:
        - Decisions
      summary: Ask for a decision
      description: >-
        Describe an action your agent is about to take. Navige answers allow,
        deny or pending, and records the decision. It never sees what happens
        next, so your code must act on the answer.


        A refusal is a normal answer with 200, not an HTTP error. `error` comes
        back with 400 when the request is wrong, or 503 with `"unavailable":
        true` when Navige could not decide.
      operationId: askForDecision
      parameters:
        - schema:
            type: string
          in: header
          name: x-navige-client
          required: false
          description: >-
            Which app on a computer connected with `navige connect` is calling.
            The call lands on that app's own agent. You rarely send it by hand.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - tool
              properties:
                tool:
                  type: string
                  maxLength: 200
                  examples:
                    - issue_refund
                  description: >-
                    What the agent wants to do. Up to 200 characters; longer is
                    rejected, not truncated.
                system:
                  type: string
                  maxLength: 200
                  examples:
                    - stripe
                  description: >-
                    Which system it acts on, such as `stripe` or `salesforce`.
                    Lets one policy cover a tool name that exists in several
                    places. Defaults to `External`.
                classification:
                  type: string
                  enum:
                    - read
                    - write
                    - destructive
                    - financial
                    - unknown
                  examples:
                    - financial
                  description: >-
                    Used the first time Navige sees this tool; after that, the
                    classification Navige has stored for the tool applies. Any
                    other value is ignored.
                arguments:
                  type: object
                  additionalProperties: true
                  examples:
                    - amount_usd: 1240
                      customer: cus_PZ8
                  description: >-
                    What the tool would be called with. Policies can read these.
                    Secrets are redacted before anything is stored.
                transaction:
                  type: object
                  description: The business task this call belongs to.
                  examples:
                    - workflowKey: billing.refund
                      externalRef: ticket-88412
                  properties:
                    workflowKey:
                      type: string
                      examples:
                        - billing.refund
                      description: The kind of task, such as `billing.refund`.
                    externalRef:
                      type: string
                      examples:
                        - ticket-88412
                      description: >-
                        Your own reference for this task, such as a ticket
                        number.
                    repo:
                      type: string
                      description: >-
                        The git repository a coding agent is working in, as
                        `host/owner/name`. `navige connect` sends it.
                    branch:
                      type: string
                      description: The git branch, sent with `repo`.
                workflow:
                  type: object
                  description: >-
                    Tags the call for the workflow view. Without `transaction`,
                    `key` and `runId` also become the task's workflow and
                    reference, so per-workflow budgets apply to the call.
                  properties:
                    key:
                      type: string
                      description: The workflow's name.
                    runId:
                      type: string
                      description: This run of it.
                wait:
                  type: boolean
                  default: true
                  examples:
                    - false
                  description: >-
                    With true, a call that needs a person's approval waits up to
                    five minutes for it. Send false to get `pending` at once and
                    poll Check a held decision.
                onBehalfOf:
                  type: object
                  description: >-
                    The person the agent is acting for: `{ "memberId": "…" }`,
                    or an identity a workspace admin linked in Settings →
                    Members, such as `{ "provider": "lark", "externalId": "ou_…"
                    }`. With it, guardrail verdicts are real on every plan
                    unless shadow mode is on, and a person Navige cannot
                    establish is refused. A malformed value is refused with 400.
            example:
              tool: issue_refund
              system: stripe
              classification: financial
              arguments:
                amount_usd: 1240
                customer: cus_PZ8
              transaction:
                workflowKey: billing.refund
                externalRef: ticket-88412
              wait: false
      responses:
        '200':
          description: A decision. Do not treat `decision` as a boolean.
          content:
            application/json:
              schema:
                type: object
                required:
                  - decision
                additionalProperties: false
                properties:
                  decision:
                    type: string
                    enum:
                      - allow
                      - deny
                      - pending
                      - approved
                      - rejected
                      - expired
                  reason:
                    type: string
                    description: Why, in words you can show a person.
                  code:
                    type: string
                    enum:
                      - policy
                      - kill_switch
                      - spend_cap
                      - unknown_requester
                      - inactive_requester
                      - requester_unavailable
                    description: >-
                      Why, as a value your code can branch on. The last three
                      appear only with `onBehalfOf`.
                  transactionId:
                    type: string
                    format: uuid
                    description: The task this call joined. Use it to report the outcome.
                  approvalId:
                    type: string
                    format: uuid
                    description: 'With `pending`: the approval to poll.'
                  expiresAt:
                    type: string
                    format: date-time
                    description: 'With `pending`: when the approval expires.'
                  decidedBy:
                    description: >-
                      Who settled the approval. `console` when a member decided
                      in the console. `link` when the decision came from an
                      approve or deny link in an email or Slack message: the
                      links need no sign-in, so `memberId` is null.
                    oneOf:
                      - type: object
                        required:
                          - channel
                          - memberId
                          - role
                        additionalProperties: false
                        properties:
                          channel:
                            enum:
                              - console
                          memberId:
                            type: string
                            format: uuid
                          role:
                            type:
                              - string
                              - 'null'
                            enum:
                              - owner
                              - admin
                              - viewer
                              - null
                            description: >-
                              The member's role now, not the role they held when
                              they decided.
                      - type: object
                        required:
                          - channel
                          - memberId
                        additionalProperties: false
                        properties:
                          channel:
                            enum:
                              - link
                          memberId:
                            type: 'null'
                  enforced:
                    type: boolean
                    description: >-
                      false on an `allow` that was not enforced: on Watchtower
                      or in shadow mode, a guardrail's verdict is recorded and
                      the call is allowed. In shadow mode the kill switch and
                      spend cap answer this way too.
                    enum:
                      - false
                  wouldHaveBeen:
                    type: string
                    enum:
                      - deny
                      - pending
                    description: 'With `"enforced": false`: what Navige would have answered.'
                  requester:
                    type: object
                    description: >-
                      With `onBehalfOf`: who Navige took the person to be. Never
                      what they may do.
                    required:
                      - status
                    additionalProperties: false
                    properties:
                      status:
                        type: string
                        enum:
                          - linked
                          - unlinked
                          - inactive
                          - unavailable
                      memberId:
                        type: string
                        format: uuid
                      role:
                        type: string
                        enum:
                          - owner
                          - admin
                          - viewer
        '400':
          description: The request is wrong, for example a body without a string `tool`.
          content:
            application/json:
              schema:
                oneOf:
                  - type: object
                    required:
                      - error
                    additionalProperties: false
                    properties:
                      error:
                        type: string
                        description: What was wrong, in words.
                  - type: object
                    required:
                      - decision
                      - reason
                    additionalProperties: false
                    properties:
                      decision:
                        enum:
                          - error
                      reason:
                        type: string
                      transactionId:
                        type: string
                        format: uuid
        '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.
        '503':
          description: Navige could not decide. Do not handle it as `deny`.
          content:
            application/json:
              schema:
                type: object
                required:
                  - decision
                  - reason
                  - unavailable
                additionalProperties: false
                properties:
                  decision:
                    enum:
                      - error
                  reason:
                    type: string
                  unavailable:
                    enum:
                      - true
                  transactionId:
                    type: string
                    format: uuid
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.