---
search:
  tags:
    - Shops
    - POST
seo:
  description: >-
    Adds a user with the vendedor role (own-orders access, see Authentication)
    to… Reference for the POST /shops/{shop_id}/admins endpoint in the Bolder
    API v2.
sidebar:
  label: Create a dealer user
  badge: POST
title: Create a dealer user
type: openapi-operation
---
Adds a user with the `vendedor` role (own-orders access, see Authentication) to the shop's seller and emails
them an invitation. Needs `shops.write`. A new user is created in the seller's account with a random password
the dealer replaces through the login page's password reset; an existing user of the same account just
gets the role. Other roles cannot be assigned here.

`POST /shops/{shop_id}/admins`

**Request body** (`application/json`, required)

- `email` (string, required) — Lowercased on save. \`422\` if the user already has a role in the seller or belongs to another account.
- `name` (string) — Defaults to the part of the email before the \`@\`.
- `branch_id` (integer) — The sucursal (a branch of the seller) the dealer works at. \`422\` on \`$.branch\_id\` if it is not one.

Request body example:

```json
{
  "email": "string",
  "name": "string",
  "branch_id": 0
}
```

**Responses**

- `201` — The created dealer user
- `403` — Access denied
- `422` — Invalid or unknown fields, or the user cannot be added

Response example, 201:

```json
{
  "id": 11,
  "email": "ana@dealer.cl",
  "name": "Ana Dealer",
  "role": "vendedor",
  "disabled": false,
  "last_logged_on": null
}
```
