# 2. Create Profile

### <mark style="background-color:yellow;">Create Profile</mark>

```
POST http://127.0.0.1:12368/profiles
```

###

### <mark style="background-color:yellow;">Parameters -</mark> `Parameter`

<table><thead><tr><th width="150">Name</th><th width="150">Type</th><th width="445.2">Description</th></tr></thead><tbody><tr><td>os</td><td><code>String</code></td><td>Operating system. List of supported operating systems: (win, mac, linux, android, ios)</td></tr><tr><td>name</td><td><code>String</code></td><td>Optional profile's name</td></tr><tr><td>notes</td><td><code>String</code></td><td>Optional Note</td></tr><tr><td>browser</td><td><code>String</code></td><td>Optional Browser. List of supported browsers: (chrome, opera, edge, firefox)</td></tr><tr><td>proxy</td><td><code>String</code></td><td>Optional Proxy. Use in the following format: "{"host":"103.171.112.245","mode":"http","password":"1ee93edba5c911c33","port":19099,"username":"nguyenmanhtien.bh"}"</td></tr></tbody></table>

###

### <mark style="background-color:yellow;">Examples</mark>

* Curl example

```
curl -X POST http://127.0.0.1:12368/profiles -i -d "os=mac&name=test&notes=example&browser=chrome"
```

* Javascript example

```
const hidemyacc = new Hidemyacc();
const proxy = {
  host: "103.171.112.245",
  mode: "http",
  password: "1ee93edba5c911c33",
  port: 19099,
  username: "nguyenmanhtien.bh",
};
const user = await hidemyacc.create(os, name, notes, browser, proxy);
```

###

### <mark style="background-color:yellow;">Success response</mark>

**Success response - `Success 200`**

| Name | Type     | Description          |
| ---- | -------- | -------------------- |
| data | `Object` | Profile information. |

###

### <mark style="background-color:yellow;">Success response example</mark>

**Success response example - `Success-Example`**

```
HTTP/1.1 200 OK
    {
        "code": 1,
        "data":
        {
            "browserType": "chrome",
            "createdAt": "2021-10-06T09:28:43.178Z",
            "id": "615d6c4b2a151505fe6ba060",
            "name": "test",
            "notes": "example",
            "os": "mac",
            "platform": "MacIntel",
            "proxy":
            {
                "autoProxyPassword": "",
                "autoProxyRegion": "us",
                "autoProxyServer": "",
                "autoProxyUsername": "",
                "host": "",
                "mode": "none",
                "password": "",
                "port": 80,
                "proxyEnabled": false,
                "torProxyRegion": "us",
                "username": ""
            },
            "role": "owner",
            "updatedAt": "2021-10-06T09:28:43.178Z"
        }
    }
```

###

### <mark style="background-color:yellow;">Error response</mark>

**Error response - `Error 4xx`**

<table><thead><tr><th width="150">Name</th><th width="184.4">Type</th><th>Description</th></tr></thead><tbody><tr><td>401</td><td></td><td>Not logged into account</td></tr></tbody></table>

### <mark style="background-color:yellow;">Error response example</mark>

**Error response example - `Response (example):`**

```
HTTP/1.1 401 Not Authenticated
{
  "code": 0,
  "message": "Unauthorized",
  "data": {}
}
```
