For clean Markdown of any page, append .md to the page URL. For a complete documentation index, see https://docs.wisboo.com/wisboo-api/llms.txt. For full documentation content, see https://docs.wisboo.com/wisboo-api/llms-full.txt.

# Create user

POST https://api.wisboo.com/v3/public/users
Content-Type: application/json

Permite crear un usuario

Reference: https://docs.wisboo.com/wisboo-api/create-user

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: collection
  version: 1.0.0
paths:
  /v3/public/users:
    post:
      operationId: create-user
      summary: Create user
      description: Permite crear un usuario
      tags:
        - ''
      parameters:
        - name: Authorization
          in: header
          description: Bearer authentication
          required: true
          schema:
            type: string
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Create user_Response_201'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PostV3PublicUsersRequestBadRequestError'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PostV3PublicUsersRequestUnauthorizedError'
        '422':
          description: Unprocessable Content
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/PostV3PublicUsersRequestUnprocessableEntityError
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                email:
                  type: string
                  format: email
                phone:
                  type: string
                avatar:
                  type: string
                country:
                  type: string
                language:
                  type: string
                password:
                  type: string
                last_name:
                  type: string
                external_id:
                  type: string
                custom_fields:
                  $ref: >-
                    #/components/schemas/V3PublicUsersPostRequestBodyContentApplicationJsonSchemaCustomFields
              required:
                - name
                - email
                - phone
                - avatar
                - country
                - language
                - password
                - last_name
                - external_id
                - custom_fields
servers:
  - url: https://api.wisboo.com
components:
  schemas:
    V3PublicUsersPostRequestBodyContentApplicationJsonSchemaCustomFields:
      type: object
      properties:
        field1:
          type: string
      required:
        - field1
      title: V3PublicUsersPostRequestBodyContentApplicationJsonSchemaCustomFields
    V3PublicUsersPostResponsesContentApplicationJsonSchemaCustomFields:
      type: object
      properties:
        field1:
          type: string
      required:
        - field1
      title: V3PublicUsersPostResponsesContentApplicationJsonSchemaCustomFields
    Create user_Response_201:
      type: object
      properties:
        id:
          type: integer
        name:
          type: string
        role:
          type: string
        email:
          type: string
          format: email
        phone:
          type: string
        avatar:
          type: string
        country:
          type: string
        language:
          type: string
        last_name:
          type: string
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
        external_id:
          type: string
        custom_fields:
          $ref: >-
            #/components/schemas/V3PublicUsersPostResponsesContentApplicationJsonSchemaCustomFields
      required:
        - id
        - name
        - role
        - email
        - phone
        - avatar
        - country
        - language
        - last_name
        - created_at
        - updated_at
        - external_id
        - custom_fields
      title: Create user_Response_201
    V3PublicUsersPostResponsesContentApplicationJsonSchemaDetails:
      type: object
      properties:
        field:
          type: string
        explanation:
          type: string
      required:
        - field
        - explanation
      title: V3PublicUsersPostResponsesContentApplicationJsonSchemaDetails
    PostV3PublicUsersRequestBadRequestError:
      type: object
      properties:
        code:
          type: string
        type:
          type: string
        details:
          $ref: >-
            #/components/schemas/V3PublicUsersPostResponsesContentApplicationJsonSchemaDetails
        message:
          type: string
        timestamp:
          type: string
          format: date-time
        request_id:
          type: string
          format: uuid
      required:
        - code
        - type
        - details
        - message
        - timestamp
        - request_id
      title: PostV3PublicUsersRequestBadRequestError
    PostV3PublicUsersRequestUnauthorizedError:
      type: object
      properties:
        code:
          type: string
        type:
          type: string
        message:
          type: string
        timestamp:
          type: string
          format: date-time
        request_id:
          type: string
          format: uuid
      required:
        - code
        - type
        - message
        - timestamp
        - request_id
      title: PostV3PublicUsersRequestUnauthorizedError
    V3PublicUsersPostResponsesContentApplicationJsonSchemaDetailsItems:
      type: object
      properties:
        field:
          type: string
        value:
          type: string
        explanation:
          type: string
      required:
        - field
        - value
        - explanation
      title: V3PublicUsersPostResponsesContentApplicationJsonSchemaDetailsItems
    PostV3PublicUsersRequestUnprocessableEntityError:
      type: object
      properties:
        code:
          type: string
        type:
          type: string
        details:
          type: array
          items:
            $ref: >-
              #/components/schemas/V3PublicUsersPostResponsesContentApplicationJsonSchemaDetailsItems
        message:
          type: string
        timestamp:
          type: string
          format: date-time
        request_id:
          type: string
          format: uuid
      required:
        - code
        - type
        - details
        - message
        - timestamp
        - request_id
      title: PostV3PublicUsersRequestUnprocessableEntityError
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

```

## SDK Code Examples

```python Create user_example
import requests

url = "https://api.wisboo.com/v3/public/users"

payload = {
    "name": "John",
    "email": "john_doe@email.com",
    "phone": "+5491134578457",
    "avatar": "",
    "country": "AR",
    "language": "ES",
    "password": "password",
    "last_name": "Doe",
    "external_id": "1e3aafh",
    "custom_fields": { "field1": "value" }
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript Create user_example
const url = 'https://api.wisboo.com/v3/public/users';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"name":"John","email":"john_doe@email.com","phone":"+5491134578457","avatar":"","country":"AR","language":"ES","password":"password","last_name":"Doe","external_id":"1e3aafh","custom_fields":{"field1":"value"}}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Create user_example
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.wisboo.com/v3/public/users"

	payload := strings.NewReader("{\n  \"name\": \"John\",\n  \"email\": \"john_doe@email.com\",\n  \"phone\": \"+5491134578457\",\n  \"avatar\": \"\",\n  \"country\": \"AR\",\n  \"language\": \"ES\",\n  \"password\": \"password\",\n  \"last_name\": \"Doe\",\n  \"external_id\": \"1e3aafh\",\n  \"custom_fields\": {\n    \"field1\": \"value\"\n  }\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Create user_example
require 'uri'
require 'net/http'

url = URI("https://api.wisboo.com/v3/public/users")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"name\": \"John\",\n  \"email\": \"john_doe@email.com\",\n  \"phone\": \"+5491134578457\",\n  \"avatar\": \"\",\n  \"country\": \"AR\",\n  \"language\": \"ES\",\n  \"password\": \"password\",\n  \"last_name\": \"Doe\",\n  \"external_id\": \"1e3aafh\",\n  \"custom_fields\": {\n    \"field1\": \"value\"\n  }\n}"

response = http.request(request)
puts response.read_body
```

```java Create user_example
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.wisboo.com/v3/public/users")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"name\": \"John\",\n  \"email\": \"john_doe@email.com\",\n  \"phone\": \"+5491134578457\",\n  \"avatar\": \"\",\n  \"country\": \"AR\",\n  \"language\": \"ES\",\n  \"password\": \"password\",\n  \"last_name\": \"Doe\",\n  \"external_id\": \"1e3aafh\",\n  \"custom_fields\": {\n    \"field1\": \"value\"\n  }\n}")
  .asString();
```

```php Create user_example
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.wisboo.com/v3/public/users', [
  'body' => '{
  "name": "John",
  "email": "john_doe@email.com",
  "phone": "+5491134578457",
  "avatar": "",
  "country": "AR",
  "language": "ES",
  "password": "password",
  "last_name": "Doe",
  "external_id": "1e3aafh",
  "custom_fields": {
    "field1": "value"
  }
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp Create user_example
using RestSharp;

var client = new RestClient("https://api.wisboo.com/v3/public/users");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"name\": \"John\",\n  \"email\": \"john_doe@email.com\",\n  \"phone\": \"+5491134578457\",\n  \"avatar\": \"\",\n  \"country\": \"AR\",\n  \"language\": \"ES\",\n  \"password\": \"password\",\n  \"last_name\": \"Doe\",\n  \"external_id\": \"1e3aafh\",\n  \"custom_fields\": {\n    \"field1\": \"value\"\n  }\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Create user_example
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "name": "John",
  "email": "john_doe@email.com",
  "phone": "+5491134578457",
  "avatar": "",
  "country": "AR",
  "language": "ES",
  "password": "password",
  "last_name": "Doe",
  "external_id": "1e3aafh",
  "custom_fields": ["field1": "value"]
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.wisboo.com/v3/public/users")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```