---
title: "Create permission request"
method: POST
path: "/api/session/{sessionID}/permission"
tags: ["permission"]
---

# Create permission request

`POST /api/session/{sessionID}/permission`

## Request

- Base URL: `https://opencode.ai` (the document declares no server; this is the origin it was published from)
- URL: `https://opencode.ai/api/session/{sessionID}/permission`
- Auth: none required

Evaluate and, when approval is required, create a permission request for a session.

## Path parameters

- `sessionID` string, required

## Request body

- object
  - `id` string
  - `action` string, required
  - `resources` string[], required
  - `save` string[]
  - `metadata` object
  - `source` PermissionSource
    - `type` 'tool', required
    - `messageID` string, required
    - `id` string, required
  - `agent` string

## Response `200`

Success

- object
  - `data` object, required
    - `id` string, required
    - `effect` 'allow' | 'deny' | 'ask', required

## Other responses

- `400`: InvalidRequestError
- `401`: UnauthorizedError
- `404`: SessionNotFoundError | LocationNotFoundError

---

[API](https://skmtc.dev/kaaass/apis/opencode.md) - [All operations](https://skmtc.dev/kaaass/apis/opencode/llms.txt) - [OpenAPI document](https://skmtc.dev/kaaass/apis/opencode/revisions/4e083d954707?raw)
