# Register an app

`POST /oauth/apps` · Rivier · keys

Register an app: its redirect addresses and the most it may ask for. A confidential client's secret is returned once.

- Scope: keys:admin
- Sdk: keys.app.create
- Cli: keys app create

## Request body

`application/json`

```json
{
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 120
    },
    "redirectUris": {
      "type": "array",
      "items": {
        "type": "string",
        "maxLength": 500
      },
      "minItems": 1,
      "maxItems": 10
    },
    "scopes": {
      "type": "array",
      "items": {
        "type": "string",
        "maxLength": 40
      },
      "minItems": 1,
      "maxItems": 60
    },
    "confidential": {
      "type": "boolean"
    }
  },
  "required": [
    "name",
    "redirectUris",
    "scopes"
  ],
  "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/oauth/apps' \
  -H 'Authorization: Bearer $KEY' \
  -H 'Content-Type: application/json' \
  -d '{
  "name": "string",
  "redirectUris": [
    "string"
  ],
  "scopes": [
    "string"
  ]
}'
```
