# Ask the owner of a business to connect it to this platform

`POST /connected-businesses` · Rivier · workspace

Ask the owner of a business to connect it to this platform: name it, give their address and the scopes the platform asks for. They are mailed an invitation, accept it in their own organisation and choose what the platform may do. With a test key it is a test business at once: connected with every scope asked, no mail and no owner, reached only by the test key. the platform hears platform.business.connected, .declined, .expired, .granted, .paused, .resumed and .ended.

- Scope: workspace:admin
- Graphql: Mutation.workspaceConnectedBusinessCreate
- Sdk: workspace.connectedBusiness.create
- Cli: workspace connected business create

## Request body

`application/json`

```json
{
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 120
    },
    "email": {
      "type": "string",
      "format": "email",
      "maxLength": 254
    },
    "scopes": {
      "type": "array",
      "items": {
        "type": "string",
        "pattern": "^[a-z]+:(read|write|admin|decide|run|message)$"
      },
      "minItems": 1,
      "maxItems": 30
    },
    "ref": {
      "type": "string",
      "maxLength": 120
    },
    "language": {
      "type": "string",
      "maxLength": 12
    },
    "notices": {
      "type": "string",
      "enum": [
        "platform",
        "business"
      ],
      "default": "platform"
    },
    "feeCeiling": {
      "type": "object",
      "properties": {
        "bps": {
          "type": "integer",
          "minimum": 1,
          "maximum": 5000
        }
      },
      "required": [
        "bps"
      ],
      "additionalProperties": false
    },
    "returnUrl": {
      "type": "string",
      "format": "uri",
      "maxLength": 500
    },
    "mail": {
      "type": "boolean",
      "default": true
    },
    "metadata": {
      "type": "object",
      "additionalProperties": {
        "type": "string",
        "maxLength": 500
      },
      "propertyNames": {
        "minLength": 1,
        "maxLength": 40,
        "pattern": "^[A-Za-z0-9_.:-]+$"
      }
    }
  },
  "required": [
    "name",
    "email",
    "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/connected-businesses' \
  -H 'Authorization: Bearer $KEY' \
  -H 'Content-Type: application/json' \
  -d '{
  "name": "string",
  "email": "name@example.com",
  "scopes": [
    "string"
  ]
}'
```
