Skip to main content
POST
/
tenants
/
create-tenant
Create Tenant
curl --request POST \
  --url https://api.skortorent.com/api/v1/tenants/create-tenant \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "email": "jsmith@example.com",
  "fname": "<string>",
  "lname": "<string>",
  "post_code": "<string>",
  "dob": "2023-12-25",
  "current_annual_income": 1,
  "currency": "<string>",
  "phone_number": "<string>",
  "dni_nie": "<string>",
  "passport_id": "<string>",
  "protected_housing_docs": [
    "<string>"
  ],
  "about_me": "<string>"
}
'
import requests

url = "https://api.skortorent.com/api/v1/tenants/create-tenant"

payload = {
    "email": "jsmith@example.com",
    "fname": "<string>",
    "lname": "<string>",
    "post_code": "<string>",
    "dob": "2023-12-25",
    "current_annual_income": 1,
    "currency": "<string>",
    "phone_number": "<string>",
    "dni_nie": "<string>",
    "passport_id": "<string>",
    "protected_housing_docs": ["<string>"],
    "about_me": "<string>"
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

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

print(response.text)
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: JSON.stringify({
    email: 'jsmith@example.com',
    fname: '<string>',
    lname: '<string>',
    post_code: '<string>',
    dob: '2023-12-25',
    current_annual_income: 1,
    currency: '<string>',
    phone_number: '<string>',
    dni_nie: '<string>',
    passport_id: '<string>',
    protected_housing_docs: ['<string>'],
    about_me: '<string>'
  })
};

fetch('https://api.skortorent.com/api/v1/tenants/create-tenant', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => "https://api.skortorent.com/api/v1/tenants/create-tenant",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => json_encode([
    'email' => 'jsmith@example.com',
    'fname' => '<string>',
    'lname' => '<string>',
    'post_code' => '<string>',
    'dob' => '2023-12-25',
    'current_annual_income' => 1,
    'currency' => '<string>',
    'phone_number' => '<string>',
    'dni_nie' => '<string>',
    'passport_id' => '<string>',
    'protected_housing_docs' => [
        '<string>'
    ],
    'about_me' => '<string>'
  ]),
  CURLOPT_HTTPHEADER => [
    "Authorization: Bearer <token>",
    "Content-Type: application/json"
  ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
package main

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

func main() {

	url := "https://api.skortorent.com/api/v1/tenants/create-tenant"

	payload := strings.NewReader("{\n  \"email\": \"jsmith@example.com\",\n  \"fname\": \"<string>\",\n  \"lname\": \"<string>\",\n  \"post_code\": \"<string>\",\n  \"dob\": \"2023-12-25\",\n  \"current_annual_income\": 1,\n  \"currency\": \"<string>\",\n  \"phone_number\": \"<string>\",\n  \"dni_nie\": \"<string>\",\n  \"passport_id\": \"<string>\",\n  \"protected_housing_docs\": [\n    \"<string>\"\n  ],\n  \"about_me\": \"<string>\"\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(string(body))

}
HttpResponse<String> response = Unirest.post("https://api.skortorent.com/api/v1/tenants/create-tenant")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"email\": \"jsmith@example.com\",\n  \"fname\": \"<string>\",\n  \"lname\": \"<string>\",\n  \"post_code\": \"<string>\",\n  \"dob\": \"2023-12-25\",\n  \"current_annual_income\": 1,\n  \"currency\": \"<string>\",\n  \"phone_number\": \"<string>\",\n  \"dni_nie\": \"<string>\",\n  \"passport_id\": \"<string>\",\n  \"protected_housing_docs\": [\n    \"<string>\"\n  ],\n  \"about_me\": \"<string>\"\n}")
  .asString();
require 'uri'
require 'net/http'

url = URI("https://api.skortorent.com/api/v1/tenants/create-tenant")

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  \"email\": \"jsmith@example.com\",\n  \"fname\": \"<string>\",\n  \"lname\": \"<string>\",\n  \"post_code\": \"<string>\",\n  \"dob\": \"2023-12-25\",\n  \"current_annual_income\": 1,\n  \"currency\": \"<string>\",\n  \"phone_number\": \"<string>\",\n  \"dni_nie\": \"<string>\",\n  \"passport_id\": \"<string>\",\n  \"protected_housing_docs\": [\n    \"<string>\"\n  ],\n  \"about_me\": \"<string>\"\n}"

response = http.request(request)
puts response.read_body
{
  "status": "success",
  "message": "<string>",
  "data": {}
}
{
  "status": "error",
  "message": "<string>"
}
{
  "status": "error",
  "message": "<string>"
}
{
  "status": "error",
  "message": "<string>"
}

Authorizations

Authorization
string
header
required

HTTP Bearer Authentication. Pass the token generated via /keys/generate-token as Authorization: Bearer <token>.

Body

application/json
email
string<email>
required
fname
string
required
lname
string
required
post_code
string
required

Postal code (numbers only)

Required string length: 5
dob
string<date>
required

Date of birth format (YYYY-MM-DD)

employment_status
enum<string>
required
Available options:
employed,
self_employed,
student,
unemployed,
retired,
public_servant
current_annual_income
number
required
Required range: x >= 0
currency
string
required
Required string length: 3
phone_number
string
required

Phone number (numbers only)

Required string length: 6 - 15
dni_nie
string

Either dni_nie or passport_id is required. At least one of these identification fields must be provided.

passport_id
string

Either dni_nie or passport_id is required. At least one of these identification fields must be provided.

employment_category
enum<string>
Available options:
public_servant,
military,
permanent,
temporary,
permanent_seasonal_worker,
paternity_or_maternity_leave,
medical_leave,
ownACompany,
freelancer
protected_housing_docs
string[]
about_me
string

Response

Successful response

status
enum<string>
Available options:
success
message
string
data
object