---
title: "promptSession"
---

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

# promptSession

Path: agenthold API › sessions

`POST /sessions/{sessionId}/prompt`

URL: `/api/v1/sessions/{sessionId}/prompt`

Start a turn (operator role). Wakes the agent if it sleeps. Progress arrives on the event stream.

## Authentication

Requires one of the following:

- `session`, apiKey, in cookie
- `token`, http bearer, header `Authorization`

## Path parameters

- `sessionId` (`promptSession.path.sessionId`; string, required)

## Request body

_Required._

- `text` (`promptSession.text`; string, required)
  - minLength: `1`

## Example request

```json
{
  "text": "string"
}
```

## Code samples

### cURL

```bash
curl --request POST \
  --url '<base-url>/api/v1/sessions/<sessionId>/prompt' \
  --header 'Content-Type: application/json' \
  --cookie 'agenthold_session=<agenthold_session>' \
  --data '
{
  "text": "string"
}
'
```

### TypeScript

```typescript
const url = '<base-url>/api/v1/sessions/<sessionId>/prompt';
const options = {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    cookie: 'agenthold_session=<agenthold_session>'
  },
  body: JSON.stringify({text: 'string'})
};

fetch(url, options)
  .then(res => res.json())
  .then(json => console.log(json))
  .catch(err => console.error(err));
```

### Python

```python
import requests

url = "<base-url>/api/v1/sessions/<sessionId>/prompt"

payload = { "text": "string" }
headers = {
    "cookie": "agenthold_session=<agenthold_session>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
```

## Responses

### 202

The turn started.

### 400

Error.

#### Example

```json
{
  "error": "string"
}
```

- `error` (`promptSession.response.400.error`; string, required)

### 403

Error.

#### Example

```json
{
  "error": "string"
}
```

- `error` (`promptSession.response.403.error`; string, required)

### 404

Error.

#### Example

```json
{
  "error": "string"
}
```

- `error` (`promptSession.response.404.error`; string, required)

### 409

Error.

#### Example

```json
{
  "error": "string"
}
```

- `error` (`promptSession.response.409.error`; string, required)


Source: https://agenthold.dev/api/prompt-session/index.md
