MENU navbar-image

Introduction

This documentation aims to provide all the information you need to work with our API.

<aside>As you scroll, you'll see code examples for working with the API in different programming languages in the dark area to the right (or as part of the content on mobile).
You can switch the language used with the tabs at the top right (or from the nav menu at the top left on mobile).</aside>

Authenticating requests

To authenticate requests, include an Authorization header with the value "Bearer {YOUR_BEARER_TOKEN}".

All authenticated endpoints are marked with a requires authentication badge in the documentation below.

Get a bearer token from the POST /v1/auth/login endpoint.

Authentication

Token Authentication

Register

Create a new account and issue a Sanctum bearer token.

Example request:
curl --request POST \
    "http://localhost/v1/auth/register" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"Jane Doe\",
    \"email\": \"jane@example.com\",
    \"password\": \"password123\",
    \"device_name\": \"ios-app\"
}"
const url = new URL(
    "http://localhost/v1/auth/register"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "name": "Jane Doe",
    "email": "jane@example.com",
    "password": "password123",
    "device_name": "ios-app"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (201, Registration succeeded.):


{
    "data": {
        "id": "",
        "type": "users",
        "attributes": {
            "name": "Alexandra Salvador",
            "email": "miguel.sevilla@example.com",
            "email_verified_at": "2026-03-19T08:50:09+00:00",
            "created_at": null,
            "updated_at": null
        }
    },
    "meta": {
        "token": "1|example-token",
        "token_type": "Bearer",
        "expires_at": null
    }
}
 

Example response (422, Validation failed.):


{
    "message": "The given data was invalid.",
    "errors": {
        "email": [
            "The email has already been taken."
        ]
    }
}
 

Request      

POST v1/auth/register

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

name   string     

Display name for the account. Example: Jane Doe

email   string     

Unique email address for login. Example: jane@example.com

password   string     

Account password. Example: password123

device_name   string  optional    

Client device label for token tracking. Example: ios-app

Login

Authenticate a user and issue a Sanctum bearer token.

Example request:
curl --request POST \
    "http://localhost/v1/auth/login" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"email\": \"jane@example.com\",
    \"password\": \"password123\",
    \"device_name\": \"ios-app\"
}"
const url = new URL(
    "http://localhost/v1/auth/login"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "email": "jane@example.com",
    "password": "password123",
    "device_name": "ios-app"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200, Login succeeded.):


{
    "data": {
        "id": "",
        "type": "users",
        "attributes": {
            "name": "Alexandra Salvador",
            "email": "gallego.adrian@example.com",
            "email_verified_at": "2026-03-19T08:50:09+00:00",
            "created_at": null,
            "updated_at": null
        }
    },
    "meta": {
        "token": "1|example-token",
        "token_type": "Bearer",
        "expires_at": null
    }
}
 

Example response (422, Credentials were invalid.):


{
    "message": "The given data was invalid.",
    "errors": {
        "email": [
            "The provided credentials are incorrect."
        ]
    }
}
 

Request      

POST v1/auth/login

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

email   string     

User email address. Example: jane@example.com

password   string     

User password. Example: password123

device_name   string  optional    

Client device label for token tracking. If empty, User Agent will be used. Example: ios-app

Get Current User

requires authentication

Return the authenticated user for the current bearer token.

Example request:
curl --request GET \
    --get "http://localhost/v1/auth/me" \
    --header "Authorization: Bearer {YOUR_BEARER_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/v1/auth/me"
);

const headers = {
    "Authorization": "Bearer {YOUR_BEARER_TOKEN}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200, Authenticated user profile.):


{
    "data": {
        "id": "",
        "type": "users",
        "attributes": {
            "name": "Omar Domínguez",
            "email": "arredondo.juana@example.com",
            "email_verified_at": "2026-03-19T08:50:09+00:00",
            "created_at": null,
            "updated_at": null
        }
    }
}
 

Example response (401, Authentication failed.):


{
    "message": "Unauthenticated."
}
 

Request      

GET v1/auth/me

Headers

Authorization        

Example: Bearer {YOUR_BEARER_TOKEN}

Content-Type        

Example: application/json

Accept        

Example: application/json

Logout

requires authentication

Revoke the current Sanctum token.

Example request:
curl --request POST \
    "http://localhost/v1/auth/logout" \
    --header "Authorization: Bearer {YOUR_BEARER_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/v1/auth/logout"
);

const headers = {
    "Authorization": "Bearer {YOUR_BEARER_TOKEN}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "POST",
    headers,
}).then(response => response.json());

Example response (204, Token revoked.):

Empty response
 

Example response (401, Authentication failed.):


{
    "message": "Unauthenticated."
}
 

Request      

POST v1/auth/logout

Headers

Authorization        

Example: Bearer {YOUR_BEARER_TOKEN}

Content-Type        

Example: application/json

Accept        

Example: application/json

List Tokens

requires authentication

List personal access tokens for the authenticated user.

Example request:
curl --request GET \
    --get "http://localhost/v1/auth/tokens" \
    --header "Authorization: Bearer {YOUR_BEARER_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/v1/auth/tokens"
);

const headers = {
    "Authorization": "Bearer {YOUR_BEARER_TOKEN}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200, Token list payload.):


{
    "data": [
        {
            "id": "1",
            "type": "personal-access-tokens",
            "attributes": {
                "name": "ios-app",
                "abilities": [
                    "auth:me",
                    "auth:logout"
                ],
                "last_used_at": null,
                "expires_at": "2026-02-24T12:00:00+00:00",
                "created_at": "2026-02-23T12:00:00+00:00",
                "updated_at": "2026-02-23T12:00:00+00:00",
                "is_current": true
            }
        }
    ]
}
 

Example response (401, Authentication failed.):


{
    "message": "Unauthenticated."
}
 

Example response (403, Token is missing required ability.):


{
    "message": "Forbidden."
}
 

Request      

GET v1/auth/tokens

Headers

Authorization        

Example: Bearer {YOUR_BEARER_TOKEN}

Content-Type        

Example: application/json

Accept        

Example: application/json

Revoke All Tokens

requires authentication

Revoke all personal access tokens for the authenticated user.

Example request:
curl --request DELETE \
    "http://localhost/v1/auth/tokens" \
    --header "Authorization: Bearer {YOUR_BEARER_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/v1/auth/tokens"
);

const headers = {
    "Authorization": "Bearer {YOUR_BEARER_TOKEN}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());

Example response (204, All tokens revoked.):

Empty response
 

Example response (401, Authentication failed.):


{
    "message": "Unauthenticated."
}
 

Example response (403, Token is missing required ability.):


{
    "message": "Forbidden."
}
 

Request      

DELETE v1/auth/tokens

Headers

Authorization        

Example: Bearer {YOUR_BEARER_TOKEN}

Content-Type        

Example: application/json

Accept        

Example: application/json

Revoke Token

requires authentication

Revoke one personal access token owned by the authenticated user.

Example request:
curl --request DELETE \
    "http://localhost/v1/auth/tokens/42" \
    --header "Authorization: Bearer {YOUR_BEARER_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"token_id\": 16
}"
const url = new URL(
    "http://localhost/v1/auth/tokens/42"
);

const headers = {
    "Authorization": "Bearer {YOUR_BEARER_TOKEN}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "token_id": 16
};

fetch(url, {
    method: "DELETE",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (204, Token revoked.):

Empty response
 

Example response (401, Authentication failed.):


{
    "message": "Unauthenticated."
}
 

Example response (403, Token is missing required ability.):


{
    "message": "Forbidden."
}
 

Example response (404, Token does not belong to current user or no longer exists.):


{
    "message": "Token not found."
}
 

Request      

DELETE v1/auth/tokens/{token_id}

Headers

Authorization        

Example: Bearer {YOUR_BEARER_TOKEN}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

token_id   integer     

Personal access token id. Example: 42

Body Parameters

token_id   integer     

Example: 16

Password Reset

Request Password Reset

Send a password reset link to the provided email if an account exists.

Example request:
curl --request POST \
    "http://localhost/v1/auth/password/forgot" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"email\": \"jane@example.com\"
}"
const url = new URL(
    "http://localhost/v1/auth/password/forgot"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "email": "jane@example.com"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200, Password reset request accepted.):


{
    "message": "If the account exists, a password reset link has been sent."
}
 

Request      

POST v1/auth/password/forgot

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

email   string     

Account email address. Example: jane@example.com

Reset Password

Reset the user password using a valid reset token.

Example request:
curl --request POST \
    "http://localhost/v1/auth/password/reset" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"token\": \"reset-token-value\",
    \"email\": \"jane@example.com\",
    \"password\": \"new-password123\",
    \"password_confirmation\": \"new-password123\"
}"
const url = new URL(
    "http://localhost/v1/auth/password/reset"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "token": "reset-token-value",
    "email": "jane@example.com",
    "password": "new-password123",
    "password_confirmation": "new-password123"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200, Password reset succeeded.):


{
    "message": "Your password has been reset."
}
 

Example response (422, Reset token or payload was invalid.):


{
    "message": "The given data was invalid.",
    "errors": {
        "email": [
            "This password reset token is invalid."
        ]
    }
}
 

Request      

POST v1/auth/password/reset

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

token   string     

Password reset token. Example: reset-token-value

email   string     

Account email associated with token. Example: jane@example.com

password   string     

New account password. Example: new-password123

password_confirmation   string     

Must match password. Example: new-password123

Read Reset Token Payload

Return reset token and email payload for API clients handling email reset links.

Example request:
curl --request GET \
    --get "http://localhost/v1/auth/password/reset/reset-token-value?email=jane%40example.com" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"token\": \"architecto\",
    \"email\": \"zbailey@example.net\"
}"
const url = new URL(
    "http://localhost/v1/auth/password/reset/reset-token-value"
);

const params = {
    "email": "jane@example.com",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "token": "architecto",
    "email": "zbailey@example.net"
};

fetch(url, {
    method: "GET",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200, Reset payload data.):


{
    "token": "reset-token-value",
    "email": "jane@example.com"
}
 

Request      

GET v1/auth/password/reset/{token}

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

token   string     

Password reset token from reset link. Example: reset-token-value

Query Parameters

email   string  optional    

Account email from the reset link. Example: jane@example.com

Body Parameters

token   string     

Example: architecto

email   string  optional    

El campo value debe ser una direccion de correo valida. El campo value no debe ser mayor que 255 caracteres. Example: zbailey@example.net

Email Verification

Verify Email

Verify a user email using the signed verification link parameters.

Example request:
curl --request GET \
    --get "http://localhost/v1/auth/email/verify/01HZX3W3T4J8Q57XNZD5BPHJ92/8c4f4370e5db9b5be6d0f4c95495f49f998fa32a" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"id\": \"architecto\",
    \"hash\": \"ngzmiyvdljnikhwaykcmyuwpwlvqwrsitcpscqld\"
}"
const url = new URL(
    "http://localhost/v1/auth/email/verify/01HZX3W3T4J8Q57XNZD5BPHJ92/8c4f4370e5db9b5be6d0f4c95495f49f998fa32a"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "id": "architecto",
    "hash": "ngzmiyvdljnikhwaykcmyuwpwlvqwrsitcpscqld"
};

fetch(url, {
    method: "GET",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200, Email was verified.):


{
    "message": "Email verified successfully."
}
 

Example response (403, Signed URL was invalid, expired, or mismatched.):


{
    "message": "Invalid verification link."
}
 

Request      

GET v1/auth/email/verify/{id}/{hash}

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   string     

User ULID from the signed verification link. Example: 01HZX3W3T4J8Q57XNZD5BPHJ92

hash   string     

SHA-1 hash of the email from the signed verification link. Example: 8c4f4370e5db9b5be6d0f4c95495f49f998fa32a

Body Parameters

id   string     

The id of an existing record in the users table. Example: architecto

hash   string     

El campo value debe tener 40 caracteres. Example: ngzmiyvdljnikhwaykcmyuwpwlvqwrsitcpscqld

Send Verification Email

requires authentication

Send (or resend) an email verification link to the authenticated user.

Example request:
curl --request POST \
    "http://localhost/v1/auth/email/verification-notification" \
    --header "Authorization: Bearer {YOUR_BEARER_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/v1/auth/email/verification-notification"
);

const headers = {
    "Authorization": "Bearer {YOUR_BEARER_TOKEN}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "POST",
    headers,
}).then(response => response.json());

Example response (200, Verification email queued/sent.):


{
    "message": "Verification link sent."
}
 

Example response (200, User already verified.):


{
    "message": "Email is already verified."
}
 

Example response (401, Authentication failed.):


{
    "message": "Unauthenticated."
}
 

Request      

POST v1/auth/email/verification-notification

Headers

Authorization        

Example: Bearer {YOUR_BEARER_TOKEN}

Content-Type        

Example: application/json

Accept        

Example: application/json

Endpoints

Handle the incoming request.

Example request:
curl --request GET \
    --get "http://localhost/v1/properties/architecto" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/v1/properties/architecto"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Request      

GET v1/properties/{id}

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   string     

The ID of the property. Example: architecto

Properties

Property Lookup

Get Property by Address

requires authentication

Retrieve property data by sending the address string.

Example request:
curl --request POST \
    "http://localhost/v1/properties/address" \
    --header "Authorization: Bearer {YOUR_BEARER_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"address\": \"Calle Mayor 123, Madrid\",
    \"page\": 1,
    \"per_page\": 20
}"
const url = new URL(
    "http://localhost/v1/properties/address"
);

const headers = {
    "Authorization": "Bearer {YOUR_BEARER_TOKEN}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "address": "Calle Mayor 123, Madrid",
    "page": 1,
    "per_page": 20
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200, Properties retrieved successfully.):


{
    "status": "success",
    "data": {
        "properties": [
            {
                "id": "01ABC...",
                "direccion": "Calle Mayor 123, Madrid"
            }
        ],
        "pagination": {
            "current_page": 1,
            "per_page": 20,
            "total": 100,
            "last_page": 5
        }
    }
}
 

Example response (404, Property with the given address was not found.):


{
    "status": "error",
    "error": {
        "code": "NOT_FOUND",
        "message": "Property not found"
    }
}
 

Request      

POST v1/properties/address

Headers

Authorization        

Example: Bearer {YOUR_BEARER_TOKEN}

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

address   string     

Full property address to search for. Example: Calle Mayor 123, Madrid

page   integer  optional    

Page number for pagination. Example: 1

per_page   integer  optional    

Number of items per page (default 20). Example: 20

Get Properties by Zip Code

requires authentication

Retrieve properties by sending a zip code. Returns multiple properties if available.

Example request:
curl --request POST \
    "http://localhost/v1/properties/zip" \
    --header "Authorization: Bearer {YOUR_BEARER_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"zip\": \"41001\",
    \"page\": 1,
    \"per_page\": 20
}"
const url = new URL(
    "http://localhost/v1/properties/zip"
);

const headers = {
    "Authorization": "Bearer {YOUR_BEARER_TOKEN}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "zip": "41001",
    "page": 1,
    "per_page": 20
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200, Properties retrieved successfully.):


{
    "status": "success",
    "data": {
        "properties": [
            {
                "id": "01ABC...",
                "direccion": "Calle Mayor",
                "codigo_postal": "41001"
            }
        ],
        "pagination": {
            "current_page": 1,
            "per_page": 20,
            "total": 100,
            "last_page": 5
        }
    }
}
 

Example response (404, No properties found with the given zip code.):


{
    "status": "error",
    "error": {
        "code": "NOT_FOUND",
        "message": "No properties found for this zip code"
    }
}
 

Request      

POST v1/properties/zip

Headers

Authorization        

Example: Bearer {YOUR_BEARER_TOKEN}

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

zip   string     

Postal code to search for properties. Example: 41001

page   integer  optional    

Page number for pagination. Example: 1

per_page   integer  optional    

Number of items per page (default 20). Example: 20

Get Properties by Cadastral Reference

requires authentication

Retrieve properties by sending a cadastral reference. Returns one or more properties if available.

Example request:
curl --request POST \
    "http://localhost/v1/properties/cadastral" \
    --header "Authorization: Bearer {YOUR_BEARER_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"cadastral_reference\": \"1234567VG1234A0001BG\",
    \"page\": 1,
    \"per_page\": 20
}"
const url = new URL(
    "http://localhost/v1/properties/cadastral"
);

const headers = {
    "Authorization": "Bearer {YOUR_BEARER_TOKEN}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "cadastral_reference": "1234567VG1234A0001BG",
    "page": 1,
    "per_page": 20
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200, Properties retrieved successfully.):


{
    "status": "success",
    "data": {
        "properties": [
            {
                "id": "01ABC...",
                "direccion": "Calle Mayor",
                "referencia_catastral": "1234567VG1234A0001BG"
            }
        ],
        "pagination": {
            "current_page": 1,
            "per_page": 20,
            "total": 100,
            "last_page": 5
        }
    }
}
 

Example response (404, No properties found with the given cadastral reference.):


{
    "status": "error",
    "error": {
        "code": "NOT_FOUND",
        "message": "No properties found for this cadastral reference"
    }
}
 

Request      

POST v1/properties/cadastral

Headers

Authorization        

Example: Bearer {YOUR_BEARER_TOKEN}

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

cadastral_reference   string     

Cadastral reference to search for properties. Example: 1234567VG1234A0001BG

page   integer  optional    

Page number for pagination. Example: 1

per_page   integer  optional    

Number of items per page (default 20). Example: 20

Get Properties by Province

requires authentication

Retrieve properties by sending a province name. Returns multiple properties if available.

Example request:
curl --request POST \
    "http://localhost/v1/properties/province" \
    --header "Authorization: Bearer {YOUR_BEARER_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"province\": \"Sevilla\",
    \"page\": 1,
    \"per_page\": 20
}"
const url = new URL(
    "http://localhost/v1/properties/province"
);

const headers = {
    "Authorization": "Bearer {YOUR_BEARER_TOKEN}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "province": "Sevilla",
    "page": 1,
    "per_page": 20
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200, Properties retrieved successfully.):


{
    "status": "success",
    "data": {
        "properties": [
            {
                "id": "01ABC...",
                "direccion": "Calle Mayor",
                "provincia": "Sevilla"
            }
        ],
        "pagination": {
            "current_page": 1,
            "per_page": 20,
            "total": 100,
            "last_page": 5
        }
    }
}
 

Example response (404, No properties found with the given province.):


{
    "status": "error",
    "error": {
        "code": "NOT_FOUND",
        "message": "No properties found for this province"
    }
}
 

Request      

POST v1/properties/province

Headers

Authorization        

Example: Bearer {YOUR_BEARER_TOKEN}

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

province   string     

Province name to search for properties. Example: Sevilla

page   integer  optional    

Page number for pagination. Example: 1

per_page   integer  optional    

Number of items per page (default 20). Example: 20

Get Properties by Municipality

requires authentication

Retrieve properties by sending a municipality name. Returns multiple properties if available.

Example request:
curl --request POST \
    "http://localhost/v1/properties/municipality" \
    --header "Authorization: Bearer {YOUR_BEARER_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"municipality\": \"Camas\",
    \"page\": 1,
    \"per_page\": 20
}"
const url = new URL(
    "http://localhost/v1/properties/municipality"
);

const headers = {
    "Authorization": "Bearer {YOUR_BEARER_TOKEN}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "municipality": "Camas",
    "page": 1,
    "per_page": 20
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200, Properties retrieved successfully.):


{
    "status": "success",
    "data": {
        "properties": [
            {
                "id": "01ABC...",
                "direccion": "Calle Mayor",
                "municipio": "Camas"
            }
        ],
        "pagination": {
            "current_page": 1,
            "per_page": 20,
            "total": 100,
            "last_page": 5
        }
    }
}
 

Example response (404, No properties found with the given municipality.):


{
    "status": "error",
    "error": {
        "code": "NOT_FOUND",
        "message": "No properties found for this municipality"
    }
}
 

Request      

POST v1/properties/municipality

Headers

Authorization        

Example: Bearer {YOUR_BEARER_TOKEN}

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

municipality   string     

Municipality name to search for properties. Example: Camas

page   integer  optional    

Page number for pagination. Example: 1

per_page   integer  optional    

Number of items per page (default 20). Example: 20