# An agent of the platform

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

An agent of the platform: instructions, the typed parts its answers may carry (a schema each), whether it may ask a model, a first step (a tool asked first each turn, which may answer on its own, so an agent may have no model at all), and the most a session may keep. With answersPlatforms, it is the one agent of this project that answers the agents of platforms connected to its business (A6).

- Scope: agents:admin
- Graphql: Mutation.agentsPlatformAgentCreate
- Sdk: agents.platformAgent.create
- Cli: agents platform agent create

## Request body

`application/json`

```json
{
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 120
    },
    "instructions": {
      "type": "string",
      "maxLength": 8000,
      "default": ""
    },
    "model": {
      "type": "boolean",
      "default": true
    },
    "firstStep": {
      "anyOf": [
        {
          "type": "string",
          "pattern": "^[a-z][a-z0-9_]{0,47}$"
        },
        {
          "type": "null"
        }
      ],
      "default": null
    },
    "retain": {
      "type": "string",
      "enum": [
        "none",
        "session"
      ],
      "default": "session"
    },
    "parts": {
      "type": "object",
      "additionalProperties": {
        "type": "object",
        "additionalProperties": {}
      },
      "propertyNames": {
        "pattern": "^[a-z][a-z0-9_]{0,47}$"
      },
      "default": {}
    },
    "answersPlatforms": {
      "type": "boolean",
      "default": false
    }
  },
  "required": [
    "name"
  ],
  "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/agents' \
  -H 'Authorization: Bearer $KEY' \
  -H 'Content-Type: application/json' \
  -d '{
  "name": "string"
}'
```
