> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.staple.ai/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.staple.ai/_mcp/server.

# Registration

POST https://api.staple.io/v1/users/register
Content-Type: application/json

Register a new user by providing the relevant information related to the user profile, billing, organisation details and subscription plan

Reference: https://docs.staple.ai/api-reference/v1/users/registration

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: v1
  version: 1.0.0
paths:
  /v1/users/register:
    post:
      operationId: registration
      summary: Registration
      description: >-
        Register a new user by providing the relevant information related to the
        user profile, billing, organisation details and subscription plan
      tags:
        - users
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Users_registration_Response_200'
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                user:
                  $ref: >-
                    #/components/schemas/V1UsersRegisterPostRequestBodyContentApplicationJsonSchemaUser
                billing:
                  $ref: >-
                    #/components/schemas/V1UsersRegisterPostRequestBodyContentApplicationJsonSchemaBilling
                organisation:
                  $ref: >-
                    #/components/schemas/V1UsersRegisterPostRequestBodyContentApplicationJsonSchemaOrganisation
                stripeSubs:
                  $ref: >-
                    #/components/schemas/V1UsersRegisterPostRequestBodyContentApplicationJsonSchemaStripeSubs
servers:
  - url: https://api.staple.io
    description: https://api.staple.io
components:
  schemas:
    V1UsersRegisterPostRequestBodyContentApplicationJsonSchemaUser:
      type: object
      properties:
        email:
          type: string
        password:
          type: string
        firstName:
          type: string
        lastName:
          type: string
        position:
          type: string
        phoneNumber:
          type: string
      title: V1UsersRegisterPostRequestBodyContentApplicationJsonSchemaUser
    V1UsersRegisterPostRequestBodyContentApplicationJsonSchemaBilling:
      type: object
      properties:
        address:
          type: string
        city:
          type: string
        country:
          type: string
        postCode:
          type: string
        phoneNumber:
          type: string
      title: V1UsersRegisterPostRequestBodyContentApplicationJsonSchemaBilling
    V1UsersRegisterPostRequestBodyContentApplicationJsonSchemaOrganisation:
      type: object
      properties:
        name:
          type: string
        country:
          type: string
        postCode:
          type: string
        phoneNumber:
          type: string
        businessCode:
          type: string
        email:
          type: string
      title: V1UsersRegisterPostRequestBodyContentApplicationJsonSchemaOrganisation
    V1UsersRegisterPostRequestBodyContentApplicationJsonSchemaStripeSubs:
      type: object
      properties:
        plans:
          type: array
          items:
            type: string
      title: V1UsersRegisterPostRequestBodyContentApplicationJsonSchemaStripeSubs
    Users_registration_Response_200:
      type: object
      properties: {}
      description: Empty response body
      title: Users_registration_Response_200

```

## Examples

### Registration



**Request**

```json
undefined
```

**Response**

```json
{
  "signupWithNewCompany": {
    "accessToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1aWQiOjQwLCJpYXQiOjE1OTM3NTc3OTYsImV4cCI6MTU5Mzc5Mzc5Nn0.4ZrEDB-6wBSG5uStLMJUh297GYFBQgDm4SqgCEIgDZg",
    "refreshToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1aWQiOjQwLCJpYXQiOjE1OTM3NTc3OTYsImV4cCI6MTU5NDM2MjU5Nn0.OaybEj50V1hR3v5vAkoNnZ1LOyEvO2_5khLiLI75WSg"
  }
}
```

**SDK Code**

```python Registration
import requests

url = "https://api.staple.io/v1/users/register"

headers = {"Content-Type": "application/json"}

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

print(response.json())
```

```javascript Registration
const url = 'https://api.staple.io/v1/users/register';
const options = {method: 'POST', headers: {'Content-Type': 'application/json'}, body: undefined};

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

```go Registration
package main

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

func main() {

	url := "https://api.staple.io/v1/users/register"

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

	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 Registration
require 'uri'
require 'net/http'

url = URI("https://api.staple.io/v1/users/register")

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

request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'

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

```java Registration
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.staple.io/v1/users/register")
  .header("Content-Type", "application/json")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.staple.io/v1/users/register', [
  'headers' => [
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp Registration
using RestSharp;

var client = new RestClient("https://api.staple.io/v1/users/register");
var request = new RestRequest(Method.POST);
request.AddHeader("Content-Type", "application/json");
IRestResponse response = client.Execute(request);
```

```swift Registration
import Foundation

let headers = ["Content-Type": "application/json"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.staple.io/v1/users/register")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers

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()
```

### Users_registration_example



**Request**

```json
{
  "user": {
    "email": "staple@staple.io",
    "password": "123456789",
    "firstName": "Staple",
    "lastName": "Staple",
    "position": "TESTER",
    "phoneNumber": "099999999"
  },
  "billing": {
    "address": "Duong Quang Ham, Go Vap",
    "city": "HCM",
    "country": "vn",
    "postCode": "70000",
    "phoneNumber": "0992929292"
  },
  "organisation": {
    "name": "Organisation",
    "country": "VN",
    "postCode": "70000",
    "phoneNumber": "099999999",
    "businessCode": "ORGCODE",
    "email": "Organisation@staple.io"
  },
  "stripeSubs": {
    "plans": [
      "STAPLE_DEVELOPER_FREE"
    ]
  }
}
```

**Response**

```json
{
  "signupWithNewCompany": {
    "accessToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1aWQiOjQwLCJpYXQiOjE1OTM3NTc3OTYsImV4cCI6MTU5Mzc5Mzc5Nn0.4ZrEDB-6wBSG5uStLMJUh297GYFBQgDm4SqgCEIgDZg",
    "refreshToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1aWQiOjQwLCJpYXQiOjE1OTM3NTc3OTYsImV4cCI6MTU5NDM2MjU5Nn0.OaybEj50V1hR3v5vAkoNnZ1LOyEvO2_5khLiLI75WSg"
  }
}
```

**SDK Code**

```python Users_registration_example
import requests

url = "https://api.staple.io/v1/users/register"

payload = {
    "user": {
        "email": "staple@staple.io",
        "password": "123456789",
        "firstName": "Staple",
        "lastName": "Staple",
        "position": "TESTER",
        "phoneNumber": "099999999"
    },
    "billing": {
        "address": "Duong Quang Ham, Go Vap",
        "city": "HCM",
        "country": "vn",
        "postCode": "70000",
        "phoneNumber": "0992929292"
    },
    "organisation": {
        "name": "Organisation",
        "country": "VN",
        "postCode": "70000",
        "phoneNumber": "099999999",
        "businessCode": "ORGCODE",
        "email": "Organisation@staple.io"
    },
    "stripeSubs": { "plans": ["STAPLE_DEVELOPER_FREE"] }
}
headers = {"Content-Type": "application/json"}

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

print(response.json())
```

```javascript Users_registration_example
const url = 'https://api.staple.io/v1/users/register';
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json'},
  body: '{"user":{"email":"staple@staple.io","password":"123456789","firstName":"Staple","lastName":"Staple","position":"TESTER","phoneNumber":"099999999"},"billing":{"address":"Duong Quang Ham, Go Vap","city":"HCM","country":"vn","postCode":"70000","phoneNumber":"0992929292"},"organisation":{"name":"Organisation","country":"VN","postCode":"70000","phoneNumber":"099999999","businessCode":"ORGCODE","email":"Organisation@staple.io"},"stripeSubs":{"plans":["STAPLE_DEVELOPER_FREE"]}}'
};

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

```go Users_registration_example
package main

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

func main() {

	url := "https://api.staple.io/v1/users/register"

	payload := strings.NewReader("{\n  \"user\": {\n    \"email\": \"staple@staple.io\",\n    \"password\": \"123456789\",\n    \"firstName\": \"Staple\",\n    \"lastName\": \"Staple\",\n    \"position\": \"TESTER\",\n    \"phoneNumber\": \"099999999\"\n  },\n  \"billing\": {\n    \"address\": \"Duong Quang Ham, Go Vap\",\n    \"city\": \"HCM\",\n    \"country\": \"vn\",\n    \"postCode\": \"70000\",\n    \"phoneNumber\": \"0992929292\"\n  },\n  \"organisation\": {\n    \"name\": \"Organisation\",\n    \"country\": \"VN\",\n    \"postCode\": \"70000\",\n    \"phoneNumber\": \"099999999\",\n    \"businessCode\": \"ORGCODE\",\n    \"email\": \"Organisation@staple.io\"\n  },\n  \"stripeSubs\": {\n    \"plans\": [\n      \"STAPLE_DEVELOPER_FREE\"\n    ]\n  }\n}")

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

	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 Users_registration_example
require 'uri'
require 'net/http'

url = URI("https://api.staple.io/v1/users/register")

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

request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n  \"user\": {\n    \"email\": \"staple@staple.io\",\n    \"password\": \"123456789\",\n    \"firstName\": \"Staple\",\n    \"lastName\": \"Staple\",\n    \"position\": \"TESTER\",\n    \"phoneNumber\": \"099999999\"\n  },\n  \"billing\": {\n    \"address\": \"Duong Quang Ham, Go Vap\",\n    \"city\": \"HCM\",\n    \"country\": \"vn\",\n    \"postCode\": \"70000\",\n    \"phoneNumber\": \"0992929292\"\n  },\n  \"organisation\": {\n    \"name\": \"Organisation\",\n    \"country\": \"VN\",\n    \"postCode\": \"70000\",\n    \"phoneNumber\": \"099999999\",\n    \"businessCode\": \"ORGCODE\",\n    \"email\": \"Organisation@staple.io\"\n  },\n  \"stripeSubs\": {\n    \"plans\": [\n      \"STAPLE_DEVELOPER_FREE\"\n    ]\n  }\n}"

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

```java Users_registration_example
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.staple.io/v1/users/register")
  .header("Content-Type", "application/json")
  .body("{\n  \"user\": {\n    \"email\": \"staple@staple.io\",\n    \"password\": \"123456789\",\n    \"firstName\": \"Staple\",\n    \"lastName\": \"Staple\",\n    \"position\": \"TESTER\",\n    \"phoneNumber\": \"099999999\"\n  },\n  \"billing\": {\n    \"address\": \"Duong Quang Ham, Go Vap\",\n    \"city\": \"HCM\",\n    \"country\": \"vn\",\n    \"postCode\": \"70000\",\n    \"phoneNumber\": \"0992929292\"\n  },\n  \"organisation\": {\n    \"name\": \"Organisation\",\n    \"country\": \"VN\",\n    \"postCode\": \"70000\",\n    \"phoneNumber\": \"099999999\",\n    \"businessCode\": \"ORGCODE\",\n    \"email\": \"Organisation@staple.io\"\n  },\n  \"stripeSubs\": {\n    \"plans\": [\n      \"STAPLE_DEVELOPER_FREE\"\n    ]\n  }\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.staple.io/v1/users/register', [
  'body' => '{
  "user": {
    "email": "staple@staple.io",
    "password": "123456789",
    "firstName": "Staple",
    "lastName": "Staple",
    "position": "TESTER",
    "phoneNumber": "099999999"
  },
  "billing": {
    "address": "Duong Quang Ham, Go Vap",
    "city": "HCM",
    "country": "vn",
    "postCode": "70000",
    "phoneNumber": "0992929292"
  },
  "organisation": {
    "name": "Organisation",
    "country": "VN",
    "postCode": "70000",
    "phoneNumber": "099999999",
    "businessCode": "ORGCODE",
    "email": "Organisation@staple.io"
  },
  "stripeSubs": {
    "plans": [
      "STAPLE_DEVELOPER_FREE"
    ]
  }
}',
  'headers' => [
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp Users_registration_example
using RestSharp;

var client = new RestClient("https://api.staple.io/v1/users/register");
var request = new RestRequest(Method.POST);
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"user\": {\n    \"email\": \"staple@staple.io\",\n    \"password\": \"123456789\",\n    \"firstName\": \"Staple\",\n    \"lastName\": \"Staple\",\n    \"position\": \"TESTER\",\n    \"phoneNumber\": \"099999999\"\n  },\n  \"billing\": {\n    \"address\": \"Duong Quang Ham, Go Vap\",\n    \"city\": \"HCM\",\n    \"country\": \"vn\",\n    \"postCode\": \"70000\",\n    \"phoneNumber\": \"0992929292\"\n  },\n  \"organisation\": {\n    \"name\": \"Organisation\",\n    \"country\": \"VN\",\n    \"postCode\": \"70000\",\n    \"phoneNumber\": \"099999999\",\n    \"businessCode\": \"ORGCODE\",\n    \"email\": \"Organisation@staple.io\"\n  },\n  \"stripeSubs\": {\n    \"plans\": [\n      \"STAPLE_DEVELOPER_FREE\"\n    ]\n  }\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Users_registration_example
import Foundation

let headers = ["Content-Type": "application/json"]
let parameters = [
  "user": [
    "email": "staple@staple.io",
    "password": "123456789",
    "firstName": "Staple",
    "lastName": "Staple",
    "position": "TESTER",
    "phoneNumber": "099999999"
  ],
  "billing": [
    "address": "Duong Quang Ham, Go Vap",
    "city": "HCM",
    "country": "vn",
    "postCode": "70000",
    "phoneNumber": "0992929292"
  ],
  "organisation": [
    "name": "Organisation",
    "country": "VN",
    "postCode": "70000",
    "phoneNumber": "099999999",
    "businessCode": "ORGCODE",
    "email": "Organisation@staple.io"
  ],
  "stripeSubs": ["plans": ["STAPLE_DEVELOPER_FREE"]]
] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.staple.io/v1/users/register")! 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()
```