# Agents platform session create

`POST /platform-agents/sessions` · Rivier · agents

Open a session of an agent for one of the platform's customers, optionally inside a connected business that let the platform run an agent there (agents:run), with scopes (read, act: a tool that acts is offered only with act) and how much it keeps (none: nothing of the words beyond the turn; session).

- Scope: agents:write
- Graphql: Mutation.agentsPlatformSessionCreate
- Sdk: agents.platformSession.create
- Cli: agents platform session create

## Request body

`application/json`

```json
{
  "type": "object",
  "properties": {
    "agentId": {
      "type": "string",
      "format": "uuid"
    },
    "customer": {
      "type": "string",
      "format": "uuid"
    },
    "connectionId": {
      "type": "string",
      "format": "uuid"
    },
    "scopes": {
      "type": "array",
      "items": {
        "type": "string",
        "enum": [
          "read",
          "act"
        ]
      },
      "minItems": 1,
      "default": [
        "read"
      ]
    },
    "retain": {
      "type": "string",
      "enum": [
        "none",
        "session"
      ],
      "default": "none"
    }
  },
  "required": [
    "agentId",
    "customer"
  ],
  "additionalProperties": false
}
```

## Responses

- `201`: Success
- `400`: The request was malformed
- `401`: No valid credential
- `403`: The credential lacks the scope, origin or address
- `429`: Over the key's rate limit; see Retry-After

## Example

```sh
curl -X POST 'https://api.rivier.ai/platform-agents/sessions' \
  -H 'Authorization: Bearer $KEY' \
  -H 'Content-Type: application/json' \
  -d '{
  "agentId": "string",
  "customer": "string"
}'
```
