MENU navbar-image

Introduction

This is the API documentation for AIC Online Backend.

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

Authenticating requests

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

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

Address

Retrieve a list of addresses or a single address.

requires authentication

Returns either all addresses for the current workspace or a specific address with its relations.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/address/1';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'query' => [
            'per_page' => '10',
            'page' => '1',
            'with[0]' => 'contacts',
        ],
        'json' => [
            'per_page' => 16,
            'page' => 16,
            'with' => [
                'architecto',
            ],
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
    --get "http://localhost/api/address/1?per_page=10&page=1&with[]=contacts" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"per_page\": 16,
    \"page\": 16,
    \"with\": [
        \"architecto\"
    ]
}"
const url = new URL(
    "http://localhost/api/address/1"
);

const params = {
    "per_page": "10",
    "page": "1",
    "with[0]": "contacts",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

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

let body = {
    "per_page": 16,
    "page": 16,
    "with": [
        "architecto"
    ]
};

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

Example response (200):


{
  "data": [
    {
      "id": 1,
      "street": "Main St",
      "housenumber": "123",
      "zip": "12345",
      "city": "Sample City",
      "region": "Sample Region",
      "country": "Sample Country",
      "lat": 52.52,
      "lng": 13.405,
      "attributes": [],
      // ...other fields...
    }
  ]
}
 

Request      

GET api/address/{address?}

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

address   integer  optional  

optional The ID of the address. Example: 1

Query Parameters

per_page   integer  optional  

optional Number of results per page. Example: 10

page   integer  optional  

optional Page number. Example: 1

with   string[]  optional  

optional Relations to load.

Body Parameters

per_page   integer  optional  

Example: 16

page   integer  optional  

Example: 16

with   string[]  optional  

Create a new address.

requires authentication

Validates the request data and creates a new address record.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/address';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'street' => '"Main St"',
            'housenumber' => '"123"',
            'zip' => '"12345"',
            'city' => '"Sample City"',
            'region' => '"Sample Region"',
            'country' => '"Sample Country"',
            'lat' => 52.52,
            'lng' => 13.405,
            'attributes' => [
                'architecto',
            ],
            'object_id' => 16,
            'object_type' => 'architecto',
            'connection_type' => 'architecto',
            'connection_data' => [
                'architecto',
            ],
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
    "http://localhost/api/address" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"street\": \"\\\"Main St\\\"\",
    \"housenumber\": \"\\\"123\\\"\",
    \"zip\": \"\\\"12345\\\"\",
    \"city\": \"\\\"Sample City\\\"\",
    \"region\": \"\\\"Sample Region\\\"\",
    \"country\": \"\\\"Sample Country\\\"\",
    \"lat\": 52.52,
    \"lng\": 13.405,
    \"attributes\": [
        \"architecto\"
    ],
    \"object_id\": 16,
    \"object_type\": \"architecto\",
    \"connection_type\": \"architecto\",
    \"connection_data\": [
        \"architecto\"
    ]
}"
const url = new URL(
    "http://localhost/api/address"
);

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

let body = {
    "street": "\"Main St\"",
    "housenumber": "\"123\"",
    "zip": "\"12345\"",
    "city": "\"Sample City\"",
    "region": "\"Sample Region\"",
    "country": "\"Sample Country\"",
    "lat": 52.52,
    "lng": 13.405,
    "attributes": [
        "architecto"
    ],
    "object_id": 16,
    "object_type": "architecto",
    "connection_type": "architecto",
    "connection_data": [
        "architecto"
    ]
};

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

Example response (201):


{
  "success": true,
  "message": "address created successfully",
  "data": {
    "data": {
      "id": 1,
      "street": "Main St",
      // ...other fields...
    }
  }
}
 

Request      

POST api/address

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

street   string   

The street name. Example: "Main St"

housenumber   string   

The house number. Example: "123"

zip   string   

The postal code. Example: "12345"

city   string   

The city name. Example: "Sample City"

region   string  optional  

optional The region name. Example: "Sample Region"

country   string   

The country name. Example: "Sample Country"

lat   number  optional  

optional Latitude. Example: 52.52

lng   number  optional  

optional Longitude. Example: 13.405

attributes   string[]  optional  

optional Additional attributes.

object_id   integer  optional  

optional ID of the related object. Example: 16

object_type   string  optional  

optional Type of the related object. Example: architecto

connection_type   string  optional  

optional Type of the connection. Example: architecto

connection_data   string[]  optional  

optional Additional connection data.

Update an existing address.

requires authentication

Validates the request data and updates the specified address record.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/address/1';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'street' => '"Main St"',
            'housenumber' => '"123"',
            'zip' => '"12345"',
            'city' => '"Sample City"',
            'region' => '"Sample Region"',
            'country' => '"Sample Country"',
            'lat' => 52.52,
            'lng' => 13.405,
            'attributes' => [
                'architecto',
            ],
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
    "http://localhost/api/address/1" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"street\": \"\\\"Main St\\\"\",
    \"housenumber\": \"\\\"123\\\"\",
    \"zip\": \"\\\"12345\\\"\",
    \"city\": \"\\\"Sample City\\\"\",
    \"region\": \"\\\"Sample Region\\\"\",
    \"country\": \"\\\"Sample Country\\\"\",
    \"lat\": 52.52,
    \"lng\": 13.405,
    \"attributes\": [
        \"architecto\"
    ]
}"
const url = new URL(
    "http://localhost/api/address/1"
);

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

let body = {
    "street": "\"Main St\"",
    "housenumber": "\"123\"",
    "zip": "\"12345\"",
    "city": "\"Sample City\"",
    "region": "\"Sample Region\"",
    "country": "\"Sample Country\"",
    "lat": 52.52,
    "lng": 13.405,
    "attributes": [
        "architecto"
    ]
};

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

Example response (200):


{
    "success": true,
    "message": "address updated successfully"
}
 

Request      

POST api/address/{address_id}

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

address_id   integer   

The ID of the address. Example: 1

address   integer   

The ID of the address to update. Example: 1

Body Parameters

street   string   

The street name. Example: "Main St"

housenumber   string   

The house number. Example: "123"

zip   string   

The postal code. Example: "12345"

city   string   

The city name. Example: "Sample City"

region   string  optional  

optional The region name. Example: "Sample Region"

country   string   

The country name. Example: "Sample Country"

lat   number  optional  

optional Latitude. Example: 52.52

lng   number  optional  

optional Longitude. Example: 13.405

attributes   string[]  optional  

optional Additional attributes.

Delete an address.

requires authentication

Removes the specified address from the database.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/address/1';
$response = $client->delete(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request DELETE \
    "http://localhost/api/address/1" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/address/1"
);

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

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

Example response (200):


{
    "success": true,
    "message": "address deletion successful"
}
 

Request      

DELETE api/address/{address_id}

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

address_id   integer   

The ID of the address. Example: 1

address   integer   

The ID of the address to delete. Example: 1

Connect an address to another object.

requires authentication

Validates the request data and connects the address to the specified object.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/address/1/connect';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'object_id' => 2,
            'object_type' => '"App\\\\Models\\\\Contact"',
            'connection_type' => '"primary"',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
    "http://localhost/api/address/1/connect" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"object_id\": 2,
    \"object_type\": \"\\\"App\\\\\\\\Models\\\\\\\\Contact\\\"\",
    \"connection_type\": \"\\\"primary\\\"\"
}"
const url = new URL(
    "http://localhost/api/address/1/connect"
);

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

let body = {
    "object_id": 2,
    "object_type": "\"App\\\\Models\\\\Contact\"",
    "connection_type": "\"primary\""
};

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

Example response (200):


{
    "success": true,
    "message": "address connected to object"
}
 

Request      

POST api/address/{address_id}/connect

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

address_id   integer   

The ID of the address. Example: 1

address   integer   

The ID of the address to connect. Example: 1

Body Parameters

object_id   integer   

The ID of the object to connect. Example: 2

object_type   string   

The type of the object to connect. Example: "App\\Models\\Contact"

connection_type   string  optional  

optional The type of the connection. Example: "primary"

Disconnect an address from another object.

requires authentication

Validates the request data and disconnects the address from the specified object.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/address/1/disconnect';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'object_id' => 2,
            'object_type' => '"App\\\\Models\\\\Contact"',
            'connection_type' => '"primary"',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
    "http://localhost/api/address/1/disconnect" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"object_id\": 2,
    \"object_type\": \"\\\"App\\\\\\\\Models\\\\\\\\Contact\\\"\",
    \"connection_type\": \"\\\"primary\\\"\"
}"
const url = new URL(
    "http://localhost/api/address/1/disconnect"
);

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

let body = {
    "object_id": 2,
    "object_type": "\"App\\\\Models\\\\Contact\"",
    "connection_type": "\"primary\""
};

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

Example response (200):


{
    "success": true,
    "message": "address disconnected from object"
}
 

Request      

POST api/address/{address_id}/disconnect

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

address_id   integer   

The ID of the address. Example: 1

address   integer   

The ID of the address to disconnect. Example: 1

Body Parameters

object_id   integer   

The ID of the object to disconnect. Example: 2

object_type   string   

The type of the object to disconnect. Example: "App\\Models\\Contact"

connection_type   string  optional  

optional The type of the connection. Example: "primary"

Update the connection data between an address and another object.

requires authentication

Validates the request data and updates the connection information.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/address/1/update-connection';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'object_id' => 2,
            'object_type' => '"App\\\\Models\\\\Contact"',
            'connection_type' => '"primary"',
            'data' => [
                'type' => '"secondary"',
                'data' => [
                    'architecto',
                ],
            ],
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
    "http://localhost/api/address/1/update-connection" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"object_id\": 2,
    \"object_type\": \"\\\"App\\\\\\\\Models\\\\\\\\Contact\\\"\",
    \"connection_type\": \"\\\"primary\\\"\",
    \"data\": {
        \"type\": \"\\\"secondary\\\"\",
        \"data\": [
            \"architecto\"
        ]
    }
}"
const url = new URL(
    "http://localhost/api/address/1/update-connection"
);

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

let body = {
    "object_id": 2,
    "object_type": "\"App\\\\Models\\\\Contact\"",
    "connection_type": "\"primary\"",
    "data": {
        "type": "\"secondary\"",
        "data": [
            "architecto"
        ]
    }
};

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

Example response (200):


{
    "success": true,
    "message": "address connection updated successfully"
}
 

Request      

POST api/address/{address_id}/update-connection

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

address_id   integer   

The ID of the address. Example: 1

address   integer   

The ID of the address. Example: 1

Body Parameters

object_id   integer   

The ID of the object. Example: 2

object_type   string   

The type of the object. Example: "App\\Models\\Contact"

connection_type   string  optional  

optional The type of the connection. Example: "primary"

data   object   

The connection data.

type   string  optional  

optional The type of the address connection. Example: "secondary"

data   string[]  optional  

optional Additional connection data.

Get weather data for an address.

requires authentication

Returns weather information for the specified address.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/address/1/weather';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
    --get "http://localhost/api/address/1/weather" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/address/1/weather"
);

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

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

Example response (200):


{
  "success": true,
  "message": "weather data",
  "data": {
    // weather data fields
  }
}
 

Request      

GET api/address/{address_id}/weather

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

address_id   integer   

The ID of the address. Example: 1

address   integer   

The ID of the address. Example: 1

Auth

Register a new user and send activation mail.

Creates a new user for the specified workspace, assigns a role and group, and sends an activation email.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/auth/register';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'email' => '"user@example.com"',
            'password' => '|]|{+-',
            'tfatype' => '"email"',
            'firstname' => '"John"',
            'lastname' => '"Doe"',
            'salutation' => '"M"',
            'type' => '"customer"',
            'subtype' => 'architecto',
            'workspace' => 1,
            'google2fa_secret' => 'architecto',
            'group_id' => 2,
            'active_language' => '"en"',
            'company' => 'architecto',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
    "http://localhost/api/auth/register" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"email\": \"\\\"user@example.com\\\"\",
    \"password\": \"|]|{+-\",
    \"tfatype\": \"\\\"email\\\"\",
    \"firstname\": \"\\\"John\\\"\",
    \"lastname\": \"\\\"Doe\\\"\",
    \"salutation\": \"\\\"M\\\"\",
    \"type\": \"\\\"customer\\\"\",
    \"subtype\": \"architecto\",
    \"workspace\": 1,
    \"google2fa_secret\": \"architecto\",
    \"group_id\": 2,
    \"active_language\": \"\\\"en\\\"\",
    \"company\": \"architecto\"
}"
const url = new URL(
    "http://localhost/api/auth/register"
);

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

let body = {
    "email": "\"user@example.com\"",
    "password": "|]|{+-",
    "tfatype": "\"email\"",
    "firstname": "\"John\"",
    "lastname": "\"Doe\"",
    "salutation": "\"M\"",
    "type": "\"customer\"",
    "subtype": "architecto",
    "workspace": 1,
    "google2fa_secret": "architecto",
    "group_id": 2,
    "active_language": "\"en\"",
    "company": "architecto"
};

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

Example response (201):


{
    "success": true,
    "message": "user created successfully",
    "data": {
        "id": 1
    }
}
 

Example response (400):


{
    "status": false,
    "message": "user already exists"
}
 

Example response (404):


{
    "success": false,
    "message": "workspace does not exist"
}
 

Request      

POST api/auth/register

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

email   string   

The user's email address. Example: "user@example.com"

password   string   

The user's password. Example: |]|{+-

tfatype   string   

The type of two-factor authentication. Example: "email"

firstname   string   

The user's first name. Example: "John"

lastname   string   

The user's last name. Example: "Doe"

salutation   string   

Salutation, one character. Example: "M"

type   string   

The user type. Example: "customer"

subtype   string   

Example: architecto

workspace   integer   

Workspace ID. Example: 1

google2fa_secret   string  optional  

optional Google 2FA secret, required if tfatype is not "email". Example: architecto

group_id   integer  optional  

optional Group ID. Example: 2

active_language   string  optional  

optional Language code. Example: "en"

company   string  optional  

optional Company name for group assignment. Example: architecto

Authenticate user and send two-factor information.

Checks email and password, sends two-factor authentication info if required, and returns user data.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/auth/login';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'workspace' => 1,
            'email' => '"user@example.com"',
            'password' => '|]|{+-',
            'group_id' => 2,
            'uuid1' => 'architecto',
            'uuid2' => 'architecto',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
    "http://localhost/api/auth/login" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"workspace\": 1,
    \"email\": \"\\\"user@example.com\\\"\",
    \"password\": \"|]|{+-\",
    \"group_id\": 2,
    \"uuid1\": \"architecto\",
    \"uuid2\": \"architecto\"
}"
const url = new URL(
    "http://localhost/api/auth/login"
);

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

let body = {
    "workspace": 1,
    "email": "\"user@example.com\"",
    "password": "|]|{+-",
    "group_id": 2,
    "uuid1": "architecto",
    "uuid2": "architecto"
};

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

Example response (200):


{
    "success": true,
    "message": "login successful, user exists",
    "data": {
        "user": {
            "id": 1,
            "tfatype": "email"
        }
    }
}
 

Example response (401):


{
    "success": false,
    "message": "invalid username or password"
}
 

Example response (429):


{
    "success": false,
    "message": "too many login attempts, please try again in X minutes"
}
 

Request      

POST api/auth/login

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

workspace   integer   

Workspace ID. Example: 1

email   string   

The user's email address. Example: "user@example.com"

password   string   

The user's password. Example: |]|{+-

group_id   integer  optional  

optional Group ID. Example: 2

uuid1   string   

Device UUID1. Example: architecto

uuid2   string   

Device UUID2. Example: architecto

Send password reset email.

Sends an email to the user with instructions to reset their password.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/auth/forgotpassword';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'email' => '"user@example.com"',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
    "http://localhost/api/auth/forgotpassword" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"email\": \"\\\"user@example.com\\\"\"
}"
const url = new URL(
    "http://localhost/api/auth/forgotpassword"
);

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

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

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

Example response (200):


{
    "success": true,
    "message": "email to reset password successfully sent"
}
 

Example response (404):


{
    "success": false,
    "message": "user does not exist"
}
 

Request      

POST api/auth/forgotpassword

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

email   string   

The user's email address. Example: "user@example.com"

Verify two-factor token and log in the user.

Validates the provided one-time password for two-factor authentication and logs in the user.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/auth/tfalogin';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'user_id' => 1,
            'one_time_password' => 'architecto',
            'uuid1' => 'architecto',
            'uuid2' => 'architecto',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
    "http://localhost/api/auth/tfalogin" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"user_id\": 1,
    \"one_time_password\": \"architecto\",
    \"uuid1\": \"architecto\",
    \"uuid2\": \"architecto\"
}"
const url = new URL(
    "http://localhost/api/auth/tfalogin"
);

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

let body = {
    "user_id": 1,
    "one_time_password": "architecto",
    "uuid1": "architecto",
    "uuid2": "architecto"
};

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

Example response (200):


{
    "success": true,
    "message": "two-factor authentication successful"
}
 

Example response (401):


{
    "success": false,
    "message": "invalid or expired two-factor token"
}
 

Request      

POST api/auth/tfalogin

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

user_id   integer   

The user's ID. Example: 1

one_time_password   string   

The one-time password for 2FA. Example: architecto

uuid1   string   

Device UUID1. Example: architecto

uuid2   string   

Device UUID2. Example: architecto

Log in using a token.

Authenticates the user using a previously issued token.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/auth/token';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'token' => 'architecto',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
    "http://localhost/api/auth/token" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"token\": \"architecto\"
}"
const url = new URL(
    "http://localhost/api/auth/token"
);

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

let body = {
    "token": "architecto"
};

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

Example response (200):


{
    "success": true,
    "message": "login successful",
    "data": {
        "user_id": 1
    }
}
 

Example response (401):


{
    "success": false,
    "message": "invalid token"
}
 

Example response (429):


{
    "success": false,
    "message": "too many login attempts, please try again in X minutes"
}
 

Request      

POST api/auth/token

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

token   string   

The login token. Example: architecto

Change the active group of the authenticated user.

requires authentication

Sets the user's active group to the specified group if the user has access.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/auth/group';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'group_id' => 2,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
    "http://localhost/api/auth/group" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"group_id\": 2
}"
const url = new URL(
    "http://localhost/api/auth/group"
);

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

let body = {
    "group_id": 2
};

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

Example response (200):


{
    "success": true,
    "message": "group changed successfully",
    "data": {
        "user": {},
        "group": {}
    }
}
 

Example response (403):


{
    "success": false,
    "message": "user does not have access to this group"
}
 

Request      

POST api/auth/group

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

group_id   integer   

The ID of the group to activate. Example: 2

Refresh the access token for the authenticated user.

requires authentication

Returns a new access token for the currently authenticated user.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/auth/refresh';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
    "http://localhost/api/auth/refresh" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/auth/refresh"
);

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

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

Example response (200):


{
    "success": true,
    "message": "access token refreshed successfully",
    "data": {
        "user": {}
    }
}
 

Request      

POST api/auth/refresh

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

Log out the current user and invalidate the token.

requires authentication

Invalidates the current user's authentication token and logs them out.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/auth/logout';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
    "http://localhost/api/auth/logout" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/auth/logout"
);

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

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

Example response (200):


{
    "success": true,
    "message": "logout successful"
}
 

Request      

POST api/auth/logout

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

Benchmark

Compare a policy with a benchmark.

requires authentication

Compares the specified policy with the benchmark based on insurance sum, building type, gustavo, and group.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/benchmark/compare';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'insurance_sum' => 200000.0,
            'building_type' => '"house"',
            'gustavo' => true,
            'group_id' => 2,
            'policy_id' => 5,
            'workspace_id' => 1,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
    --get "http://localhost/api/benchmark/compare" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"insurance_sum\": 200000,
    \"building_type\": \"\\\"house\\\"\",
    \"gustavo\": true,
    \"group_id\": 2,
    \"policy_id\": 5,
    \"workspace_id\": 1
}"
const url = new URL(
    "http://localhost/api/benchmark/compare"
);

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

let body = {
    "insurance_sum": 200000,
    "building_type": "\"house\"",
    "gustavo": true,
    "group_id": 2,
    "policy_id": 5,
    "workspace_id": 1
};

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

Example response (200):


{
  "success": true,
  "message": "benchmark compared successfully",
  "data": {
    // comparison result data
  }
}
 

Example response (404):


{
    "success": false,
    "message": "no benchmark found"
}
 

Request      

GET api/benchmark/compare

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

insurance_sum   number   

The insurance sum to compare. Example: 200000

building_type   string   

The building type. Example: "house"

gustavo   boolean   

Gustavo flag. Example: true

group_id   integer   

The group ID. Example: 2

policy_id   integer   

The policy ID to compare. Example: 5

workspace_id   integer   

The workspace ID. Example: 1

Retrieve a list of all benchmarks or a single benchmark.

requires authentication

Returns either all benchmarks for the current workspace or a specific benchmark with its relations.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/benchmark/1';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'query' => [
            'per_page' => '10',
            'page' => '1',
            'with[0]' => 'benchmarkProducts',
            'with[1]' => 'group',
            'paged' => '1',
            'shortresult' => '0',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
    --get "http://localhost/api/benchmark/1?per_page=10&page=1&with[]=benchmarkProducts&with[]=group&paged=1&shortresult=" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/benchmark/1"
);

const params = {
    "per_page": "10",
    "page": "1",
    "with[0]": "benchmarkProducts",
    "with[1]": "group",
    "paged": "1",
    "shortresult": "0",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

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

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

Example response (200):


{
    "data": [
        {
            "id": 1,
            "name": "Sample Benchmark",
            "group_id": 2,
            "active": true,
            "insurance_sum_from": 100000,
            "insurance_sum_to": 500000,
            "building_type": [
                "house"
            ],
            "gustavo": true,
            "global": false,
            "benchmarkProducts": [],
            "group": {}
        }
    ]
}
 

Request      

GET api/benchmark/{benchmark?}

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

benchmark   integer  optional  

optional The ID of the benchmark. Example: 1

Query Parameters

per_page   integer  optional  

optional Number of results per page. Example: 10

page   integer  optional  

optional Page number. Example: 1

with   string[]  optional  

optional Relations to load.

paged   boolean  optional  

optional Whether to paginate results. Example: true

shortresult   boolean  optional  

optional If true, returns only basic data. Example: false

Create a new benchmark.

requires authentication

Validates the request data and creates a new benchmark record with associated products.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/benchmark';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'name' => '"Sample Benchmark"',
            'group_id' => 2,
            'active' => true,
            'insurance_sum_from' => 100000.0,
            'insurance_sum_to' => 500000.0,
            'building_type' => [
                'house',
            ],
            'gustavo' => true,
            'global' => false,
            'benchmark_products' => [
                'architecto',
            ],
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
    "http://localhost/api/benchmark" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"\\\"Sample Benchmark\\\"\",
    \"group_id\": 2,
    \"active\": true,
    \"insurance_sum_from\": 100000,
    \"insurance_sum_to\": 500000,
    \"building_type\": [
        \"house\"
    ],
    \"gustavo\": true,
    \"global\": false,
    \"benchmark_products\": [
        \"architecto\"
    ]
}"
const url = new URL(
    "http://localhost/api/benchmark"
);

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

let body = {
    "name": "\"Sample Benchmark\"",
    "group_id": 2,
    "active": true,
    "insurance_sum_from": 100000,
    "insurance_sum_to": 500000,
    "building_type": [
        "house"
    ],
    "gustavo": true,
    "global": false,
    "benchmark_products": [
        "architecto"
    ]
};

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

Example response (201):


{
  "success": true,
  "message": "benchmark created successfully",
  "data": {
    "data": {
      "id": 1,
      "name": "Sample Benchmark",
      // ...other fields...
    }
  }
}
 

Request      

POST api/benchmark

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

name   string   

The name of the benchmark. Example: "Sample Benchmark"

group_id   integer  optional  

required_without:global The group ID. Example: 2

active   boolean   

Whether the benchmark is active. Example: true

insurance_sum_from   number   

Minimum insurance sum. Example: 100000

insurance_sum_to   number   

Maximum insurance sum. Example: 500000

building_type   string[]   

Building types.

gustavo   boolean   

Gustavo flag. Example: true

global   boolean  optional  

required_without:group_id Global flag. Example: false

benchmark_products   string[]   

List of benchmark products.

*   object  optional  
module_product_item_id   integer   

Module product item ID. Example: 1

cover   boolean   

Cover flag. Example: true

value   mixed   

Value for the product. Example: architecto

comment   string  optional  

optional Comment for the product. Example: architecto

Update an existing benchmark.

requires authentication

Validates the request data and updates the specified benchmark record and its products.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/benchmark/1';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'name' => '"Updated Benchmark"',
            'group_id' => 2,
            'active' => true,
            'insurance_sum_from' => 100000.0,
            'insurance_sum_to' => 500000.0,
            'building_type' => [
                'house',
            ],
            'gustavo' => true,
            'global' => false,
            'benchmark_products' => [
                'architecto',
            ],
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
    "http://localhost/api/benchmark/1" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"\\\"Updated Benchmark\\\"\",
    \"group_id\": 2,
    \"active\": true,
    \"insurance_sum_from\": 100000,
    \"insurance_sum_to\": 500000,
    \"building_type\": [
        \"house\"
    ],
    \"gustavo\": true,
    \"global\": false,
    \"benchmark_products\": [
        \"architecto\"
    ]
}"
const url = new URL(
    "http://localhost/api/benchmark/1"
);

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

let body = {
    "name": "\"Updated Benchmark\"",
    "group_id": 2,
    "active": true,
    "insurance_sum_from": 100000,
    "insurance_sum_to": 500000,
    "building_type": [
        "house"
    ],
    "gustavo": true,
    "global": false,
    "benchmark_products": [
        "architecto"
    ]
};

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

Example response (200):


{
  "success": true,
  "message": "benchmark updated successfully",
  "data": {
    "data": {
      "id": 1,
      "name": "Updated Benchmark",
      // ...other fields...
    }
  }
}
 

Request      

POST api/benchmark/{benchmark_id}

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

benchmark_id   integer   

The ID of the benchmark. Example: 1

benchmark   integer   

The ID of the benchmark to update. Example: 1

Body Parameters

name   string   

The name of the benchmark. Example: "Updated Benchmark"

group_id   integer  optional  

required_without:global The group ID. Example: 2

active   boolean   

Whether the benchmark is active. Example: true

insurance_sum_from   number   

Minimum insurance sum. Example: 100000

insurance_sum_to   number   

Maximum insurance sum. Example: 500000

building_type   string[]   

Building types.

gustavo   boolean   

Gustavo flag. Example: true

global   boolean  optional  

required_without:group_id Global flag. Example: false

benchmark_products   string[]   

List of benchmark products.

*   object  optional  
module_product_item_id   integer   

Module product item ID. Example: 1

cover   boolean   

Cover flag. Example: true

value   mixed   

Value for the product. Example: architecto

comment   string  optional  

optional Comment for the product. Example: architecto

Delete a benchmark.

requires authentication

Removes the specified benchmark from the database.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/benchmark/1';
$response = $client->delete(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request DELETE \
    "http://localhost/api/benchmark/1" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/benchmark/1"
);

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

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

Example response (204):

Empty response
 

Request      

DELETE api/benchmark/{benchmark_id}

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

benchmark_id   integer   

The ID of the benchmark. Example: 1

benchmark   integer   

The ID of the benchmark to delete. Example: 1

Canton

Retrieve a list of all cantons or a single canton.

requires authentication

Returns all cantons ordered by name, or a specific canton by name, short, or ID, including related canton indexes.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/canton/1';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'query' => [
            'name' => '"Zürich"',
            'short' => '"ZH"',
        ],
        'json' => [
            'name' => 'architecto',
            'short' => 'architecto',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
    --get "http://localhost/api/canton/1?name=%22Z%C3%BCrich%22&short=%22ZH%22" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"architecto\",
    \"short\": \"architecto\"
}"
const url = new URL(
    "http://localhost/api/canton/1"
);

const params = {
    "name": ""Zürich"",
    "short": ""ZH"",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

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

let body = {
    "name": "architecto",
    "short": "architecto"
};

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

Example response (200):


{
    "id": 1,
    "name": "Zürich",
    "short": "ZH",
    "cantonIndexes": []
}
 

Request      

GET api/canton/{canton?}

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

canton   integer  optional  

optional The ID of the canton. Example: 1

Query Parameters

name   string  optional  

optional The name of the canton. Example: "Zürich"

short   string  optional  

optional The short code of the canton. Example: "ZH"

Body Parameters

name   string  optional  

Example: architecto

short   string  optional  

Example: architecto

Create a new canton.

requires authentication

Validates the request data and creates a new canton record.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/canton';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'name' => '"Zürich"',
            'short' => '"ZH"',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
    "http://localhost/api/canton" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"\\\"Zürich\\\"\",
    \"short\": \"\\\"ZH\\\"\"
}"
const url = new URL(
    "http://localhost/api/canton"
);

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

let body = {
    "name": "\"Zürich\"",
    "short": "\"ZH\""
};

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

Example response (201):


{
    "success": true,
    "message": "canton created successfully",
    "data": {
        "id": 1,
        "name": "Zürich",
        "short": "ZH"
    }
}
 

Request      

POST api/canton

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

name   string   

The name of the canton. Example: "Zürich"

short   string   

The short code of the canton. Example: "ZH"

Update an existing canton.

requires authentication

Validates the request data and updates the specified canton record.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/canton/1';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'name' => '"Bern"',
            'short' => '"BE"',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
    "http://localhost/api/canton/1" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"\\\"Bern\\\"\",
    \"short\": \"\\\"BE\\\"\"
}"
const url = new URL(
    "http://localhost/api/canton/1"
);

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

let body = {
    "name": "\"Bern\"",
    "short": "\"BE\""
};

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

Example response (200):


{
    "success": true,
    "message": "canton updated successfully",
    "data": {
        "id": 1,
        "name": "Bern",
        "short": "BE"
    }
}
 

Request      

POST api/canton/{canton_id}

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

canton_id   integer   

The ID of the canton. Example: 1

canton   integer   

The ID of the canton to update. Example: 1

Body Parameters

name   string  optional  

optional The new name of the canton. Example: "Bern"

short   string  optional  

optional The new short code of the canton. Example: "BE"

Delete a canton.

requires authentication

Removes the specified canton from the database.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/canton/1';
$response = $client->delete(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request DELETE \
    "http://localhost/api/canton/1" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/canton/1"
);

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

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

Example response (200):


{
    "success": true,
    "message": "canton deleted successfully"
}
 

Request      

DELETE api/canton/{canton_id}

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

canton_id   integer   

The ID of the canton. Example: 1

canton   integer   

The ID of the canton to delete. Example: 1

Canton Index

Retrieve a list of all canton indexes for a canton or a single index.

requires authentication

Returns all indexes for the specified canton or a specific index with its related canton.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/canton/1/index/5';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
    --get "http://localhost/api/canton/1/index/5" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/canton/1/index/5"
);

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

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

Example response (200):


{
    "id": 5,
    "year": 2023,
    "index": 102,
    "canton_id": 1,
    "canton": {
        "id": 1,
        "name": "Zürich",
        "short": "ZH"
    }
}
 

Request      

GET api/canton/{canton_id}/index/{index?}

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

canton_id   integer   

The ID of the canton. Example: 1

index   integer  optional  

optional The ID of the canton index. Example: 5

canton   integer   

The ID of the canton. Example: 1

Create a new canton index for a canton.

requires authentication

Validates the request data and creates a new index for the specified canton.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/canton/1/index';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'year' => 2023,
            'index' => 102,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
    "http://localhost/api/canton/1/index" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"year\": 2023,
    \"index\": 102
}"
const url = new URL(
    "http://localhost/api/canton/1/index"
);

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

let body = {
    "year": 2023,
    "index": 102
};

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

Example response (201):


{
    "success": true,
    "message": "canton index created successfully",
    "data": {
        "data": {
            "id": 5,
            "year": 2023,
            "index": 102,
            "canton_id": 1
        }
    }
}
 

Request      

POST api/canton/{canton_id}/index

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

canton_id   integer   

The ID of the canton. Example: 1

canton   integer   

The ID of the canton. Example: 1

Body Parameters

year   integer   

The year of the index. Example: 2023

index   integer   

The value of the index. Example: 102

Update an existing canton index.

requires authentication

Validates the request data and updates the specified canton index.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/canton/1/index/1';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'year' => 2024,
            'index' => 105,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
    "http://localhost/api/canton/1/index/1" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"year\": 2024,
    \"index\": 105
}"
const url = new URL(
    "http://localhost/api/canton/1/index/1"
);

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

let body = {
    "year": 2024,
    "index": 105
};

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

Example response (200):


{
    "success": true,
    "message": "canton index updated successfully",
    "data": {
        "data": {
            "id": 5,
            "year": 2024,
            "index": 105,
            "canton_id": 1
        }
    }
}
 

Request      

POST api/canton/{canton_id}/index/{index_id}

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

canton_id   integer   

The ID of the canton. Example: 1

index_id   integer   

The ID of the index. Example: 1

canton   integer   

The ID of the canton. Example: 1

index   integer   

The ID of the canton index to update. Example: 5

Body Parameters

year   integer  optional  

optional The new year of the index. Example: 2024

index   integer  optional  

optional The new value of the index. Example: 105

Delete a canton index.

requires authentication

Removes the specified canton index from the database.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/canton/1/index/1';
$response = $client->delete(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request DELETE \
    "http://localhost/api/canton/1/index/1" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/canton/1/index/1"
);

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

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

Example response (200):


{
    "success": true,
    "message": "canton index deleted successfully"
}
 

Request      

DELETE api/canton/{canton_id}/index/{index_id}

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

canton_id   integer   

The ID of the canton. Example: 1

index_id   integer   

The ID of the index. Example: 1

canton   integer   

The ID of the canton. Example: 1

index   integer   

The ID of the canton index to delete. Example: 5

Collection

Retrieve collections for a specific user.

requires authentication

Returns all collections associated with the specified user, paginated.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/collection/user/1';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'query' => [
            'per_page' => '15',
            'page' => '1',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
    --get "http://localhost/api/collection/user/1?per_page=15&page=1" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/collection/user/1"
);

const params = {
    "per_page": "15",
    "page": "1",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

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

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

Example response (200):


{
    "data": [
        {
            "id": 1,
            "name": "Sample Collection",
            "group_id": 2
        }
    ]
}
 

Request      

GET api/collection/user/{user?}

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

user   integer  optional  

optional The ID of the user. Example: 1

Query Parameters

per_page   integer  optional  

optional Number of results per page. Example: 15

page   integer  optional  

optional Page number. Example: 1

Update an existing collection.

requires authentication

Validates the request data and updates the specified collection.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/collection/1';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'name' => '"Updated Collection"',
            'group_id' => 3,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
    "http://localhost/api/collection/1" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"\\\"Updated Collection\\\"\",
    \"group_id\": 3
}"
const url = new URL(
    "http://localhost/api/collection/1"
);

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

let body = {
    "name": "\"Updated Collection\"",
    "group_id": 3
};

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

Example response (200):


{
    "success": true,
    "message": "collection updated successfully"
}
 

Request      

POST api/collection/{collection_id}

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

collection_id   integer   

The ID of the collection. Example: 1

collection   integer   

The ID of the collection to update. Example: 1

Body Parameters

name   string  optional  

optional The new name of the collection. Example: "Updated Collection"

group_id   integer  optional  

optional The new group ID. Example: 3

Delete a collection.

requires authentication

Removes the specified collection from the database.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/collection/1';
$response = $client->delete(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request DELETE \
    "http://localhost/api/collection/1" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/collection/1"
);

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

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

Example response (200):


{
    "success": true,
    "message": "collection deleted successfully"
}
 

Request      

DELETE api/collection/{collection_id}

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

collection_id   integer   

The ID of the collection. Example: 1

collection   integer   

The ID of the collection to delete. Example: 1

Retrieve a list of all collections or a single collection.

requires authentication

Returns all collections for the current workspace, optionally paginated, or a specific collection with its files.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/collection/1';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'query' => [
            'paged' => '1',
            'per_page' => '15',
            'page' => '1',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
    --get "http://localhost/api/collection/1?paged=1&per_page=15&page=1" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/collection/1"
);

const params = {
    "paged": "1",
    "per_page": "15",
    "page": "1",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

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

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

Example response (200):


{
    "id": 1,
    "name": "Sample Collection",
    "group_id": 2,
    "files": []
}
 

Request      

GET api/collection/{collection?}

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

collection   integer  optional  

optional The ID of the collection. Example: 1

Query Parameters

paged   boolean  optional  

optional Whether to paginate results. Example: true

per_page   integer  optional  

optional Number of results per page. Example: 15

page   integer  optional  

optional Page number. Example: 1

Attach objects to a collection.

requires authentication

Validates the request data and attaches the specified objects to the collection.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/collection/1/object';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'objects' => [
                'architecto',
            ],
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
    "http://localhost/api/collection/1/object" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"objects\": [
        \"architecto\"
    ]
}"
const url = new URL(
    "http://localhost/api/collection/1/object"
);

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

let body = {
    "objects": [
        "architecto"
    ]
};

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

Example response (201):


{
    "success": true,
    "message": "objects successfully added to collection",
    "errors": []
}
 

Request      

POST api/collection/{collection_id}/object

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

collection_id   integer   

The ID of the collection. Example: 1

collection   integer   

The ID of the collection. Example: 1

Body Parameters

objects   string[]   

List of objects to attach.

*   object  optional  
type   string   

The type of the object. Example: "Policy"

id   integer   

The ID of the object. Example: 5

Detach objects from a collection.

requires authentication

Validates the request data and detaches the specified objects from the collection.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/collection/1/object';
$response = $client->delete(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'objects' => [
                'architecto',
            ],
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request DELETE \
    "http://localhost/api/collection/1/object" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"objects\": [
        \"architecto\"
    ]
}"
const url = new URL(
    "http://localhost/api/collection/1/object"
);

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

let body = {
    "objects": [
        "architecto"
    ]
};

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

Example response (200):


{
    "success": true,
    "message": "objects successfully removed from collection",
    "errors": []
}
 

Request      

DELETE api/collection/{collection_id}/object

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

collection_id   integer   

The ID of the collection. Example: 1

collection   integer   

The ID of the collection. Example: 1

Body Parameters

objects   string[]   

List of objects to detach.

*   object  optional  
type   string   

The type of the object. Example: "Policy"

id   integer   

The ID of the object. Example: 5

Add users to a collection.

requires authentication

Validates the request data and adds the specified users to the collection.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/collection/1/user';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'users' => [
                2,
                3,
            ],
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
    "http://localhost/api/collection/1/user" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"users\": [
        2,
        3
    ]
}"
const url = new URL(
    "http://localhost/api/collection/1/user"
);

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

let body = {
    "users": [
        2,
        3
    ]
};

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

Example response (200):


{
    "success": true,
    "message": "users successfully added to collection"
}
 

Request      

POST api/collection/{collection_id}/user

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

collection_id   integer   

The ID of the collection. Example: 1

collection   integer   

The ID of the collection. Example: 1

Body Parameters

users   string[]   

List of user IDs to add.

Remove users from a collection.

requires authentication

Validates the request data and removes the specified users from the collection.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/collection/1/user';
$response = $client->delete(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'users' => [
                2,
                3,
            ],
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request DELETE \
    "http://localhost/api/collection/1/user" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"users\": [
        2,
        3
    ]
}"
const url = new URL(
    "http://localhost/api/collection/1/user"
);

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

let body = {
    "users": [
        2,
        3
    ]
};

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

Example response (200):


{
    "success": true,
    "message": "users successfully removed from collection"
}
 

Request      

DELETE api/collection/{collection_id}/user

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

collection_id   integer   

The ID of the collection. Example: 1

collection   integer   

The ID of the collection. Example: 1

Body Parameters

users   string[]   

List of user IDs to remove.

Create a new collection.

requires authentication

Validates the request data and creates a new collection for the specified group.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/collection';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'name' => '"Sample Collection"',
            'group_id' => 2,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
    "http://localhost/api/collection" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"\\\"Sample Collection\\\"\",
    \"group_id\": 2
}"
const url = new URL(
    "http://localhost/api/collection"
);

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

let body = {
    "name": "\"Sample Collection\"",
    "group_id": 2
};

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

Example response (201):


{
    "success": true,
    "message": "collection created successfully",
    "data": {
        "id": 1
    }
}
 

Request      

POST api/collection

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

name   string   

The name of the collection. Example: "Sample Collection"

group_id   integer   

The group ID. Example: 2

Invite a user to a collection via email.

requires authentication

Sends an invitation email to the specified address to join the collection.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/collection/1/invite';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'email' => '"invitee@example.com"',
            'salutation' => '"Mr"',
            'firstname' => '"John"',
            'lastname' => '"Doe"',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
    "http://localhost/api/collection/1/invite" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"email\": \"\\\"invitee@example.com\\\"\",
    \"salutation\": \"\\\"Mr\\\"\",
    \"firstname\": \"\\\"John\\\"\",
    \"lastname\": \"\\\"Doe\\\"\"
}"
const url = new URL(
    "http://localhost/api/collection/1/invite"
);

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

let body = {
    "email": "\"invitee@example.com\"",
    "salutation": "\"Mr\"",
    "firstname": "\"John\"",
    "lastname": "\"Doe\""
};

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

Example response (200):


{
    "success": true,
    "message": "invite sent successfully"
}
 

Request      

POST api/collection/{collection_id}/invite

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

collection_id   integer   

The ID of the collection. Example: 1

collection   integer   

The ID of the collection. Example: 1

Body Parameters

email   string   

The email address to invite. Example: "invitee@example.com"

salutation   string   

The salutation for the invitee. Example: "Mr"

firstname   string   

The first name of the invitee. Example: "John"

lastname   string   

The last name of the invitee. Example: "Doe"

Authorize a collection invite using a code.

requires authentication

Validates the invite code and adds the user to the collection.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/collection/1/authorize';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'code' => '"ABC123"',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
    "http://localhost/api/collection/1/authorize" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"code\": \"\\\"ABC123\\\"\"
}"
const url = new URL(
    "http://localhost/api/collection/1/authorize"
);

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

let body = {
    "code": "\"ABC123\""
};

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

Example response (200):


{
    "success": true,
    "message": "user successfully added to collection"
}
 

Example response (400):


{
    "success": false,
    "message": "invalid code"
}
 

Request      

POST api/collection/{collection_id}/authorize

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

collection_id   integer   

The ID of the collection. Example: 1

collection   integer   

The ID of the collection. Example: 1

Body Parameters

code   string   

The invite code. Example: "ABC123"

Add group managers to a collection.

requires authentication

Validates the request data and adds all managers of the specified group to the collection.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/collection/1/addGroupManagers';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'group_id' => 2,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
    "http://localhost/api/collection/1/addGroupManagers" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"group_id\": 2
}"
const url = new URL(
    "http://localhost/api/collection/1/addGroupManagers"
);

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

let body = {
    "group_id": 2
};

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

Example response (200):


{
    "success": true,
    "message": "Group managers successfully added to collection"
}
 

Example response (403):


{
    "success": false,
    "message": "You are not allowed to add group managers to this collection"
}
 

Request      

POST api/collection/{collection_id}/addGroupManagers

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

collection_id   integer   

The ID of the collection. Example: 1

collection   integer   

The ID of the collection. Example: 1

Body Parameters

group_id   integer   

The group ID whose managers should be added. Example: 2

Reject a collection invite.

requires authentication

Notifies the inviting user and deletes the invite.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/collection/rejectInvite/2';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
    "http://localhost/api/collection/rejectInvite/2" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/collection/rejectInvite/2"
);

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

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

Example response (200):


{
    "success": true,
    "message": "invite rejected successfully"
}
 

Request      

POST api/collection/rejectInvite/{collectionInvite_id}

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

collectionInvite_id   integer   

The ID of the collectionInvite. Example: 2

collectionInvite   integer   

The ID of the collection invite to reject. Example: 1

Contact

Retrieve a list of contacts or a single contact.

requires authentication

Returns all contacts for the current workspace or group, or a specific contact with its relations.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/contact/1';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'query' => [
            'per_page' => '10',
            'page' => '1',
        ],
        'json' => [
            'per_page' => 16,
            'page' => 16,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
    --get "http://localhost/api/contact/1?per_page=10&page=1" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"per_page\": 16,
    \"page\": 16
}"
const url = new URL(
    "http://localhost/api/contact/1"
);

const params = {
    "per_page": "10",
    "page": "1",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

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

let body = {
    "per_page": 16,
    "page": 16
};

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

Example response (200):


{
  "data": [
    {
      "id": 1,
      "firstname": "John",
      "lastname": "Doe",
      "email": "john.doe@example.com",
      // ...other fields...
    }
  ]
}
 

Request      

GET api/contact/{contact?}

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

contact   integer  optional  

optional The ID of the contact. Example: 1

Query Parameters

per_page   integer  optional  

optional Number of results per page. Example: 10

page   integer  optional  

optional Page number. Example: 1

Body Parameters

per_page   integer  optional  

Example: 16

page   integer  optional  

Example: 16

Create a new contact.

requires authentication

Validates the request data and creates a new contact record. Optionally connects the contact to an object.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/contact';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'salutation' => '"Mr"',
            'firstname' => '"John"',
            'lastname' => '"Doe"',
            'company' => '"Acme Inc."',
            'email' => '"john.doe@example.com"',
            'phone' => '"+123456789"',
            'mobile' => '"+987654321"',
            'fax' => '"+1122334455"',
            'homepage' => '"https://acme.com"',
            'address_id' => 2,
            'street' => '"Main St"',
            'housenumber' => '"42"',
            'zip' => '"12345"',
            'city' => '"Sample City"',
            'region' => '"Sample Region"',
            'country' => '"Sample Country"',
            'lat' => '"52.52"',
            'lng' => '"13.405"',
            'object_id' => 16,
            'object_type' => 'architecto',
            'connection_type' => 'architecto',
            'connection_subtype' => 'architecto',
            'connection_data' => [
                'architecto',
            ],
            'attributes' => [
                'architecto',
            ],
            'workspace_id' => 1,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
    "http://localhost/api/contact" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"salutation\": \"\\\"Mr\\\"\",
    \"firstname\": \"\\\"John\\\"\",
    \"lastname\": \"\\\"Doe\\\"\",
    \"company\": \"\\\"Acme Inc.\\\"\",
    \"email\": \"\\\"john.doe@example.com\\\"\",
    \"phone\": \"\\\"+123456789\\\"\",
    \"mobile\": \"\\\"+987654321\\\"\",
    \"fax\": \"\\\"+1122334455\\\"\",
    \"homepage\": \"\\\"https:\\/\\/acme.com\\\"\",
    \"address_id\": 2,
    \"street\": \"\\\"Main St\\\"\",
    \"housenumber\": \"\\\"42\\\"\",
    \"zip\": \"\\\"12345\\\"\",
    \"city\": \"\\\"Sample City\\\"\",
    \"region\": \"\\\"Sample Region\\\"\",
    \"country\": \"\\\"Sample Country\\\"\",
    \"lat\": \"\\\"52.52\\\"\",
    \"lng\": \"\\\"13.405\\\"\",
    \"object_id\": 16,
    \"object_type\": \"architecto\",
    \"connection_type\": \"architecto\",
    \"connection_subtype\": \"architecto\",
    \"connection_data\": [
        \"architecto\"
    ],
    \"attributes\": [
        \"architecto\"
    ],
    \"workspace_id\": 1
}"
const url = new URL(
    "http://localhost/api/contact"
);

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

let body = {
    "salutation": "\"Mr\"",
    "firstname": "\"John\"",
    "lastname": "\"Doe\"",
    "company": "\"Acme Inc.\"",
    "email": "\"john.doe@example.com\"",
    "phone": "\"+123456789\"",
    "mobile": "\"+987654321\"",
    "fax": "\"+1122334455\"",
    "homepage": "\"https:\/\/acme.com\"",
    "address_id": 2,
    "street": "\"Main St\"",
    "housenumber": "\"42\"",
    "zip": "\"12345\"",
    "city": "\"Sample City\"",
    "region": "\"Sample Region\"",
    "country": "\"Sample Country\"",
    "lat": "\"52.52\"",
    "lng": "\"13.405\"",
    "object_id": 16,
    "object_type": "architecto",
    "connection_type": "architecto",
    "connection_subtype": "architecto",
    "connection_data": [
        "architecto"
    ],
    "attributes": [
        "architecto"
    ],
    "workspace_id": 1
};

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

Example response (201):


{
  "success": true,
  "message": "contact created successfully",
  "data": {
    "data": {
      "id": 1,
      "firstname": "John",
      // ...other fields...
    },
    "newGroup": false
  }
}
 

Request      

POST api/contact

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

salutation   string  optional  

optional Salutation. Example: "Mr"

firstname   string  optional  

optional First name. Example: "John"

lastname   string  optional  

optional Last name. Example: "Doe"

company   string  optional  

optional Company name. Example: "Acme Inc."

email   string  optional  

optional Email address. Example: "john.doe@example.com"

phone   string  optional  

optional Phone number. Example: "+123456789"

mobile   string  optional  

optional Mobile number. Example: "+987654321"

fax   string  optional  

optional Fax number. Example: "+1122334455"

homepage   string  optional  

optional Homepage URL. Example: "https://acme.com"

address_id   integer  optional  

optional Address ID. Example: 2

street   string  optional  

optional Street name. Example: "Main St"

housenumber   string  optional  

optional House number. Example: "42"

zip   string  optional  

optional Zip code. Example: "12345"

city   string  optional  

optional City name. Example: "Sample City"

region   string  optional  

optional Region name. Example: "Sample Region"

country   string  optional  

optional Country name. Example: "Sample Country"

lat   string  optional  

optional Latitude. Example: "52.52"

lng   string  optional  

optional Longitude. Example: "13.405"

object_id   integer  optional  

optional ID of the related object. Example: 16

object_type   string  optional  

optional Type of the related object. Example: architecto

connection_type   string  optional  

optional Type of the connection. Example: architecto

connection_subtype   string  optional  

optional Subtype of the connection. Example: architecto

connection_data   string[]  optional  

optional Additional connection data.

attributes   string[]  optional  

optional Additional attributes.

workspace_id   integer   

Workspace ID. Example: 1

Update an existing contact.

requires authentication

Validates the request data and updates the specified contact record.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/contact/1';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'salutation' => '"Ms"',
            'firstname' => '"Jane"',
            'lastname' => '"Doe"',
            'company' => '"Acme Inc."',
            'email' => '"jane.doe@example.com"',
            'phone' => '"+123456789"',
            'mobile' => '"+987654321"',
            'fax' => '"+1122334455"',
            'homepage' => '"https://acme.com"',
            'address_id' => 2,
            'street' => '"Main St"',
            'housenumber' => '"42"',
            'zip' => '"12345"',
            'city' => '"Sample City"',
            'region' => '"Sample Region"',
            'country' => '"Sample Country"',
            'lat' => '"52.52"',
            'lng' => '"13.405"',
            'attributes' => [
                'architecto',
            ],
            'workspace_id' => 1,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
    "http://localhost/api/contact/1" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"salutation\": \"\\\"Ms\\\"\",
    \"firstname\": \"\\\"Jane\\\"\",
    \"lastname\": \"\\\"Doe\\\"\",
    \"company\": \"\\\"Acme Inc.\\\"\",
    \"email\": \"\\\"jane.doe@example.com\\\"\",
    \"phone\": \"\\\"+123456789\\\"\",
    \"mobile\": \"\\\"+987654321\\\"\",
    \"fax\": \"\\\"+1122334455\\\"\",
    \"homepage\": \"\\\"https:\\/\\/acme.com\\\"\",
    \"address_id\": 2,
    \"street\": \"\\\"Main St\\\"\",
    \"housenumber\": \"\\\"42\\\"\",
    \"zip\": \"\\\"12345\\\"\",
    \"city\": \"\\\"Sample City\\\"\",
    \"region\": \"\\\"Sample Region\\\"\",
    \"country\": \"\\\"Sample Country\\\"\",
    \"lat\": \"\\\"52.52\\\"\",
    \"lng\": \"\\\"13.405\\\"\",
    \"attributes\": [
        \"architecto\"
    ],
    \"workspace_id\": 1
}"
const url = new URL(
    "http://localhost/api/contact/1"
);

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

let body = {
    "salutation": "\"Ms\"",
    "firstname": "\"Jane\"",
    "lastname": "\"Doe\"",
    "company": "\"Acme Inc.\"",
    "email": "\"jane.doe@example.com\"",
    "phone": "\"+123456789\"",
    "mobile": "\"+987654321\"",
    "fax": "\"+1122334455\"",
    "homepage": "\"https:\/\/acme.com\"",
    "address_id": 2,
    "street": "\"Main St\"",
    "housenumber": "\"42\"",
    "zip": "\"12345\"",
    "city": "\"Sample City\"",
    "region": "\"Sample Region\"",
    "country": "\"Sample Country\"",
    "lat": "\"52.52\"",
    "lng": "\"13.405\"",
    "attributes": [
        "architecto"
    ],
    "workspace_id": 1
};

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

Example response (200):


{
    "success": true,
    "message": "contact updated successfully"
}
 

Request      

POST api/contact/{contact_id}

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

contact_id   integer   

The ID of the contact. Example: 1

contact   integer   

The ID of the contact to update. Example: 1

Body Parameters

salutation   string  optional  

optional Salutation. Example: "Ms"

firstname   string  optional  

optional First name. Example: "Jane"

lastname   string  optional  

optional Last name. Example: "Doe"

company   string  optional  

optional Company name. Example: "Acme Inc."

email   string  optional  

optional Email address. Example: "jane.doe@example.com"

phone   string  optional  

optional Phone number. Example: "+123456789"

mobile   string  optional  

optional Mobile number. Example: "+987654321"

fax   string  optional  

optional Fax number. Example: "+1122334455"

homepage   string  optional  

optional Homepage URL. Example: "https://acme.com"

address_id   integer  optional  

optional Address ID. Example: 2

street   string  optional  

optional Street name. Example: "Main St"

housenumber   string  optional  

optional House number. Example: "42"

zip   string  optional  

optional Zip code. Example: "12345"

city   string  optional  

optional City name. Example: "Sample City"

region   string  optional  

optional Region name. Example: "Sample Region"

country   string  optional  

optional Country name. Example: "Sample Country"

lat   string  optional  

optional Latitude. Example: "52.52"

lng   string  optional  

optional Longitude. Example: "13.405"

attributes   string[]  optional  

optional Additional attributes.

workspace_id   integer  optional  

optional Workspace ID. Example: 1

Delete a contact.

requires authentication

Removes the specified contact from the database.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/contact/1';
$response = $client->delete(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request DELETE \
    "http://localhost/api/contact/1" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/contact/1"
);

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

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

Example response (200):


{
    "success": true,
    "message": "contact deletion successful"
}
 

Request      

DELETE api/contact/{contact_id}

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

contact_id   integer   

The ID of the contact. Example: 1

contact   integer   

The ID of the contact to delete. Example: 1

Connect a contact to another object.

requires authentication

Validates the request data and connects the contact to the specified object.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/contact/1/connect';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'object_id' => 2,
            'object_type' => '"App\\\\Models\\\\User"',
            'connection_type' => '"primary"',
            'connection_subtype' => '"manager"',
            'connection_data' => [
                'architecto',
            ],
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
    "http://localhost/api/contact/1/connect" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"object_id\": 2,
    \"object_type\": \"\\\"App\\\\\\\\Models\\\\\\\\User\\\"\",
    \"connection_type\": \"\\\"primary\\\"\",
    \"connection_subtype\": \"\\\"manager\\\"\",
    \"connection_data\": [
        \"architecto\"
    ]
}"
const url = new URL(
    "http://localhost/api/contact/1/connect"
);

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

let body = {
    "object_id": 2,
    "object_type": "\"App\\\\Models\\\\User\"",
    "connection_type": "\"primary\"",
    "connection_subtype": "\"manager\"",
    "connection_data": [
        "architecto"
    ]
};

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

Example response (200):


{
    "success": true,
    "message": "contact connected to object"
}
 

Request      

POST api/contact/{contact_id}/connect

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

contact_id   integer   

The ID of the contact. Example: 1

contact   integer   

The ID of the contact to connect. Example: 1

Body Parameters

object_id   integer   

The ID of the object to connect. Example: 2

object_type   string   

The type of the object to connect. Example: "App\\Models\\User"

connection_type   string  optional  

optional Type of the connection. Example: "primary"

connection_subtype   string  optional  

optional Subtype of the connection. Example: "manager"

connection_data   string[]  optional  

optional Additional connection data.

Disconnect a contact from one or more objects.

requires authentication

Validates the request data and disconnects the contact from the specified object(s).

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/contact/1/disconnect';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'object_id' => 2,
            'object_ids' => [
                2,
                3,
            ],
            'object_type' => '"App\\\\Models\\\\User"',
            'connection_type' => '"primary"',
            'connection_subtype' => '"manager"',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
    "http://localhost/api/contact/1/disconnect" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"object_id\": 2,
    \"object_ids\": [
        2,
        3
    ],
    \"object_type\": \"\\\"App\\\\\\\\Models\\\\\\\\User\\\"\",
    \"connection_type\": \"\\\"primary\\\"\",
    \"connection_subtype\": \"\\\"manager\\\"\"
}"
const url = new URL(
    "http://localhost/api/contact/1/disconnect"
);

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

let body = {
    "object_id": 2,
    "object_ids": [
        2,
        3
    ],
    "object_type": "\"App\\\\Models\\\\User\"",
    "connection_type": "\"primary\"",
    "connection_subtype": "\"manager\""
};

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

Example response (200):


{
    "success": true,
    "message": "contact disconnected from object"
}
 

Request      

POST api/contact/{contact_id}/disconnect

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

contact_id   integer   

The ID of the contact. Example: 1

contact   integer   

The ID of the contact to disconnect. Example: 1

Body Parameters

object_id   integer  optional  

required_without:object_ids The ID of the object to disconnect. Example: 2

object_ids   string[]  optional  

required_without:object_id List of object IDs to disconnect.

object_type   string   

The type of the object to disconnect. Example: "App\\Models\\User"

connection_type   string  optional  

optional Type of the connection. Example: "primary"

connection_subtype   string  optional  

optional Subtype of the connection. Example: "manager"

Update the connection data between a contact and another object.

requires authentication

Validates the request data and updates the connection information.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/contact/1/update-connection';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'object_id' => 2,
            'object_type' => '"App\\\\Models\\\\User"',
            'connection_type' => '"primary"',
            'connection_subtype' => '"manager"',
            'data' => [
                'type' => '"secondary"',
                'subtype' => '"assistant"',
                'data' => [
                    'architecto',
                ],
            ],
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
    "http://localhost/api/contact/1/update-connection" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"object_id\": 2,
    \"object_type\": \"\\\"App\\\\\\\\Models\\\\\\\\User\\\"\",
    \"connection_type\": \"\\\"primary\\\"\",
    \"connection_subtype\": \"\\\"manager\\\"\",
    \"data\": {
        \"type\": \"\\\"secondary\\\"\",
        \"subtype\": \"\\\"assistant\\\"\",
        \"data\": [
            \"architecto\"
        ]
    }
}"
const url = new URL(
    "http://localhost/api/contact/1/update-connection"
);

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

let body = {
    "object_id": 2,
    "object_type": "\"App\\\\Models\\\\User\"",
    "connection_type": "\"primary\"",
    "connection_subtype": "\"manager\"",
    "data": {
        "type": "\"secondary\"",
        "subtype": "\"assistant\"",
        "data": [
            "architecto"
        ]
    }
};

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

Example response (200):


{
    "success": true,
    "message": "contact connection updated successfully"
}
 

Request      

POST api/contact/{contact_id}/update-connection

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

contact_id   integer   

The ID of the contact. Example: 1

contact   integer   

The ID of the contact. Example: 1

Body Parameters

object_id   integer   

The ID of the object. Example: 2

object_type   string   

The type of the object. Example: "App\\Models\\User"

connection_type   string  optional  

optional Type of the connection. Example: "primary"

connection_subtype   string  optional  

optional Subtype of the connection. Example: "manager"

data   object   

The connection data.

type   string  optional  

optional The type of the contact connection. Example: "secondary"

subtype   string  optional  

optional The subtype of the contact connection. Example: "assistant"

data   string[]  optional  

optional Additional connection data.

DamageReport

Download the damage report PDF file.

requires authentication

Downloads the generated PDF file for the specified damage report, or returns an error if not available.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/damagereport/205/download';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
    --get "http://localhost/api/damagereport/205/download" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/damagereport/205/download"
);

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

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

Example response (200):


PDF file download.
 

Example response (404):


{
    "success": false,
    "message": "damage report pdf not yet generated"
}
 

Request      

GET api/damagereport/{damagereport_id}/download

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

damagereport_id   integer   

The ID of the damagereport. Example: 205

damagereport   integer   

The ID of the damage report. Example: 1

Send a damage report document package link by email.

requires authentication

Queues a job to send a document package link for the specified damage report to the given email address.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/damagereport/205/sendzipemail';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'file_ids' => [
                10,
                11,
            ],
            'email' => '"recipient@example.com"',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
    "http://localhost/api/damagereport/205/sendzipemail" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"file_ids\": [
        10,
        11
    ],
    \"email\": \"\\\"recipient@example.com\\\"\"
}"
const url = new URL(
    "http://localhost/api/damagereport/205/sendzipemail"
);

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

let body = {
    "file_ids": [
        10,
        11
    ],
    "email": "\"recipient@example.com\""
};

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

Example response (200):


{
    "success": true,
    "message": "damage report document package queued successfully"
}
 

Request      

POST api/damagereport/{damagereport_id}/sendzipemail

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

damagereport_id   integer   

The ID of the damagereport. Example: 205

damagereport   integer   

The ID of the damage report. Example: 1

Body Parameters

file_ids   string[]  optional  

optional List of file IDs to include.

email   string  optional  

optional The email address to send the package to. Example: "recipient@example.com"

Invite a user to the documents section of a damage report.

requires authentication

Creates a guest user and sends an invitation to access the documents section of the specified damage report.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/damagereport/205/invite-upload-center';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'salutation' => '"Mr"',
            'firstname' => '"John"',
            'lastname' => '"Doe"',
            'email' => '"john.doe@example.com"',
            'folders' => [
                1,
                2,
            ],
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
    "http://localhost/api/damagereport/205/invite-upload-center" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"salutation\": \"\\\"Mr\\\"\",
    \"firstname\": \"\\\"John\\\"\",
    \"lastname\": \"\\\"Doe\\\"\",
    \"email\": \"\\\"john.doe@example.com\\\"\",
    \"folders\": [
        1,
        2
    ]
}"
const url = new URL(
    "http://localhost/api/damagereport/205/invite-upload-center"
);

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

let body = {
    "salutation": "\"Mr\"",
    "firstname": "\"John\"",
    "lastname": "\"Doe\"",
    "email": "\"john.doe@example.com\"",
    "folders": [
        1,
        2
    ]
};

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

Example response (201):


{
    "success": true,
    "message": "guest invite successfully created",
    "user": {
        "id": 5,
        "email": "john.doe@example.com"
    }
}
 

Request      

POST api/damagereport/{damagereport_id}/invite-upload-center

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

damagereport_id   integer   

The ID of the damagereport. Example: 205

damagereport   integer   

The ID of the damage report. Example: 1

Body Parameters

salutation   string   

Salutation of the invitee. Example: "Mr"

firstname   string   

First name of the invitee. Example: "John"

lastname   string   

Last name of the invitee. Example: "Doe"

email   string   

Email address of the invitee. Example: "john.doe@example.com"

folders   string[]   

List of folder IDs to grant access.

Retrieve a list of damage reports or a single damage report.

requires authentication

Returns all damage reports for the current workspace, optionally paginated, or a specific damage report with its relations.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/damagereport/205';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'query' => [
            'per_page' => '15',
            'page' => '1',
            'with[0]' => 'moduleObject',
            'with[1]' => 'user',
            'with[2]' => 'journals',
            'with[3]' => 'files',
            'with[4]' => 'policy',
            'with[5]' => 'contacts',
            'with[6]' => 'addresses',
            'paged' => '1',
            'shortresult' => '0',
        ],
        'json' => [
            'per_page' => 16,
            'page' => 16,
            'with' => [
                'files',
            ],
            'paged' => true,
            'shortresult' => false,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
    --get "http://localhost/api/damagereport/205?per_page=15&page=1&with[]=moduleObject&with[]=user&with[]=journals&with[]=files&with[]=policy&with[]=contacts&with[]=addresses&paged=1&shortresult=" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"per_page\": 16,
    \"page\": 16,
    \"with\": [
        \"files\"
    ],
    \"paged\": true,
    \"shortresult\": false
}"
const url = new URL(
    "http://localhost/api/damagereport/205"
);

const params = {
    "per_page": "15",
    "page": "1",
    "with[0]": "moduleObject",
    "with[1]": "user",
    "with[2]": "journals",
    "with[3]": "files",
    "with[4]": "policy",
    "with[5]": "contacts",
    "with[6]": "addresses",
    "paged": "1",
    "shortresult": "0",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

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

let body = {
    "per_page": 16,
    "page": 16,
    "with": [
        "files"
    ],
    "paged": true,
    "shortresult": false
};

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

Example response (200):


{
  "id": 1,
  "name": "Storm Damage",
  "user_id": 2,
  "policy_id": 3,
  "module_object_id": 4,
  "contacts": [],
  "addresses": [],
  // ...other fields...
}
 

Request      

GET api/damagereport/{damagereport_id}

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

damagereport_id   integer   

The ID of the damagereport. Example: 205

damagereport   integer  optional  

optional The ID of the damage report. Example: 1

Query Parameters

per_page   integer  optional  

optional Number of results per page. Example: 15

page   integer  optional  

optional Page number. Example: 1

with   string[]  optional  

optional Relations to load.

paged   boolean  optional  

optional Whether to paginate results. Example: true

shortresult   boolean  optional  

optional If true, returns only basic data. Example: false

Body Parameters

per_page   integer  optional  

Example: 16

page   integer  optional  

Example: 16

with   string[]  optional  
Must be one of:
  • moduleObject
  • user
  • journals
  • files
  • policy
  • damageReportAttributes
paged   boolean  optional  

Example: true

shortresult   boolean  optional  

Example: false

Retrieve a list of damage reports or a single damage report.

requires authentication

Returns all damage reports for the current workspace, optionally paginated, or a specific damage report with its relations.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/damagereport';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'query' => [
            'per_page' => '15',
            'page' => '1',
            'with[0]' => 'moduleObject',
            'with[1]' => 'user',
            'with[2]' => 'journals',
            'with[3]' => 'files',
            'with[4]' => 'policy',
            'with[5]' => 'contacts',
            'with[6]' => 'addresses',
            'paged' => '1',
            'shortresult' => '0',
        ],
        'json' => [
            'per_page' => 16,
            'page' => 16,
            'with' => [
                'files',
            ],
            'paged' => true,
            'shortresult' => false,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
    --get "http://localhost/api/damagereport?per_page=15&page=1&with[]=moduleObject&with[]=user&with[]=journals&with[]=files&with[]=policy&with[]=contacts&with[]=addresses&paged=1&shortresult=" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"per_page\": 16,
    \"page\": 16,
    \"with\": [
        \"files\"
    ],
    \"paged\": true,
    \"shortresult\": false
}"
const url = new URL(
    "http://localhost/api/damagereport"
);

const params = {
    "per_page": "15",
    "page": "1",
    "with[0]": "moduleObject",
    "with[1]": "user",
    "with[2]": "journals",
    "with[3]": "files",
    "with[4]": "policy",
    "with[5]": "contacts",
    "with[6]": "addresses",
    "paged": "1",
    "shortresult": "0",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

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

let body = {
    "per_page": 16,
    "page": 16,
    "with": [
        "files"
    ],
    "paged": true,
    "shortresult": false
};

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

Example response (200):


{
  "id": 1,
  "name": "Storm Damage",
  "user_id": 2,
  "policy_id": 3,
  "module_object_id": 4,
  "contacts": [],
  "addresses": [],
  // ...other fields...
}
 

Request      

GET api/damagereport

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

damagereport   integer  optional  

optional The ID of the damage report. Example: 1

Query Parameters

per_page   integer  optional  

optional Number of results per page. Example: 15

page   integer  optional  

optional Page number. Example: 1

with   string[]  optional  

optional Relations to load.

paged   boolean  optional  

optional Whether to paginate results. Example: true

shortresult   boolean  optional  

optional If true, returns only basic data. Example: false

Body Parameters

per_page   integer  optional  

Example: 16

page   integer  optional  

Example: 16

with   string[]  optional  
Must be one of:
  • moduleObject
  • user
  • journals
  • files
  • policy
  • damageReportAttributes
paged   boolean  optional  

Example: true

shortresult   boolean  optional  

Example: false

Update an existing damage report.

requires authentication

Validates the request data and updates the specified damage report record. Optionally connects contacts and triggers jobs.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/damagereport/205';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'name' => '"Updated Damage"',
            'module_object_id' => 5,
            'policy_id' => 4,
            'contacts' => [
                'architecto',
            ],
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
    "http://localhost/api/damagereport/205" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"\\\"Updated Damage\\\"\",
    \"module_object_id\": 5,
    \"policy_id\": 4,
    \"contacts\": [
        \"architecto\"
    ]
}"
const url = new URL(
    "http://localhost/api/damagereport/205"
);

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

let body = {
    "name": "\"Updated Damage\"",
    "module_object_id": 5,
    "policy_id": 4,
    "contacts": [
        "architecto"
    ]
};

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

Example response (200):


{
    "success": true,
    "message": "damagereport updated",
    "data": {
        "data": {
            "id": 1,
            "name": "Updated Damage"
        }
    }
}
 

Request      

POST api/damagereport/{damageReport_id}

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

damageReport_id   integer   

The ID of the damageReport. Example: 205

damageReport   integer   

The ID of the damage report to update. Example: 1

Body Parameters

name   string  optional  

optional The new name of the damage report. Example: "Updated Damage"

module_object_id   integer  optional  

optional The new module object ID. Example: 5

policy_id   integer  optional  

optional The new policy ID. Example: 4

contacts   string[]  optional  

optional List of contacts to associate.

Delete a damage report.

requires authentication

Removes the specified damage report from the database.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/damagereport/205';
$response = $client->delete(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request DELETE \
    "http://localhost/api/damagereport/205" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/damagereport/205"
);

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

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

Example response (200):


{
    "success": true,
    "message": "damagereport deleted"
}
 

Request      

DELETE api/damagereport/{damagereport_id}

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

damagereport_id   integer   

The ID of the damagereport. Example: 205

damagereport   integer   

The ID of the damage report to delete. Example: 1

Create a new damage report.

requires authentication

Validates the request data and creates a new damage report record. Optionally connects contacts and triggers jobs.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/damagereport';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'name' => '"Storm Damage"',
            'module_object_id' => 4,
            'policy_id' => 3,
            'contacts' => [
                'architecto',
            ],
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
    "http://localhost/api/damagereport" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"\\\"Storm Damage\\\"\",
    \"module_object_id\": 4,
    \"policy_id\": 3,
    \"contacts\": [
        \"architecto\"
    ]
}"
const url = new URL(
    "http://localhost/api/damagereport"
);

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

let body = {
    "name": "\"Storm Damage\"",
    "module_object_id": 4,
    "policy_id": 3,
    "contacts": [
        "architecto"
    ]
};

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

Example response (201):


{
    "success": true,
    "message": "damagereport created",
    "data": {
        "data": {
            "id": 1,
            "name": "Storm Damage"
        }
    }
}
 

Request      

POST api/damagereport

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

name   string   

The name of the damage report. Example: "Storm Damage"

module_object_id   integer   

The module object ID. Example: 4

policy_id   integer  optional  

optional The policy ID. Example: 3

contacts   string[]  optional  

optional List of contacts to associate.

DamageTypeModuleProduct

Retrieve a list of all damage type module products or a single damage type module product.

requires authentication

Returns all damage type module products for the current workspace, optionally paginated, or a specific damage type module product with its related module product.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/damagetypemoduleproduct/1';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'query' => [
            'per_page' => '15',
            'page' => '1',
            'with[0]' => 'moduleProduct',
            'paged' => '1',
            'shortresult' => '0',
        ],
        'json' => [
            'per_page' => 16,
            'page' => 16,
            'with' => [
                'moduleProduct',
            ],
            'paged' => true,
            'shortresult' => false,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
    --get "http://localhost/api/damagetypemoduleproduct/1?per_page=15&page=1&with[]=moduleProduct&paged=1&shortresult=" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"per_page\": 16,
    \"page\": 16,
    \"with\": [
        \"moduleProduct\"
    ],
    \"paged\": true,
    \"shortresult\": false
}"
const url = new URL(
    "http://localhost/api/damagetypemoduleproduct/1"
);

const params = {
    "per_page": "15",
    "page": "1",
    "with[0]": "moduleProduct",
    "paged": "1",
    "shortresult": "0",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

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

let body = {
    "per_page": 16,
    "page": 16,
    "with": [
        "moduleProduct"
    ],
    "paged": true,
    "shortresult": false
};

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

Example response (200):


{
    "id": 1,
    "type": "fire",
    "module_product_id": 2,
    "moduleProduct": {}
}
 

Request      

GET api/damagetypemoduleproduct/{damagetypemoduleproduct?}

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

damagetypemoduleproduct   integer  optional  

optional The ID of the damage type module product. Example: 1

Query Parameters

per_page   integer  optional  

optional Number of results per page. Example: 15

page   integer  optional  

optional Page number. Example: 1

with   string[]  optional  

optional Relations to load.

paged   boolean  optional  

optional Whether to paginate results. Example: true

shortresult   boolean  optional  

optional If true, returns only basic data. Example: false

Body Parameters

per_page   integer  optional  

Example: 16

page   integer  optional  

Example: 16

with   string[]  optional  
Must be one of:
  • moduleProduct
paged   boolean  optional  

Example: true

shortresult   boolean  optional  

Example: false

Update an existing damage type module product.

requires authentication

Validates the request data and updates the specified damage type module product record.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/damagetypemoduleproduct/1';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'type' => '"water"',
            'module_product_id' => 3,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
    "http://localhost/api/damagetypemoduleproduct/1" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"type\": \"\\\"water\\\"\",
    \"module_product_id\": 3
}"
const url = new URL(
    "http://localhost/api/damagetypemoduleproduct/1"
);

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

let body = {
    "type": "\"water\"",
    "module_product_id": 3
};

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

Example response (200):


{
    "success": true,
    "message": "damage type module product updated",
    "data": {
        "data": {
            "id": 1,
            "type": "water",
            "module_product_id": 3
        }
    }
}
 

Request      

POST api/damagetypemoduleproduct/{damagetypemoduleproduct_id}

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

damagetypemoduleproduct_id   integer   

The ID of the damagetypemoduleproduct. Example: 1

damagetypemoduleproduct   integer   

The ID of the damage type module product to update. Example: 1

Body Parameters

type   string  optional  

optional The new type of damage. Example: "water"

module_product_id   integer  optional  

optional The new module product ID. Example: 3

Delete a damage type module product.

requires authentication

Removes the specified damage type module product from the database.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/damagetypemoduleproduct/1';
$response = $client->delete(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request DELETE \
    "http://localhost/api/damagetypemoduleproduct/1" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/damagetypemoduleproduct/1"
);

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

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

Example response (200):


{
    "success": true,
    "message": "damage type module product deleted"
}
 

Request      

DELETE api/damagetypemoduleproduct/{damagetypemoduleproduct_id}

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

damagetypemoduleproduct_id   integer   

The ID of the damagetypemoduleproduct. Example: 1

damagetypemoduleproduct   integer   

The ID of the damage type module product to delete. Example: 1

Create a new damage type module product.

requires authentication

Validates the request data and creates a new damage type module product record.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/damagetypemoduleproduct';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'type' => '"fire"',
            'module_product_id' => 2,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
    "http://localhost/api/damagetypemoduleproduct" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"type\": \"\\\"fire\\\"\",
    \"module_product_id\": 2
}"
const url = new URL(
    "http://localhost/api/damagetypemoduleproduct"
);

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

let body = {
    "type": "\"fire\"",
    "module_product_id": 2
};

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

Example response (201):


{
    "success": true,
    "message": "damage type module product created",
    "data": {
        "data": {
            "id": 1,
            "type": "fire",
            "module_product_id": 2
        }
    }
}
 

Request      

POST api/damagetypemoduleproduct

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

type   string   

The type of damage. Example: "fire"

module_product_id   integer   

The module product ID. Example: 2

Dashboard

Get dashboard data for the authenticated user.

requires authentication

Returns dashboard statistics and information for the current user, including leads, buildings, policies, and more.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/dashboard';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
    --get "http://localhost/api/dashboard" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/dashboard"
);

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

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

Example response (200):


{
    "success": true,
    "message": "Dashboard data",
    "data": {
        "last_login": "2024-06-01 12:00:00",
        "leads": 10,
        "leadVolume": 500000,
        "pendingLeads": 2,
        "buildingsCount": 5,
        "insuranceSum": 1200000,
        "policyCount": 4,
        "policyTotal": 3500,
        "openDamages": 1,
        "openTasks": 0,
        "buildings": [],
        "careByAic": 3,
        "notCareByAic": 2,
        "objectGustavo": 4,
        "objectNotGustavo": 1,
        "gustavoPercentage": 80,
        "notGustavoPercentage": 20,
        "ownerTypeStwegCount": 2,
        "ownerTypeStwegPercentage": 40,
        "ownerTypeMegCount": 1,
        "ownerTypeMegPercentage": 20,
        "ownerTypeInvestorCount": 1,
        "ownerTypeInvestorPercentage": 20,
        "ownerTypeErbengemeinschaftCount": 1,
        "ownerTypeErbengemeinschaftPercentage": 20,
        "objectTypeWohnenCount": 3,
        "objectTypeWohnenPercentage": 60,
        "objectTypeGewerbeCount": 2,
        "objectTypeGewerbePercentage": 40,
        "groupLocations": []
    }
}
 

Example response (400):


{
    "success": false,
    "message": "No data found"
}
 

Request      

GET api/dashboard

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

Declaration

Retrieve a list of declarations or a single declaration.

requires authentication

Returns all declarations for the current workspace, optionally paginated, or a specific declaration with its relations.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/declaration/1';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'query' => [
            'per_page' => '15',
            'page' => '1',
            'with[0]' => 'formLead',
            'with[1]' => 'file',
            'paged' => '1',
            'shortresult' => '0',
        ],
        'json' => [
            'per_page' => 16,
            'page' => 16,
            'with' => [
                'file',
            ],
            'paged' => true,
            'shortresult' => false,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
    --get "http://localhost/api/declaration/1?per_page=15&page=1&with[]=formLead&with[]=file&paged=1&shortresult=" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"per_page\": 16,
    \"page\": 16,
    \"with\": [
        \"file\"
    ],
    \"paged\": true,
    \"shortresult\": false
}"
const url = new URL(
    "http://localhost/api/declaration/1"
);

const params = {
    "per_page": "15",
    "page": "1",
    "with[0]": "formLead",
    "with[1]": "file",
    "paged": "1",
    "shortresult": "0",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

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

let body = {
    "per_page": 16,
    "page": 16,
    "with": [
        "file"
    ],
    "paged": true,
    "shortresult": false
};

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

Example response (200):


{
    "id": 1,
    "form_lead_id": 2,
    "file_id": 3,
    "bkp1": 1000,
    "bkp2": 2000,
    "bkp3": 3000,
    "bkp4": 4000,
    "preparatory_work": 500,
    "operational_equipment": 600,
    "damages": "Some damages",
    "account_holder": "John Doe",
    "account_bank": "Bank AG",
    "iban": "CH9300762011623852957",
    "filler_name": "John",
    "filler_firstname": "Doe",
    "filler_email": "john.doe@example.com",
    "filler_phone": "+41791234567",
    "formLead": {},
    "file": {}
}
 

Request      

GET api/declaration/{declaration?}

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

declaration   integer  optional  

optional The ID of the declaration. Example: 1

Query Parameters

per_page   integer  optional  

optional Number of results per page. Example: 15

page   integer  optional  

optional Page number. Example: 1

with   string[]  optional  

optional Relations to load.

paged   boolean  optional  

optional Whether to paginate results. Example: true

shortresult   boolean  optional  

optional If true, returns only basic data. Example: false

Body Parameters

per_page   integer  optional  

Example: 16

page   integer  optional  

Example: 16

with   string[]  optional  
Must be one of:
  • formLead
  • file
paged   boolean  optional  

Example: true

shortresult   boolean  optional  

Example: false

Update an existing declaration.

requires authentication

Validates the request data and updates the specified declaration record. Optionally sends an email to the insurer if requested.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/declaration/1';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'form_lead_id' => 2,
            'file_id' => 3,
            'bkp1' => 1000.0,
            'bkp2' => 2000.0,
            'bkp3' => 3000.0,
            'bkp4' => 4000.0,
            'preparatory_work' => 500.0,
            'operational_equipment' => 600.0,
            'damages' => '"Some damages"',
            'account_holder' => '"John Doe"',
            'account_bank' => '"Bank AG"',
            'iban' => '"CH9300762011623852957"',
            'filler_name' => '"John"',
            'filler_firstname' => '"Doe"',
            'filler_email' => '"john.doe@example.com"',
            'filler_phone' => '"+41791234567"',
            'send_email' => true,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
    "http://localhost/api/declaration/1" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"form_lead_id\": 2,
    \"file_id\": 3,
    \"bkp1\": 1000,
    \"bkp2\": 2000,
    \"bkp3\": 3000,
    \"bkp4\": 4000,
    \"preparatory_work\": 500,
    \"operational_equipment\": 600,
    \"damages\": \"\\\"Some damages\\\"\",
    \"account_holder\": \"\\\"John Doe\\\"\",
    \"account_bank\": \"\\\"Bank AG\\\"\",
    \"iban\": \"\\\"CH9300762011623852957\\\"\",
    \"filler_name\": \"\\\"John\\\"\",
    \"filler_firstname\": \"\\\"Doe\\\"\",
    \"filler_email\": \"\\\"john.doe@example.com\\\"\",
    \"filler_phone\": \"\\\"+41791234567\\\"\",
    \"send_email\": true
}"
const url = new URL(
    "http://localhost/api/declaration/1"
);

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

let body = {
    "form_lead_id": 2,
    "file_id": 3,
    "bkp1": 1000,
    "bkp2": 2000,
    "bkp3": 3000,
    "bkp4": 4000,
    "preparatory_work": 500,
    "operational_equipment": 600,
    "damages": "\"Some damages\"",
    "account_holder": "\"John Doe\"",
    "account_bank": "\"Bank AG\"",
    "iban": "\"CH9300762011623852957\"",
    "filler_name": "\"John\"",
    "filler_firstname": "\"Doe\"",
    "filler_email": "\"john.doe@example.com\"",
    "filler_phone": "\"+41791234567\"",
    "send_email": true
};

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

Example response (200):


{
  "success": true,
  "message": "declaration updated",
  "data": {
    "data": {
      "id": 1,
      "form_lead_id": 2,
      // ...other fields...
    }
  }
}
 

Request      

POST api/declaration/{declaration_id}

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

declaration_id   integer   

The ID of the declaration. Example: 1

declaration   integer   

The ID of the declaration to update. Example: 1

Body Parameters

form_lead_id   integer  optional  

optional The form lead ID. Example: 2

file_id   integer  optional  

optional The file ID. Example: 3

bkp1   number  optional  

optional BKP1 value. Example: 1000

bkp2   number  optional  

optional BKP2 value. Example: 2000

bkp3   number  optional  

optional BKP3 value. Example: 3000

bkp4   number  optional  

optional BKP4 value. Example: 4000

preparatory_work   number  optional  

optional Preparatory work value. Example: 500

operational_equipment   number  optional  

optional Operational equipment value. Example: 600

damages   string  optional  

optional Description of damages. Example: "Some damages"

account_holder   string  optional  

optional Account holder name. Example: "John Doe"

account_bank   string  optional  

optional Account bank name. Example: "Bank AG"

iban   string  optional  

optional IBAN. Example: "CH9300762011623852957"

filler_name   string  optional  

optional Filler name. Example: "John"

filler_firstname   string  optional  

optional Filler firstname. Example: "Doe"

filler_email   string  optional  

optional Filler email. Example: "john.doe@example.com"

filler_phone   string  optional  

optional Filler phone. Example: "+41791234567"

send_email   boolean  optional  

optional If true, sends an email to the insurer. Example: true

Delete a declaration.

requires authentication

Removes the specified declaration from the database.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/declaration/1';
$response = $client->delete(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request DELETE \
    "http://localhost/api/declaration/1" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/declaration/1"
);

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

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

Example response (200):


{
    "success": true,
    "message": "declaration deleted"
}
 

Request      

DELETE api/declaration/{declaration_id}

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

declaration_id   integer   

The ID of the declaration. Example: 1

declaration   integer   

The ID of the declaration to delete. Example: 1

Create a new declaration.

requires authentication

Validates the request data and creates a new declaration record. Optionally sends an email to the insurer if requested.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/declaration';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'form_lead_id' => 2,
            'file_id' => 3,
            'bkp1' => 1000.0,
            'bkp2' => 2000.0,
            'bkp3' => 3000.0,
            'bkp4' => 4000.0,
            'preparatory_work' => 500.0,
            'operational_equipment' => 600.0,
            'damages' => '"Some damages"',
            'account_holder' => '"John Doe"',
            'account_bank' => '"Bank AG"',
            'iban' => '"CH9300762011623852957"',
            'filler_name' => '"John"',
            'filler_firstname' => '"Doe"',
            'filler_email' => '"john.doe@example.com"',
            'filler_phone' => '"+41791234567"',
            'send_email' => true,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
    "http://localhost/api/declaration" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"form_lead_id\": 2,
    \"file_id\": 3,
    \"bkp1\": 1000,
    \"bkp2\": 2000,
    \"bkp3\": 3000,
    \"bkp4\": 4000,
    \"preparatory_work\": 500,
    \"operational_equipment\": 600,
    \"damages\": \"\\\"Some damages\\\"\",
    \"account_holder\": \"\\\"John Doe\\\"\",
    \"account_bank\": \"\\\"Bank AG\\\"\",
    \"iban\": \"\\\"CH9300762011623852957\\\"\",
    \"filler_name\": \"\\\"John\\\"\",
    \"filler_firstname\": \"\\\"Doe\\\"\",
    \"filler_email\": \"\\\"john.doe@example.com\\\"\",
    \"filler_phone\": \"\\\"+41791234567\\\"\",
    \"send_email\": true
}"
const url = new URL(
    "http://localhost/api/declaration"
);

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

let body = {
    "form_lead_id": 2,
    "file_id": 3,
    "bkp1": 1000,
    "bkp2": 2000,
    "bkp3": 3000,
    "bkp4": 4000,
    "preparatory_work": 500,
    "operational_equipment": 600,
    "damages": "\"Some damages\"",
    "account_holder": "\"John Doe\"",
    "account_bank": "\"Bank AG\"",
    "iban": "\"CH9300762011623852957\"",
    "filler_name": "\"John\"",
    "filler_firstname": "\"Doe\"",
    "filler_email": "\"john.doe@example.com\"",
    "filler_phone": "\"+41791234567\"",
    "send_email": true
};

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

Example response (201):


{
  "success": true,
  "message": "declaration created",
  "data": {
    "data": {
      "id": 1,
      "form_lead_id": 2,
      // ...other fields...
    }
  }
}
 

Request      

POST api/declaration

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

form_lead_id   integer   

The form lead ID. Example: 2

file_id   integer  optional  

optional The file ID. Example: 3

bkp1   number  optional  

optional BKP1 value. Example: 1000

bkp2   number  optional  

optional BKP2 value. Example: 2000

bkp3   number  optional  

optional BKP3 value. Example: 3000

bkp4   number  optional  

optional BKP4 value. Example: 4000

preparatory_work   number  optional  

optional Preparatory work value. Example: 500

operational_equipment   number  optional  

optional Operational equipment value. Example: 600

damages   string  optional  

optional Description of damages. Example: "Some damages"

account_holder   string  optional  

optional Account holder name. Example: "John Doe"

account_bank   string  optional  

optional Account bank name. Example: "Bank AG"

iban   string  optional  

optional IBAN. Example: "CH9300762011623852957"

filler_name   string   

Filler name. Example: "John"

filler_firstname   string   

Filler firstname. Example: "Doe"

filler_email   string   

Filler email. Example: "john.doe@example.com"

filler_phone   string   

Filler phone. Example: "+41791234567"

send_email   boolean  optional  

optional If true, sends an email to the insurer. Example: true

Endpoints

Edit Form Lead

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/formlead/26';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
    "http://localhost/api/formlead/26" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
const url = new URL(
    "http://localhost/api/formlead/26"
);

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

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

Request      

POST api/formlead/{formlead_id}

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

formlead_id   integer   

The ID of the formlead. Example: 26

Body Parameters

template_id   string  optional  

The id of an existing record in the templates table.

module_object_id   string  optional  

The id of an existing record in the module_objects table.

workspace_insurer_product_id   string  optional  

The id of an existing record in the workspace_insurer_products table.

module_workspace_id   string  optional  

The id of an existing record in the module_workspaces table.

Get Form Lead Construction Change

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/formlead/26/constructionchange/16';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
    --get "http://localhost/api/formlead/26/constructionchange/16" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/formlead/26/constructionchange/16"
);

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

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

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: http://localhost:3000
access-control-allow-credentials: true
 

{
    "message": "Unauthenticated."
}
 

Request      

GET api/formlead/{formlead_id}/constructionchange/{constructionChange?}

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

formlead_id   integer   

The ID of the formlead. Example: 26

constructionChange   integer  optional  

Example: 16

Create Form Lead Construction Change

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/formlead/26/constructionchange';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
    "http://localhost/api/formlead/26/constructionchange" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/formlead/26/constructionchange"
);

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

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

Request      

POST api/formlead/{formlead_id}/constructionchange

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

formlead_id   integer   

The ID of the formlead. Example: 26

Edit Form Lead Construction Change

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/formlead/26/constructionchange/16';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
    "http://localhost/api/formlead/26/constructionchange/16" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/formlead/26/constructionchange/16"
);

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

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

Request      

POST api/formlead/{formlead_id}/constructionchange/{constructionChange_id}

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

formlead_id   integer   

The ID of the formlead. Example: 26

constructionChange_id   integer   

The ID of the constructionChange. Example: 16

Delete Form Lead Construction Change

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/formlead/26/constructionchange/16';
$response = $client->delete(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request DELETE \
    "http://localhost/api/formlead/26/constructionchange/16" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/formlead/26/constructionchange/16"
);

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

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

Request      

DELETE api/formlead/{formlead_id}/constructionchange/{constructionChange_id}

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

formlead_id   integer   

The ID of the formlead. Example: 26

constructionChange_id   integer   

The ID of the constructionChange. Example: 16

extend a policy with invoice and send invoice to invoiceReceiver

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/policy/28/extension';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
    "http://localhost/api/policy/28/extension" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/policy/28/extension"
);

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

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

Request      

POST api/policy/{policy_id}/extension

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

policy_id   integer   

The ID of the policy. Example: 28

GET api/contact/{contact?}/listing

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/contact/1/listing';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
    --get "http://localhost/api/contact/1/listing" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/contact/1/listing"
);

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

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

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: http://localhost:3000
access-control-allow-credentials: true
 

{
    "message": "Unauthenticated."
}
 

Request      

GET api/contact/{contact?}/listing

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

contact   integer  optional  

Example: 1

GET api/login

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/login';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
    --get "http://localhost/api/login" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/login"
);

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

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

Example response (200):

Show headers
cache-control: no-cache, private
content-type: application/json
x-ratelimit-limit: 90
x-ratelimit-remaining: 89
access-control-allow-origin: http://localhost:3000
access-control-allow-credentials: true
 

{
    "status": "false",
    "message": "please login"
}
 

Request      

GET api/login

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

File

Create a new file or folder.

requires authentication

Validates and creates a new file or folder. Optionally links to form lead, user, or another model.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/file';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'multipart/form-data',
            'Accept' => 'application/json',
        ],
        'multipart' => [
            [
                'name' => 'parent_id',
                'contents' => '2'
            ],
            [
                'name' => 'name',
                'contents' => '"Document.pdf"'
            ],
            [
                'name' => 'form_lead_id',
                'contents' => '3'
            ],
            [
                'name' => 'user_id',
                'contents' => '4'
            ],
            [
                'name' => 'link_model',
                'contents' => '"Policy"'
            ],
            [
                'name' => 'link_id',
                'contents' => '5'
            ],
            [
                'name' => 'mime',
                'contents' => '"application/pdf"'
            ],
            [
                'name' => 'data',
                'contents' => fopen('/tmp/phpLrTMc4', 'r')
            ],
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
    "http://localhost/api/file" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: multipart/form-data" \
    --header "Accept: application/json" \
    --form "parent_id=2"\
    --form "name="Document.pdf""\
    --form "form_lead_id=3"\
    --form "user_id=4"\
    --form "link_model="Policy""\
    --form "link_id=5"\
    --form "mime="application/pdf""\
    --form "data=@/tmp/phpLrTMc4" 
const url = new URL(
    "http://localhost/api/file"
);

const headers = {
    "Authorization": "Bearer {ACCESS_TOKEN}",
    "Content-Type": "multipart/form-data",
    "Accept": "application/json",
};

const body = new FormData();
body.append('parent_id', '2');
body.append('name', '"Document.pdf"');
body.append('form_lead_id', '3');
body.append('user_id', '4');
body.append('link_model', '"Policy"');
body.append('link_id', '5');
body.append('mime', '"application/pdf"');
body.append('data', document.querySelector('input[name="data"]').files[0]);

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

Example response (201):


{
    "success": true,
    "message": "file created successfully",
    "data": {
        "file_id": 1,
        "uploadCenter_id": 2
    }
}
 

Request      

POST api/file

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: multipart/form-data

Accept      

Example: application/json

Body Parameters

parent_id   integer  optional  

required_unless:mime,folder The parent folder ID. Example: 2

name   string   

The name of the file or folder. Example: "Document.pdf"

data   file  optional  

required_unless:mime,folder The file to upload. Example: /tmp/phpLrTMc4

form_lead_id   integer  optional  

optional The form lead ID. Example: 3

user_id   integer   

The user ID. Example: 4

link_model   string  optional  

optional The model name to link. Example: "Policy"

link_id   integer  optional  

optional The model ID to link. Example: 5

mime   string  optional  

optional The mime type. Example: "application/pdf"

Add a specific user to a file (for upload center).

requires authentication

Grants access to a user for a file in the upload center.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/file/1/user';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'form_lead_id' => 3,
            'user_id' => 4,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
    "http://localhost/api/file/1/user" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"form_lead_id\": 3,
    \"user_id\": 4
}"
const url = new URL(
    "http://localhost/api/file/1/user"
);

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

let body = {
    "form_lead_id": 3,
    "user_id": 4
};

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

Example response (201):


{
    "success": true,
    "message": "user access to file added successfully",
    "data": {
        "uploadCenter_id": 2
    }
}
 

Request      

POST api/file/{file_id}/user

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

file_id   integer   

The ID of the file. Example: 1

file   integer   

The ID of the file. Example: 1

Body Parameters

form_lead_id   integer   

The form lead ID. Example: 3

user_id   integer   

The user ID. Example: 4

Remove a specific user from a file (for upload center).

requires authentication

Revokes access for a user to a file in the upload center.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/file/1/user';
$response = $client->delete(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'form_lead_id' => 3,
            'user_id' => 4,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request DELETE \
    "http://localhost/api/file/1/user" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"form_lead_id\": 3,
    \"user_id\": 4
}"
const url = new URL(
    "http://localhost/api/file/1/user"
);

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

let body = {
    "form_lead_id": 3,
    "user_id": 4
};

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

Example response (200):


{
    "success": true,
    "message": "user access to file removed successfully"
}
 

Example response (400):


{
    "success": false,
    "message": "given user or form lead not found."
}
 

Request      

DELETE api/file/{file_id}/user

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

file_id   integer   

The ID of the file. Example: 1

file   integer   

The ID of the file. Example: 1

Body Parameters

form_lead_id   integer   

The form lead ID. Example: 3

user_id   integer   

The user ID. Example: 4

Retrieve a list of files or a single file.

requires authentication

Returns all folders with their content, or a specific file with its users and folder content.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/file/1';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
    --get "http://localhost/api/file/1" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/file/1"
);

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

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

Example response (200):


{
    "id": 1,
    "name": "Document.pdf",
    "mime": "application/pdf",
    "users": [],
    "folderContent": []
}
 

Request      

GET api/file/{file?}

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

file   integer  optional  

optional The ID of the file. Example: 1

Update file name or parent folder.

requires authentication

Updates the name or parent folder of the specified file.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/file/1';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'parent_id' => 2,
            'name' => '"UpdatedDocument.pdf"',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
    "http://localhost/api/file/1" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"parent_id\": 2,
    \"name\": \"\\\"UpdatedDocument.pdf\\\"\"
}"
const url = new URL(
    "http://localhost/api/file/1"
);

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

let body = {
    "parent_id": 2,
    "name": "\"UpdatedDocument.pdf\""
};

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

Example response (200):


{
    "success": true,
    "message": "file updated successfully"
}
 

Request      

POST api/file/{file_id}

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

file_id   integer   

The ID of the file. Example: 1

file   integer   

The ID of the file to update. Example: 1

Body Parameters

parent_id   integer  optional  

optional The new parent folder ID. Example: 2

name   string  optional  

optional The new name of the file. Example: "UpdatedDocument.pdf"

Delete a file.

requires authentication

Deletes the specified file from the database.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/file/1';
$response = $client->delete(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request DELETE \
    "http://localhost/api/file/1" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/file/1"
);

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

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

Example response (200):


{
    "success": true,
    "message": "file deleted successfully"
}
 

Request      

DELETE api/file/{file_id}

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

file_id   integer   

The ID of the file. Example: 1

file   integer   

The ID of the file to delete. Example: 1

Download a file.

requires authentication

Downloads the specified file. Returns an error if the file is a folder. For S3 storage, returns a temporary download link.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/file/1/download';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
    --get "http://localhost/api/file/1/download" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/file/1/download"
);

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

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

Example response (200):


File download stream or redirect.
 

Example response (400):


{
    "success": false,
    "message": "downloading folder is not possible"
}
 

Request      

GET api/file/{file?}/download

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

file   integer   

The ID of the file to download. Example: 1

requires authentication

Returns a temporary download link for the specified file. Only available for S3 storage.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/file/1/link';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
    --get "http://localhost/api/file/1/link" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/file/1/link"
);

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

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

Example response (200):


{
    "success": true,
    "message": "download link is valid for 30 minutes.",
    "data": {
        "link": "https://s3.amazonaws.com/bucket/file.pdf?..."
    }
}
 

Example response (400):


{
    "success": false,
    "message": "creating download link for a folder is not possible"
}
 

Example response (400):


{
    "success": false,
    "message": "creating download link for local storage is not possible"
}
 

requires authentication

Attaches a model (by type and ID) to the specified file.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/file/1/link';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'link_model' => '"Policy"',
            'link_id' => 5,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
    "http://localhost/api/file/1/link" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"link_model\": \"\\\"Policy\\\"\",
    \"link_id\": 5
}"
const url = new URL(
    "http://localhost/api/file/1/link"
);

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

let body = {
    "link_model": "\"Policy\"",
    "link_id": 5
};

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

Example response (200):


{
    "success": true,
    "message": "file linked successfully"
}
 

Example response (400):


{
    "success": false,
    "message": "could not attach file to model: ..."
}
 

FormHint

Retrieve form hints for a template or a single form hint.

Returns all form hints for the specified template, or a specific form hint.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/template/1/formhint/2';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
    --get "http://localhost/api/template/1/formhint/2" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/template/1/formhint/2"
);

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

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

Example response (200):


[
    {
        "id": 2,
        "template_id": 1,
        "name": "hint_name",
        "content": "This is a hint.",
        "label": "Hint Label"
    }
]
 

Example response (200):


{
    "id": 2,
    "template_id": 1,
    "name": "hint_name",
    "content": "This is a hint.",
    "label": "Hint Label"
}
 

Request      

GET api/template/{template_id}/formhint/{formhint?}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

template_id   integer   

The ID of the template. Example: 1

formhint   integer  optional  

optional The ID of the form hint. Example: 2

template   integer   

The ID of the template. Example: 1

Create a new form hint for a template.

requires authentication

Validates the request data and creates a new form hint for the specified template.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/template/1/formhint';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'name' => '"hint_name"',
            'content' => '"This is a hint."',
            'label' => '"Hint Label"',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
    "http://localhost/api/template/1/formhint" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"\\\"hint_name\\\"\",
    \"content\": \"\\\"This is a hint.\\\"\",
    \"label\": \"\\\"Hint Label\\\"\"
}"
const url = new URL(
    "http://localhost/api/template/1/formhint"
);

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

let body = {
    "name": "\"hint_name\"",
    "content": "\"This is a hint.\"",
    "label": "\"Hint Label\""
};

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

Example response (201):


{
    "success": true,
    "message": "form hint created successfully",
    "data": {
        "id": 2
    }
}
 

Request      

POST api/template/{template_id}/formhint

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

template_id   integer   

The ID of the template. Example: 1

template   integer   

The ID of the template. Example: 1

Body Parameters

name   string   

The name of the form hint. Example: "hint_name"

content   string   

The content of the form hint. Example: "This is a hint."

label   string  optional  

optional The label for the form hint. Example: "Hint Label"

Update an existing form hint.

requires authentication

Validates the request data and updates the specified form hint.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/template/1/formhint/1';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'name' => '"updated_hint"',
            'content' => '"Updated hint content."',
            'label' => '"Updated Label"',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
    "http://localhost/api/template/1/formhint/1" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"\\\"updated_hint\\\"\",
    \"content\": \"\\\"Updated hint content.\\\"\",
    \"label\": \"\\\"Updated Label\\\"\"
}"
const url = new URL(
    "http://localhost/api/template/1/formhint/1"
);

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

let body = {
    "name": "\"updated_hint\"",
    "content": "\"Updated hint content.\"",
    "label": "\"Updated Label\""
};

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

Example response (200):


{
    "success": true,
    "message": "form hint updated successfully"
}
 

Request      

POST api/template/{template_id}/formhint/{formhint_id}

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

template_id   integer   

The ID of the template. Example: 1

formhint_id   integer   

The ID of the formhint. Example: 1

template   integer   

The ID of the template. Example: 1

formhint   integer   

The ID of the form hint to update. Example: 2

Body Parameters

name   string  optional  

optional The new name of the form hint. Example: "updated_hint"

content   string  optional  

optional The new content of the form hint. Example: "Updated hint content."

label   string  optional  

optional The new label for the form hint. Example: "Updated Label"

Delete a form hint.

requires authentication

Removes the specified form hint from the database.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/template/1/formhint/1';
$response = $client->delete(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request DELETE \
    "http://localhost/api/template/1/formhint/1" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/template/1/formhint/1"
);

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

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

Example response (200):


{
    "success": true,
    "message": "form hint deleted successfully"
}
 

Request      

DELETE api/template/{template_id}/formhint/{formhint_id}

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

template_id   integer   

The ID of the template. Example: 1

formhint_id   integer   

The ID of the formhint. Example: 1

template   integer   

The ID of the template. Example: 1

formhint   integer   

The ID of the form hint to delete. Example: 2

FormLead

Create Form Lead without an account.

Creates a new form lead for a user without an account. Generates contacts, attributes, and logs the creation.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/formlead/withoutaccount';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'template_id' => 2,
            'module_object_id' => 10,
            'workspace_insurer_product_id' => 5,
            'module_workspace_id' => 3,
            'formStartSalutation' => '"Mr"',
            'formStartFirstname' => '"John"',
            'formStartName' => '"Doe"',
            'isFastlane' => true,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
    "http://localhost/api/formlead/withoutaccount" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"template_id\": 2,
    \"module_object_id\": 10,
    \"workspace_insurer_product_id\": 5,
    \"module_workspace_id\": 3,
    \"formStartSalutation\": \"\\\"Mr\\\"\",
    \"formStartFirstname\": \"\\\"John\\\"\",
    \"formStartName\": \"\\\"Doe\\\"\",
    \"isFastlane\": true
}"
const url = new URL(
    "http://localhost/api/formlead/withoutaccount"
);

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

let body = {
    "template_id": 2,
    "module_object_id": 10,
    "workspace_insurer_product_id": 5,
    "module_workspace_id": 3,
    "formStartSalutation": "\"Mr\"",
    "formStartFirstname": "\"John\"",
    "formStartName": "\"Doe\"",
    "isFastlane": true
};

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

Example response (201):


{
    "success": true,
    "message": "form lead created successfully",
    "data": {
        "id": 1
    },
    "refreshToken": true
}
 

Example response (422):


{
    "message": "The given data was invalid.",
    "errors": {
        "template_id": [
            "The template_id field is required."
        ],
        "workspace_insurer_product_id": [
            "The workspace_insurer_product_id field is required."
        ],
        "module_workspace_id": [
            "The module_workspace_id field is required."
        ]
    }
}
 

Request      

POST api/formlead/withoutaccount

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

template_id   integer   

The template ID for the form lead. Example: 2

module_object_id   integer  optional  

optional The module object ID. Example: 10

workspace_insurer_product_id   integer   

The workspace insurer product ID. Example: 5

module_workspace_id   integer   

The module workspace ID. Example: 3

formStartSalutation   string  optional  

required_without:isFastlane Salutation for the contact. Example: "Mr"

formStartFirstname   string  optional  

required_without:isFastlane First name for the contact. Example: "John"

formStartName   string  optional  

required_without:isFastlane Last name for the contact. Example: "Doe"

isFastlane   boolean  optional  

optional Fastlane flag. Example: true

Get Form Lead(s).

requires authentication

Retrieves a single form lead or a paginated list of form leads. Supports filtering, sorting, and eager loading of relations.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/formlead/26';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'per_page' => 15,
            'page' => 1,
            'template_id' => 2,
            'filter' => '"active"',
            'group_id' => 5,
            'with' => [
                'formLeadAttributes',
            ],
            'paged' => true,
            'shortresult' => false,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
    --get "http://localhost/api/formlead/26" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"per_page\": 15,
    \"page\": 1,
    \"template_id\": 2,
    \"filter\": \"\\\"active\\\"\",
    \"group_id\": 5,
    \"with\": [
        \"formLeadAttributes\"
    ],
    \"paged\": true,
    \"shortresult\": false
}"
const url = new URL(
    "http://localhost/api/formlead/26"
);

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

let body = {
    "per_page": 15,
    "page": 1,
    "template_id": 2,
    "filter": "\"active\"",
    "group_id": 5,
    "with": [
        "formLeadAttributes"
    ],
    "paged": true,
    "shortresult": false
};

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

Example response (200):


{
  "id": 1,
  "template_id": 2,
  "workspace_insurer_product_id": 5,
  "formLeadAttributes": {...},
  "contacts": [...],
  "addresses": [...],
  "...other relations..."
}
 

Example response (403):


{
    "success": false,
    "message": "Unauthorized"
}
 

Request      

GET api/formlead/{formlead?}

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

formlead   integer  optional  

Example: 26

Body Parameters

per_page   integer  optional  

optional Number of results per page. Example: 15

page   integer  optional  

optional Page number. Example: 1

template_id   integer  optional  

optional Filter by template ID. Example: 2

filter   string  optional  

optional Filter by status. Allowed: active, inactive, cancelled. Example: "active"

group_id   integer  optional  

optional Filter by group ID. Example: 5

with   string[]  optional  

optional Relations to include. Allowed: formLeadAttributes,workspaceInsurerProduct,moduleObject,constructionChanges,mandates,uploads,insuranceAnnouncements,insuranceOffers,moduleWorkspace,declarations,journal,versions,contacts,addresses.

paged   boolean  optional  

optional Whether to paginate results. Example: true

shortresult   boolean  optional  

optional If true, returns a short result without relations. Example: false

Create a new Form Lead.

requires authentication

Creates a new form lead and assigns the user as formfiller. Also creates contacts and attributes, triggers jobs and logs the creation.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/formlead';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'template_id' => 2,
            'module_object_id' => 10,
            'workspace_insurer_product_id' => 5,
            'user_id' => 7,
            'module_workspace_id' => 3,
            'attributes' => 'architecto',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
    "http://localhost/api/formlead" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"template_id\": 2,
    \"module_object_id\": 10,
    \"workspace_insurer_product_id\": 5,
    \"user_id\": 7,
    \"module_workspace_id\": 3,
    \"attributes\": \"architecto\"
}"
const url = new URL(
    "http://localhost/api/formlead"
);

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

let body = {
    "template_id": 2,
    "module_object_id": 10,
    "workspace_insurer_product_id": 5,
    "user_id": 7,
    "module_workspace_id": 3,
    "attributes": "architecto"
};

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

Example response (201):


{
    "success": true,
    "message": "form lead created successfully",
    "data": {
        "id": 1,
        "lead_user_role_id": 2
    },
    "refreshToken": true
}
 

Example response (422):


{
    "message": "The given data was invalid.",
    "errors": {
        "template_id": [
            "The template_id field is required."
        ],
        "workspace_insurer_product_id": [
            "The workspace_insurer_product_id field is required."
        ],
        "module_workspace_id": [
            "The module_workspace_id field is required."
        ]
    }
}
 

Request      

POST api/formlead

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

template_id   integer   

The template ID for the form lead. Example: 2

module_object_id   integer  optional  

optional The module object ID. Example: 10

workspace_insurer_product_id   integer   

The workspace insurer product ID. Example: 5

user_id   integer  optional  

optional The user ID to assign as formfiller. Example: 7

module_workspace_id   integer   

The module workspace ID. Example: 3

attributes   mixed  optional  

optional Any additional attributes for the form lead (ex "foo", "bar"). Example: architecto

Continue fill up form lead chapter two.

requires authentication

Sends an email to the formfiller to continue chapter two of the form lead and logs the action.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/formlead/26/continue-chapter-two';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
    "http://localhost/api/formlead/26/continue-chapter-two" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/formlead/26/continue-chapter-two"
);

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

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

Example response (200):


{
    "success": true,
    "message": "form lead chapter two continued successfully",
    "refreshToken": true
}
 

Example response (200):


{
    "success": false,
    "message": "form lead chapter two fillup already continued",
    "refreshToken": true
}
 

Request      

POST api/formlead/{formlead_id}/continue-chapter-two

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

formlead_id   integer   

The ID of the formlead. Example: 26

Send form lead zip link by email.

requires authentication

Sends a document package for the form lead to the specified email address.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/formlead/26/sendzipemail';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'file_ids' => [
                1,
                2,
                3,
            ],
            'email' => '"john.doe@example.com"',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
    "http://localhost/api/formlead/26/sendzipemail" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"file_ids\": [
        1,
        2,
        3
    ],
    \"email\": \"\\\"john.doe@example.com\\\"\"
}"
const url = new URL(
    "http://localhost/api/formlead/26/sendzipemail"
);

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

let body = {
    "file_ids": [
        1,
        2,
        3
    ],
    "email": "\"john.doe@example.com\""
};

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

Example response (200):


{
    "success": true,
    "message": "form lead document package queued successfully",
    "refreshToken": true
}
 

Request      

POST api/formlead/{formlead_id}/sendzipemail

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

formlead_id   integer   

The ID of the formlead. Example: 26

Body Parameters

file_ids   string[]  optional  

optional Array of file IDs to include.

email   string  optional  

optional Email address to send the package to. Example: "john.doe@example.com"

Set reaction to Bindexis emails.

requires authentication

Sets the user's reaction to Bindexis emails for the form lead, updates attributes, triggers Asana actions, and logs the action.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/formlead/26/react';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'user_id' => 7,
            'reaction' => '"contactMe"',
            'contact_email' => '"john.doe@example.com"',
            'contact_firstname' => '"John"',
            'contact_name' => '"Doe"',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
    "http://localhost/api/formlead/26/react" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"user_id\": 7,
    \"reaction\": \"\\\"contactMe\\\"\",
    \"contact_email\": \"\\\"john.doe@example.com\\\"\",
    \"contact_firstname\": \"\\\"John\\\"\",
    \"contact_name\": \"\\\"Doe\\\"\"
}"
const url = new URL(
    "http://localhost/api/formlead/26/react"
);

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

let body = {
    "user_id": 7,
    "reaction": "\"contactMe\"",
    "contact_email": "\"john.doe@example.com\"",
    "contact_firstname": "\"John\"",
    "contact_name": "\"Doe\""
};

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

Example response (200):


{
    "success": true,
    "message": "Reaction set successfully",
    "refreshToken": true
}
 

Example response (400):


{
    "success": false,
    "message": "Invalid reaction"
}
 

Request      

POST api/formlead/{formlead_id}/react

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

formlead_id   integer   

The ID of the formlead. Example: 26

Body Parameters

user_id   integer   

The user ID setting the reaction. Example: 7

reaction   string   

The reaction type. Allowed: abortLead, contactMe, remindMe1, remindMe2, remindMe6. Example: "contactMe"

contact_email   string  optional  

optional Contact email address. Example: "john.doe@example.com"

contact_firstname   string  optional  

optional Contact first name. Example: "John"

contact_name   string  optional  

optional Contact last name. Example: "Doe"

Delete Form Lead.

requires authentication

Deletes the specified form lead and logs the deletion.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/formlead/26';
$response = $client->delete(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request DELETE \
    "http://localhost/api/formlead/26" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/formlead/26"
);

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

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

Example response (200):


{
    "success": true,
    "message": "form lead deleted successfully",
    "refreshToken": true
}
 

Request      

DELETE api/formlead/{formlead_id}

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

formlead_id   integer   

The ID of the formlead. Example: 26

FormLeadAttribute

Retrieve form lead attributes or a single attribute.

requires authentication

Returns all attributes for the specified form lead, or a specific attribute with its relations.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/formlead/26/attribute/2';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
    --get "http://localhost/api/formlead/26/attribute/2" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/formlead/26/attribute/2"
);

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

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

Example response (200):


[
    {
        "id": 2,
        "form_lead_id": 1,
        "name": "attribute_name",
        "type": "string",
        "value": "example value",
        "category": "general",
        "parent_id": null,
        "formLead": {},
        "childAttributes": []
    }
]
 

Example response (200):


{
    "id": 2,
    "form_lead_id": 1,
    "name": "attribute_name",
    "type": "string",
    "value": "example value",
    "category": "general",
    "parent_id": null,
    "formLead": {},
    "childAttributes": []
}
 

Request      

GET api/formlead/{formlead_id}/attribute/{attribute?}

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

formlead_id   integer   

The ID of the formlead. Example: 26

attribute   integer  optional  

optional The ID of the attribute. Example: 2

formlead   integer   

The ID of the form lead. Example: 1

Create a new form lead attribute.

requires authentication

Validates the request data and creates a new attribute for the specified form lead. Triggers PDF generation and logs the creation.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/formlead/26/attribute';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'name' => '"attribute_name"',
            'type' => '"string"',
            'value' => '"example value"',
            'category' => '"general"',
            'parent_id' => 2,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
    "http://localhost/api/formlead/26/attribute" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"\\\"attribute_name\\\"\",
    \"type\": \"\\\"string\\\"\",
    \"value\": \"\\\"example value\\\"\",
    \"category\": \"\\\"general\\\"\",
    \"parent_id\": 2
}"
const url = new URL(
    "http://localhost/api/formlead/26/attribute"
);

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

let body = {
    "name": "\"attribute_name\"",
    "type": "\"string\"",
    "value": "\"example value\"",
    "category": "\"general\"",
    "parent_id": 2
};

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

Example response (201):


{
    "success": true,
    "message": "form lead attribute created successfully",
    "data": {
        "id": 3
    }
}
 

Request      

POST api/formlead/{formlead_id}/attribute

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

formlead_id   integer   

The ID of the formlead. Example: 26

formlead   integer   

The ID of the form lead. Example: 1

Body Parameters

name   string   

The name of the attribute. Example: "attribute_name"

type   string   

The type of the attribute. Allowed: bool, string, text, int, float, datetime. Example: "string"

value   string   

The value of the attribute. Example: "example value"

category   string  optional  

optional The category of the attribute. Example: "general"

parent_id   integer  optional  

optional The parent attribute ID. Example: 2

Update an existing form lead attribute.

requires authentication

Validates the request data and updates the specified attribute. Triggers PDF generation and logs the update.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/formlead/26/attribute/2482';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'name' => '"updated_name"',
            'type' => '"int"',
            'value' => '42',
            'category' => '"details"',
            'parent_id' => 3,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
    "http://localhost/api/formlead/26/attribute/2482" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"\\\"updated_name\\\"\",
    \"type\": \"\\\"int\\\"\",
    \"value\": \"42\",
    \"category\": \"\\\"details\\\"\",
    \"parent_id\": 3
}"
const url = new URL(
    "http://localhost/api/formlead/26/attribute/2482"
);

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

let body = {
    "name": "\"updated_name\"",
    "type": "\"int\"",
    "value": "42",
    "category": "\"details\"",
    "parent_id": 3
};

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

Example response (200):


{
    "success": true,
    "message": "form lead attribute updated successfully"
}
 

Request      

POST api/formlead/{formlead_id}/attribute/{attribute_id}

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

formlead_id   integer   

The ID of the formlead. Example: 26

attribute_id   integer   

The ID of the attribute. Example: 2482

formlead   integer   

The ID of the form lead. Example: 1

attribute   integer   

The ID of the attribute to update. Example: 2

Body Parameters

name   string  optional  

optional The new name of the attribute. Example: "updated_name"

type   string  optional  

optional The new type of the attribute. Allowed: bool, string, text, int, float, datetime. Example: "int"

value   mixed   

The new value of the attribute. Example: 42

category   string  optional  

optional The new category of the attribute. Example: "details"

parent_id   integer  optional  

optional The new parent attribute ID. Example: 3

Delete a form lead attribute.

requires authentication

Removes the specified attribute from the database.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/formlead/26/attribute/2482';
$response = $client->delete(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request DELETE \
    "http://localhost/api/formlead/26/attribute/2482" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/formlead/26/attribute/2482"
);

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

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

Example response (200):


{
    "success": true,
    "message": "form lead attribute deleted successfully"
}
 

Request      

DELETE api/formlead/{formlead_id}/attribute/{attribute_id}

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

formlead_id   integer   

The ID of the formlead. Example: 26

attribute_id   integer   

The ID of the attribute. Example: 2482

formlead   integer   

The ID of the form lead. Example: 1

attribute   integer   

The ID of the attribute to delete. Example: 2

FormLeadUser

Retrieve form lead users or a single user.

requires authentication

Returns either a specific user with their roles and contacts, or all user roles for the form lead, optionally paginated and with relations.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/formlead/26/user/2';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'query' => [
            'per_page' => '15',
            'page' => '1',
            'with[0]' => 'user',
            'with[1]' => 'role',
            'with[2]' => 'formLead',
            'paged' => '1',
            'shortresult' => '0',
        ],
        'json' => [
            'per_page' => 16,
            'page' => 16,
            'with' => [
                'user',
            ],
            'paged' => true,
            'shortresult' => false,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
    --get "http://localhost/api/formlead/26/user/2?per_page=15&page=1&with[]=user&with[]=role&with[]=formLead&paged=1&shortresult=" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"per_page\": 16,
    \"page\": 16,
    \"with\": [
        \"user\"
    ],
    \"paged\": true,
    \"shortresult\": false
}"
const url = new URL(
    "http://localhost/api/formlead/26/user/2"
);

const params = {
    "per_page": "15",
    "page": "1",
    "with[0]": "user",
    "with[1]": "role",
    "with[2]": "formLead",
    "paged": "1",
    "shortresult": "0",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

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

let body = {
    "per_page": 16,
    "page": 16,
    "with": [
        "user"
    ],
    "paged": true,
    "shortresult": false
};

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

Example response (200):


{
    "id": 2,
    "user": {},
    "role": {},
    "formLead": {}
}
 

Request      

GET api/formlead/{formLead_id}/user/{user?}

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

formLead_id   integer   

The ID of the formLead. Example: 26

user   integer  optional  

optional The ID of the user. Example: 2

formLead   integer   

The ID of the form lead. Example: 1

Query Parameters

per_page   integer  optional  

optional Number of results per page. Example: 15

page   integer  optional  

optional Page number. Example: 1

with   string[]  optional  

optional Relations to load.

paged   boolean  optional  

optional Whether to paginate results. Example: true

shortresult   boolean  optional  

optional If true, returns only basic data. Example: false

Body Parameters

per_page   integer  optional  

Example: 16

page   integer  optional  

Example: 16

with   string[]  optional  
Must be one of:
  • user
  • role
  • formLead
paged   boolean  optional  

Example: true

shortresult   boolean  optional  

Example: false

Add a user role to a form lead.

requires authentication

Assigns a role to the specified user for the given form lead and logs the action.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/formlead/26/user/1';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'role_id' => 3,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
    "http://localhost/api/formlead/26/user/1" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"role_id\": 3
}"
const url = new URL(
    "http://localhost/api/formlead/26/user/1"
);

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

let body = {
    "role_id": 3
};

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

Example response (201):


{
    "success": true,
    "message": "role for user on form added successfully",
    "data": {
        "id": 5
    }
}
 

Request      

POST api/formlead/{formLead_id}/user/{user_id}

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

formLead_id   integer   

The ID of the formLead. Example: 26

user_id   integer   

The ID of the user. Example: 1

formLead   integer   

The ID of the form lead. Example: 1

user   integer   

The ID of the user. Example: 2

Body Parameters

role_id   integer   

The role ID to assign. Example: 3

Create a guest user for a form lead.

requires authentication

Creates a guest user for the specified form lead, assigns a role, creates a contact, sends an invite email, and logs the action.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/formlead/26/guest';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'email' => '"guest@example.com"',
            'firstname' => '"John"',
            'lastname' => '"Doe"',
            'salutation' => '"M"',
            'role_id' => 3,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
    "http://localhost/api/formlead/26/guest" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"email\": \"\\\"guest@example.com\\\"\",
    \"firstname\": \"\\\"John\\\"\",
    \"lastname\": \"\\\"Doe\\\"\",
    \"salutation\": \"\\\"M\\\"\",
    \"role_id\": 3
}"
const url = new URL(
    "http://localhost/api/formlead/26/guest"
);

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

let body = {
    "email": "\"guest@example.com\"",
    "firstname": "\"John\"",
    "lastname": "\"Doe\"",
    "salutation": "\"M\"",
    "role_id": 3
};

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

Example response (201):


{
    "success": true,
    "message": "guest user for form lead created successfully",
    "data": {
        "user_id": 7,
        "id": 8
    }
}
 

Request      

POST api/formlead/{formLead_id}/guest

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

formLead_id   integer   

The ID of the formLead. Example: 26

formLead   integer   

The ID of the form lead. Example: 1

Body Parameters

email   string   

The email address of the guest user. Example: "guest@example.com"

firstname   string   

First name of the guest user. Example: "John"

lastname   string   

Last name of the guest user. Example: "Doe"

salutation   string   

Salutation (one character). Example: "M"

role_id   integer   

The role ID to assign. Example: 3

Update a guest user for a form lead.

requires authentication

Updates the contact information for the specified guest user and logs the action.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/formlead/26/guest/1';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'email' => '"newguest@example.com"',
            'firstname' => '"Jane"',
            'lastname' => '"Smith"',
            'salutation' => '"F"',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
    "http://localhost/api/formlead/26/guest/1" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"email\": \"\\\"newguest@example.com\\\"\",
    \"firstname\": \"\\\"Jane\\\"\",
    \"lastname\": \"\\\"Smith\\\"\",
    \"salutation\": \"\\\"F\\\"\"
}"
const url = new URL(
    "http://localhost/api/formlead/26/guest/1"
);

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

let body = {
    "email": "\"newguest@example.com\"",
    "firstname": "\"Jane\"",
    "lastname": "\"Smith\"",
    "salutation": "\"F\""
};

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

Example response (200):


{
    "success": true,
    "message": "guest user for form lead updated successfully"
}
 

Request      

POST api/formlead/{formLead_id}/guest/{user_id}

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

formLead_id   integer   

The ID of the formLead. Example: 26

user_id   integer   

The ID of the user. Example: 1

formLead   integer   

The ID of the form lead. Example: 1

user   integer   

The ID of the guest user. Example: 2

Body Parameters

email   string  optional  

optional The new email address. Example: "newguest@example.com"

firstname   string  optional  

optional The new first name. Example: "Jane"

lastname   string  optional  

optional The new last name. Example: "Smith"

salutation   string  optional  

optional The new salutation (one character). Example: "F"

Delete a guest user from a form lead.

requires authentication

Deletes the specified guest user from the form lead and logs the action.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/formlead/26/guest/1';
$response = $client->delete(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request DELETE \
    "http://localhost/api/formlead/26/guest/1" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/formlead/26/guest/1"
);

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

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

Example response (200):


{
    "success": true,
    "message": "guest user deleted successfully"
}
 

Example response (400):


{
    "success": false,
    "message": "user is not a guest user"
}
 

Request      

DELETE api/formlead/{formLead_id}/guest/{user_id}

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

formLead_id   integer   

The ID of the formLead. Example: 26

user_id   integer   

The ID of the user. Example: 1

formLead   integer   

The ID of the form lead. Example: 1

user   integer   

The ID of the guest user. Example: 2

Update a user role for a form lead.

requires authentication

Updates the role for the specified user on the form lead and logs the action.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/formlead/26/role/5';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'role_id' => 4,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
    "http://localhost/api/formlead/26/role/5" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"role_id\": 4
}"
const url = new URL(
    "http://localhost/api/formlead/26/role/5"
);

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

let body = {
    "role_id": 4
};

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

Example response (200):


{
    "success": true,
    "message": "role for form lead updated successfully"
}
 

Request      

POST api/formlead/{formLead_id}/role/{leaduserrole}

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

formLead_id   integer   

The ID of the formLead. Example: 26

leaduserrole   integer   

The ID of the lead user role. Example: 5

formLead   integer   

The ID of the form lead. Example: 1

Body Parameters

role_id   integer   

The new role ID. Example: 4

Delete a user role from a form lead.

requires authentication

Deletes the specified user role from the form lead and logs the action.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/formlead/26/role/5';
$response = $client->delete(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request DELETE \
    "http://localhost/api/formlead/26/role/5" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/formlead/26/role/5"
);

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

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

Example response (200):


{
    "success": true,
    "message": "role for form lead deleted successfully"
}
 

Request      

DELETE api/formlead/{formLead_id}/role/{leaduserrole}

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

formLead_id   integer   

The ID of the formLead. Example: 26

leaduserrole   integer   

The ID of the lead user role. Example: 5

formLead   integer   

The ID of the form lead. Example: 1

Geo

Get geographic coordinates for a given address.

requires authentication

Returns the latitude and longitude for the specified address using the Google Geocoding API.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/geo/coordinates';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'query' => [
            'address' => '"1600 Amphitheatre Parkway, Mountain View, CA"',
        ],
        'json' => [
            'address' => 'architecto',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
    --get "http://localhost/api/geo/coordinates?address=%221600+Amphitheatre+Parkway%2C+Mountain+View%2C+CA%22" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"address\": \"architecto\"
}"
const url = new URL(
    "http://localhost/api/geo/coordinates"
);

const params = {
    "address": ""1600 Amphitheatre Parkway, Mountain View, CA"",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

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

let body = {
    "address": "architecto"
};

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

Example response (200):


{
    "success": true,
    "message": "Coordinates fetched successfully",
    "data": {
        "lat": 37.4224764,
        "lng": -122.0842499
    }
}
 

Example response (400):


{
    "success": false,
    "message": "Failed to fetch coordinates"
}
 

Request      

GET api/geo/coordinates

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

Query Parameters

address   string   

The address to geocode. Example: "1600 Amphitheatre Parkway, Mountain View, CA"

Body Parameters

address   string   

Example: architecto

Group

Retrieve a list of groups or a single group.

requires authentication

Returns all groups for the current workspace, optionally paginated, or a specific group with its relations.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/group/1';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'query' => [
            'per_page' => '15',
            'page' => '1',
            'with[0]' => 'groupAttributes',
            'with[1]' => 'collections',
            'with[2]' => 'files',
            'paged' => '1',
            'shortresult' => '0',
        ],
        'json' => [
            'per_page' => 16,
            'page' => 16,
            'paged' => false,
            'shortresult' => true,
            'with' => [
                'architecto',
            ],
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
    --get "http://localhost/api/group/1?per_page=15&page=1&with[]=groupAttributes&with[]=collections&with[]=files&paged=1&shortresult=" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"per_page\": 16,
    \"page\": 16,
    \"paged\": false,
    \"shortresult\": true,
    \"with\": [
        \"architecto\"
    ]
}"
const url = new URL(
    "http://localhost/api/group/1"
);

const params = {
    "per_page": "15",
    "page": "1",
    "with[0]": "groupAttributes",
    "with[1]": "collections",
    "with[2]": "files",
    "paged": "1",
    "shortresult": "0",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

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

let body = {
    "per_page": 16,
    "page": 16,
    "paged": false,
    "shortresult": true,
    "with": [
        "architecto"
    ]
};

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

Example response (200):


{
    "id": 1,
    "name": "Sample Group",
    "type": "customer",
    "groupAttributes": [],
    "collections": [],
    "files": []
}
 

Request      

GET api/group/{group?}

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

group   integer  optional  

optional The ID of the group. Example: 1

Query Parameters

per_page   integer  optional  

optional Number of results per page. Example: 15

page   integer  optional  

optional Page number. Example: 1

with   string[]  optional  

optional Relations to load.

paged   boolean  optional  

optional Whether to paginate results. Example: true

shortresult   boolean  optional  

optional If true, returns only basic data. Example: false

Body Parameters

per_page   integer  optional  

Example: 16

page   integer  optional  

Example: 16

paged   boolean  optional  

Example: false

shortresult   boolean  optional  

Example: true

with   string[]  optional  

Create a new group.

requires authentication

Validates the request data and creates a new group record, assigns the current user as a member, and sets attributes.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/group';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'multipart/form-data',
            'Accept' => 'application/json',
        ],
        'multipart' => [
            [
                'name' => 'name',
                'contents' => '"Sample Group"'
            ],
            [
                'name' => 'user_id',
                'contents' => '2'
            ],
            [
                'name' => 'type',
                'contents' => '"company", "personal", "stweg", "meg" or "heirs"'
            ],
            [
                'name' => 'logo',
                'contents' => fopen('/tmp/phpY1JXlX', 'r')
            ],
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
    "http://localhost/api/group" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: multipart/form-data" \
    --header "Accept: application/json" \
    --form "name="Sample Group""\
    --form "user_id=2"\
    --form "type="company", "personal", "stweg", "meg" or "heirs""\
    --form "logo=@/tmp/phpY1JXlX" 
const url = new URL(
    "http://localhost/api/group"
);

const headers = {
    "Authorization": "Bearer {ACCESS_TOKEN}",
    "Content-Type": "multipart/form-data",
    "Accept": "application/json",
};

const body = new FormData();
body.append('name', '"Sample Group"');
body.append('user_id', '2');
body.append('type', '"company", "personal", "stweg", "meg" or "heirs"');
body.append('logo', document.querySelector('input[name="logo"]').files[0]);

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

Example response (201):


{
    "success": true,
    "message": "group created successfully",
    "data": {
        "data": {
            "id": 1,
            "name": "Sample Group"
        }
    }
}
 

Request      

POST api/group

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: multipart/form-data

Accept      

Example: application/json

Body Parameters

name   string   

The name of the group. Example: "Sample Group"

user_id   integer  optional  

optional The user ID to assign. Example: 2

type   string   

The type of the group. Example: "company", "personal", "stweg", "meg" or "heirs"

logo   file  optional  

optional The logo image file. Example: /tmp/phpY1JXlX

Update an existing group.

requires authentication

Validates the request data and updates the specified group record and its attributes.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/group/1';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'multipart/form-data',
            'Accept' => 'application/json',
        ],
        'multipart' => [
            [
                'name' => 'name',
                'contents' => '"Updated Group"'
            ],
            [
                'name' => 'type',
                'contents' => '"customer"'
            ],
            [
                'name' => 'logo',
                'contents' => fopen('/tmp/phpyB9YrX', 'r')
            ],
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
    "http://localhost/api/group/1" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: multipart/form-data" \
    --header "Accept: application/json" \
    --form "name="Updated Group""\
    --form "type="customer""\
    --form "logo=@/tmp/phpyB9YrX" 
const url = new URL(
    "http://localhost/api/group/1"
);

const headers = {
    "Authorization": "Bearer {ACCESS_TOKEN}",
    "Content-Type": "multipart/form-data",
    "Accept": "application/json",
};

const body = new FormData();
body.append('name', '"Updated Group"');
body.append('type', '"customer"');
body.append('logo', document.querySelector('input[name="logo"]').files[0]);

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

Example response (200):


{
    "success": true,
    "message": "group updated successfully",
    "data": {
        "data": {
            "id": 1,
            "name": "Updated Group"
        }
    }
}
 

Request      

POST api/group/{group_id}

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: multipart/form-data

Accept      

Example: application/json

URL Parameters

group_id   integer   

The ID of the group. Example: 1

group   integer   

The ID of the group to update. Example: 1

Body Parameters

name   string  optional  

optional The new name of the group. Example: "Updated Group"

type   string  optional  

optional The new type of the group. Example: "customer"

logo   file  optional  

optional The new logo image file. Example: /tmp/phpyB9YrX

Delete a group.

requires authentication

Removes the specified group from the database.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/group/1';
$response = $client->delete(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request DELETE \
    "http://localhost/api/group/1" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/group/1"
);

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

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

Example response (200):


{
    "success": true,
    "message": "group deleted successfully"
}
 

Request      

DELETE api/group/{group_id}

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

group_id   integer   

The ID of the group. Example: 1

group   integer   

The ID of the group to delete. Example: 1

Send a group request to the superadmin of the group.

requires authentication

Creates a group request and sends an email to the superadmin of the group.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/group/1/request';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
    "http://localhost/api/group/1/request" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/group/1/request"
);

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

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

Example response (200):


{
    "success": true,
    "message": "request sent successfully"
}
 

Example response (400):


{
    "success": false,
    "message": "no superadmin found for this group"
}
 

Example response (404):


{
    "success": false,
    "message": "no user found"
}
 

Request      

POST api/group/{group_id}/request

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

group_id   integer   

The ID of the group. Example: 1

group   integer   

The ID of the group. Example: 1

Get contact info statistics for a group.

requires authentication

Returns statistics about active policies, project insurances, building count, insurance sum, and total premium per year for the group.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/group/1/contactInfo';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
    --get "http://localhost/api/group/1/contactInfo" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/group/1/contactInfo"
);

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

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

Example response (200):


{
    "activePolicies": 5,
    "projectInsurances": 2,
    "buildingCount": 10,
    "buildingInsuranceSum": 1000000,
    "totalPremiumPerYear": 50000,
    "damageBurden": 0
}
 

Example response (404):


{
    "success": false,
    "message": "no collection found"
}
 

Request      

GET api/group/{group_id}/contactInfo

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

group_id   integer   

The ID of the group. Example: 1

group   integer   

The ID of the group. Example: 1

Authorize a group request using a code.

requires authentication

Validates the code and completes the group request if correct.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/group/authorize/16';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'code' => '"ABC123"',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
    "http://localhost/api/group/authorize/16" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"code\": \"\\\"ABC123\\\"\"
}"
const url = new URL(
    "http://localhost/api/group/authorize/16"
);

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

let body = {
    "code": "\"ABC123\""
};

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

Example response (200):


{
    "success": true,
    "message": "group request accepted successfully"
}
 

Example response (400):


{
    "success": false,
    "message": "code is incorrect"
}
 

Request      

POST api/group/authorize/{groupRequest_id}

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

groupRequest_id   integer   

The ID of the groupRequest. Example: 16

groupRequest   integer   

The ID of the group request. Example: 1

Body Parameters

code   string   

The authorization code. Example: "ABC123"

Reject a group request and notify the requesting user.

requires authentication

Sends a rejection email to the requesting user and deletes the user.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/group/reject/16';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
    "http://localhost/api/group/reject/16" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/group/reject/16"
);

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

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

Example response (200):


{
    "success": true,
    "message": "groupRequest rejected successfully"
}
 

Example response (404):


{
    "success": false,
    "message": "groupRequest entry not found"
}
 

Request      

POST api/group/reject/{groupRequest_id}

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

groupRequest_id   integer   

The ID of the groupRequest. Example: 16

groupRequest   integer   

The ID of the group request. Example: 1

GroupAttribute

Retrieve group attributes or a single attribute.

requires authentication

Returns all attributes for the specified group, or a specific attribute with its relations.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/group/1/attribute/2';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
    --get "http://localhost/api/group/1/attribute/2" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/group/1/attribute/2"
);

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

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

Example response (200):


[
    {
        "id": 2,
        "group_id": 1,
        "name": "attribute_name",
        "type": "string",
        "value": "example value",
        "category": "general",
        "group": {}
    }
]
 

Example response (200):


{
    "id": 2,
    "group_id": 1,
    "name": "attribute_name",
    "type": "string",
    "value": "example value",
    "category": "general",
    "group": {}
}
 

Request      

GET api/group/{group_id}/attribute/{attribute?}

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

group_id   integer   

The ID of the group. Example: 1

attribute   integer  optional  

optional The ID of the attribute. Example: 2

group   integer   

The ID of the group. Example: 1

Create a new group attribute.

requires authentication

Validates the request data and creates a new attribute for the specified group.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/group/1/attribute';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'name' => '"attribute_name"',
            'type' => '"string"',
            'value' => '"example value"',
            'category' => '"general"',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
    "http://localhost/api/group/1/attribute" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"\\\"attribute_name\\\"\",
    \"type\": \"\\\"string\\\"\",
    \"value\": \"\\\"example value\\\"\",
    \"category\": \"\\\"general\\\"\"
}"
const url = new URL(
    "http://localhost/api/group/1/attribute"
);

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

let body = {
    "name": "\"attribute_name\"",
    "type": "\"string\"",
    "value": "\"example value\"",
    "category": "\"general\""
};

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

Example response (201):


{
    "success": true,
    "message": "group attribute created successfully",
    "data": {
        "id": 3
    }
}
 

Request      

POST api/group/{group_id}/attribute

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

group_id   integer   

The ID of the group. Example: 1

group   integer   

The ID of the group. Example: 1

Body Parameters

name   string   

The name of the attribute. Example: "attribute_name"

type   string   

The type of the attribute. Allowed: bool, string, text, int, float, datetime. Example: "string"

value   string   

The value of the attribute. Example: "example value"

category   string  optional  

optional The category of the attribute. Example: "general"

Update an existing group attribute.

requires authentication

Validates the request data and updates the specified attribute.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/group/1/attribute/1';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'name' => '"updated_name"',
            'type' => '"int"',
            'value' => '42',
            'category' => '"details"',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
    "http://localhost/api/group/1/attribute/1" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"\\\"updated_name\\\"\",
    \"type\": \"\\\"int\\\"\",
    \"value\": \"42\",
    \"category\": \"\\\"details\\\"\"
}"
const url = new URL(
    "http://localhost/api/group/1/attribute/1"
);

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

let body = {
    "name": "\"updated_name\"",
    "type": "\"int\"",
    "value": "42",
    "category": "\"details\""
};

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

Example response (200):


{
    "success": true,
    "message": "group attribute updated successfully"
}
 

Request      

POST api/group/{group_id}/attribute/{attribute_id}

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

group_id   integer   

The ID of the group. Example: 1

attribute_id   integer   

The ID of the attribute. Example: 1

group   integer   

The ID of the group. Example: 1

attribute   integer   

The ID of the attribute to update. Example: 2

Body Parameters

name   string  optional  

optional The new name of the attribute. Example: "updated_name"

type   string  optional  

optional The new type of the attribute. Allowed: bool, string, text, int, float, datetime. Example: "int"

value   mixed   

The new value of the attribute. Example: 42

category   string  optional  

optional The new category of the attribute. Example: "details"

Delete a group attribute.

requires authentication

Removes the specified attribute from the database.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/group/1/attribute/1';
$response = $client->delete(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request DELETE \
    "http://localhost/api/group/1/attribute/1" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/group/1/attribute/1"
);

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

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

Example response (204):

Empty response
 

Request      

DELETE api/group/{group_id}/attribute/{attribute_id}

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

group_id   integer   

The ID of the group. Example: 1

attribute_id   integer   

The ID of the attribute. Example: 1

group   integer   

The ID of the group. Example: 1

attribute   integer   

The ID of the attribute to delete. Example: 2

GuestInvite

Invite a guest user to the upload center for a form lead.

requires authentication

Creates a guest user if not existing, assigns the upload center role, creates a contact, links folders, sends an invite email, and logs the action.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/guest/invite-upload-center';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'form_lead_id' => 1,
            'salutation' => '"Mr"',
            'firstname' => '"John"',
            'lastname' => '"Doe"',
            'email' => '"john.doe@example.com"',
            'folders' => [
                1,
                2,
            ],
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
    "http://localhost/api/guest/invite-upload-center" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"form_lead_id\": 1,
    \"salutation\": \"\\\"Mr\\\"\",
    \"firstname\": \"\\\"John\\\"\",
    \"lastname\": \"\\\"Doe\\\"\",
    \"email\": \"\\\"john.doe@example.com\\\"\",
    \"folders\": [
        1,
        2
    ]
}"
const url = new URL(
    "http://localhost/api/guest/invite-upload-center"
);

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

let body = {
    "form_lead_id": 1,
    "salutation": "\"Mr\"",
    "firstname": "\"John\"",
    "lastname": "\"Doe\"",
    "email": "\"john.doe@example.com\"",
    "folders": [
        1,
        2
    ]
};

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

Example response (201):


{
    "success": true,
    "message": "Guest Invite successfully created",
    "data": {
        "user": {
            "id": 5,
            "email": "john.doe@example.com"
        },
        "id": 10
    }
}
 

Request      

POST api/guest/invite-upload-center

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

form_lead_id   integer   

The ID of the form lead. Example: 1

salutation   string   

Salutation of the invitee. Example: "Mr"

firstname   string   

First name of the invitee. Example: "John"

lastname   string   

Last name of the invitee. Example: "Doe"

email   string   

Email address of the invitee. Example: "john.doe@example.com"

folders   string[]   

List of folder IDs to grant access.

*   integer   

Folder ID. Example: 1

Retrieve a guest user by token.

requires authentication

Returns the guest user and their contacts for the given token.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/guest/"123e4567-e89b-12d3-a456-426614174000"';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
    --get "http://localhost/api/guest/"123e4567-e89b-12d3-a456-426614174000"" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/guest/"123e4567-e89b-12d3-a456-426614174000""
);

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

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

Example response (200):


{
    "success": true,
    "message": "Guest User found",
    "data": {
        "guestUser": {
            "id": 5,
            "email": "john.doe@example.com",
            "contacts": []
        }
    }
}
 

Request      

GET api/guest/{token}

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

token   string   

The token of the guest user. Example: "123e4567-e89b-12d3-a456-426614174000"

GustavoZip

Retrieve GustavoZip locations by zip, city, or area.

Returns a list of GustavoZip locations filtered by zip, city, or area.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/gustavozip';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'query' => [
            'zip' => '"8001"',
            'city' => '"Zurich"',
            'area' => '"Downtown"',
        ],
        'json' => [
            'zip' => 'architecto',
            'city' => 'architecto',
            'area' => 'architecto',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
    --get "http://localhost/api/gustavozip?zip=%228001%22&city=%22Zurich%22&area=%22Downtown%22" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"zip\": \"architecto\",
    \"city\": \"architecto\",
    \"area\": \"architecto\"
}"
const url = new URL(
    "http://localhost/api/gustavozip"
);

const params = {
    "zip": ""8001"",
    "city": ""Zurich"",
    "area": ""Downtown"",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

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

let body = {
    "zip": "architecto",
    "city": "architecto",
    "area": "architecto"
};

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

Example response (200):


[
    {
        "id": 1,
        "zip": "8001",
        "city": "Zurich",
        "region": "Zurich",
        "short": "ZH",
        "country": "Switzerland",
        "gustavo": true,
        "area": "Downtown"
    }
]
 

Request      

GET api/gustavozip

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Query Parameters

zip   string  optional  

required_without:city The zip code to filter by. Example: "8001"

city   string  optional  

required_without:zip The city name to filter by. Example: "Zurich"

area   string  optional  

optional The area name to filter by. Example: "Downtown"

Body Parameters

zip   string  optional  

This field is required when city is not present. Example: architecto

city   string  optional  

This field is required when zip is not present. Example: architecto

area   string  optional  

Example: architecto

Create a new GustavoZip location.

requires authentication

Validates the request data and creates a new GustavoZip location.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/gustavozip';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'zip' => '"8001"',
            'city' => '"Zurich"',
            'region' => '"Zurich"',
            'short' => '"ZH"',
            'country' => '"Switzerland"',
            'gustavo' => true,
            'area' => '"Downtown"',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
    "http://localhost/api/gustavozip" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"zip\": \"\\\"8001\\\"\",
    \"city\": \"\\\"Zurich\\\"\",
    \"region\": \"\\\"Zurich\\\"\",
    \"short\": \"\\\"ZH\\\"\",
    \"country\": \"\\\"Switzerland\\\"\",
    \"gustavo\": true,
    \"area\": \"\\\"Downtown\\\"\"
}"
const url = new URL(
    "http://localhost/api/gustavozip"
);

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

let body = {
    "zip": "\"8001\"",
    "city": "\"Zurich\"",
    "region": "\"Zurich\"",
    "short": "\"ZH\"",
    "country": "\"Switzerland\"",
    "gustavo": true,
    "area": "\"Downtown\""
};

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

Example response (201):


{
    "success": true,
    "message": "location for GUSTAVO created successfully",
    "data": {
        "id": 1
    }
}
 

Request      

POST api/gustavozip

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

zip   string   

The zip code. Example: "8001"

city   string   

The city name. Example: "Zurich"

region   string   

The region name. Example: "Zurich"

short   string   

The short code for the region. Example: "ZH"

country   string   

The country name. Example: "Switzerland"

gustavo   boolean   

Whether the location is a Gustavo location. Example: true

area   string   

The area name. Example: "Downtown"

Update an existing GustavoZip location.

requires authentication

Validates the request data and updates the specified GustavoZip location.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/gustavozip/1';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'zip' => '"8002"',
            'city' => '"Zurich"',
            'region' => '"Zurich"',
            'short' => '"ZH"',
            'country' => '"Switzerland"',
            'gustavo' => false,
            'area' => '"Uptown"',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
    "http://localhost/api/gustavozip/1" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"zip\": \"\\\"8002\\\"\",
    \"city\": \"\\\"Zurich\\\"\",
    \"region\": \"\\\"Zurich\\\"\",
    \"short\": \"\\\"ZH\\\"\",
    \"country\": \"\\\"Switzerland\\\"\",
    \"gustavo\": false,
    \"area\": \"\\\"Uptown\\\"\"
}"
const url = new URL(
    "http://localhost/api/gustavozip/1"
);

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

let body = {
    "zip": "\"8002\"",
    "city": "\"Zurich\"",
    "region": "\"Zurich\"",
    "short": "\"ZH\"",
    "country": "\"Switzerland\"",
    "gustavo": false,
    "area": "\"Uptown\""
};

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

Example response (200):


{
    "success": true,
    "message": "location for GUSTAVO updated successfully"
}
 

Request      

POST api/gustavozip/{city_id}

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

city_id   integer   

The ID of the city. Example: 1

city   integer   

The ID of the GustavoZip location to update. Example: 1

Body Parameters

zip   string  optional  

optional The zip code. Example: "8002"

city   string  optional  

optional The city name. Example: "Zurich"

region   string  optional  

optional The region name. Example: "Zurich"

short   string  optional  

optional The short code for the region. Example: "ZH"

country   string  optional  

optional The country name. Example: "Switzerland"

gustavo   boolean  optional  

optional Whether the location is a Gustavo location. Example: false

area   string  optional  

optional The area name. Example: "Uptown"

Delete a GustavoZip location.

requires authentication

Removes the specified GustavoZip location from the database.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/gustavozip/1';
$response = $client->delete(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request DELETE \
    "http://localhost/api/gustavozip/1" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/gustavozip/1"
);

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

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

Example response (200):


{
    "success": true,
    "message": "location for GUSTAVO deleted successfully"
}
 

Request      

DELETE api/gustavozip/{city_id}

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

city_id   integer   

The ID of the city. Example: 1

city   integer   

The ID of the GustavoZip location to delete. Example: 1

Import

Import properties from a CSV file.

requires authentication

Validates the uploaded CSV file and field mappings, then queues a job to import properties for the specified module category.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/import/properties';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'multipart/form-data',
            'Accept' => 'application/json',
        ],
        'multipart' => [
            [
                'name' => 'module_category_id',
                'contents' => '1'
            ],
            [
                'name' => 'fields[]',
                'contents' => 'architecto'
            ],
            [
                'name' => 'separator',
                'contents' => '";"'
            ],
            [
                'name' => 'file',
                'contents' => fopen('/tmp/phpkITQtr', 'r')
            ],
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
    "http://localhost/api/import/properties" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: multipart/form-data" \
    --header "Accept: application/json" \
    --form "module_category_id=1"\
    --form "fields[]=architecto"\
    --form "separator=";""\
    --form "file=@/tmp/phpkITQtr" 
const url = new URL(
    "http://localhost/api/import/properties"
);

const headers = {
    "Authorization": "Bearer {ACCESS_TOKEN}",
    "Content-Type": "multipart/form-data",
    "Accept": "application/json",
};

const body = new FormData();
body.append('module_category_id', '1');
body.append('fields[]', 'architecto');
body.append('separator', '";"');
body.append('file', document.querySelector('input[name="file"]').files[0]);

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

Example response (201):


{
    "success": true,
    "message": "Property import queued."
}
 

Example response (400):


{
    "success": false,
    "message": "objectName is required."
}
 

Request      

POST api/import/properties

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: multipart/form-data

Accept      

Example: application/json

Body Parameters

file   file   

The CSV file to import. Must be of type csv or txt. Example: /tmp/phpkITQtr

module_category_id   integer   

The ID of the module category. Example: 1

fields   string[]   

List of field mappings.

source   string   

Example: architecto

target   string   

Example: architecto

*   object  optional  
source   string   

The source column name in the CSV. Example: "Name"

target   string   

The target field name in the database. Example: "objectName"

separator   string  optional  

optional The separator used in the CSV file. Default: ",". Example: ";"

InsuranceAnnouncement

Get current coverage for a module object.

requires authentication

Returns benchmark and policy product data for the specified module object.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/insurance/announcement/object/44/coverage';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
    --get "http://localhost/api/insurance/announcement/object/44/coverage" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/insurance/announcement/object/44/coverage"
);

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

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

Example response (200):


{
    "success": true,
    "message": "Object Benchmark and policy",
    "data": {
        "benchmark": {},
        "policy": {}
    }
}
 

Example response (400):


{
    "success": false,
    "message": "Object has no group"
}
 

Example response (400):


{
    "success": false,
    "message": "Object attributes are missing"
}
 

Request      

GET api/insurance/announcement/object/{object_id}/coverage

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

object_id   integer   

The ID of the object. Example: 44

object   integer   

The ID of the module object. Example: 1

Create an insurance announcement for a module object.

requires authentication

Validates the request data and creates an insurance announcement for the specified module object, attaches products, receivers, and files, and sends emails.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/insurance/announcement/object/44';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'module_product_items' => [
                'architecto',
            ],
            'announcementReceivers' => [
                3,
                4,
            ],
            'changeTo' => '"2024-07-01"',
            'changeReason' => '"Renewal"',
            'changeInfo' => '"Some info"',
            'offerDeadline' => '"2024-07-15"',
            'damageDocuments' => [
                10,
                11,
            ],
            'requestDocuments' => [
                'architecto',
            ],
            'announcementDraft' => true,
            'form_lead_id' => 4,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
    "http://localhost/api/insurance/announcement/object/44" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"module_product_items\": [
        \"architecto\"
    ],
    \"announcementReceivers\": [
        3,
        4
    ],
    \"changeTo\": \"\\\"2024-07-01\\\"\",
    \"changeReason\": \"\\\"Renewal\\\"\",
    \"changeInfo\": \"\\\"Some info\\\"\",
    \"offerDeadline\": \"\\\"2024-07-15\\\"\",
    \"damageDocuments\": [
        10,
        11
    ],
    \"requestDocuments\": [
        \"architecto\"
    ],
    \"announcementDraft\": true,
    \"form_lead_id\": 4
}"
const url = new URL(
    "http://localhost/api/insurance/announcement/object/44"
);

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

let body = {
    "module_product_items": [
        "architecto"
    ],
    "announcementReceivers": [
        3,
        4
    ],
    "changeTo": "\"2024-07-01\"",
    "changeReason": "\"Renewal\"",
    "changeInfo": "\"Some info\"",
    "offerDeadline": "\"2024-07-15\"",
    "damageDocuments": [
        10,
        11
    ],
    "requestDocuments": [
        "architecto"
    ],
    "announcementDraft": true,
    "form_lead_id": 4
};

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

Example response (201):


{
    "success": true,
    "message": "Insurance announcement created successfully"
}
 

Request      

POST api/insurance/announcement/object/{object_id}

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

object_id   integer   

The ID of the object. Example: 44

object   integer   

The ID of the module object. Example: 1

Body Parameters

module_product_items   string[]   

List of product items with values.

id   string   

Product items with values. The id of an existing record in the module_product_items table. Example: architecto

value   string   

Example: architecto

approved   string   

Example: architecto

variant   integer   

Example: 16

*   object  optional  
id   integer   

The module product item ID. Example: 2

value   mixed   

The value for the product item. Example: architecto

approved   boolean   

Approval status for the product item. Example: true

variant   integer   

Variant ID for the product item. Example: 1

announcementReceivers   string[]   

List of insurer product user IDs.

changeTo   date   

The date of change. Example: "2024-07-01"

changeReason   string   

The reason for the change. Example: "Renewal"

changeInfo   string  optional  

optional Additional info for the change. Example: "Some info"

offerDeadline   date   

The offer deadline. Example: "2024-07-15"

damageDocuments   string[]  optional  

optional List of file IDs for damage documents.

requestDocuments   string[]  optional  

optional List of request documents.

user   string[]  optional  

The id of an existing record in the insurer_product_users table.

policy   string  optional  

InsurerProductUser IDs. This field is required when requestDocuments is present. The id of an existing record in the policies table.

*   object  optional  
user   string[]  optional  

required_with:requestDocuments List of insurer product user IDs.

policy   integer  optional  

required_with:requestDocuments The policy ID. Example: 5

announcementDraft   boolean  optional  

optional Whether the announcement is a draft. Example: true

form_lead_id   integer  optional  

optional The form lead ID. Example: 4

Retrieve insurance announcements or a single announcement.

requires authentication

Returns all insurance announcements for the current user, optionally paginated, or a specific announcement with its relations.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/insurance/announcement/1';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'query' => [
            'per_page' => '15',
            'page' => '1',
            'with[0]' => 'insurerProductUser.user.contacts',
            'with[1]' => 'insurerProductUser.user.workspace',
            'with[2]' => 'announcementAttributes',
            'with[3]' => 'products',
            'paged' => '1',
            'shortresult' => '0',
        ],
        'json' => [
            'per_page' => 16,
            'page' => 16,
            'with' => [
                'products',
            ],
            'paged' => true,
            'shortresult' => false,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
    --get "http://localhost/api/insurance/announcement/1?per_page=15&page=1&with[]=insurerProductUser.user.contacts&with[]=insurerProductUser.user.workspace&with[]=announcementAttributes&with[]=products&paged=1&shortresult=" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"per_page\": 16,
    \"page\": 16,
    \"with\": [
        \"products\"
    ],
    \"paged\": true,
    \"shortresult\": false
}"
const url = new URL(
    "http://localhost/api/insurance/announcement/1"
);

const params = {
    "per_page": "15",
    "page": "1",
    "with[0]": "insurerProductUser.user.contacts",
    "with[1]": "insurerProductUser.user.workspace",
    "with[2]": "announcementAttributes",
    "with[3]": "products",
    "paged": "1",
    "shortresult": "0",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

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

let body = {
    "per_page": 16,
    "page": 16,
    "with": [
        "products"
    ],
    "paged": true,
    "shortresult": false
};

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

Example response (200):


{
    "id": 1,
    "workspace_insurer_product_id": 2,
    "insurer_product_user_id": 3,
    "form_lead_id": 4,
    "user_id": 5,
    "info": "Some info",
    "announcementAttributes": [],
    "products": []
}
 

Request      

GET api/insurance/announcement/{announcement?}

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

announcement   integer  optional  

optional The ID of the insurance announcement. Example: 1

Query Parameters

per_page   integer  optional  

optional Number of results per page. Example: 15

page   integer  optional  

optional Page number. Example: 1

with   string[]  optional  

optional Relations to load.

paged   boolean  optional  

optional Whether to paginate results. Example: true

shortresult   boolean  optional  

optional If true, returns only basic data. Example: false

Body Parameters

per_page   integer  optional  

Example: 16

page   integer  optional  

Example: 16

with   string[]  optional  
Must be one of:
  • insurerProductUser.user.contacts
  • insurerProductUser.user.workspace
  • announcementAttributes
  • products
paged   boolean  optional  

Example: true

shortresult   boolean  optional  

Example: false

Create one or multiple insurance announcements.

requires authentication

Validates the request data and creates insurance announcements for the specified insurer product users and workspace insurer products.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/insurance/announcement';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'workspace_insurer_products' => 'architecto',
            'workspace_insurer_product_id' => 2,
            'insurer_product_user_ids' => [
                3,
                4,
            ],
            'form_lead_id' => 4,
            'info' => '"Some info"',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
    "http://localhost/api/insurance/announcement" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"workspace_insurer_products\": \"architecto\",
    \"workspace_insurer_product_id\": 2,
    \"insurer_product_user_ids\": [
        3,
        4
    ],
    \"form_lead_id\": 4,
    \"info\": \"\\\"Some info\\\"\"
}"
const url = new URL(
    "http://localhost/api/insurance/announcement"
);

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

let body = {
    "workspace_insurer_products": "architecto",
    "workspace_insurer_product_id": 2,
    "insurer_product_user_ids": [
        3,
        4
    ],
    "form_lead_id": 4,
    "info": "\"Some info\""
};

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

Example response (201):


{
    "success": true,
    "message": "insurance announcements created successfully",
    "data": {
        "ids": "[1,2,3]"
    }
}
 

Example response (400):


{
    "success": false,
    "message": "insurance announcement not created because no insurer product user could be determined"
}
 

Request      

POST api/insurance/announcement

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

workspace_insurer_products   json  optional  

required_without:workspace_insurer_product_id List of workspace insurer products and their insurer product users. Example: architecto

workspace_insurer_product_id   integer  optional  

required_without:workspace_insurer_products The workspace insurer product ID. Example: 2

insurer_product_user_ids   string[]  optional  

required_without:workspace_insurer_products List of insurer product user IDs.

form_lead_id   integer   

The form lead ID. Example: 4

info   string  optional  

optional Additional info for the announcement. Example: "Some info"

Send a draft insurance announcement.

requires authentication

Sends the insurance announcement draft to all receivers and marks it as not a draft.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/insurance/announcement/11/send';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
    "http://localhost/api/insurance/announcement/11/send" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/insurance/announcement/11/send"
);

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

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

Example response (200):


{
    "success": true,
    "message": "Insurance announcement draft sent successfully"
}
 

Example response (400):


{
    "success": false,
    "message": "Insurance announcement is not a draft"
}
 

Request      

POST api/insurance/announcement/{announcement_id}/send

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

announcement_id   integer   

The ID of the announcement. Example: 11

announcement   integer   

The ID of the insurance announcement draft. Example: 1

Update an existing insurance announcement.

requires authentication

Validates the request data and updates the specified insurance announcement.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/insurance/announcement/11';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'workspace_insurer_product_id' => 2,
            'insurer_product_user_id' => 3,
            'form_lead_id' => 4,
            'info' => '"Some info"',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
    "http://localhost/api/insurance/announcement/11" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"workspace_insurer_product_id\": 2,
    \"insurer_product_user_id\": 3,
    \"form_lead_id\": 4,
    \"info\": \"\\\"Some info\\\"\"
}"
const url = new URL(
    "http://localhost/api/insurance/announcement/11"
);

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

let body = {
    "workspace_insurer_product_id": 2,
    "insurer_product_user_id": 3,
    "form_lead_id": 4,
    "info": "\"Some info\""
};

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

Example response (200):


{
    "success": true,
    "message": "insurance announcement updated successfully"
}
 

Request      

POST api/insurance/announcement/{announcement_id}

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

announcement_id   integer   

The ID of the announcement. Example: 11

announcement   integer   

The ID of the insurance announcement to update. Example: 1

Body Parameters

workspace_insurer_product_id   integer  optional  

optional The workspace insurer product ID. Example: 2

insurer_product_user_id   integer  optional  

optional The insurer product user ID. Example: 3

form_lead_id   integer  optional  

optional The form lead ID. Example: 4

info   string  optional  

optional Additional info for the announcement. Example: "Some info"

Delete an insurance announcement.

requires authentication

Removes the specified insurance announcement from the database.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/insurance/announcement/11';
$response = $client->delete(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request DELETE \
    "http://localhost/api/insurance/announcement/11" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/insurance/announcement/11"
);

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

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

Example response (200):


{
    "success": true,
    "message": "insurance announcement deleted successfully"
}
 

Request      

DELETE api/insurance/announcement/{announcement_id}

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

announcement_id   integer   

The ID of the announcement. Example: 11

announcement   integer   

The ID of the insurance announcement to delete. Example: 1

InsuranceCoverGrade

Retrieve insurance cover grades or a single insurance cover grade.

requires authentication

Returns all insurance cover grades for the current user, optionally paginated, or a specific insurance cover grade with its relations.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/insurance/covergrade/1';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'query' => [
            'per_page' => '15',
            'page' => '1',
            'with[0]' => 'workspaceInsurerProduct',
            'with[1]' => 'formLead',
            'with[2]' => 'user',
            'with[3]' => 'insuranceCoverGradeContacts',
            'paged' => '1',
            'shortresult' => '0',
        ],
        'json' => [
            'per_page' => 16,
            'page' => 16,
            'with' => [
                'insuranceCoverGradeContacts',
            ],
            'paged' => true,
            'shortresult' => false,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
    --get "http://localhost/api/insurance/covergrade/1?per_page=15&page=1&with[]=workspaceInsurerProduct&with[]=formLead&with[]=user&with[]=insuranceCoverGradeContacts&paged=1&shortresult=" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"per_page\": 16,
    \"page\": 16,
    \"with\": [
        \"insuranceCoverGradeContacts\"
    ],
    \"paged\": true,
    \"shortresult\": false
}"
const url = new URL(
    "http://localhost/api/insurance/covergrade/1"
);

const params = {
    "per_page": "15",
    "page": "1",
    "with[0]": "workspaceInsurerProduct",
    "with[1]": "formLead",
    "with[2]": "user",
    "with[3]": "insuranceCoverGradeContacts",
    "paged": "1",
    "shortresult": "0",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

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

let body = {
    "per_page": 16,
    "page": 16,
    "with": [
        "insuranceCoverGradeContacts"
    ],
    "paged": true,
    "shortresult": false
};

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

Example response (200):


{
    "id": 1,
    "workspace_insurer_product_id": 2,
    "form_lead_id": 3,
    "user_id": 4,
    "info": "Some info",
    "offer": 100000,
    "construction_start": "2024-07-01",
    "construction_end": "2024-08-01",
    "workspaceInsurerProduct": {},
    "formLead": {},
    "user": {},
    "insuranceCoverGradeContacts": []
}
 

Request      

GET api/insurance/covergrade/{covergrade?}

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

covergrade   integer  optional  

optional The ID of the insurance cover grade. Example: 1

Query Parameters

per_page   integer  optional  

optional Number of results per page. Example: 15

page   integer  optional  

optional Page number. Example: 1

with   string[]  optional  

optional Relations to load.

paged   boolean  optional  

optional Whether to paginate results. Example: true

shortresult   boolean  optional  

optional If true, returns only basic data. Example: false

Body Parameters

per_page   integer  optional  

Example: 16

page   integer  optional  

Example: 16

with   string[]  optional  
Must be one of:
  • workspaceInsurerProduct
  • formLead
  • user
  • insuranceCoverGradeContacts
paged   boolean  optional  

Example: true

shortresult   boolean  optional  

Example: false

Create a new insurance cover grade.

requires authentication

Validates the request data and creates a new insurance cover grade record, logs the creation, and sends emails to insurer product users.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/insurance/covergrade';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'workspace_insurer_product_id' => 2,
            'form_lead_id' => 3,
            'info' => '"Some info"',
            'offer' => 100000.0,
            'construction_start' => '"2024-07-01"',
            'construction_end' => '"2024-08-01"',
            'insurer_product_user_ids' => [
                5,
                6,
            ],
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
    "http://localhost/api/insurance/covergrade" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"workspace_insurer_product_id\": 2,
    \"form_lead_id\": 3,
    \"info\": \"\\\"Some info\\\"\",
    \"offer\": 100000,
    \"construction_start\": \"\\\"2024-07-01\\\"\",
    \"construction_end\": \"\\\"2024-08-01\\\"\",
    \"insurer_product_user_ids\": [
        5,
        6
    ]
}"
const url = new URL(
    "http://localhost/api/insurance/covergrade"
);

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

let body = {
    "workspace_insurer_product_id": 2,
    "form_lead_id": 3,
    "info": "\"Some info\"",
    "offer": 100000,
    "construction_start": "\"2024-07-01\"",
    "construction_end": "\"2024-08-01\"",
    "insurer_product_user_ids": [
        5,
        6
    ]
};

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

Example response (201):


{
    "success": true,
    "message": "insurance cover grade created successfully",
    "data": {
        "id": 1
    }
}
 

Request      

POST api/insurance/covergrade

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

workspace_insurer_product_id   integer   

The workspace insurer product ID. Example: 2

form_lead_id   integer   

The form lead ID. Example: 3

info   string  optional  

optional Additional info for the cover grade. Example: "Some info"

offer   number   

The offer amount. Example: 100000

construction_start   date   

Construction start date (Y-m-d). Example: "2024-07-01"

construction_end   date   

Construction end date (Y-m-d). Example: "2024-08-01"

insurer_product_user_ids   string[]   

List of insurer product user IDs.

Update an existing insurance cover grade.

requires authentication

Validates the request data and updates the specified insurance cover grade record, logs the update.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/insurance/covergrade/10';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'workspace_insurer_product_id' => 2,
            'form_lead_id' => 3,
            'info' => '"Updated info"',
            'offer' => 120000.0,
            'construction_start' => '"2024-07-10"',
            'construction_end' => '"2024-08-10"',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
    "http://localhost/api/insurance/covergrade/10" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"workspace_insurer_product_id\": 2,
    \"form_lead_id\": 3,
    \"info\": \"\\\"Updated info\\\"\",
    \"offer\": 120000,
    \"construction_start\": \"\\\"2024-07-10\\\"\",
    \"construction_end\": \"\\\"2024-08-10\\\"\"
}"
const url = new URL(
    "http://localhost/api/insurance/covergrade/10"
);

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

let body = {
    "workspace_insurer_product_id": 2,
    "form_lead_id": 3,
    "info": "\"Updated info\"",
    "offer": 120000,
    "construction_start": "\"2024-07-10\"",
    "construction_end": "\"2024-08-10\""
};

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

Example response (200):


{
    "success": true,
    "message": "insurance cover grade updated successfully"
}
 

Request      

POST api/insurance/covergrade/{covergrade_id}

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

covergrade_id   integer   

The ID of the covergrade. Example: 10

covergrade   integer   

The ID of the insurance cover grade to update. Example: 1

Body Parameters

workspace_insurer_product_id   integer  optional  

optional The workspace insurer product ID. Example: 2

form_lead_id   integer  optional  

optional The form lead ID. Example: 3

info   string  optional  

optional Additional info for the cover grade. Example: "Updated info"

offer   number  optional  

optional The offer amount. Example: 120000

construction_start   date  optional  

optional Construction start date (Y-m-d). Example: "2024-07-10"

construction_end   date  optional  

optional Construction end date (Y-m-d). Example: "2024-08-10"

Delete an insurance cover grade.

requires authentication

Removes the specified insurance cover grade from the database and logs the deletion.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/insurance/covergrade/10';
$response = $client->delete(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request DELETE \
    "http://localhost/api/insurance/covergrade/10" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/insurance/covergrade/10"
);

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

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

Example response (200):


{
    "success": true,
    "message": "insurance cover grade deleted successfully"
}
 

Request      

DELETE api/insurance/covergrade/{covergrade_id}

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

covergrade_id   integer   

The ID of the covergrade. Example: 10

covergrade   integer   

The ID of the insurance cover grade to delete. Example: 1

InsuranceOffer

Retrieve insurance offers or a single insurance offer.

requires authentication

Returns all insurance offers visible to the current user, optionally paginated, or a specific insurance offer with its relations.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/insurance/offer/1';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'query' => [
            'per_page' => '15',
            'page' => '1',
            'with[0]' => 'workspaceInsurerProduct',
            'with[1]' => 'formLead',
            'with[2]' => 'insuranceOfferAttributes',
            'with[3]' => 'files',
            'with[4]' => 'products',
            'with[5]' => 'user',
            'with[6]' => 'policy',
            'paged' => '1',
            'shortresult' => '0',
        ],
        'json' => [
            'per_page' => 16,
            'page' => 16,
            'with' => [
                'products',
            ],
            'paged' => true,
            'shortresult' => false,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
    --get "http://localhost/api/insurance/offer/1?per_page=15&page=1&with[]=workspaceInsurerProduct&with[]=formLead&with[]=insuranceOfferAttributes&with[]=files&with[]=products&with[]=user&with[]=policy&paged=1&shortresult=" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"per_page\": 16,
    \"page\": 16,
    \"with\": [
        \"products\"
    ],
    \"paged\": true,
    \"shortresult\": false
}"
const url = new URL(
    "http://localhost/api/insurance/offer/1"
);

const params = {
    "per_page": "15",
    "page": "1",
    "with[0]": "workspaceInsurerProduct",
    "with[1]": "formLead",
    "with[2]": "insuranceOfferAttributes",
    "with[3]": "files",
    "with[4]": "products",
    "with[5]": "user",
    "with[6]": "policy",
    "paged": "1",
    "shortresult": "0",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

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

let body = {
    "per_page": 16,
    "page": 16,
    "with": [
        "products"
    ],
    "paged": true,
    "shortresult": false
};

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

Example response (200):


{
    "id": 1,
    "workspace_insurer_product_id": 2,
    "form_lead_id": 3,
    "module_object_id": 4,
    "user_id": 5,
    "insuranceOfferAttributes": [],
    "files": [],
    "products": [],
    "user": {},
    "policy": {}
}
 

Request      

GET api/insurance/offer/{offer?}

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

offer   integer  optional  

optional The ID of the insurance offer. Example: 1

Query Parameters

per_page   integer  optional  

optional Number of results per page. Example: 15

page   integer  optional  

optional Page number. Example: 1

with   string[]  optional  

optional Relations to load.

paged   boolean  optional  

optional Whether to paginate results. Example: true

shortresult   boolean  optional  

optional If true, returns only basic data. Example: false

Body Parameters

per_page   integer  optional  

Example: 16

page   integer  optional  

Example: 16

with   string[]  optional  
Must be one of:
  • workspaceInsurerProduct
  • formLead
  • insuranceOfferAttributes
  • files
  • products
  • user
  • policy
paged   boolean  optional  

Example: true

shortresult   boolean  optional  

Example: false

Create a new insurance offer.

requires authentication

Validates the request data and creates a new insurance offer record, including offer products and attributes.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/insurance/offer';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'workspace_insurer_product_id' => 2,
            'form_lead_id' => 3,
            'module_object_id' => 4,
            'replaceProduct' => false,
            'items' => [
                'architecto',
            ],
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
    "http://localhost/api/insurance/offer" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"workspace_insurer_product_id\": 2,
    \"form_lead_id\": 3,
    \"module_object_id\": 4,
    \"replaceProduct\": false,
    \"items\": [
        \"architecto\"
    ]
}"
const url = new URL(
    "http://localhost/api/insurance/offer"
);

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

let body = {
    "workspace_insurer_product_id": 2,
    "form_lead_id": 3,
    "module_object_id": 4,
    "replaceProduct": false,
    "items": [
        "architecto"
    ]
};

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

Example response (201):


{
    "success": true,
    "message": "insurance offer created successfully",
    "data": {
        "id": 1
    }
}
 

Request      

POST api/insurance/offer

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

workspace_insurer_product_id   integer   

The workspace insurer product ID. Example: 2

form_lead_id   integer  optional  

required_without:module_object_id The form lead ID. Example: 3

module_object_id   integer  optional  

required_without:form_lead_id The module object ID. Example: 4

replaceProduct   boolean  optional  

optional Whether to replace the product. Example: false

items   string[]  optional  

optional List of offer items.

insurer_product_item_id   string   

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

difference   string  optional  

Example: architecto

approved   boolean  optional  

Example: false

*   object  optional  
insurer_product_item_id   integer   

The insurer product item ID. Example: 5

difference   string  optional  

optional Difference description. Example: "Coverage difference"

approved   boolean  optional  

optional Approval status. Example: true

Update an existing insurance offer.

requires authentication

Validates the request data and updates the specified insurance offer record, including offer products and attributes.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/insurance/offer/30';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'workspace_insurer_product_id' => 2,
            'form_lead_id' => 3,
            'module_object_id' => 4,
            'replaceProduct' => false,
            'items' => [
                'architecto',
            ],
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
    "http://localhost/api/insurance/offer/30" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"workspace_insurer_product_id\": 2,
    \"form_lead_id\": 3,
    \"module_object_id\": 4,
    \"replaceProduct\": false,
    \"items\": [
        \"architecto\"
    ]
}"
const url = new URL(
    "http://localhost/api/insurance/offer/30"
);

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

let body = {
    "workspace_insurer_product_id": 2,
    "form_lead_id": 3,
    "module_object_id": 4,
    "replaceProduct": false,
    "items": [
        "architecto"
    ]
};

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

Example response (200):


{
    "success": true,
    "message": "insurance offer updated successfully"
}
 

Request      

POST api/insurance/offer/{offer_id}

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

offer_id   integer   

The ID of the offer. Example: 30

offer   integer   

The ID of the insurance offer to update. Example: 1

Body Parameters

workspace_insurer_product_id   integer  optional  

optional The workspace insurer product ID. Example: 2

form_lead_id   integer  optional  

optional The form lead ID. Example: 3

module_object_id   integer  optional  

optional The module object ID. Example: 4

replaceProduct   boolean  optional  

optional Whether to replace the product. Example: false

items   string[]  optional  

optional List of offer items.

insurer_product_item_id   string   

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

difference   string  optional  

Example: architecto

approved   boolean  optional  

Example: false

*   object  optional  
insurer_product_item_id   integer   

The insurer product item ID. Example: 5

difference   string  optional  

optional Difference description. Example: "Coverage difference"

approved   boolean  optional  

optional Approval status. Example: true

Delete an insurance offer.

requires authentication

Removes the specified insurance offer from the database and logs the deletion.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/insurance/offer/30';
$response = $client->delete(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request DELETE \
    "http://localhost/api/insurance/offer/30" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/insurance/offer/30"
);

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

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

Example response (200):


{
    "success": true,
    "message": "insurance offer deleted successfully"
}
 

Request      

DELETE api/insurance/offer/{offer_id}

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

offer_id   integer   

The ID of the offer. Example: 30

offer   integer   

The ID of the insurance offer to delete. Example: 1

Accept an insurance offer using a token.

Validates the token and user ID, logs the acceptance, and dispatches jobs for further processing.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/insurance/offer/30/accept';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'token' => 'architecto',
            'user_id' => 5,
            'portalAccept' => true,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
    "http://localhost/api/insurance/offer/30/accept" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"token\": \"architecto\",
    \"user_id\": 5,
    \"portalAccept\": true
}"
const url = new URL(
    "http://localhost/api/insurance/offer/30/accept"
);

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

let body = {
    "token": "architecto",
    "user_id": 5,
    "portalAccept": true
};

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

Example response (200):


{
    "success": true,
    "message": "insurance offer accepted successfully"
}
 

Example response (400):


{
    "success": false,
    "message": "offer token mismatch"
}
 

Request      

POST api/insurance/offer/{offer_id}/accept

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

offer_id   integer   

The ID of the offer. Example: 30

offer   integer   

The ID of the insurance offer to accept. Example: 1

Body Parameters

token   string   

The acceptance token. Example: architecto

user_id   integer   

The user ID accepting the offer. Example: 5

portalAccept   boolean  optional  

optional Accept via portal. Example: true

Check acceptance code for insurance offer.

requires authentication

Validates the code and acceptance status, logs the result, and completes the offer acceptance if accepted.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/insurance/offer/30/checkAcceptCode';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'code' => 'architecto',
            'accept' => true,
            'reason' => '"Not interested"',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
    "http://localhost/api/insurance/offer/30/checkAcceptCode" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"code\": \"architecto\",
    \"accept\": true,
    \"reason\": \"\\\"Not interested\\\"\"
}"
const url = new URL(
    "http://localhost/api/insurance/offer/30/checkAcceptCode"
);

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

let body = {
    "code": "architecto",
    "accept": true,
    "reason": "\"Not interested\""
};

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

Example response (200):


{
    "success": true,
    "message": "insurance offer accepted successfully"
}
 

Example response (200):


{
    "success": true,
    "message": "insurance offer declined"
}
 

Example response (400):


{
    "success": false,
    "message": "code is incorrect"
}
 

Request      

POST api/insurance/offer/{offer_id}/checkAcceptCode

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

offer_id   integer   

The ID of the offer. Example: 30

offer   integer   

The ID of the insurance offer. Example: 1

Body Parameters

code   string   

The acceptance code. Example: architecto

accept   boolean   

Whether the offer is accepted. Example: true

reason   string  optional  

required_if:accept,false Reason for declining the offer. Example: "Not interested"

InsuranceOfferFile

Retrieve insurance offer files or a single insurance offer file.

requires authentication

Returns all files for the specified insurance offer, or a specific file with its relations.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/insurance/offer/30/file/2';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
    --get "http://localhost/api/insurance/offer/30/file/2" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/insurance/offer/30/file/2"
);

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

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

Example response (200):


[
    {
        "id": 2,
        "insurance_offer_id": 1,
        "insurer_avb_id": 3,
        "file_id": 4,
        "type": "contract",
        "insuranceOffer": {},
        "insurerAvb": {},
        "file": {}
    }
]
 

Example response (200):


{
    "id": 2,
    "insurance_offer_id": 1,
    "insurer_avb_id": 3,
    "file_id": 4,
    "type": "contract",
    "insuranceOffer": {},
    "insurerAvb": {},
    "file": {}
}
 

Request      

GET api/insurance/offer/{offer_id}/file/{file?}

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

offer_id   integer   

The ID of the offer. Example: 30

file   integer  optional  

optional The ID of the insurance offer file. Example: 2

offer   integer   

The ID of the insurance offer. Example: 1

Create a new insurance offer file.

requires authentication

Validates the request data and creates a new file for the specified insurance offer.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/insurance/offer/30/file';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'insurer_avb_id' => 3,
            'file_id' => 4,
            'type' => '"contract"',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
    "http://localhost/api/insurance/offer/30/file" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"insurer_avb_id\": 3,
    \"file_id\": 4,
    \"type\": \"\\\"contract\\\"\"
}"
const url = new URL(
    "http://localhost/api/insurance/offer/30/file"
);

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

let body = {
    "insurer_avb_id": 3,
    "file_id": 4,
    "type": "\"contract\""
};

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

Example response (201):


{
    "success": true,
    "message": "insurance offer file created successfully",
    "data": {
        "id": 2
    }
}
 

Request      

POST api/insurance/offer/{offer_id}/file

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

offer_id   integer   

The ID of the offer. Example: 30

offer   integer   

The ID of the insurance offer. Example: 1

Body Parameters

insurer_avb_id   integer  optional  

optional The ID of the insurer AVB. Example: 3

file_id   integer   

The ID of the file. Example: 4

type   string   

The type of the file. Allowed: contract, avb, zb. Example: "contract"

Update an existing insurance offer file.

requires authentication

Validates the request data and updates the specified insurance offer file.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/insurance/offer/30/file/1';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'insurer_avb_id' => 3,
            'file_id' => 4,
            'type' => '"avb"',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
    "http://localhost/api/insurance/offer/30/file/1" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"insurer_avb_id\": 3,
    \"file_id\": 4,
    \"type\": \"\\\"avb\\\"\"
}"
const url = new URL(
    "http://localhost/api/insurance/offer/30/file/1"
);

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

let body = {
    "insurer_avb_id": 3,
    "file_id": 4,
    "type": "\"avb\""
};

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

Example response (200):


{
    "success": true,
    "message": "insurance offer file updated successfully"
}
 

Request      

POST api/insurance/offer/{offer_id}/file/{file_id}

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

offer_id   integer   

The ID of the offer. Example: 30

file_id   integer   

The ID of the file. Example: 1

offer   integer   

The ID of the insurance offer. Example: 1

file   integer   

The ID of the insurance offer file to update. Example: 2

Body Parameters

insurer_avb_id   integer  optional  

optional The ID of the insurer AVB. Example: 3

file_id   integer  optional  

optional The ID of the file. Example: 4

type   string  optional  

optional The type of the file. Allowed: contract, avb, zb. Example: "avb"

Delete an insurance offer file.

requires authentication

Removes the specified insurance offer file from the database.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/insurance/offer/30/file/1';
$response = $client->delete(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request DELETE \
    "http://localhost/api/insurance/offer/30/file/1" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/insurance/offer/30/file/1"
);

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

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

Example response (200):


{
    "success": true,
    "message": "insurance offer file deleted successfully"
}
 

Request      

DELETE api/insurance/offer/{offer_id}/file/{file_id}

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

offer_id   integer   

The ID of the offer. Example: 30

file_id   integer   

The ID of the file. Example: 1

offer   integer   

The ID of the insurance offer. Example: 1

file   integer   

The ID of the insurance offer file to delete. Example: 2

InsuranceOfferProduct

Retrieve insurance offer products or a single insurance offer product.

requires authentication

Returns all products for the specified insurance offer, or a specific product with its relations.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/insurance/offer/30/product/2';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
    --get "http://localhost/api/insurance/offer/30/product/2" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/insurance/offer/30/product/2"
);

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

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

Example response (200):


[
    {
        "id": 2,
        "insurance_offer_id": 1,
        "insurer_product_item_id": 3,
        "difference": "Coverage difference",
        "approved": true,
        "insuranceOffer": {},
        "insurerProductItem": {}
    }
]
 

Example response (200):


{
    "id": 2,
    "insurance_offer_id": 1,
    "insurer_product_item_id": 3,
    "difference": "Coverage difference",
    "approved": true,
    "insuranceOffer": {},
    "insurerProductItem": {}
}
 

Request      

GET api/insurance/offer/{offer_id}/product/{product?}

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

offer_id   integer   

The ID of the offer. Example: 30

product   integer  optional  

optional The ID of the insurance offer product. Example: 2

offer   integer   

The ID of the insurance offer. Example: 1

Create a new insurance offer product.

requires authentication

Validates the request data and creates a new product for the specified insurance offer.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/insurance/offer/30/product';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'insurer_product_item_id' => 3,
            'difference' => '"Coverage difference"',
            'approved' => true,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
    "http://localhost/api/insurance/offer/30/product" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"insurer_product_item_id\": 3,
    \"difference\": \"\\\"Coverage difference\\\"\",
    \"approved\": true
}"
const url = new URL(
    "http://localhost/api/insurance/offer/30/product"
);

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

let body = {
    "insurer_product_item_id": 3,
    "difference": "\"Coverage difference\"",
    "approved": true
};

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

Example response (201):


{
    "success": true,
    "message": "insurance offer product created successfully",
    "data": {
        "id": 2
    }
}
 

Request      

POST api/insurance/offer/{offer_id}/product

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

offer_id   integer   

The ID of the offer. Example: 30

offer   integer   

The ID of the insurance offer. Example: 1

Body Parameters

insurer_product_item_id   integer   

The ID of the insurer product item. Example: 3

difference   string  optional  

required_without:approved Coverage difference description. Example: "Coverage difference"

approved   boolean  optional  

required_without:difference Approval status. Example: true

Update an existing insurance offer product.

requires authentication

Validates the request data and updates the specified insurance offer product.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/insurance/offer/30/product/1123';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'insurer_product_item_id' => 3,
            'difference' => '"Updated difference"',
            'approved' => false,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
    "http://localhost/api/insurance/offer/30/product/1123" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"insurer_product_item_id\": 3,
    \"difference\": \"\\\"Updated difference\\\"\",
    \"approved\": false
}"
const url = new URL(
    "http://localhost/api/insurance/offer/30/product/1123"
);

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

let body = {
    "insurer_product_item_id": 3,
    "difference": "\"Updated difference\"",
    "approved": false
};

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

Example response (200):


{
    "success": true,
    "message": "insurance offer product updated successfully"
}
 

Request      

POST api/insurance/offer/{offer_id}/product/{product_id}

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

offer_id   integer   

The ID of the offer. Example: 30

product_id   integer   

The ID of the product. Example: 1123

offer   integer   

The ID of the insurance offer. Example: 1

product   integer   

The ID of the insurance offer product to update. Example: 2

Body Parameters

insurer_product_item_id   integer  optional  

optional The ID of the insurer product item. Example: 3

difference   string  optional  

optional Coverage difference description. Example: "Updated difference"

approved   boolean  optional  

optional Approval status. Example: false

Delete an insurance offer product.

requires authentication

Removes the specified insurance offer product from the database.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/insurance/offer/30/product/1123';
$response = $client->delete(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request DELETE \
    "http://localhost/api/insurance/offer/30/product/1123" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/insurance/offer/30/product/1123"
);

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

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

Example response (200):


{
    "success": true,
    "message": "insurance offer product deleted successfully"
}
 

Request      

DELETE api/insurance/offer/{offer_id}/product/{product_id}

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

offer_id   integer   

The ID of the offer. Example: 30

product_id   integer   

The ID of the product. Example: 1123

offer   integer   

The ID of the insurance offer. Example: 1

product   integer   

The ID of the insurance offer product to delete. Example: 2

Insurer AVB

Returns a list of all Insurer AVBs or a single AVB.

requires authentication

Returns either all AVBs of the current workspace or a specific AVB with related models.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/insurer/avb/1';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
    --get "http://localhost/api/insurer/avb/1" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/insurer/avb/1"
);

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

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

Example response (200):


{
    "id": 1,
    "workspace_insurer_product_id": 2,
    "file_id": 3,
    "info": "Example info",
    "type": "Example type"
}
 

Request      

GET api/insurer/avb/{avb?}

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

avb   integer  optional  

optional The ID of the AVB. Example: 1

Creates a new Insurer AVB.

requires authentication

Validates the input data and creates a new AVB.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/insurer/avb';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'workspace_insurer_product_id' => 2,
            'file_id' => 3,
            'info' => '"Example info"',
            'type' => '"Example type"',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
    "http://localhost/api/insurer/avb" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"workspace_insurer_product_id\": 2,
    \"file_id\": 3,
    \"info\": \"\\\"Example info\\\"\",
    \"type\": \"\\\"Example type\\\"\"
}"
const url = new URL(
    "http://localhost/api/insurer/avb"
);

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

let body = {
    "workspace_insurer_product_id": 2,
    "file_id": 3,
    "info": "\"Example info\"",
    "type": "\"Example type\""
};

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

Example response (201):


{
    "success": true,
    "message": "insurer avb created successfully",
    "data": {
        "id": 1
    }
}
 

Request      

POST api/insurer/avb

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

workspace_insurer_product_id   integer   

The workspace insurer product ID. Example: 2

file_id   integer   

The file ID of the AVB document. Example: 3

info   string  optional  

optional Additional info for the AVB. Example: "Example info"

type   string  optional  

optional Type of the AVB. Example: "Example type"

Updates an existing Insurer AVB.

requires authentication

Validates the input data and updates the specified AVB.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/insurer/avb/1';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'workspace_insurer_product_id' => 2,
            'file_id' => 3,
            'info' => '"Example info"',
            'type' => '"Example type"',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
    "http://localhost/api/insurer/avb/1" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"workspace_insurer_product_id\": 2,
    \"file_id\": 3,
    \"info\": \"\\\"Example info\\\"\",
    \"type\": \"\\\"Example type\\\"\"
}"
const url = new URL(
    "http://localhost/api/insurer/avb/1"
);

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

let body = {
    "workspace_insurer_product_id": 2,
    "file_id": 3,
    "info": "\"Example info\"",
    "type": "\"Example type\""
};

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

Example response (200):


{
    "success": true,
    "message": "insurer avb updated successfully"
}
 

Request      

POST api/insurer/avb/{avb_id}

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

avb_id   integer   

The ID of the avb. Example: 1

avb   integer   

The ID of the AVB to update. Example: 1

Body Parameters

workspace_insurer_product_id   integer  optional  

optional The workspace insurer product ID. Example: 2

file_id   integer  optional  

optional The file ID of the AVB document. Example: 3

info   string  optional  

optional Additional info for the AVB. Example: "Example info"

type   string  optional  

optional Type of the AVB. Example: "Example type"

Deletes an Insurer AVB.

requires authentication

Removes the specified AVB from the database.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/insurer/avb/1';
$response = $client->delete(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request DELETE \
    "http://localhost/api/insurer/avb/1" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/insurer/avb/1"
);

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

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

Example response (200):


{
    "success": true,
    "message": "insurer avb deleted successfully"
}
 

Request      

DELETE api/insurer/avb/{avb_id}

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

avb_id   integer   

The ID of the avb. Example: 1

avb   integer   

The ID of the AVB to delete. Example: 1

InsurerObligation

Retrieve insurer obligations or a single insurer obligation.

requires authentication

Returns all insurer obligations for the current workspace, or a specific obligation with its related workspace insurer product and file.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/insurer/obligation/1';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
    --get "http://localhost/api/insurer/obligation/1" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/insurer/obligation/1"
);

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

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

Example response (200):


[
    {
        "id": 1,
        "workspace_insurer_product_id": 2,
        "file_id": 3,
        "info": "Some info",
        "workspaceInsurerProduct": {},
        "file": {}
    }
]
 

Example response (200):


{
    "id": 1,
    "workspace_insurer_product_id": 2,
    "file_id": 3,
    "info": "Some info",
    "workspaceInsurerProduct": {},
    "file": {}
}
 

Request      

GET api/insurer/obligation/{obligation?}

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

obligation   integer  optional  

optional The ID of the insurer obligation. Example: 1

Create a new insurer obligation.

requires authentication

Validates the request data and creates a new insurer obligation record.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/insurer/obligation';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'file_id' => 3,
            'workspace_insurer_product_id' => 2,
            'info' => '"Some info"',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
    "http://localhost/api/insurer/obligation" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"file_id\": 3,
    \"workspace_insurer_product_id\": 2,
    \"info\": \"\\\"Some info\\\"\"
}"
const url = new URL(
    "http://localhost/api/insurer/obligation"
);

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

let body = {
    "file_id": 3,
    "workspace_insurer_product_id": 2,
    "info": "\"Some info\""
};

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

Example response (201):


{
    "success": true,
    "message": "insurer obligation created successfully",
    "data": {
        "id": 1
    }
}
 

Request      

POST api/insurer/obligation

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

file_id   integer   

The ID of the file. Example: 3

workspace_insurer_product_id   integer   

The workspace insurer product ID. Example: 2

info   string  optional  

optional Additional info for the obligation. Example: "Some info"

Update an existing insurer obligation.

requires authentication

Validates the request data and updates the specified insurer obligation record.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/insurer/obligation/1';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'file_id' => 3,
            'workspace_insurer_product_id' => 2,
            'info' => '"Updated info"',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
    "http://localhost/api/insurer/obligation/1" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"file_id\": 3,
    \"workspace_insurer_product_id\": 2,
    \"info\": \"\\\"Updated info\\\"\"
}"
const url = new URL(
    "http://localhost/api/insurer/obligation/1"
);

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

let body = {
    "file_id": 3,
    "workspace_insurer_product_id": 2,
    "info": "\"Updated info\""
};

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

Example response (200):


{
    "success": true,
    "message": "insurer obligation updated successfully"
}
 

Request      

POST api/insurer/obligation/{obligation_id}

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

obligation_id   integer   

The ID of the obligation. Example: 1

obligation   integer   

The ID of the insurer obligation to update. Example: 1

Body Parameters

file_id   integer  optional  

optional The ID of the file. Example: 3

workspace_insurer_product_id   integer  optional  

optional The workspace insurer product ID. Example: 2

info   string  optional  

optional Additional info for the obligation. Example: "Updated info"

Delete an insurer obligation.

requires authentication

Removes the specified insurer obligation from the database.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/insurer/obligation/1';
$response = $client->delete(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request DELETE \
    "http://localhost/api/insurer/obligation/1" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/insurer/obligation/1"
);

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

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

Example response (200):


{
    "success": true,
    "message": "insurer obligation deleted successfully"
}
 

Request      

DELETE api/insurer/obligation/{obligation_id}

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

obligation_id   integer   

The ID of the obligation. Example: 1

obligation   integer   

The ID of the insurer obligation to delete. Example: 1

InsurerProduct

Retrieve one or multiple insurer products.

requires authentication

If a product is provided, returns detailed information about that product including related models. Otherwise, returns a paginated or full list of insurer products, optionally with related data.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/insurer/product/1';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'per_page' => 16,
            'page' => 16,
            'with' => [
                'workspace',
            ],
            'paged' => true,
            'shortresult' => false,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
    --get "http://localhost/api/insurer/product/1" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"per_page\": 16,
    \"page\": 16,
    \"with\": [
        \"workspace\"
    ],
    \"paged\": true,
    \"shortresult\": false
}"
const url = new URL(
    "http://localhost/api/insurer/product/1"
);

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

let body = {
    "per_page": 16,
    "page": 16,
    "with": [
        "workspace"
    ],
    "paged": true,
    "shortresult": false
};

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

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: http://localhost:3000
access-control-allow-credentials: true
 

{
    "message": "Unauthenticated."
}
 

Request      

GET api/insurer/product/{product?}

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

product   integer  optional  

Example: 1

Body Parameters

per_page   integer  optional  

Example: 16

page   integer  optional  

Example: 16

with   string[]  optional  
Must be one of:
  • moduleProduct
  • productItems
  • childProducts
  • workspace
paged   boolean  optional  

Example: true

shortresult   boolean  optional  

Example: false

Copy an insurer product into another workspace.

requires authentication

Duplicates the specified insurer product and all its related data into the target workspace. If a copy already exists, returns the existing copy.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/insurer/product/1/copy';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'workspace_id' => 'architecto',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
    "http://localhost/api/insurer/product/1/copy" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"workspace_id\": \"architecto\"
}"
const url = new URL(
    "http://localhost/api/insurer/product/1/copy"
);

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

let body = {
    "workspace_id": "architecto"
};

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

Request      

POST api/insurer/product/{product_id}/copy

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

product_id   integer   

The ID of the product. Example: 1

Body Parameters

workspace_id   string   

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

Delete an insurer product.

requires authentication

Removes the specified insurer product from the database.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/insurer/product/1';
$response = $client->delete(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request DELETE \
    "http://localhost/api/insurer/product/1" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/insurer/product/1"
);

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

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

Request      

DELETE api/insurer/product/{product_id}

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

product_id   integer   

The ID of the product. Example: 1

Get lead insurer contacts for a product.

requires authentication

Retrieves contact information for all users associated with the insurer product, grouped by their workspace.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/insurer/product/1/contacts';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
    --get "http://localhost/api/insurer/product/1/contacts" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/insurer/product/1/contacts"
);

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

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

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: http://localhost:3000
access-control-allow-credentials: true
 

{
    "message": "Unauthenticated."
}
 

Request      

GET api/insurer/product/{product_id}/contacts

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

product_id   integer   

The ID of the product. Example: 1

Create a new insurer product.

requires authentication

Validates and creates an insurer product with the provided attributes. Automatically adds module product items based on the selected module product.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/insurer/product';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'name' => 'architecto',
            'description' => 'Eius et animi quos velit et.',
            'start' => '2025-10-20T19:41:49',
            'end' => '2025-10-20T19:41:49',
            'module_product_id' => 'architecto',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
    "http://localhost/api/insurer/product" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"architecto\",
    \"description\": \"Eius et animi quos velit et.\",
    \"start\": \"2025-10-20T19:41:49\",
    \"end\": \"2025-10-20T19:41:49\",
    \"module_product_id\": \"architecto\"
}"
const url = new URL(
    "http://localhost/api/insurer/product"
);

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

let body = {
    "name": "architecto",
    "description": "Eius et animi quos velit et.",
    "start": "2025-10-20T19:41:49",
    "end": "2025-10-20T19:41:49",
    "module_product_id": "architecto"
};

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

Request      

POST api/insurer/product

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

name   string   

Example: architecto

description   string  optional  

Example: Eius et animi quos velit et.

tariff   object  optional  
start   string  optional  

Must be a valid date. Example: 2025-10-20T19:41:49

end   string  optional  

Must be a valid date. Example: 2025-10-20T19:41:49

module_product_id   string   

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

parent_id   string  optional  

The id of an existing record in the insurer_products table.

workspace_id   string  optional  

The id of an existing record in the workspaces table.

Update an existing insurer product.

requires authentication

Updates the specified insurer product with new attributes. If the module product changes, associated product items are replaced.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/insurer/product/1';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'name' => 'architecto',
            'description' => 'Eius et animi quos velit et.',
            'start' => '2025-10-20T19:41:49',
            'end' => '2025-10-20T19:41:49',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
    "http://localhost/api/insurer/product/1" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"architecto\",
    \"description\": \"Eius et animi quos velit et.\",
    \"start\": \"2025-10-20T19:41:49\",
    \"end\": \"2025-10-20T19:41:49\"
}"
const url = new URL(
    "http://localhost/api/insurer/product/1"
);

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

let body = {
    "name": "architecto",
    "description": "Eius et animi quos velit et.",
    "start": "2025-10-20T19:41:49",
    "end": "2025-10-20T19:41:49"
};

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

Request      

POST api/insurer/product/{product_id}

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

product_id   integer   

The ID of the product. Example: 1

Body Parameters

name   string  optional  

Example: architecto

description   string  optional  

Example: Eius et animi quos velit et.

tariff   object  optional  
start   string  optional  

Must be a valid date. Example: 2025-10-20T19:41:49

end   string  optional  

Must be a valid date. Example: 2025-10-20T19:41:49

module_product_id   string  optional  

The id of an existing record in the module_products table.

parent_id   string  optional  

The id of an existing record in the insurer_products table.

InsurerProductItem

Retrieve one or multiple insurer product items.

requires authentication

This endpoint returns either a list of all items for a given insurer product, or detailed information about a specific item if an item ID is provided.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/insurer/product/1/item/1';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
    --get "http://localhost/api/insurer/product/1/item/1" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/insurer/product/1/item/1"
);

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

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

Example response (200):


{
    "id": 1,
    "name": "Item Name",
    "insurer_product_id": 1,
    "module_product_item_id": 2,
    "info": "Additional info",
    "type": "Type",
    "coverage_type": "Coverage Type",
    "coverage": "Coverage details",
    "insurerProduct": {},
    "moduleProductItem": {},
    "insurerProductItemAttributes": {}
}
 

Request      

GET api/insurer/product/{product_id}/item/{item?}

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

product_id   integer   

The ID of the product. Example: 1

item   integer  optional  

Example: 1

Create a new insurer product item.

requires authentication

This endpoint validates and creates a new insurer product item with the provided attributes. Additional custom attributes are stored in the related attribute model.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/insurer/product/1/item';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'name' => '"Haftpflicht"',
            'module_product_item_id' => 2,
            'info' => '"Deckungssumme 10 Mio"',
            'type' => '"Basis"',
            'coverage_type' => '"Voll"',
            'coverage' => '"Europaweit"',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
    "http://localhost/api/insurer/product/1/item" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"\\\"Haftpflicht\\\"\",
    \"module_product_item_id\": 2,
    \"info\": \"\\\"Deckungssumme 10 Mio\\\"\",
    \"type\": \"\\\"Basis\\\"\",
    \"coverage_type\": \"\\\"Voll\\\"\",
    \"coverage\": \"\\\"Europaweit\\\"\"
}"
const url = new URL(
    "http://localhost/api/insurer/product/1/item"
);

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

let body = {
    "name": "\"Haftpflicht\"",
    "module_product_item_id": 2,
    "info": "\"Deckungssumme 10 Mio\"",
    "type": "\"Basis\"",
    "coverage_type": "\"Voll\"",
    "coverage": "\"Europaweit\""
};

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

Example response (201):


{
    "success": true,
    "message": "insurer product item created successfully",
    "data": {
        "id": 1
    }
}
 

Request      

POST api/insurer/product/{product_id}/item

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

product_id   integer   

The ID of the product. Example: 1

Body Parameters

name   string   

The name of the product item. Example: "Haftpflicht"

module_product_item_id   integer  optional  

optional The ID of the associated module product item. Example: 2

info   string  optional  

optional Additional information. Example: "Deckungssumme 10 Mio"

type   string  optional  

optional The type of the product item. Example: "Basis"

coverage_type   string  optional  

optional The type of coverage. Example: "Voll"

coverage   string  optional  

optional Coverage details. Example: "Europaweit"

Update an existing insurer product item.

requires authentication

This endpoint updates the specified insurer product item with new attributes. Additional custom attributes are updated in the related attribute model.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/insurer/product/1/item/1';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'name' => '"Haftpflicht Plus"',
            'module_product_item_id' => 3,
            'info' => '"Deckungssumme 20 Mio"',
            'type' => '"Premium"',
            'coverage_type' => '"Teilkasko"',
            'coverage' => '"Weltweit"',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
    "http://localhost/api/insurer/product/1/item/1" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"\\\"Haftpflicht Plus\\\"\",
    \"module_product_item_id\": 3,
    \"info\": \"\\\"Deckungssumme 20 Mio\\\"\",
    \"type\": \"\\\"Premium\\\"\",
    \"coverage_type\": \"\\\"Teilkasko\\\"\",
    \"coverage\": \"\\\"Weltweit\\\"\"
}"
const url = new URL(
    "http://localhost/api/insurer/product/1/item/1"
);

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

let body = {
    "name": "\"Haftpflicht Plus\"",
    "module_product_item_id": 3,
    "info": "\"Deckungssumme 20 Mio\"",
    "type": "\"Premium\"",
    "coverage_type": "\"Teilkasko\"",
    "coverage": "\"Weltweit\""
};

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

Example response (200):


{
    "success": true,
    "message": "insurer product item updated successfully"
}
 

Request      

POST api/insurer/product/{product_id}/item/{item_id}

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

product_id   integer   

The ID of the product. Example: 1

item_id   integer   

The ID of the item. Example: 1

Body Parameters

name   string  optional  

optional The new name of the product item. Example: "Haftpflicht Plus"

module_product_item_id   integer  optional  

optional The new module product item ID. Example: 3

info   string  optional  

optional New information. Example: "Deckungssumme 20 Mio"

type   string  optional  

optional New type. Example: "Premium"

coverage_type   string  optional  

optional New coverage type. Example: "Teilkasko"

coverage   string  optional  

optional New coverage details. Example: "Weltweit"

Delete an insurer product item.

requires authentication

This endpoint removes the specified insurer product item from the database.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/insurer/product/1/item/1';
$response = $client->delete(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request DELETE \
    "http://localhost/api/insurer/product/1/item/1" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/insurer/product/1/item/1"
);

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

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

Example response (200):


{
    "success": true,
    "message": "insurer product item deleted successfully"
}
 

Request      

DELETE api/insurer/product/{product_id}/item/{item_id}

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

product_id   integer   

The ID of the product. Example: 1

item_id   integer   

The ID of the item. Example: 1

InsurerProductUser

Add a User to an Insurer Product

requires authentication

Assigns a user to the specified insurer product. Optionally, the user can be set as the default user for the product. If the user is already assigned, you can update their default status.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/insurer/product/1/user/1';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'default' => true,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
    "http://localhost/api/insurer/product/1/user/1" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"default\": true
}"
const url = new URL(
    "http://localhost/api/insurer/product/1/user/1"
);

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

let body = {
    "default": true
};

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

Example response (200):


{
    "success": true,
    "message": "user set as default user for insurer product",
    "refreshToken": true
}
 

Example response (200):


{
    "success": false,
    "message": "user already assigned to insurer product",
    "refreshToken": true
}
 

Example response (201):


{
    "success": true,
    "message": "user assigned as default user to insurer product",
    "data": {
        "id": 123
    },
    "refreshToken": true
}
 

Request      

POST api/insurer/product/{insurerproduct_id}/user/{user_id}

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

insurerproduct_id   integer   

The ID of the insurerproduct. Example: 1

user_id   integer   

The ID of the user. Example: 1

Body Parameters

default   boolean  optional  

Optional. Set to 1 to make this user the default for the insurer product. Example: true

Remove a User from an Insurer Product

requires authentication

Removes the specified user from the insurer product. If the user is the default, another user will be set as default. At least one user must remain assigned to the insurer product.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/insurer/product/1/user/1';
$response = $client->delete(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request DELETE \
    "http://localhost/api/insurer/product/1/user/1" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/insurer/product/1/user/1"
);

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

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

Example response (200):


{
    "success": true,
    "message": "user successfully removed from insurer product",
    "refreshToken": true
}
 

Example response (200):


{
    "success": false,
    "message": "at least one user must be assigned to insurer product",
    "refreshToken": true
}
 

Example response (200):


{
    "success": false,
    "message": "user is not assigned to insurer product",
    "refreshToken": true
}
 

Request      

DELETE api/insurer/product/{insurerproduct_id}/user/{user_id}

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

insurerproduct_id   integer   

The ID of the insurerproduct. Example: 1

user_id   integer   

The ID of the user. Example: 1

InsurerTariffConstructionCost

Get insurer tariff construction costs.

requires authentication

Retrieves one or multiple insurer tariff construction cost records. If a specific tariff is provided, returns its details including related workspace insurer product and child tariffs. Otherwise, returns a paginated list of tariffs filtered by user role and workspace.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/insurer/tariffconstructioncost/121';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'per_page' => 15,
            'page' => 1,
            'with' => [
                'workspaceInsurerProduct',
            ],
            'paged' => true,
            'shortresult' => false,
            'workspace_insurer_product_id' => 5,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
    --get "http://localhost/api/insurer/tariffconstructioncost/121" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"per_page\": 15,
    \"page\": 1,
    \"with\": [
        \"workspaceInsurerProduct\"
    ],
    \"paged\": true,
    \"shortresult\": false,
    \"workspace_insurer_product_id\": 5
}"
const url = new URL(
    "http://localhost/api/insurer/tariffconstructioncost/121"
);

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

let body = {
    "per_page": 15,
    "page": 1,
    "with": [
        "workspaceInsurerProduct"
    ],
    "paged": true,
    "shortresult": false,
    "workspace_insurer_product_id": 5
};

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

Example response (200):


{
  "id": 1,
  "workspace_insurer_product_id": 5,
  "type": "construction_cost",
  "low": 100000,
  "high": 500000,
  "workspaceInsurerProduct": {...},
  "childTariffs": [...]
}
 

Example response (403):


{
    "success": false,
    "message": "Unauthorized"
}
 

Request      

GET api/insurer/tariffconstructioncost/{tariff?}

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

tariff   integer  optional  

Example: 121

Body Parameters

per_page   integer  optional  

optional Number of results per page. Example: 15

page   integer  optional  

optional Page number. Example: 1

with   string[]  optional  

optional Relations to include. Allowed: workspaceInsurerProduct,childTariffs.

paged   boolean  optional  

optional Whether to paginate results. Example: true

shortresult   boolean  optional  

optional If true, returns a short result without relations. Example: false

workspace_insurer_product_id   integer  optional  

optional Filter by workspace insurer product ID. Example: 5

Create insurer tariff construction cost.

requires authentication

Creates a new insurer tariff construction cost record. Supports batch creation for multiple types, low, and high values. The first entry with type 'construction_cost' will be the parent, others will be children.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/insurer/tariffconstructioncost';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'workspace_insurer_product_id' => 5,
            'type' => [
                'construction_cost',
                'other_type',
            ],
            'low' => [
                100000,
                200000,
            ],
            'high' => [
                500000,
                600000,
            ],
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
    "http://localhost/api/insurer/tariffconstructioncost" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"workspace_insurer_product_id\": 5,
    \"type\": [
        \"construction_cost\",
        \"other_type\"
    ],
    \"low\": [
        100000,
        200000
    ],
    \"high\": [
        500000,
        600000
    ]
}"
const url = new URL(
    "http://localhost/api/insurer/tariffconstructioncost"
);

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

let body = {
    "workspace_insurer_product_id": 5,
    "type": [
        "construction_cost",
        "other_type"
    ],
    "low": [
        100000,
        200000
    ],
    "high": [
        500000,
        600000
    ]
};

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

Example response (201):


{
    "success": true,
    "message": "insurer tariff construction cost created successfully",
    "data": {
        "id": 1
    },
    "refreshToken": true
}
 

Example response (400):


{
    "success": false,
    "message": "type, low or high values missing",
    "refreshToken": true
}
 

Example response (400):


{
    "success": false,
    "message": "one of the high values is lower as the low value",
    "refreshToken": true
}
 

Request      

POST api/insurer/tariffconstructioncost

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

workspace_insurer_product_id   integer   

The workspace insurer product ID. Example: 5

type   string[]   

Array of tariff types.

low   string[]   

Array of low values.

high   string[]   

Array of high values.

Update insurer tariff construction cost.

requires authentication

Updates an existing insurer tariff construction cost record. Only provided fields will be updated.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/insurer/tariffconstructioncost/121';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'workspace_insurer_product_id' => 5,
            'type' => '"construction_cost"',
            'high' => '500000',
            'low' => '100000',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
    "http://localhost/api/insurer/tariffconstructioncost/121" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"workspace_insurer_product_id\": 5,
    \"type\": \"\\\"construction_cost\\\"\",
    \"high\": \"500000\",
    \"low\": \"100000\"
}"
const url = new URL(
    "http://localhost/api/insurer/tariffconstructioncost/121"
);

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

let body = {
    "workspace_insurer_product_id": 5,
    "type": "\"construction_cost\"",
    "high": "500000",
    "low": "100000"
};

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

Example response (200):


{
    "success": true,
    "message": "insurer tariff construction cost updated successfully",
    "refreshToken": true
}
 

Example response (400):


{
    "success": false,
    "message": "the high value is lower as the low value",
    "refreshToken": true
}
 

Request      

POST api/insurer/tariffconstructioncost/{tariff_id}

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

tariff_id   integer   

The ID of the tariff. Example: 121

Body Parameters

workspace_insurer_product_id   integer  optional  

optional The workspace insurer product ID. Example: 5

type   string  optional  

optional The tariff type. Example: "construction_cost"

high   numeric  optional  

optional The high value. Example: 500000

low   numeric  optional  

optional The low value. Example: 100000

Delete insurer tariff construction cost.

requires authentication

Deletes the specified insurer tariff construction cost record.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/insurer/tariffconstructioncost/121';
$response = $client->delete(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request DELETE \
    "http://localhost/api/insurer/tariffconstructioncost/121" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/insurer/tariffconstructioncost/121"
);

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

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

Example response (200):


{
    "success": true,
    "message": "insurer tariff construction cost deleted successfully",
    "refreshToken": true
}
 

Request      

DELETE api/insurer/tariffconstructioncost/{tariff_id}

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

tariff_id   integer   

The ID of the tariff. Example: 121

Journal

Get journal entries.

requires authentication

Retrieves a single journal entry or a paginated list of journal entries. Supports filtering, sorting, and eager loading of relations.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/journal/998';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'paged' => true,
            'per_page' => 15,
            'page' => 1,
            'with' => [
                'journalAttributes',
            ],
            'shortresult' => false,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
    --get "http://localhost/api/journal/998" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"paged\": true,
    \"per_page\": 15,
    \"page\": 1,
    \"with\": [
        \"journalAttributes\"
    ],
    \"shortresult\": false
}"
const url = new URL(
    "http://localhost/api/journal/998"
);

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

let body = {
    "paged": true,
    "per_page": 15,
    "page": 1,
    "with": [
        "journalAttributes"
    ],
    "shortresult": false
};

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

Example response (200):


{
  "id": 1,
  "type": "state",
  "visible": true,
  "object_id": 123,
  "object_type": "App\\Models\\Workspace",
  "user_id": 5,
  "journalAttributes": {...},
  "user": {...}
}
 

Request      

GET api/journal/{journal?}

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

journal   integer  optional  

Example: 998

Body Parameters

paged   boolean  optional  

optional Whether to paginate results. Example: true

per_page   integer  optional  

optional Number of results per page. Example: 15

page   integer  optional  

optional Page number. Example: 1

with   string[]  optional  

optional Relations to include. Allowed: journalAttributes,user.

shortresult   boolean  optional  

optional If true, returns a short result without relations. Example: false

Edit an existing journal entry.

requires authentication

Updates an existing journal entry. Only provided fields will be updated. Additional attributes will be stored in journalAttributes.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/journal/998';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'type' => '"task"',
            'visible' => false,
            'object_id' => 124,
            'object_type' => '"Workspace"',
            'attributes' => 'architecto',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
    "http://localhost/api/journal/998" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"type\": \"\\\"task\\\"\",
    \"visible\": false,
    \"object_id\": 124,
    \"object_type\": \"\\\"Workspace\\\"\",
    \"attributes\": \"architecto\"
}"
const url = new URL(
    "http://localhost/api/journal/998"
);

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

let body = {
    "type": "\"task\"",
    "visible": false,
    "object_id": 124,
    "object_type": "\"Workspace\"",
    "attributes": "architecto"
};

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

Example response (200):


{
    "success": true,
    "message": "journal updated",
    "data": {
        "id": 1,
        "type": "task",
        "visible": false,
        "object_id": 124,
        "object_type": "App\\Models\\Workspace",
        "user_id": 5
    },
    "refreshToken": true
}
 

Example response (422):


{
    "message": "The given data was invalid.",
    "errors": {
        "type": [
            "The type field is invalid."
        ]
    }
}
 

Request      

POST api/journal/{journal_id}

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

journal_id   integer   

The ID of the journal. Example: 998

Body Parameters

type   string  optional  

optional The type of the journal entry. Allowed: state, task. Example: "task"

visible   boolean  optional  

optional Whether the journal entry is visible. Example: false

object_id   integer  optional  

optional The ID of the related object. Example: 124

object_type   string  optional  

optional The type of the related object. Allowed: FormLeads\FormLead, Modules\ModuleObject, Workspace, Policies\Policy, DamageReport. Example: "Workspace"

attributes   mixed  optional  

optional Any additional attributes to be stored in journalAttributes (ex. "foo", "bar"). Example: architecto

Delete a journal entry.

requires authentication

Deletes the specified journal entry.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/journal/998';
$response = $client->delete(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request DELETE \
    "http://localhost/api/journal/998" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/journal/998"
);

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

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

Example response (200):


{
    "success": true,
    "message": "journal deleted",
    "refreshToken": true
}
 

Request      

DELETE api/journal/{journal_id}

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

journal_id   integer   

The ID of the journal. Example: 998

Create a new journal entry.

requires authentication

Creates a new journal entry for a given object type and object ID. Additional attributes can be provided and will be stored as journal attributes.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/journal';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'type' => '"state"',
            'visible' => true,
            'object_id' => 123,
            'object_type' => '"Workspace"',
            'attributes' => 'architecto',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
    "http://localhost/api/journal" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"type\": \"\\\"state\\\"\",
    \"visible\": true,
    \"object_id\": 123,
    \"object_type\": \"\\\"Workspace\\\"\",
    \"attributes\": \"architecto\"
}"
const url = new URL(
    "http://localhost/api/journal"
);

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

let body = {
    "type": "\"state\"",
    "visible": true,
    "object_id": 123,
    "object_type": "\"Workspace\"",
    "attributes": "architecto"
};

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

Example response (201):


{
    "success": true,
    "message": "journal created",
    "data": {
        "id": 1,
        "type": "state",
        "visible": true,
        "object_id": 123,
        "object_type": "App\\Models\\Workspace",
        "user_id": 5
    },
    "refreshToken": true
}
 

Example response (422):


{
    "message": "The given data was invalid.",
    "errors": {
        "type": [
            "The type field is required."
        ],
        "object_id": [
            "The object_id field is required."
        ],
        "object_type": [
            "The object_type field is required."
        ]
    }
}
 

Request      

POST api/journal

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

type   string   

The type of the journal entry. Allowed: state, task. Example: "state"

visible   boolean  optional  

optional Whether the journal entry is visible. Example: true

object_id   integer   

The ID of the related object. Example: 123

object_type   string   

The type of the related object. Allowed: FormLeads\FormLead, Modules\ModuleObject, Workspace, Policies\Policy, DamageReport. Example: "Workspace"

attributes   mixed  optional  

optional Any additional attributes to be stored in journalAttributes (ex. "foo", "bar"). Example: architecto

Mandate

Get Mandates.

requires authentication

Retrieves a single mandate or a list of mandates for the given form lead. If a specific mandate is provided, returns its details including related form lead and file. Otherwise, returns all mandates for the form lead.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/formlead/26/mandate/6';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
    --get "http://localhost/api/formlead/26/mandate/6" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/formlead/26/mandate/6"
);

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

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

Example response (200):


{
  "id": 1,
  "form_lead_id": 2,
  "file_id": 3,
  "user_id": 4,
  "formLead": {...},
  "file": {...}
}
 

Request      

GET api/formlead/{formlead_id}/mandate/{mandate?}

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

formlead_id   integer   

The ID of the formlead. Example: 26

mandate   integer  optional  

Example: 6

Create a Mandate.

requires authentication

Creates a new mandate for the given form lead. Requires file and user IDs. Additional attributes can be provided and will be stored. Triggers PDF generation and logs the creation.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/formlead/26/mandate';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'file_id' => 3,
            'user_id' => 4,
            'attributes' => 'architecto',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
    "http://localhost/api/formlead/26/mandate" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"file_id\": 3,
    \"user_id\": 4,
    \"attributes\": \"architecto\"
}"
const url = new URL(
    "http://localhost/api/formlead/26/mandate"
);

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

let body = {
    "file_id": 3,
    "user_id": 4,
    "attributes": "architecto"
};

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

Example response (201):


{
    "success": true,
    "message": "mandate created successfully",
    "data": {
        "id": 1
    },
    "refreshToken": true
}
 

Example response (422):


{
    "message": "The given data was invalid.",
    "errors": {
        "file_id": [
            "The file_id field is required."
        ],
        "user_id": [
            "The user_id field is required."
        ]
    }
}
 

Request      

POST api/formlead/{formlead_id}/mandate

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

formlead_id   integer   

The ID of the formlead. Example: 26

Body Parameters

file_id   integer   

The file ID associated with the mandate. Example: 3

user_id   integer   

The user ID associated with the mandate. Example: 4

attributes   mixed  optional  

optional Any additional attributes for the mandate (ex "foo", "bar"). Example: architecto

Update a Mandate.

requires authentication

Updates an existing mandate for the given form lead. Only provided fields will be updated. Additional attributes will be stored. Triggers PDF generation and logs the update.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/formlead/26/mandate/6';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'file_id' => 3,
            'user_id' => 4,
            'attributes' => 'architecto',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
    "http://localhost/api/formlead/26/mandate/6" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"file_id\": 3,
    \"user_id\": 4,
    \"attributes\": \"architecto\"
}"
const url = new URL(
    "http://localhost/api/formlead/26/mandate/6"
);

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

let body = {
    "file_id": 3,
    "user_id": 4,
    "attributes": "architecto"
};

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

Example response (200):


{
    "success": true,
    "message": "mandate updated successfully",
    "refreshToken": true
}
 

Example response (422):


{
    "message": "The given data was invalid.",
    "errors": {
        "file_id": [
            "The file_id field is invalid."
        ],
        "user_id": [
            "The user_id field is invalid."
        ]
    }
}
 

Request      

POST api/formlead/{formlead_id}/mandate/{mandate_id}

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

formlead_id   integer   

The ID of the formlead. Example: 26

mandate_id   integer   

The ID of the mandate. Example: 6

Body Parameters

file_id   integer  optional  

optional The file ID associated with the mandate. Example: 3

user_id   integer  optional  

optional The user ID associated with the mandate. Example: 4

attributes   mixed  optional  

optional Any additional attributes for the mandate (ex. "foo", "bar"). Example: architecto

Delete a Mandate.

requires authentication

Deletes the specified mandate for the given form lead and logs the deletion.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/formlead/26/mandate/6';
$response = $client->delete(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request DELETE \
    "http://localhost/api/formlead/26/mandate/6" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/formlead/26/mandate/6"
);

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

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

Example response (200):


{
    "success": true,
    "message": "mandate deleted successfully",
    "refreshToken": true
}
 

Request      

DELETE api/formlead/{formlead_id}/mandate/{mandate_id}

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

formlead_id   integer   

The ID of the formlead. Example: 26

mandate_id   integer   

The ID of the mandate. Example: 6

Module

Get a module or all modules.

requires authentication

Retrieves a single module with its settings or a paginated list of modules. Supports filtering, sorting, and eager loading of relations.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/module/1';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'per_page' => 15,
            'page' => 1,
            'with' => [
                'settings',
            ],
            'paged' => true,
            'shortresult' => false,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
    --get "http://localhost/api/module/1" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"per_page\": 15,
    \"page\": 1,
    \"with\": [
        \"settings\"
    ],
    \"paged\": true,
    \"shortresult\": false
}"
const url = new URL(
    "http://localhost/api/module/1"
);

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

let body = {
    "per_page": 15,
    "page": 1,
    "with": [
        "settings"
    ],
    "paged": true,
    "shortresult": false
};

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

Example response (200):


{
  "id": 1,
  "name": "Module Name",
  "settings": {...},
  "products": [...]
}
 

Example response (403):


{
    "success": false,
    "message": "Unauthorized"
}
 

Request      

GET api/module/{module?}

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

module   integer  optional  

Example: 1

Body Parameters

per_page   integer  optional  

optional Number of results per page. Example: 15

page   integer  optional  

optional Page number. Example: 1

with   string[]  optional  

optional Relations to include. Allowed: settings,products.

paged   boolean  optional  

optional Whether to paginate results. Example: true

shortresult   boolean  optional  

optional If true, returns a short result without relations. Example: false

Create a new module.

requires authentication

Creates a new module with the given name and optional settings.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/module';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'name' => '"New Module"',
            'settings' => 'architecto',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
    "http://localhost/api/module" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"\\\"New Module\\\"\",
    \"settings\": \"architecto\"
}"
const url = new URL(
    "http://localhost/api/module"
);

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

let body = {
    "name": "\"New Module\"",
    "settings": "architecto"
};

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

Example response (201):


{
    "success": true,
    "message": "module created successfully",
    "data": {
        "id": 1
    },
    "refreshToken": true
}
 

Example response (422):


{
    "message": "The given data was invalid.",
    "errors": {
        "name": [
            "The name field is required."
        ]
    }
}
 

Request      

POST api/module

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

name   string   

The name of the module. Example: "New Module"

settings   mixed  optional  

optional Any additional settings for the module (ex "foo", "bar"). Example: architecto

Update an existing module.

requires authentication

Updates the name and settings of an existing module.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/module/1';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'name' => '"Updated Module"',
            'settings' => 'architecto',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
    "http://localhost/api/module/1" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"\\\"Updated Module\\\"\",
    \"settings\": \"architecto\"
}"
const url = new URL(
    "http://localhost/api/module/1"
);

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

let body = {
    "name": "\"Updated Module\"",
    "settings": "architecto"
};

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

Example response (200):


{
    "success": true,
    "message": "module updated successfully",
    "refreshToken": true
}
 

Example response (422):


{
    "message": "The given data was invalid.",
    "errors": {
        "name": [
            "The name field is required."
        ]
    }
}
 

Request      

POST api/module/{module_id}

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

module_id   integer   

The ID of the module. Example: 1

Body Parameters

name   string   

The new name of the module. Example: "Updated Module"

settings   mixed  optional  

optional Any additional settings for the module (ex. "foo", "bar"). Example: architecto

Add a category to a module.

requires authentication

Adds the specified category to the module.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/module/1/category/1';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
    "http://localhost/api/module/1/category/1" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/module/1/category/1"
);

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

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

Example response (200):


{
    "success": true,
    "message": "category added to module successfully",
    "refreshToken": true
}
 

Request      

POST api/module/{module_id}/category/{category_id}

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

module_id   integer   

The ID of the module. Example: 1

category_id   integer   

The ID of the category. Example: 1

Remove a category from a module.

requires authentication

Removes the specified category from the module.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/module/1/category/1';
$response = $client->delete(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request DELETE \
    "http://localhost/api/module/1/category/1" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/module/1/category/1"
);

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

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

Example response (200):


{
    "success": true,
    "message": "category removed from module successfully",
    "refreshToken": true
}
 

Request      

DELETE api/module/{module_id}/category/{category_id}

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

module_id   integer   

The ID of the module. Example: 1

category_id   integer   

The ID of the category. Example: 1

Delete an existing module.

requires authentication

Deletes the specified module.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/module/1';
$response = $client->delete(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request DELETE \
    "http://localhost/api/module/1" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/module/1"
);

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

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

Example response (200):


{
    "success": true,
    "message": "module deleted successfully",
    "refreshToken": true
}
 

Request      

DELETE api/module/{module_id}

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

module_id   integer   

The ID of the module. Example: 1

ModuleObject

Get Module Object(s).

requires authentication

Retrieves a single module object (with relations) or a paginated list of module objects. Supports filtering, sorting, and eager loading of relations.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/object/44';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'per_page' => 15,
            'page' => 1,
            'group_id' => 5,
            'with' => [
                'objectAttributes',
            ],
            'paged' => true,
            'shortresult' => false,
            'user_id' => 'PB-0123',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
    --get "http://localhost/api/object/44" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"per_page\": 15,
    \"page\": 1,
    \"group_id\": 5,
    \"with\": [
        \"objectAttributes\"
    ],
    \"paged\": true,
    \"shortresult\": false,
    \"user_id\": \"PB-0123\"
}"
const url = new URL(
    "http://localhost/api/object/44"
);

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

let body = {
    "per_page": 15,
    "page": 1,
    "group_id": 5,
    "with": [
        "objectAttributes"
    ],
    "paged": true,
    "shortresult": false,
    "user_id": "PB-0123"
};

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

Example response (200):


{
  "id": 1,
  "name": "Object Name",
  "module_category_id": 2,
  "user_id": 3,
  "objectAttributes": {...},
  "contacts": [...],
  "...other relations..."
}
 

Example response (403):


{
    "success": false,
    "message": "Unauthorized"
}
 

Example response (404):


{
    "success": false,
    "message": "object not found"
}
 

Request      

GET api/object/{object?}

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

object   integer  optional  

Example: 44

Body Parameters

per_page   integer  optional  

optional Number of results per page. Example: 15

page   integer  optional  

optional Page number. Example: 1

group_id   integer  optional  

optional Filter by group ID. Example: 5

with   string[]  optional  

optional Relations to include. Allowed: objectAttributes,user,moduleCategory,objectGroups,moduleObjectWorkspaceInsurerProduct,contacts,policyList,insuranceAnnouncements,insuranceOffers.

paged   boolean  optional  

optional Whether to paginate results. Example: true

shortresult   boolean  optional  

optional If true, returns a short result without relations. Example: false

user_id   string   

The id the object should be created for. Example: PB-0123

Create a new Module Object.

requires authentication

Creates a new module object and assigns the user as owner. Also creates contacts and attributes, triggers jobs and logs the creation.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/object';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => \Symfony\Component\VarExporter\Internal\Hydrator::hydrate(
            $o = [
                clone (\Symfony\Component\VarExporter\Internal\Registry::$prototypes['stdClass'] ?? \Symfony\Component\VarExporter\Internal\Registry::p('stdClass')),
            ],
            null,
            [
                'stdClass' => [
                    'type' => [
                        'owner',
                    ],
                    'firstname' => [
                        'John',
                    ],
                    'lastname' => [
                        'Doe',
                    ],
                ],
            ],
            [
                'display_id' => '"OBJ-123"',
                'name' => '"My Building"',
                'category' => 2,
                'group_id' => 5,
                'contacts' => [
                    $o[0],
                ],
            ],
            []
        ),
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
    "http://localhost/api/object" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"display_id\": \"\\\"OBJ-123\\\"\",
    \"name\": \"\\\"My Building\\\"\",
    \"category\": 2,
    \"group_id\": 5,
    \"contacts\": [
        {
            \"type\": \"owner\",
            \"firstname\": \"John\",
            \"lastname\": \"Doe\"
        }
    ]
}"
const url = new URL(
    "http://localhost/api/object"
);

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

let body = {
    "display_id": "\"OBJ-123\"",
    "name": "\"My Building\"",
    "category": 2,
    "group_id": 5,
    "contacts": [
        {
            "type": "owner",
            "firstname": "John",
            "lastname": "Doe"
        }
    ]
};

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

Example response (201):


{
    "success": true,
    "message": "object created successfully",
    "data": {
        "id": 1
    },
    "refreshToken": true
}
 

Example response (422):


{
    "message": "The given data was invalid.",
    "errors": {
        "name": [
            "The name field is required."
        ],
        "category": [
            "The category field is required."
        ]
    }
}
 

Request      

POST api/object

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

display_id   string  optional  

optional Display ID for the object. Example: "OBJ-123"

name   string   

The name of the object. Example: "My Building"

category   integer   

The module category ID. Example: 2

group_id   integer  optional  

optional The group ID to assign the object to. Example: 5

contacts   string[]  optional  

optional Array of contacts for the object.

Update an existing Module Object.

requires authentication

Updates the fields and contacts of an existing module object. Only provided fields will be updated.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/object/44';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => \Symfony\Component\VarExporter\Internal\Hydrator::hydrate(
            $o = [
                clone (\Symfony\Component\VarExporter\Internal\Registry::$prototypes['stdClass'] ?? \Symfony\Component\VarExporter\Internal\Registry::p('stdClass')),
            ],
            null,
            [
                'stdClass' => [
                    'type' => [
                        'owner',
                    ],
                    'firstname' => [
                        'Jane',
                    ],
                    'lastname' => [
                        'Smith',
                    ],
                ],
            ],
            [
                'display_id' => '"OBJ-123"',
                'name' => '"Updated Building"',
                'category' => 2,
                'contacts' => [
                    $o[0],
                ],
            ],
            []
        ),
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
    "http://localhost/api/object/44" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"display_id\": \"\\\"OBJ-123\\\"\",
    \"name\": \"\\\"Updated Building\\\"\",
    \"category\": 2,
    \"contacts\": [
        {
            \"type\": \"owner\",
            \"firstname\": \"Jane\",
            \"lastname\": \"Smith\"
        }
    ]
}"
const url = new URL(
    "http://localhost/api/object/44"
);

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

let body = {
    "display_id": "\"OBJ-123\"",
    "name": "\"Updated Building\"",
    "category": 2,
    "contacts": [
        {
            "type": "owner",
            "firstname": "Jane",
            "lastname": "Smith"
        }
    ]
};

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

Example response (200):


{
    "success": true,
    "message": "object updated successfully"
}
 

Example response (422):


{
    "message": "The given data was invalid.",
    "errors": {
        "category": [
            "The category field is invalid."
        ]
    }
}
 

Request      

POST api/object/{object_id}

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

object_id   integer   

The ID of the object. Example: 44

Body Parameters

display_id   string  optional  

optional Display ID for the object. Example: "OBJ-123"

name   string  optional  

optional The name of the object. Example: "Updated Building"

category   integer  optional  

optional The module category ID. Example: 2

contacts   string[]  optional  

optional Array of contacts for the object.

Delete a Module Object.

requires authentication

Deletes the specified module object.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/object/44';
$response = $client->delete(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request DELETE \
    "http://localhost/api/object/44" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/object/44"
);

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

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

Example response (200):


{
    "success": true,
    "message": "object deleted successfully",
    "refreshToken": true
}
 

Request      

DELETE api/object/{object_id}

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

object_id   integer   

The ID of the object. Example: 44

Send object zip link by email.

requires authentication

Queues a job to send a document package for the module object to the specified email address.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/object/44/sendZipEmail';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'files' => [
                1,
                2,
                3,
            ],
            'email' => '"john.doe@example.com"',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
    "http://localhost/api/object/44/sendZipEmail" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"files\": [
        1,
        2,
        3
    ],
    \"email\": \"\\\"john.doe@example.com\\\"\"
}"
const url = new URL(
    "http://localhost/api/object/44/sendZipEmail"
);

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

let body = {
    "files": [
        1,
        2,
        3
    ],
    "email": "\"john.doe@example.com\""
};

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

Example response (200):


{
    "success": true,
    "message": "object document package queued successfully",
    "refreshToken": true
}
 

Request      

POST api/object/{object_id}/sendZipEmail

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

object_id   integer   

The ID of the object. Example: 44

Body Parameters

files   string[]  optional  

optional Array of file IDs to include.

email   string  optional  

optional Email address to send the package to. Example: "john.doe@example.com"

ModuleObjectWorkspaceInsurerProduct

Add a WorkspaceInsurerProduct to a ModuleObject.

requires authentication

Assigns the specified workspace insurer product to the given module object. If the product is already assigned, returns an error.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/object/44/workspaceinsurerproduct/2';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
    "http://localhost/api/object/44/workspaceinsurerproduct/2" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/object/44/workspaceinsurerproduct/2"
);

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

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

Example response (200):


{
    "success": false,
    "message": "workspace insurer product already in module object",
    "refreshToken": true
}
 

Example response (201):


{
    "success": true,
    "message": "workspace insurer product assigned to module object",
    "data": {
        "id": 1
    },
    "refreshToken": true
}
 

Request      

POST api/object/{object_id}/workspaceinsurerproduct/{workspaceinsurerproduct_id}

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

object_id   integer   

The ID of the object. Example: 44

workspaceinsurerproduct_id   integer   

The ID of the workspaceinsurerproduct. Example: 2

Remove a WorkspaceInsurerProduct from a ModuleObject.

requires authentication

Removes the specified workspace insurer product from the given module object. If the product is not assigned, returns an error.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/object/44/workspaceinsurerproduct/2';
$response = $client->delete(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request DELETE \
    "http://localhost/api/object/44/workspaceinsurerproduct/2" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/object/44/workspaceinsurerproduct/2"
);

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

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

Example response (200):


{
    "success": true,
    "message": "workspace insurer product removed from module object",
    "refreshToken": true
}
 

Example response (200):


{
    "success": false,
    "message": "workspace insurer product is not assigned to module object",
    "refreshToken": true
}
 

Request      

DELETE api/object/{object_id}/workspaceinsurerproduct/{workspaceinsurerproduct_id}

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

object_id   integer   

The ID of the object. Example: 44

workspaceinsurerproduct_id   integer   

The ID of the workspaceinsurerproduct. Example: 2

ModuleObjectContact

Get all module object contacts for a module object or a module object contact by id.

requires authentication

Retrieves either a single module object contact (with relations) or a paginated list of contacts for the given module object. Supports filtering, sorting, and eager loading of relations.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/object/44/contact/70';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'per_page' => 15,
            'page' => 1,
            'with' => [
                'object',
            ],
            'paged' => true,
            'shortresult' => false,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
    --get "http://localhost/api/object/44/contact/70" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"per_page\": 15,
    \"page\": 1,
    \"with\": [
        \"object\"
    ],
    \"paged\": true,
    \"shortresult\": false
}"
const url = new URL(
    "http://localhost/api/object/44/contact/70"
);

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

let body = {
    "per_page": 15,
    "page": 1,
    "with": [
        "object"
    ],
    "paged": true,
    "shortresult": false
};

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

Example response (200):


{
  "id": 1,
  "module_object_id": 2,
  "name": "title",
  "type": "string",
  "value_string": "Contact Title",
  "object": {...},
  "parentContact": {...},
  "childContacts": [...]
}
 

Request      

GET api/object/{object_id}/contact/{contact?}

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

object_id   integer   

The ID of the object. Example: 44

contact   integer  optional  

Example: 70

Body Parameters

per_page   integer  optional  

optional Number of results per page. Example: 15

page   integer  optional  

optional Page number. Example: 1

with   string[]  optional  

optional Relations to include. Allowed: object,parentContact,childContacts.

paged   boolean  optional  

optional Whether to paginate results. Example: true

shortresult   boolean  optional  

optional If true, returns a short result without relations. Example: false

Add a module object contact to a module object.

requires authentication

Creates a new contact for the given module object. Additional contacts can be added as child contacts.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/object/44/contact';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'title' => '"Project Manager"',
            'contacts' => null,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
    "http://localhost/api/object/44/contact" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"title\": \"\\\"Project Manager\\\"\",
    \"contacts\": null
}"
const url = new URL(
    "http://localhost/api/object/44/contact"
);

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

let body = {
    "title": "\"Project Manager\"",
    "contacts": null
};

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

Example response (201):


{
    "success": true,
    "message": "module object contact created successfully",
    "data": {
        "id": 1
    },
    "refreshToken": true
}
 

Example response (422):


{
    "message": "The given data was invalid.",
    "errors": {
        "title": [
            "The title field is required."
        ]
    }
}
 

Request      

POST api/object/{object_id}/contact

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

object_id   integer   

The ID of the object. Example: 44

Body Parameters

title   string   

The title of the contact. Example: "Project Manager"

contacts   string[]  optional  

optional Additional contacts as key-value pairs.

Update an existing module object contact.

requires authentication

Updates the title and/or child contacts of an existing module object contact.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/object/44/contact/70';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'title' => '"Senior Manager"',
            'contacts' => null,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
    "http://localhost/api/object/44/contact/70" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"title\": \"\\\"Senior Manager\\\"\",
    \"contacts\": null
}"
const url = new URL(
    "http://localhost/api/object/44/contact/70"
);

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

let body = {
    "title": "\"Senior Manager\"",
    "contacts": null
};

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

Example response (200):


{
    "success": true,
    "message": "module object contact updated successfully",
    "refreshToken": true
}
 

Example response (422):


{
    "message": "The given data was invalid.",
    "errors": {
        "title": [
            "The title field must be a string."
        ]
    }
}
 

Request      

POST api/object/{object_id}/contact/{contact_id}

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

object_id   integer   

The ID of the object. Example: 44

contact_id   integer   

The ID of the contact. Example: 70

Body Parameters

title   string  optional  

optional The new title of the contact. Example: "Senior Manager"

contacts   string[]  optional  

optional Updated contacts as key-value pairs.

Remove a module object contact from a module object.

requires authentication

Deletes the specified contact from the module object.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/object/44/contact/70';
$response = $client->delete(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request DELETE \
    "http://localhost/api/object/44/contact/70" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/object/44/contact/70"
);

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

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

Example response (200):


{
    "success": true,
    "message": "module object contact deleted successfully",
    "refreshToken": true
}
 

Request      

DELETE api/object/{object_id}/contact/{contact_id}

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

object_id   integer   

The ID of the object. Example: 44

contact_id   integer   

The ID of the contact. Example: 70

ModuleObjectFile

Get ModuleObject files.

requires authentication

Retrieves a single module object file (with relations) or a paginated list of files for the given module object. Supports filtering and pagination.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/object/44/file/16';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'per_page' => 15,
            'page' => 1,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
    --get "http://localhost/api/object/44/file/16" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"per_page\": 15,
    \"page\": 1
}"
const url = new URL(
    "http://localhost/api/object/44/file/16"
);

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

let body = {
    "per_page": 15,
    "page": 1
};

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

Example response (200):


{
  "id": 1,
  "module_object_id": 2,
  "file_id": 3,
  "type": "document",
  "moduleObject": {...}
}
 

Example response (403):


{
    "success": false,
    "message": "Unauthorized"
}
 

Example response (404):


{
    "success": false,
    "message": "file not found"
}
 

Request      

GET api/object/{moduleobject_id}/file/{file?}

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

moduleobject_id   integer   

The ID of the moduleobject. Example: 44

file   integer  optional  

Example: 16

Body Parameters

per_page   integer  optional  

optional Number of results per page. Example: 15

page   integer  optional  

optional Page number. Example: 1

Create a ModuleObject file.

requires authentication

Creates a new file for the given module object. Requires file ID and type.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/object/44/file';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'file_id' => 3,
            'type' => '"document"',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
    "http://localhost/api/object/44/file" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"file_id\": 3,
    \"type\": \"\\\"document\\\"\"
}"
const url = new URL(
    "http://localhost/api/object/44/file"
);

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

let body = {
    "file_id": 3,
    "type": "\"document\""
};

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

Example response (201):


{
    "success": true,
    "message": "module object file created successfully",
    "data": {
        "id": 1
    },
    "refreshToken": true
}
 

Example response (422):


{
    "message": "The given data was invalid.",
    "errors": {
        "file_id": [
            "The file_id field is required."
        ],
        "type": [
            "The type field is required."
        ]
    }
}
 

Request      

POST api/object/{moduleobject_id}/file

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

moduleobject_id   integer   

The ID of the moduleobject. Example: 44

Body Parameters

file_id   integer   

The file ID to associate. Example: 3

type   string   

The type of the file. Example: "document"

Edit a ModuleObject file.

requires authentication

Updates the file ID and/or type of an existing module object file.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/object/44/file/16';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'file_id' => 4,
            'type' => '"image"',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
    "http://localhost/api/object/44/file/16" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"file_id\": 4,
    \"type\": \"\\\"image\\\"\"
}"
const url = new URL(
    "http://localhost/api/object/44/file/16"
);

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

let body = {
    "file_id": 4,
    "type": "\"image\""
};

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

Example response (200):


{
    "success": true,
    "message": "module object file updated successfully",
    "refreshToken": true
}
 

Example response (422):


{
    "message": "The given data was invalid.",
    "errors": {
        "file_id": [
            "The file_id field is invalid."
        ],
        "type": [
            "The type field must be a string."
        ]
    }
}
 

Request      

POST api/object/{moduleobject_id}/file/{file_id}

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

moduleobject_id   integer   

The ID of the moduleobject. Example: 44

file_id   integer   

The ID of the file. Example: 16

Body Parameters

file_id   integer  optional  

optional The new file ID to associate. Example: 4

type   string  optional  

optional The new type of the file. Example: "image"

Remove a ModuleObject file.

requires authentication

Deletes the specified file from the module object.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/object/44/file/16';
$response = $client->delete(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request DELETE \
    "http://localhost/api/object/44/file/16" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/object/44/file/16"
);

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

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

Example response (200):


{
    "success": true,
    "message": "module object file deleted successfully",
    "refreshToken": true
}
 

Request      

DELETE api/object/{moduleobject_id}/file/{file_id}

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

moduleobject_id   integer   

The ID of the moduleobject. Example: 44

file_id   integer   

The ID of the file. Example: 16

ModuleProduct

Get Module Product(s).

requires authentication

Retrieves a single module product (with relations) or a paginated list of module products for the given module. Supports filtering, sorting, and eager loading of relations.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/module/1/product/1';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'per_page' => 15,
            'page' => 1,
            'with' => [
                'productItems',
            ],
            'paged' => true,
            'shortresult' => false,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
    --get "http://localhost/api/module/1/product/1" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"per_page\": 15,
    \"page\": 1,
    \"with\": [
        \"productItems\"
    ],
    \"paged\": true,
    \"shortresult\": false
}"
const url = new URL(
    "http://localhost/api/module/1/product/1"
);

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

let body = {
    "per_page": 15,
    "page": 1,
    "with": [
        "productItems"
    ],
    "paged": true,
    "shortresult": false
};

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

Example response (200):


{
  "id": 1,
  "name": "Product Name",
  "insure_what": "Building",
  "parent_id": null,
  "productItems": [...],
  "childProducts": [...],
  "modules": [...]
}
 

Example response (403):


{
    "success": false,
    "message": "Unauthorized"
}
 

Example response (404):


{
    "success": false,
    "message": "product not found"
}
 

Request      

GET api/module/{module_id}/product/{product?}

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

module_id   integer   

The ID of the module. Example: 1

product   integer  optional  

Example: 1

Body Parameters

per_page   integer  optional  

optional Number of results per page. Example: 15

page   integer  optional  

optional Page number. Example: 1

with   string[]  optional  

optional Relations to include. Allowed: productItems,childProducts,modules.

paged   boolean  optional  

optional Whether to paginate results. Example: true

shortresult   boolean  optional  

optional If true, returns a short result without relations. Example: false

Create a Module Product.

requires authentication

Creates a new module product for the given module. Requires name and insure_what fields. Optionally, a parent product can be specified.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/module/1/product';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'name' => '"Fire Insurance"',
            'insure_what' => '"Building"',
            'parent_id' => 2,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
    "http://localhost/api/module/1/product" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"\\\"Fire Insurance\\\"\",
    \"insure_what\": \"\\\"Building\\\"\",
    \"parent_id\": 2
}"
const url = new URL(
    "http://localhost/api/module/1/product"
);

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

let body = {
    "name": "\"Fire Insurance\"",
    "insure_what": "\"Building\"",
    "parent_id": 2
};

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

Example response (201):


{
    "success": true,
    "message": "module product created successfully",
    "data": {
        "id": 1
    },
    "refreshToken": true
}
 

Example response (422):


{
    "message": "The given data was invalid.",
    "errors": {
        "name": [
            "The name field is required."
        ],
        "insure_what": [
            "The insure_what field is required."
        ]
    }
}
 

Request      

POST api/module/{module_id}/product

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

module_id   integer   

The ID of the module. Example: 1

Body Parameters

name   string   

The name of the module product. Example: "Fire Insurance"

insure_what   string   

The insured object/type. Example: "Building"

parent_id   integer  optional  

optional The parent module product ID. Example: 2

Copy a Module Product to an Insurer Product.

requires authentication

Creates a new insurer product in the specified workspace by duplicating the given module product.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/module/1/product/1/copy';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'workspace_id' => 1,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
    "http://localhost/api/module/1/product/1/copy" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"workspace_id\": 1
}"
const url = new URL(
    "http://localhost/api/module/1/product/1/copy"
);

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

let body = {
    "workspace_id": 1
};

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

Example response (201):


{
    "success": true,
    "message": "insurer product created successfully",
    "data": {
        "id": 10
    },
    "refreshToken": true
}
 

Example response (422):


{
    "message": "The given data was invalid.",
    "errors": {
        "workspace_id": [
            "The workspace_id field is required."
        ]
    }
}
 

Request      

POST api/module/{module_id}/product/{product_id}/copy

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

module_id   integer   

The ID of the module. Example: 1

product_id   integer   

The ID of the product. Example: 1

Body Parameters

workspace_id   integer   

The workspace ID where the insurer product will be created. Example: 1

Add a Module Product to a Module.

requires authentication

Assigns the specified module product to the given module. If already assigned, does nothing.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/module/1/product/1/add';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
    "http://localhost/api/module/1/product/1/add" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/module/1/product/1/add"
);

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

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

Example response (200):


{
    "success": true,
    "message": "module product added to module successfully",
    "refreshToken": true
}
 

Request      

POST api/module/{module_id}/product/{product_id}/add

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

module_id   integer   

The ID of the module. Example: 1

product_id   integer   

The ID of the product. Example: 1

Remove a Module Product from a Module.

requires authentication

Removes the specified module product from the given module.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/module/1/product/1/remove';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
    "http://localhost/api/module/1/product/1/remove" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/module/1/product/1/remove"
);

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

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

Example response (200):


{
    "success": true,
    "message": "module product removed from module successfully",
    "refreshToken": true
}
 

Request      

POST api/module/{module_id}/product/{product_id}/remove

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

module_id   integer   

The ID of the module. Example: 1

product_id   integer   

The ID of the product. Example: 1

Edit a Module Product.

requires authentication

Updates the fields of an existing module product. Only provided fields will be updated.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/module/1/product/1';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'name' => '"Updated Insurance"',
            'insure_what' => '"Updated Building"',
            'parent_id' => 3,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
    "http://localhost/api/module/1/product/1" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"\\\"Updated Insurance\\\"\",
    \"insure_what\": \"\\\"Updated Building\\\"\",
    \"parent_id\": 3
}"
const url = new URL(
    "http://localhost/api/module/1/product/1"
);

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

let body = {
    "name": "\"Updated Insurance\"",
    "insure_what": "\"Updated Building\"",
    "parent_id": 3
};

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

Example response (200):


{
    "success": true,
    "message": "module product edited successfully",
    "refreshToken": true
}
 

Example response (422):


{
    "message": "The given data was invalid.",
    "errors": {
        "parent_id": [
            "The parent_id field is invalid."
        ]
    }
}
 

Request      

POST api/module/{module_id}/product/{product_id}

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

module_id   integer   

The ID of the module. Example: 1

product_id   integer   

The ID of the product. Example: 1

Body Parameters

name   string  optional  

optional The new name of the module product. Example: "Updated Insurance"

insure_what   string  optional  

optional The new insured object/type. Example: "Updated Building"

parent_id   integer  optional  

optional The new parent module product ID. Example: 3

Remove a Module Product.

requires authentication

Deletes the specified module product from the module.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/module/1/product/1';
$response = $client->delete(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request DELETE \
    "http://localhost/api/module/1/product/1" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/module/1/product/1"
);

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

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

Example response (200):


{
    "success": true,
    "message": "module product deleted successfully",
    "refreshToken": true
}
 

Request      

DELETE api/module/{module_id}/product/{product_id}

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

module_id   integer   

The ID of the module. Example: 1

product_id   integer   

The ID of the product. Example: 1

Get Module Product(s).

requires authentication

Retrieves a single module product (with relations) or a paginated list of module products. Supports filtering, sorting, and eager loading of relations.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/product/1';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'per_page' => 15,
            'page' => 1,
            'with' => [
                'productItems',
            ],
            'paged' => true,
            'shortresult' => false,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
    --get "http://localhost/api/product/1" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"per_page\": 15,
    \"page\": 1,
    \"with\": [
        \"productItems\"
    ],
    \"paged\": true,
    \"shortresult\": false
}"
const url = new URL(
    "http://localhost/api/product/1"
);

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

let body = {
    "per_page": 15,
    "page": 1,
    "with": [
        "productItems"
    ],
    "paged": true,
    "shortresult": false
};

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

Example response (200):


{
  "id": 1,
  "name": "Product Name",
  "insure_what": "Building",
  "parent_id": null,
  "productItems": [...],
  "childProducts": [...],
  "modules": [...]
}
 

Example response (403):


{
    "success": false,
    "message": "Unauthorized"
}
 

Example response (404):


{
    "success": false,
    "message": "product not found"
}
 

Request      

GET api/product/{product?}

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

product   integer  optional  

Example: 1

Body Parameters

per_page   integer  optional  

optional Number of results per page. Example: 15

page   integer  optional  

optional Page number. Example: 1

with   string[]  optional  

optional Relations to include. Allowed: productItems,childProducts,modules.

paged   boolean  optional  

optional Whether to paginate results. Example: true

shortresult   boolean  optional  

optional If true, returns a short result without relations. Example: false

Create a Module Product.

requires authentication

Creates a new module product. Requires name and insure_what fields. Optionally, a parent product can be specified.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/product';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'name' => '"Fire Insurance"',
            'insure_what' => '"Building"',
            'parent_id' => 2,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
    "http://localhost/api/product" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"\\\"Fire Insurance\\\"\",
    \"insure_what\": \"\\\"Building\\\"\",
    \"parent_id\": 2
}"
const url = new URL(
    "http://localhost/api/product"
);

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

let body = {
    "name": "\"Fire Insurance\"",
    "insure_what": "\"Building\"",
    "parent_id": 2
};

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

Example response (201):


{
    "success": true,
    "message": "module product created successfully",
    "data": {
        "id": 1
    },
    "refreshToken": true
}
 

Example response (422):


{
    "message": "The given data was invalid.",
    "errors": {
        "name": [
            "The name field is required."
        ],
        "insure_what": [
            "The insure_what field is required."
        ]
    }
}
 

Request      

POST api/product

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

name   string   

The name of the module product. Example: "Fire Insurance"

insure_what   string   

The insured object/type. Example: "Building"

parent_id   integer  optional  

optional The parent module product ID. Example: 2

Edit a Module Product.

requires authentication

Updates the fields of an existing module product. Only provided fields will be updated.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/product/1';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'name' => '"Updated Insurance"',
            'insure_what' => '"Updated Building"',
            'parent_id' => 3,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
    "http://localhost/api/product/1" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"\\\"Updated Insurance\\\"\",
    \"insure_what\": \"\\\"Updated Building\\\"\",
    \"parent_id\": 3
}"
const url = new URL(
    "http://localhost/api/product/1"
);

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

let body = {
    "name": "\"Updated Insurance\"",
    "insure_what": "\"Updated Building\"",
    "parent_id": 3
};

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

Example response (200):


{
    "success": true,
    "message": "product edited successfully",
    "refreshToken": true
}
 

Example response (422):


{
    "message": "The given data was invalid.",
    "errors": {
        "parent_id": [
            "The parent_id field is invalid."
        ]
    }
}
 

Request      

POST api/product/{product_id}

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

product_id   integer   

The ID of the product. Example: 1

Body Parameters

name   string  optional  

optional The new name of the module product. Example: "Updated Insurance"

insure_what   string  optional  

optional The new insured object/type. Example: "Updated Building"

parent_id   integer  optional  

optional The new parent module product ID. Example: 3

Delete a Module Product.

requires authentication

Deletes the specified module product.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/product/1';
$response = $client->delete(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request DELETE \
    "http://localhost/api/product/1" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/product/1"
);

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

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

Example response (200):


{
    "success": true,
    "message": "product deleted successfully",
    "refreshToken": true
}
 

Request      

DELETE api/product/{product_id}

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

product_id   integer   

The ID of the product. Example: 1

ModuleProductItem

Get Module Product Item(s).

requires authentication

Retrieves a single module product item (with relations) or a list of items for the given module product. Supports filtering and sorting.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/module/1/product/1/item/1';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
    --get "http://localhost/api/module/1/product/1/item/1" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/module/1/product/1/item/1"
);

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

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

Example response (200):


{
  "id": 1,
  "module_product_id": 2,
  "name": "Item Name",
  "info": "Description",
  "type": "string",
  "moduleProduct": {...}
}
 

Example response (403):


{
    "success": false,
    "message": "Unauthorized"
}
 

Example response (404):


{
    "success": false,
    "message": "item not found"
}
 

Request      

GET api/module/{module_id}/product/{product_id}/item/{item?}

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

module_id   integer   

The ID of the module. Example: 1

product_id   integer   

The ID of the product. Example: 1

item   integer  optional  

Example: 1

Create a Module Product Item.

requires authentication

Creates a new item for the given module product. Requires name, optional info and type. Additional attributes can be provided and will be stored.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/module/1/product/1/item';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'name' => '"Fire Protection"',
            'info' => '"Includes fire alarm system"',
            'type' => '"safety"',
            'attributes' => 'architecto',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
    "http://localhost/api/module/1/product/1/item" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"\\\"Fire Protection\\\"\",
    \"info\": \"\\\"Includes fire alarm system\\\"\",
    \"type\": \"\\\"safety\\\"\",
    \"attributes\": \"architecto\"
}"
const url = new URL(
    "http://localhost/api/module/1/product/1/item"
);

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

let body = {
    "name": "\"Fire Protection\"",
    "info": "\"Includes fire alarm system\"",
    "type": "\"safety\"",
    "attributes": "architecto"
};

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

Example response (201):


{
    "success": true,
    "message": "module product item created successfully",
    "data": {
        "id": 1
    },
    "refreshToken": true
}
 

Example response (422):


{
    "message": "The given data was invalid.",
    "errors": {
        "name": [
            "The name field is required."
        ]
    }
}
 

Request      

POST api/module/{module_id}/product/{product_id}/item

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

module_id   integer   

The ID of the module. Example: 1

product_id   integer   

The ID of the product. Example: 1

Body Parameters

name   string   

The name of the product item. Example: "Fire Protection"

info   string  optional  

optional Additional information about the item. Example: "Includes fire alarm system"

type   string  optional  

optional The type of the item. Example: "safety"

attributes   mixed  optional  

optional Any additional attributes for the item (ex. "foo", "bar"). Example: architecto

Edit a Module Product Item.

requires authentication

Updates the fields of an existing module product item. Only provided fields will be updated. Additional attributes can be provided and will be stored.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/module/1/product/1/item/1';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'name' => '"Updated Protection"',
            'info' => '"Now includes smoke detectors"',
            'type' => '"security"',
            'attributes' => 'architecto',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
    "http://localhost/api/module/1/product/1/item/1" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"\\\"Updated Protection\\\"\",
    \"info\": \"\\\"Now includes smoke detectors\\\"\",
    \"type\": \"\\\"security\\\"\",
    \"attributes\": \"architecto\"
}"
const url = new URL(
    "http://localhost/api/module/1/product/1/item/1"
);

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

let body = {
    "name": "\"Updated Protection\"",
    "info": "\"Now includes smoke detectors\"",
    "type": "\"security\"",
    "attributes": "architecto"
};

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

Example response (200):


{
    "success": true,
    "message": "module product item updated successfully",
    "refreshToken": true
}
 

Example response (422):


{
    "message": "The given data was invalid.",
    "errors": {
        "name": [
            "The name field must be a string."
        ]
    }
}
 

Request      

POST api/module/{module_id}/product/{product_id}/item/{item_id}

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

module_id   integer   

The ID of the module. Example: 1

product_id   integer   

The ID of the product. Example: 1

item_id   integer   

The ID of the item. Example: 1

Body Parameters

name   string  optional  

optional The new name of the product item. Example: "Updated Protection"

info   string  optional  

optional Updated information about the item. Example: "Now includes smoke detectors"

type   string  optional  

optional The new type of the item. Example: "security"

attributes   mixed  optional  

optional Any additional attributes for the item (ex. "foo", "bar"). Example: architecto

Remove a Module Product Item.

requires authentication

Deletes the specified module product item.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/module/1/product/1/item/1';
$response = $client->delete(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request DELETE \
    "http://localhost/api/module/1/product/1/item/1" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/module/1/product/1/item/1"
);

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

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

Example response (200):


{
    "success": true,
    "message": "module product item deleted successfully",
    "refreshToken": true
}
 

Request      

DELETE api/module/{module_id}/product/{product_id}/item/{item_id}

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

module_id   integer   

The ID of the module. Example: 1

product_id   integer   

The ID of the product. Example: 1

item_id   integer   

The ID of the item. Example: 1

Get Module Product Item(s).

requires authentication

Retrieves a single module product item (with relations) or a list of items for the given module product. Supports filtering and sorting.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/product/1/item/1';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
    --get "http://localhost/api/product/1/item/1" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/product/1/item/1"
);

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

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

Example response (200):


{
  "id": 1,
  "module_product_id": 2,
  "name": "Item Name",
  "info": "Description",
  "type": "string",
  "moduleProduct": {...}
}
 

Example response (403):


{
    "success": false,
    "message": "Unauthorized"
}
 

Example response (404):


{
    "success": false,
    "message": "item not found"
}
 

Request      

GET api/product/{product_id}/item/{item?}

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

product_id   integer   

The ID of the product. Example: 1

item   integer  optional  

Example: 1

Create a Module Product Item.

requires authentication

Creates a new item for the given module product. Requires name, optional info and type. Additional attributes can be provided and will be stored.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/product/1/item';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'name' => '"Fire Protection"',
            'info' => '"Includes fire alarm system"',
            'type' => '"safety"',
            'attributes' => 'architecto',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
    "http://localhost/api/product/1/item" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"\\\"Fire Protection\\\"\",
    \"info\": \"\\\"Includes fire alarm system\\\"\",
    \"type\": \"\\\"safety\\\"\",
    \"attributes\": \"architecto\"
}"
const url = new URL(
    "http://localhost/api/product/1/item"
);

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

let body = {
    "name": "\"Fire Protection\"",
    "info": "\"Includes fire alarm system\"",
    "type": "\"safety\"",
    "attributes": "architecto"
};

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

Example response (201):


{
    "success": true,
    "message": "module product item created successfully",
    "data": {
        "id": 1
    },
    "refreshToken": true
}
 

Example response (422):


{
    "message": "The given data was invalid.",
    "errors": {
        "name": [
            "The name field is required."
        ]
    }
}
 

Request      

POST api/product/{product_id}/item

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

product_id   integer   

The ID of the product. Example: 1

Body Parameters

name   string   

The name of the product item. Example: "Fire Protection"

info   string  optional  

optional Additional information about the item. Example: "Includes fire alarm system"

type   string  optional  

optional The type of the item. Example: "safety"

attributes   mixed  optional  

optional Any additional attributes for the item (ex. "foo", "bar"). Example: architecto

Edit a Module Product Item.

requires authentication

Updates the fields of an existing module product item. Only provided fields will be updated. Additional attributes can be provided and will be stored.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/product/1/item/1';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'name' => '"Updated Protection"',
            'info' => '"Now includes smoke detectors"',
            'type' => '"security"',
            'attributes' => 'architecto',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
    "http://localhost/api/product/1/item/1" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"\\\"Updated Protection\\\"\",
    \"info\": \"\\\"Now includes smoke detectors\\\"\",
    \"type\": \"\\\"security\\\"\",
    \"attributes\": \"architecto\"
}"
const url = new URL(
    "http://localhost/api/product/1/item/1"
);

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

let body = {
    "name": "\"Updated Protection\"",
    "info": "\"Now includes smoke detectors\"",
    "type": "\"security\"",
    "attributes": "architecto"
};

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

Example response (200):


{
    "success": true,
    "message": "module product item updated successfully",
    "refreshToken": true
}
 

Example response (422):


{
    "message": "The given data was invalid.",
    "errors": {
        "name": [
            "The name field must be a string."
        ]
    }
}
 

Request      

POST api/product/{product_id}/item/{item_id}

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

product_id   integer   

The ID of the product. Example: 1

item_id   integer   

The ID of the item. Example: 1

Body Parameters

name   string  optional  

optional The new name of the product item. Example: "Updated Protection"

info   string  optional  

optional Updated information about the item. Example: "Now includes smoke detectors"

type   string  optional  

optional The new type of the item. Example: "security"

attributes   mixed  optional  

optional Any additional attributes for the item (ex. "foo", "bar"). Example: architecto

Remove a Module Product Item.

requires authentication

Deletes the specified module product item.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/product/1/item/1';
$response = $client->delete(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request DELETE \
    "http://localhost/api/product/1/item/1" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/product/1/item/1"
);

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

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

Example response (200):


{
    "success": true,
    "message": "module product item deleted successfully",
    "refreshToken": true
}
 

Request      

DELETE api/product/{product_id}/item/{item_id}

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

product_id   integer   

The ID of the product. Example: 1

item_id   integer   

The ID of the item. Example: 1

ModuleWorkspaces

Link a module to a workspace.

requires authentication

Assigns the specified module to the given workspace. If the module is already assigned, returns an error.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/module/1/workspace/2';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
    "http://localhost/api/module/1/workspace/2" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/module/1/workspace/2"
);

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

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

Example response (200):


{
    "success": false,
    "message": "module already assigned to workspace",
    "refreshToken": true
}
 

Example response (201):


{
    "success": true,
    "message": "module has been assigned to workspace",
    "refreshToken": true
}
 

Request      

POST api/module/{module_id}/workspace/{workspace_id}

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

module_id   integer   

The ID of the module. Example: 1

workspace_id   integer   

The ID of the workspace. Example: 2

Unlink a module from a workspace.

requires authentication

Removes the specified module from the given workspace. If the module is not assigned, returns an error.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/module/1/workspace/2';
$response = $client->delete(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request DELETE \
    "http://localhost/api/module/1/workspace/2" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/module/1/workspace/2"
);

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

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

Example response (200):


{
    "success": true,
    "message": "module has been removed from workspace",
    "refreshToken": true
}
 

Example response (200):


{
    "success": false,
    "message": "module is not assigned to workspace",
    "refreshToken": true
}
 

Request      

DELETE api/module/{module_id}/workspace/{workspace_id}

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

module_id   integer   

The ID of the module. Example: 1

workspace_id   integer   

The ID of the workspace. Example: 2

Get module workspace settings.

requires authentication

Retrieves the settings for the specified module and workspace combination.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/module/1/workspace/2/settings';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
    --get "http://localhost/api/module/1/workspace/2/settings" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/module/1/workspace/2/settings"
);

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

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

Example response (200):


{
  "settings": {...}
}
 

Example response (200):


[]
 

Request      

GET api/module/{module_id}/workspace/{workspace_id}/settings

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

module_id   integer   

The ID of the module. Example: 1

workspace_id   integer   

The ID of the workspace. Example: 2

Save module workspace settings.

requires authentication

Updates the settings for the specified module and workspace combination.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/module/1/workspace/2/settings';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'settings' => 'architecto',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
    "http://localhost/api/module/1/workspace/2/settings" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"settings\": \"architecto\"
}"
const url = new URL(
    "http://localhost/api/module/1/workspace/2/settings"
);

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

let body = {
    "settings": "architecto"
};

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

Example response (200):


{
    "success": true,
    "message": "module settings updated successfully",
    "refreshToken": true
}
 

Example response (200):


{
    "success": false,
    "message": "module is not assigned to workspace",
    "refreshToken": true
}
 

Request      

POST api/module/{module_id}/workspace/{workspace_id}/settings

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

module_id   integer   

The ID of the module. Example: 1

workspace_id   integer   

The ID of the workspace. Example: 2

Body Parameters

settings   mixed   

The settings to update for the module workspace. Example: architecto

Policy

Get Policy or Policies.

requires authentication

Retrieves a single policy (with relations) or a paginated list of policies. Supports filtering, sorting, and eager loading of relations. Policies are visible to policy creators, object users, insurer admins, and broker admins.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/policy/28';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'per_page' => 15,
            'page' => 1,
            'group_id' => 5,
            'with' => [
                'user',
            ],
            'paged' => true,
            'shortresult' => false,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
    --get "http://localhost/api/policy/28" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"per_page\": 15,
    \"page\": 1,
    \"group_id\": 5,
    \"with\": [
        \"user\"
    ],
    \"paged\": true,
    \"shortresult\": false
}"
const url = new URL(
    "http://localhost/api/policy/28"
);

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

let body = {
    "per_page": 15,
    "page": 1,
    "group_id": 5,
    "with": [
        "user"
    ],
    "paged": true,
    "shortresult": false
};

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

Example response (200):


{
  "id": 1,
  "module_object_workspace_insurer_product_id": 2,
  "user_id": 3,
  "parent_id": null,
  "policyAttributes": {...},
  "products": [...],
  "offers": [...],
  "journals": [...],
  "files": [...],
  "...other relations..."
}
 

Example response (403):


{
    "success": false,
    "message": "Unauthorized"
}
 

Request      

GET api/policy/{policy?}

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

policy   integer  optional  

Example: 28

Body Parameters

per_page   integer  optional  

optional Number of results per page. Example: 15

page   integer  optional  

optional Page number. Example: 1

group_id   integer  optional  

optional Filter by group ID. Example: 5

with   string[]  optional  

optional Relations to include. Allowed: moduleObjectWorkspaceInsurerProduct,user,policyAttributes,parentPolicy,childPolicies,offers,products,journals,files.

paged   boolean  optional  

optional Whether to paginate results. Example: true

shortresult   boolean  optional  

optional If true, returns a short result without relations. Example: false

Create a Policy.

requires authentication

Creates a new policy for a module object workspace insurer product. If IDs are not provided, related objects are created or fetched. Also creates policy products and fills attributes.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/policy';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => \Symfony\Component\VarExporter\Internal\Hydrator::hydrate(
            $o = [
                clone (\Symfony\Component\VarExporter\Internal\Registry::$prototypes['stdClass'] ?? \Symfony\Component\VarExporter\Internal\Registry::p('stdClass')),
            ],
            null,
            [
                'stdClass' => [
                    'insurer_product_item_id' => [
                        1,
                    ],
                    'name' => [
                        'Coverage',
                    ],
                    'value' => [
                        '10000',
                    ],
                ],
            ],
            [
                'module_object_workspace_insurer_product_id' => 2,
                'module_object_id' => 5,
                'workspace_id' => 1,
                'insurer_product_id' => 7,
                'module_product_ids' => [
                    3,
                    4,
                ],
                'parent_id' => 10,
                'policy_products' => [
                    $o[0],
                ],
                'attributes' => 'architecto',
            ],
            []
        ),
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
    "http://localhost/api/policy" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"module_object_workspace_insurer_product_id\": 2,
    \"module_object_id\": 5,
    \"workspace_id\": 1,
    \"insurer_product_id\": 7,
    \"module_product_ids\": [
        3,
        4
    ],
    \"parent_id\": 10,
    \"policy_products\": [
        {
            \"insurer_product_item_id\": 1,
            \"name\": \"Coverage\",
            \"value\": \"10000\"
        }
    ],
    \"attributes\": \"architecto\"
}"
const url = new URL(
    "http://localhost/api/policy"
);

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

let body = {
    "module_object_workspace_insurer_product_id": 2,
    "module_object_id": 5,
    "workspace_id": 1,
    "insurer_product_id": 7,
    "module_product_ids": [
        3,
        4
    ],
    "parent_id": 10,
    "policy_products": [
        {
            "insurer_product_item_id": 1,
            "name": "Coverage",
            "value": "10000"
        }
    ],
    "attributes": "architecto"
};

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

Example response (201):


{
    "success": true,
    "message": "policy created successfully",
    "data": {
        "id": 1
    },
    "refreshToken": true
}
 

Example response (422):


{
    "message": "The given data was invalid.",
    "errors": {
        "module_object_workspace_insurer_product_id": [
            "The module_object_workspace_insurer_product_id field is required."
        ],
        "module_object_id": [
            "The module_object_id field is required."
        ],
        "workspace_id": [
            "The workspace_id field is required."
        ],
        "insurer_product_id": [
            "The insurer_product_id field is required."
        ]
    }
}
 

Request      

POST api/policy

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

module_object_workspace_insurer_product_id   integer  optional  

required_without_all:module_object_id,workspace_id,insurer_product_id,module_product_ids The ID of the module object workspace insurer product. Example: 2

module_object_id   integer  optional  

required_without:module_object_workspace_insurer_product_id The ID of the module object. Example: 5

workspace_id   integer  optional  

required_without:module_object_workspace_insurer_product_id The workspace ID. Example: 1

insurer_product_id   integer  optional  

required_without_all:module_object_workspace_insurer_product_id,module_product_ids The insurer product ID. Example: 7

module_product_ids   string[]  optional  

required_without_all:module_object_workspace_insurer_product_id,module_object_id,workspace_id,insurer_product_id Array of module product IDs.

parent_id   integer  optional  

optional The parent policy ID. Example: 10

policy_products   string[]  optional  

optional Array of policy products to create.

attributes   mixed  optional  

optional Any additional attributes for the policy (ex. "foo", "bar"). Example: architecto

Update a Policy.

requires authentication

Updates the module object workspace insurer product and attributes of an existing policy.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/policy/28';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'module_object_workspace_insurer_product_id' => 2,
            'attributes' => 'architecto',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
    "http://localhost/api/policy/28" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"module_object_workspace_insurer_product_id\": 2,
    \"attributes\": \"architecto\"
}"
const url = new URL(
    "http://localhost/api/policy/28"
);

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

let body = {
    "module_object_workspace_insurer_product_id": 2,
    "attributes": "architecto"
};

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

Example response (200):


{
    "success": true,
    "message": "policy updated successfully",
    "refreshToken": true
}
 

Example response (422):


{
    "message": "The given data was invalid.",
    "errors": {
        "module_object_workspace_insurer_product_id": [
            "The module_object_workspace_insurer_product_id field is invalid."
        ]
    }
}
 

Request      

POST api/policy/{policy_id}

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

policy_id   integer   

The ID of the policy. Example: 28

Body Parameters

module_object_workspace_insurer_product_id   integer  optional  

optional The new module object workspace insurer product ID. Example: 2

attributes   mixed  optional  

optional Any additional attributes for the policy (ex. "foo", "bar"). Example: architecto

Delete a Policy.

requires authentication

Deletes the specified policy.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/policy/28';
$response = $client->delete(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request DELETE \
    "http://localhost/api/policy/28" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/policy/28"
);

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

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

Example response (200):


{
    "success": true,
    "message": "policy deleted successfully",
    "refreshToken": true
}
 

Request      

DELETE api/policy/{policy_id}

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

policy_id   integer   

The ID of the policy. Example: 28

PolicyFile

Get Policy File(s).

requires authentication

Retrieves a single policy file (with relations) or a list of files for the given policy. Supports eager loading of related policy, file, and insurer AVB.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/policy/28/file/24';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
    --get "http://localhost/api/policy/28/file/24" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/policy/28/file/24"
);

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

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

Example response (200):


{
  "id": 1,
  "policy_id": 2,
  "file_id": 3,
  "type": "document",
  "invoice_paid": true,
  "send_notification": false,
  "employee_id": 4,
  "individual_email": "john.doe@example.com",
  "policy": {...},
  "file": {...},
  "insurerAvb": {...}
}
 

Example response (403):


{
    "success": false,
    "message": "Unauthorized"
}
 

Example response (404):


{
    "success": false,
    "message": "file not found"
}
 

Request      

GET api/policy/{policy_id}/file/{file?}

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

policy_id   integer   

The ID of the policy. Example: 28

file   integer  optional  

Example: 24

Create a Policy File.

requires authentication

Creates a new file for the given policy. Requires file ID and type. Optionally, invoice paid status, notification settings, employee, and individual email can be provided.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/policy/28/file';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'file_id' => 3,
            'insurer_avb_id' => 5,
            'type' => '"document"',
            'invoice_paid' => true,
            'send_notification' => false,
            'employee_id' => 4,
            'individual_email' => '"john.doe@example.com"',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
    "http://localhost/api/policy/28/file" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"file_id\": 3,
    \"insurer_avb_id\": 5,
    \"type\": \"\\\"document\\\"\",
    \"invoice_paid\": true,
    \"send_notification\": false,
    \"employee_id\": 4,
    \"individual_email\": \"\\\"john.doe@example.com\\\"\"
}"
const url = new URL(
    "http://localhost/api/policy/28/file"
);

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

let body = {
    "file_id": 3,
    "insurer_avb_id": 5,
    "type": "\"document\"",
    "invoice_paid": true,
    "send_notification": false,
    "employee_id": 4,
    "individual_email": "\"john.doe@example.com\""
};

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

Example response (201):


{
    "success": true,
    "message": "policy file created successfully",
    "data": {
        "id": 1
    },
    "refreshToken": true
}
 

Example response (422):


{
    "message": "The given data was invalid.",
    "errors": {
        "file_id": [
            "The file_id field is required."
        ],
        "type": [
            "The type field is required."
        ]
    }
}
 

Request      

POST api/policy/{policy_id}/file

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

policy_id   integer   

The ID of the policy. Example: 28

Body Parameters

file_id   integer   

The file ID to associate. Example: 3

insurer_avb_id   integer  optional  

optional The insurer AVB ID to associate. Example: 5

type   string   

The type of the file. Example: "document"

invoice_paid   boolean  optional  

optional Whether the invoice is paid. Example: true

send_notification   boolean  optional  

optional Whether to send notification to policyholder. Example: false

employee_id   integer  optional  

optional The employee ID to notify. Example: 4

individual_email   string  optional  

optional Individual email to notify. Example: "john.doe@example.com"

Edit a Policy File.

requires authentication

Updates the file ID, insurer AVB ID, type, or invoice paid status of an existing policy file.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/policy/28/file/1';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'file_id' => 4,
            'insurer_avb_id' => 6,
            'type' => '"image"',
            'invoice_paid' => false,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
    "http://localhost/api/policy/28/file/1" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"file_id\": 4,
    \"insurer_avb_id\": 6,
    \"type\": \"\\\"image\\\"\",
    \"invoice_paid\": false
}"
const url = new URL(
    "http://localhost/api/policy/28/file/1"
);

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

let body = {
    "file_id": 4,
    "insurer_avb_id": 6,
    "type": "\"image\"",
    "invoice_paid": false
};

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

Example response (200):


{
    "success": true,
    "message": "policy file updated successfully",
    "refreshToken": true
}
 

Example response (422):


{
    "message": "The given data was invalid.",
    "errors": {
        "file_id": [
            "The file_id field is invalid."
        ],
        "type": [
            "The type field must be a string."
        ]
    }
}
 

Request      

POST api/policy/{policy_id}/file/{file_id}

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

policy_id   integer   

The ID of the policy. Example: 28

file_id   integer   

The ID of the file. Example: 1

Body Parameters

file_id   integer  optional  

optional The new file ID to associate. Example: 4

insurer_avb_id   integer  optional  

optional The new insurer AVB ID to associate. Example: 6

type   string  optional  

optional The new type of the file. Example: "image"

invoice_paid   boolean  optional  

optional Whether the invoice is paid. Example: false

Remove a Policy File.

requires authentication

Deletes the specified file from the policy.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/policy/28/file/1';
$response = $client->delete(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request DELETE \
    "http://localhost/api/policy/28/file/1" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/policy/28/file/1"
);

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

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

Example response (200):


{
    "success": true,
    "message": "policy file deleted successfully",
    "refreshToken": true
}
 

Request      

DELETE api/policy/{policy_id}/file/{file_id}

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

policy_id   integer   

The ID of the policy. Example: 28

file_id   integer   

The ID of the file. Example: 1

PolicyProduct

Get Policy Product(s).

requires authentication

Retrieves a single policy product (with relations) or a list of products for the given policy. Supports eager loading of related policy and insurer product item.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/policy/28/product/184';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
    --get "http://localhost/api/policy/28/product/184" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/policy/28/product/184"
);

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

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

Example response (200):


{
  "id": 1,
  "policy_id": 2,
  "insurer_product_item_id": 3,
  "name": "Coverage",
  "value": "10000",
  "info": "Details",
  "excess": 500,
  "approved": true,
  "policy": {...},
  "insurerProductItem": {...}
}
 

Example response (403):


{
    "success": false,
    "message": "Unauthorized"
}
 

Example response (404):


{
    "success": false,
    "message": "product not found"
}
 

Request      

GET api/policy/{policy_id}/product/{product?}

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

policy_id   integer   

The ID of the policy. Example: 28

product   integer  optional  

Example: 184

Create a Policy Product.

requires authentication

Creates a new product for the given policy. Requires name, optionally links to insurer product item or module product item. Additional fields like value, info, excess, and approved can be provided.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/policy/28/product';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'insurer_product_item_id' => 3,
            'name' => '"Coverage"',
            'value' => '"10000"',
            'info' => '"Details"',
            'excess' => '500',
            'approved' => true,
            'module_product_item_id' => 5,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
    "http://localhost/api/policy/28/product" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"insurer_product_item_id\": 3,
    \"name\": \"\\\"Coverage\\\"\",
    \"value\": \"\\\"10000\\\"\",
    \"info\": \"\\\"Details\\\"\",
    \"excess\": \"500\",
    \"approved\": true,
    \"module_product_item_id\": 5
}"
const url = new URL(
    "http://localhost/api/policy/28/product"
);

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

let body = {
    "insurer_product_item_id": 3,
    "name": "\"Coverage\"",
    "value": "\"10000\"",
    "info": "\"Details\"",
    "excess": "500",
    "approved": true,
    "module_product_item_id": 5
};

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

Example response (201):


{
    "success": true,
    "message": "policy product created successfully",
    "data": {
        "id": 1
    },
    "refreshToken": true
}
 

Example response (422):


{
    "message": "The given data was invalid.",
    "errors": {
        "name": [
            "The name field is required."
        ],
        "insurer_product_item_id": [
            "The insurer_product_item_id field is invalid."
        ],
        "module_product_item_id": [
            "The module_product_item_id field is invalid."
        ]
    }
}
 

Request      

POST api/policy/{policy_id}/product

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

policy_id   integer   

The ID of the policy. Example: 28

Body Parameters

insurer_product_item_id   integer  optional  

optional The insurer product item ID to associate. Example: 3

name   string   

The name of the policy product. Example: "Coverage"

value   string  optional  

optional The value of the product. Example: "10000"

info   string  optional  

optional Additional information. Example: "Details"

excess   numeric  optional  

optional Excess value. Example: 500

approved   boolean  optional  

optional Approval status. Example: true

module_product_item_id   integer  optional  

optional The module product item ID to associate. Example: 5

Edit a Policy Product.

requires authentication

Updates the fields of an existing policy product. Only provided fields will be updated.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/policy/28/product/184';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'insurer_product_item_id' => 3,
            'name' => '"Updated Coverage"',
            'value' => '"15000"',
            'info' => '"Updated details"',
            'excess' => '1000',
            'approved' => false,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
    "http://localhost/api/policy/28/product/184" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"insurer_product_item_id\": 3,
    \"name\": \"\\\"Updated Coverage\\\"\",
    \"value\": \"\\\"15000\\\"\",
    \"info\": \"\\\"Updated details\\\"\",
    \"excess\": \"1000\",
    \"approved\": false
}"
const url = new URL(
    "http://localhost/api/policy/28/product/184"
);

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

let body = {
    "insurer_product_item_id": 3,
    "name": "\"Updated Coverage\"",
    "value": "\"15000\"",
    "info": "\"Updated details\"",
    "excess": "1000",
    "approved": false
};

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

Example response (200):


{
    "success": true,
    "message": "policy product updated successfully",
    "refreshToken": true
}
 

Example response (422):


{
    "message": "The given data was invalid.",
    "errors": {
        "insurer_product_item_id": [
            "The insurer_product_item_id field is invalid."
        ]
    }
}
 

Request      

POST api/policy/{policy_id}/product/{product_id}

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

policy_id   integer   

The ID of the policy. Example: 28

product_id   integer   

The ID of the product. Example: 184

Body Parameters

insurer_product_item_id   integer  optional  

optional The insurer product item ID to associate. Example: 3

name   string  optional  

optional The new name of the policy product. Example: "Updated Coverage"

value   string  optional  

optional The new value of the product. Example: "15000"

info   string  optional  

optional Updated information. Example: "Updated details"

excess   numeric  optional  

optional Updated excess value. Example: 1000

approved   boolean  optional  

optional Updated approval status. Example: false

Remove a Policy Product.

requires authentication

Deletes the specified policy product from the policy.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/policy/28/product/184';
$response = $client->delete(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request DELETE \
    "http://localhost/api/policy/28/product/184" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/policy/28/product/184"
);

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

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

Example response (200):


{
    "success": true,
    "message": "policy product deleted successfully",
    "refreshToken": true
}
 

Request      

DELETE api/policy/{policy_id}/product/{product_id}

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

policy_id   integer   

The ID of the policy. Example: 28

product_id   integer   

The ID of the product. Example: 184

Propbase

Journal

APIs for managing journal entries.

Get journal entries.

requires authentication

Retrieves a single journal entry or a paginated list of journal entries. Supports filtering, sorting, and eager loading of relations.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/propbase/journal/architecto';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'paged' => false,
            'per_page' => 15,
            'page' => 1,
            'with' => [
                'user',
            ],
            'shortresult' => false,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
    --get "http://localhost/api/propbase/journal/architecto" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"paged\": false,
    \"per_page\": 15,
    \"page\": 1,
    \"with\": [
        \"user\"
    ],
    \"shortresult\": false
}"
const url = new URL(
    "http://localhost/api/propbase/journal/architecto"
);

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

let body = {
    "paged": false,
    "per_page": 15,
    "page": 1,
    "with": [
        "user"
    ],
    "shortresult": false
};

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

Example response (200):


{
    "data": {
        "id": 2567,
        "type": "adipisci",
        "visible": true,
        "object_id": 1031881,
        "object_type": "commodi",
        "comment": "incidunt",
        "information": [
            "iure",
            "odit",
            "et"
        ],
        "subtype": "et",
        "categories": [
            "modi",
            "ipsum",
            "nostrum"
        ],
        "pinned": false,
        "created_at": "2025-10-20T17:41:50.000000Z",
        "updated_at": "2025-10-20T17:41:50.000000Z",
        "additional_data": [
            "autem",
            "et",
            "consequatur"
        ],
        "user_id": 2637
    }
}
 

Request      

GET api/propbase/journal/{externalId?}

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

externalId   string  optional  

Example: architecto

Body Parameters

paged   boolean  optional  

Indicates if the results should be paginated. Defaults to true. Example: false

per_page   integer  optional  

Number of results per page when pagination is enabled. Example: 15

page   integer  optional  

The page number to retrieve when pagination is enabled. Example: 1

with   string[]  optional  
Must be one of:
  • user
shortresult   boolean  optional  

If true, returns a simplified result set without related models. Defaults to false. Example: false

Get journals for a specific object.

requires authentication

Retrieves all journal entries associated with a specific object type and ID.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/propbase/journal/object/architecto';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'per_page' => 15,
            'page' => 1,
            'with' => [
                'user',
            ],
            'paged' => false,
            'shortresult' => false,
            'type' => 'Modules\\ModuleObject',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
    --get "http://localhost/api/propbase/journal/object/architecto" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"per_page\": 15,
    \"page\": 1,
    \"with\": [
        \"user\"
    ],
    \"paged\": false,
    \"shortresult\": false,
    \"type\": \"Modules\\\\ModuleObject\"
}"
const url = new URL(
    "http://localhost/api/propbase/journal/object/architecto"
);

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

let body = {
    "per_page": 15,
    "page": 1,
    "with": [
        "user"
    ],
    "paged": false,
    "shortresult": false,
    "type": "Modules\\ModuleObject"
};

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

Example response (200):


{
 "status": true,
 "message": "3 entries found",
 "current_page": 1,
 "last_page": 1,
 "per_page": 15,
 "from": 1,
 "to": 3,
 "total": 3,
 "data": [
    {
    "id": 1,
    "type": "state",
    "visible": true,
    "object_id": 123,
    "object_type": "App\\Models\\Workspace",
    "user_id": 5,
    "additional_data": {...},
    "user": {...}
 }
 

Request      

GET api/propbase/journal/object/{externalId?}

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

externalId   string  optional  

propbase-internal ID Example: architecto

Body Parameters

per_page   integer  optional  

Number of results per page when pagination is enabled. Example: 15

page   integer  optional  

The page number to retrieve when pagination is enabled. Example: 1

with   string[]  optional  
Must be one of:
  • user
paged   boolean  optional  

Indicates if the results should be paginated. Defaults to true. Example: false

shortresult   boolean  optional  

If true, returns a simplified result set without related models. Defaults to false. Example: false

type   string   

The type of the object to retrieve journals for. This should be the class name without the "App\Models\" namespace. Example: Modules\ModuleObject

Create a new journal entry.

requires authentication

Creates a new journal entry for a given object type and object ID. Additional attributes can be provided and will be stored as journal attributes.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/propbase/journal';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'type' => 'note',
            'visible' => false,
            'object_id' => 'PB-0123',
            'object_type' => 'Modules\\ModuleObject',
            'user_id' => 'PB-0123',
            'comment' => 'This is a journal entry comment.',
            'information' => '{"key":"value"}',
            'subtype' => 'update',
            'categories' => '["category1","category2"]',
            'pinned' => false,
            'additional_data' => [
                'extra_info' => 'some value',
            ],
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
    "http://localhost/api/propbase/journal" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"type\": \"note\",
    \"visible\": false,
    \"object_id\": \"PB-0123\",
    \"object_type\": \"Modules\\\\ModuleObject\",
    \"user_id\": \"PB-0123\",
    \"comment\": \"This is a journal entry comment.\",
    \"information\": \"{\\\"key\\\":\\\"value\\\"}\",
    \"subtype\": \"update\",
    \"categories\": \"[\\\"category1\\\",\\\"category2\\\"]\",
    \"pinned\": false,
    \"additional_data\": {
        \"extra_info\": \"some value\"
    }
}"
const url = new URL(
    "http://localhost/api/propbase/journal"
);

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

let body = {
    "type": "note",
    "visible": false,
    "object_id": "PB-0123",
    "object_type": "Modules\\ModuleObject",
    "user_id": "PB-0123",
    "comment": "This is a journal entry comment.",
    "information": "{\"key\":\"value\"}",
    "subtype": "update",
    "categories": "[\"category1\",\"category2\"]",
    "pinned": false,
    "additional_data": {
        "extra_info": "some value"
    }
};

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

Example response (201):


{
  "status": true,
  "message": "Journal entry created successfully",
  "data": {
    "id": 1,
    "type": "state",
    "visible": true,
    "object_id": 123,
    "object_type": "App\\Models\\Workspace",
    "user_id": 5,
    "additional_data": {...},
    "user": {...}
}
 

Request      

POST api/propbase/journal

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

type   string   

The type of journal entry. Example: note

visible   boolean  optional  

Indicates if the journal entry is visible. Example: false

object_id   string   

The ID of the associated object. Example: PB-0123

object_type   string   

The type of the associated object. Example: Modules\ModuleObject

Must be one of:
  • FormLeads\FormLead
  • Modules\ModuleObject
  • Workspace
  • Policies\Policy
  • DamageReport
user_id   string   

The ID of the user creating the journal entry. Example: PB-0123

comment   string  optional  

The comment for the journal entry. Example: This is a journal entry comment.

information   string  optional  

Additional information for the journal entry. Example: {"key":"value"}

subtype   string  optional  

The subtype of the journal entry. Example: update

categories   string  optional  

Categories associated with the journal entry. Example: ["category1","category2"]

pinned   boolean  optional  

Indicates if the journal entry is pinned. Example: false

additional_data   object  optional  

Additional data for the journal entry as a JSON object.

Objects

APIs for managing module objects.

Get Module Object(s).

requires authentication

Retrieves a single module object (with relations) or a paginated list of module objects. Supports filtering, sorting, and eager loading of relations.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/propbase/object/architecto';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'per_page' => 15,
            'page' => 1,
            'group_id' => 2,
            'with' => [
                'policyList',
            ],
            'paged' => false,
            'shortresult' => false,
            'user_id' => 'PB-0123',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
    --get "http://localhost/api/propbase/object/architecto" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"per_page\": 15,
    \"page\": 1,
    \"group_id\": 2,
    \"with\": [
        \"policyList\"
    ],
    \"paged\": false,
    \"shortresult\": false,
    \"user_id\": \"PB-0123\"
}"
const url = new URL(
    "http://localhost/api/propbase/object/architecto"
);

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

let body = {
    "per_page": 15,
    "page": 1,
    "group_id": 2,
    "with": [
        "policyList"
    ],
    "paged": false,
    "shortresult": false,
    "user_id": "PB-0123"
};

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

Example response (200):


{
  "success": true,
  "message": "object(s) retrieved successfully",
  "data": {
     "id": 1,
     "name": "Object Name",
     "module_category_id": 2,
     "user_id": 3,
     "objectAttributes": {...},
     "contacts": [...],
     "...other relations..."
  },
 

Example response (403):


{
    "success": false,
    "message": "Unauthorized"
}
 

Example response (404):


{
    "success": false,
    "message": "object not found"
}
 

Request      

GET api/propbase/object/{externalId?}

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

externalId   string  optional  

Example: architecto

Body Parameters

per_page   integer  optional  

Number of results per page when pagination is enabled. Example: 15

page   integer  optional  

The page number to retrieve when pagination is enabled. Example: 1

group_id   integer  optional  

Filter results by group ID. Example: 2

with   string[]  optional  
Must be one of:
  • objectAttributes
  • user
  • moduleCategory
  • objectGroups
  • moduleObjectWorkspaceInsurerProduct
  • contacts
  • policyList
  • insuranceAnnouncements
  • insuranceOffers
paged   boolean  optional  

Indicates if the results should be paginated. Defaults to true. Example: false

shortresult   boolean  optional  

If true, returns a simplified result set without related models. Defaults to false. Example: false

user_id   string   

The id the object should be created for. Example: PB-0123

Create a new Module Object.

requires authentication

Creates a new module object with the provided data.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/propbase/object';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'id' => 'OBJ-12345',
            'name' => 'Sample Object',
            'category' => 1,
            'group_id' => 10,
            'contacts' => [
                [
                    'type' => 'address',
                    'street' => 'Main St',
                    'housenumber' => '123',
                    'zip' => '12345',
                    'city' => 'Anytown',
                    'region' => 'State',
                    'workspace_id' => 1,
                ],
            ],
            'user_id' => 'USR-67890',
            'propbase_id' => 'PB-54321',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
    "http://localhost/api/propbase/object" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"id\": \"OBJ-12345\",
    \"name\": \"Sample Object\",
    \"category\": 1,
    \"group_id\": 10,
    \"contacts\": [
        {
            \"type\": \"address\",
            \"street\": \"Main St\",
            \"housenumber\": \"123\",
            \"zip\": \"12345\",
            \"city\": \"Anytown\",
            \"region\": \"State\",
            \"workspace_id\": 1
        }
    ],
    \"user_id\": \"USR-67890\",
    \"propbase_id\": \"PB-54321\"
}"
const url = new URL(
    "http://localhost/api/propbase/object"
);

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

let body = {
    "id": "OBJ-12345",
    "name": "Sample Object",
    "category": 1,
    "group_id": 10,
    "contacts": [
        {
            "type": "address",
            "street": "Main St",
            "housenumber": "123",
            "zip": "12345",
            "city": "Anytown",
            "region": "State",
            "workspace_id": 1
        }
    ],
    "user_id": "USR-67890",
    "propbase_id": "PB-54321"
};

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

Example response (201):


{
    "success": true,
    "message": "object created successfully",
    "data": {
        "id": 1
    }
}
 

Example response (400):


{
    "success": false,
    "message": "Validation error message"
}
 

Example response (404):


{
    "success": false,
    "message": "User not found"
}
 

Request      

POST api/propbase/object

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

id   string  optional  

The display ID for the module object. If not provided, a new ID will be generated. Example: OBJ-12345

name   string   

The name of the module object. Example: Sample Object

category   string   

The ID of the category the module object belongs to. The id of an existing record in the module_categories table. Example: 1

group_id   integer  optional  

The ID of the group the module object is associated with (optional). The id of an existing record in the groups table. Example: 10

contacts   object  optional  

An array of contact objects associated with the module object (optional).

user_id   string   

The ID of the user creating the module object. Example: USR-67890

propbase_id   string   

The Propbase ID associated with the module object. Example: PB-54321

User

APIs for managing users.

Register a new user.

requires authentication

Creates a new user and assigns a role and group.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/propbase/users';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'email' => 'user@example.com',
            'firstname' => 'John',
            'lastname' => 'Doe',
            'salutation' => 'M',
            'company' => 'Acme Corp',
            'type' => 'customer',
            'subtype' => 'architecto',
            'group_id' => 2,
            'active_language' => 'de',
            'propbase_id' => 'PB-54321',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
    "http://localhost/api/propbase/users" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"email\": \"user@example.com\",
    \"firstname\": \"John\",
    \"lastname\": \"Doe\",
    \"salutation\": \"M\",
    \"company\": \"Acme Corp\",
    \"type\": \"customer\",
    \"subtype\": \"architecto\",
    \"group_id\": 2,
    \"active_language\": \"de\",
    \"propbase_id\": \"PB-54321\"
}"
const url = new URL(
    "http://localhost/api/propbase/users"
);

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

let body = {
    "email": "user@example.com",
    "firstname": "John",
    "lastname": "Doe",
    "salutation": "M",
    "company": "Acme Corp",
    "type": "customer",
    "subtype": "architecto",
    "group_id": 2,
    "active_language": "de",
    "propbase_id": "PB-54321"
};

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

Example response (201):


{
  "success": true,
  "message": "user created successfully",
  "user": {
    "workspace_id": 1,
    "email": "mail@localhost",
    "active": true,
    "type": "customer",
    "..."
}
 

Example response (400):


{
    "status": false,
    "message": "user already exists"
}
 

Example response (404):


{
    "success": false,
    "message": "workspace does not exist"
}
 

Request      

POST api/propbase/users

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

email   string   

The user's email address. Must be a valid email address. Example: user@example.com

firstname   string   

The user's first name. Example: John

lastname   string   

The user's last name. Example: Doe

salutation   string   

Salutation, one character. Must be at least 1 character. Must not be greater than 1 character. Example: M

company   string  optional  

Company name for group assignment. Example: Acme Corp

type   string  optional  

The user type. Example: customer

Must be one of:
  • main
  • sub
subtype   string   

Example: architecto

group_id   integer  optional  

Group ID. The id of an existing record in the groups table. Example: 2

active_language   string  optional  

Language code. Example: de

Must be one of:
  • de
  • en
propbase_id   string   

propbase internal id. Example: PB-54321

Role

Get Role by Name.

requires authentication

Retrieves a role by its name.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/role/name/architecto';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
    --get "http://localhost/api/role/name/architecto" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/role/name/architecto"
);

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

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

Example response (200):


{
    "id": 1,
    "name": "Admin",
    "description": "Administrator role"
}
 

Example response (404):


{
    "message": "No query results for model [App\\Models\\Role] Admin"
}
 

Request      

GET api/role/name/{name}

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

name   string   

The name. Example: architecto

Get Role(s).

requires authentication

Retrieves a single role by ID or a list of all roles.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/role/1';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
    --get "http://localhost/api/role/1" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/role/1"
);

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

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

Example response (200):


{
    "id": 1,
    "name": "Admin",
    "description": "Administrator role"
}
 

Example response (200):


[
    {
        "id": 1,
        "name": "Admin",
        "description": "Administrator role"
    },
    {
        "id": 2,
        "name": "User",
        "description": "Standard user role"
    }
]
 

Request      

GET api/role/{role?}

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

role   integer  optional  

Example: 1

Search

requires authentication

Performs a search query across all Elasticsearch indices. Returns results grouped by model type. Supports fuzzy search and limits the number of results.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/search';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'query' => '"insurance"',
            'limit' => 50,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
    --get "http://localhost/api/search" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"query\": \"\\\"insurance\\\"\",
    \"limit\": 50
}"
const url = new URL(
    "http://localhost/api/search"
);

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

let body = {
    "query": "\"insurance\"",
    "limit": 50
};

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

Example response (200):


{
  "formlead": [
    {
      "id": 1,
      "name": "Lead A",
      "...other fields..."
    }
  ],
  "user": [
    {
      "id": 2,
      "name": "John Doe",
      "...other fields..."
    }
  ]
}
 

Example response (404):


{
    "error": "No results found"
}
 

Source

Track Source-Template Relation.

Tracks the relation between a source and a template by IP address. Prevents duplicate entries from the same IP within 30 minutes.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/source/track';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'template' => '"template-uuid"',
            'source' => '"source-uuid"',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
    "http://localhost/api/source/track" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"template\": \"\\\"template-uuid\\\"\",
    \"source\": \"\\\"source-uuid\\\"\"
}"
const url = new URL(
    "http://localhost/api/source/track"
);

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

let body = {
    "template": "\"template-uuid\"",
    "source": "\"source-uuid\""
};

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

Example response (201):


{
    "success": true
}
 

Example response (404):


{
    "error": "template or source not found"
}
 

Example response (409):


{
    "error": "entry from this ip already stored"
}
 

Request      

POST api/source/track

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

template   string   

The UUID of the template. Example: "template-uuid"

source   string   

The UUID of the source. Example: "source-uuid"

Get Source(s).

requires authentication

Retrieves a single source (with relations) or a paginated list of sources. Supports filtering, sorting, and eager loading of relations. Only master users can access all sources; others are limited to their workspace.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/source/1';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'per_page' => 15,
            'page' => 1,
            'with' => [
                'workspace',
            ],
            'paged' => true,
            'shortresult' => false,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
    --get "http://localhost/api/source/1" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"per_page\": 15,
    \"page\": 1,
    \"with\": [
        \"workspace\"
    ],
    \"paged\": true,
    \"shortresult\": false
}"
const url = new URL(
    "http://localhost/api/source/1"
);

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

let body = {
    "per_page": 15,
    "page": 1,
    "with": [
        "workspace"
    ],
    "paged": true,
    "shortresult": false
};

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

Example response (200):


{
  "id": 1,
  "name": "Source Name",
  "workspace_id": 2,
  "workspace": {...},
  "groups": [...],
  "collections": [...],
  "sourceAttributes": {...}
}
 

Example response (403):


{
    "success": false,
    "message": "Unauthorized"
}
 

Example response (404):


{
    "success": false,
    "message": "source not found"
}
 

Request      

GET api/source/{source?}

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

source   integer  optional  

Example: 1

Body Parameters

per_page   integer  optional  

optional Number of results per page. Example: 15

page   integer  optional  

optional Page number. Example: 1

with   string[]  optional  

optional Relations to include. Allowed: workspace,groups,collections,sourceAttributes.

paged   boolean  optional  

optional Whether to paginate results. Example: true

shortresult   boolean  optional  

optional If true, returns a short result without relations. Example: false

Create a Source.

requires authentication

Creates a new source. Requires name, optionally workspace_id and avatar image. Additional attributes are stored.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/source';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'multipart/form-data',
            'Accept' => 'application/json',
        ],
        'multipart' => [
            [
                'name' => 'name',
                'contents' => '"My Source"'
            ],
            [
                'name' => 'workspace_id',
                'contents' => '2'
            ],
            [
                'name' => 'attributes',
                'contents' => 'architecto'
            ],
            [
                'name' => 'avatar',
                'contents' => fopen('/tmp/phpMju7xR', 'r')
            ],
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
    "http://localhost/api/source" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: multipart/form-data" \
    --header "Accept: application/json" \
    --form "name="My Source""\
    --form "workspace_id=2"\
    --form "attributes=architecto"\
    --form "avatar=@/tmp/phpMju7xR" 
const url = new URL(
    "http://localhost/api/source"
);

const headers = {
    "Authorization": "Bearer {ACCESS_TOKEN}",
    "Content-Type": "multipart/form-data",
    "Accept": "application/json",
};

const body = new FormData();
body.append('name', '"My Source"');
body.append('workspace_id', '2');
body.append('attributes', 'architecto');
body.append('avatar', document.querySelector('input[name="avatar"]').files[0]);

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

Example response (201):


{
    "success": true,
    "message": "source created successfully",
    "data": {
        "id": 1
    },
    "refreshToken": true
}
 

Example response (422):


{
    "message": "The given data was invalid.",
    "errors": {
        "name": [
            "The name field is required."
        ]
    }
}
 

Request      

POST api/source

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: multipart/form-data

Accept      

Example: application/json

Body Parameters

name   string   

The name of the source. Example: "My Source"

workspace_id   integer  optional  

optional The workspace ID to assign. Example: 2

avatar   file  optional  

optional Avatar image file (max 20MB). Example: /tmp/phpMju7xR

attributes   mixed  optional  

optional Any additional attributes for the source (ex. "foo", "bar"). Example: architecto

Edit a Source.

requires authentication

Updates the fields and attributes of an existing source. Only provided fields will be updated.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/source/1';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'multipart/form-data',
            'Accept' => 'application/json',
        ],
        'multipart' => [
            [
                'name' => 'name',
                'contents' => '"Updated Source"'
            ],
            [
                'name' => 'workspace_id',
                'contents' => '3'
            ],
            [
                'name' => 'attributes',
                'contents' => 'architecto'
            ],
            [
                'name' => 'avatar',
                'contents' => fopen('/tmp/phpxnBqfE', 'r')
            ],
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
    "http://localhost/api/source/1" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: multipart/form-data" \
    --header "Accept: application/json" \
    --form "name="Updated Source""\
    --form "workspace_id=3"\
    --form "attributes=architecto"\
    --form "avatar=@/tmp/phpxnBqfE" 
const url = new URL(
    "http://localhost/api/source/1"
);

const headers = {
    "Authorization": "Bearer {ACCESS_TOKEN}",
    "Content-Type": "multipart/form-data",
    "Accept": "application/json",
};

const body = new FormData();
body.append('name', '"Updated Source"');
body.append('workspace_id', '3');
body.append('attributes', 'architecto');
body.append('avatar', document.querySelector('input[name="avatar"]').files[0]);

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

Example response (200):


{
    "success": true,
    "message": "source edited successfully",
    "refreshToken": true
}
 

Example response (422):


{
    "message": "The given data was invalid.",
    "errors": {
        "workspace_id": [
            "The workspace_id field is invalid."
        ]
    }
}
 

Request      

POST api/source/{source_id}

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: multipart/form-data

Accept      

Example: application/json

URL Parameters

source_id   integer   

The ID of the source. Example: 1

Body Parameters

name   string  optional  

optional The new name of the source. Example: "Updated Source"

workspace_id   integer  optional  

optional The new workspace ID. Example: 3

avatar   file  optional  

optional New avatar image file (max 20MB). Example: /tmp/phpxnBqfE

attributes   mixed  optional  

optional Any additional attributes for the source (ex. "foo", "bar"). Example: architecto

Delete a Source.

requires authentication

Deletes the specified source.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/source/1';
$response = $client->delete(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request DELETE \
    "http://localhost/api/source/1" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/source/1"
);

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

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

Example response (200):


{
    "success": true,
    "message": "source deleted successfully",
    "refreshToken": true
}
 

Request      

DELETE api/source/{source_id}

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

source_id   integer   

The ID of the source. Example: 1

Template

Get Template(s).

requires authentication

Retrieves a single template (with relations) or a paginated list of templates. Supports filtering, sorting, and eager loading of relations.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/template/1';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'per_page' => 15,
            'page' => 1,
            'with' => [
                'settings',
            ],
            'paged' => true,
            'shortresult' => false,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
    --get "http://localhost/api/template/1" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"per_page\": 15,
    \"page\": 1,
    \"with\": [
        \"settings\"
    ],
    \"paged\": true,
    \"shortresult\": false
}"
const url = new URL(
    "http://localhost/api/template/1"
);

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

let body = {
    "per_page": 15,
    "page": 1,
    "with": [
        "settings"
    ],
    "paged": true,
    "shortresult": false
};

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

Example response (200):


{
  "id": 1,
  "name": "Template Name",
  "active": true,
  "settings": {...}
}
 

Example response (403):


{
    "success": false,
    "message": "Unauthorized"
}
 

Example response (404):


{
    "success": false,
    "message": "template not found"
}
 

Request      

GET api/template/{template?}

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

template   integer  optional  

Example: 1

Body Parameters

per_page   integer  optional  

optional Number of results per page. Example: 15

page   integer  optional  

optional Page number. Example: 1

with   string[]  optional  

optional Relations to include. Allowed: settings.

paged   boolean  optional  

optional Whether to paginate results. Example: true

shortresult   boolean  optional  

optional If true, returns a short result without relations. Example: false

Create a Template.

requires authentication

Creates a new template. Requires name and active status.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/template';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'name' => '"My Template"',
            'active' => true,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
    "http://localhost/api/template" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"\\\"My Template\\\"\",
    \"active\": true
}"
const url = new URL(
    "http://localhost/api/template"
);

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

let body = {
    "name": "\"My Template\"",
    "active": true
};

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

Example response (201):


{
    "success": true,
    "message": "template created successfully",
    "data": {
        "id": 1
    },
    "refreshToken": true
}
 

Example response (422):


{
    "message": "The given data was invalid.",
    "errors": {
        "name": [
            "The name field is required."
        ],
        "active": [
            "The active field is required."
        ]
    }
}
 

Request      

POST api/template

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

name   string   

The name of the template. Example: "My Template"

active   boolean   

Whether the template is active. Example: true

Edit a Template.

requires authentication

Updates the name and active status of an existing template.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/template/1';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'name' => '"Updated Template"',
            'active' => false,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
    "http://localhost/api/template/1" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"\\\"Updated Template\\\"\",
    \"active\": false
}"
const url = new URL(
    "http://localhost/api/template/1"
);

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

let body = {
    "name": "\"Updated Template\"",
    "active": false
};

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

Example response (200):


{
    "success": true,
    "message": "template edited successfully",
    "refreshToken": true
}
 

Example response (422):


{
    "message": "The given data was invalid.",
    "errors": {
        "name": [
            "The name field is required."
        ],
        "active": [
            "The active field is required."
        ]
    }
}
 

Request      

POST api/template/{template_id}

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

template_id   integer   

The ID of the template. Example: 1

Body Parameters

name   string   

The new name of the template. Example: "Updated Template"

active   boolean   

The new active status. Example: false

Delete a Template.

requires authentication

Deletes the specified template.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/template/1';
$response = $client->delete(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request DELETE \
    "http://localhost/api/template/1" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/template/1"
);

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

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

Example response (200):


{
    "success": true,
    "message": "template deleted successfully",
    "refreshToken": true
}
 

Request      

DELETE api/template/{template_id}

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

template_id   integer   

The ID of the template. Example: 1

Get Template Settings for Module Workspace.

Retrieves the settings for the specified template and module workspace combination.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/template/1/settings';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'workspace' => 2,
            'module' => 3,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
    --get "http://localhost/api/template/1/settings" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"workspace\": 2,
    \"module\": 3
}"
const url = new URL(
    "http://localhost/api/template/1/settings"
);

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

let body = {
    "workspace": 2,
    "module": 3
};

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

Example response (200):


[
    {
        "id": 1,
        "template_id": 2,
        "module_workspace_id": 3,
        "name": "setting_name",
        "value": "setting_value"
    }
]
 

Example response (422):


{
    "message": "The given data was invalid.",
    "errors": {
        "workspace": [
            "The workspace field is required."
        ],
        "module": [
            "The module field is required."
        ]
    }
}
 

Request      

GET api/template/{template_id}/settings

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

template_id   integer   

The ID of the template. Example: 1

Body Parameters

workspace   integer   

The workspace ID. Example: 2

module   integer   

The module ID. Example: 3

Save Template Settings for Module Workspace.

requires authentication

Updates the settings for the specified template and module workspace combination.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/template/1/settings';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'workspace' => 2,
            'module' => 3,
            'settings' => 'architecto',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
    "http://localhost/api/template/1/settings" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"workspace\": 2,
    \"module\": 3,
    \"settings\": \"architecto\"
}"
const url = new URL(
    "http://localhost/api/template/1/settings"
);

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

let body = {
    "workspace": 2,
    "module": 3,
    "settings": "architecto"
};

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

Example response (200):


{
    "success": true,
    "message": "template settings updated",
    "refreshToken": true
}
 

Example response (200):


{
    "success": false,
    "message": "module not assigned to Workspace",
    "refreshToken": true
}
 

Example response (422):


{
    "message": "The given data was invalid.",
    "errors": {
        "workspace": [
            "The workspace field is required."
        ],
        "module": [
            "The module field is required."
        ]
    }
}
 

Request      

POST api/template/{template_id}/settings

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

template_id   integer   

The ID of the template. Example: 1

Body Parameters

workspace   integer   

The workspace ID. Example: 2

module   integer   

The module ID. Example: 3

settings   mixed   

The settings to update for the template (ex. "foo", "bar"). Example: architecto

User

Change Password.

requires authentication

Updates the password for the currently authenticated user.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/user/change-password';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'password' => '|]|{+-',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
    "http://localhost/api/user/change-password" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"password\": \"|]|{+-\"
}"
const url = new URL(
    "http://localhost/api/user/change-password"
);

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

let body = {
    "password": "|]|{+-"
};

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

Example response (200):


{
    "success": true,
    "message": "password changed successfully",
    "refreshToken": true
}
 

Example response (422):


{
    "message": "The given data was invalid.",
    "errors": {
        "password": [
            "The password field is invalid."
        ]
    }
}
 

Request      

POST api/user/change-password

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

password   string   

The new password. Example: |]|{+-

Get Permissions for the User.

requires authentication

Retrieves the permissions for the specified user or the currently authenticated user.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/user/permissions/1';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
    --get "http://localhost/api/user/permissions/1" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/user/permissions/1"
);

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

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

Example response (200):


[
  {
    "id": 1,
    "name": "Admin",
    "permissions": [...]
  }
]
 

Request      

GET api/user/permissions/{user?}

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

user   integer  optional  

Example: 1

Update User Permissions.

requires authentication

Updates the role of the specified user. Deprecated: use update user endpoint with role_id instead.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/user/permissions/1';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'roles' => [
                2,
            ],
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
    "http://localhost/api/user/permissions/1" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"roles\": [
        2
    ]
}"
const url = new URL(
    "http://localhost/api/user/permissions/1"
);

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

let body = {
    "roles": [
        2
    ]
};

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

Example response (200):


{
    "success": true,
    "message": "user roles changed successfully",
    "refreshToken": true
}
 

Request      

POST api/user/permissions/{user?}

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

user   integer  optional  

Example: 1

Body Parameters

roles   string[]   

The new role(s) for the user.

Add User to Group.

requires authentication

Adds the specified user to a group with a given role. If no role is provided, assigns the 'superadmin' customer role.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/user/groups/1';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'group_id' => 5,
            'role_id' => 2,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
    "http://localhost/api/user/groups/1" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"group_id\": 5,
    \"role_id\": 2
}"
const url = new URL(
    "http://localhost/api/user/groups/1"
);

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

let body = {
    "group_id": 5,
    "role_id": 2
};

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

Example response (200):


{
    "success": true,
    "message": "user added to group successfully",
    "refreshToken": true
}
 

Example response (404):


{
    "success": false,
    "message": "group not found"
}
 

Request      

POST api/user/groups/{user?}

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

user   integer  optional  

Example: 1

Body Parameters

group_id   integer   

The group ID to assign. Example: 5

role_id   integer  optional  

optional The role ID to assign. Example: 2

Delete Current User.

requires authentication

Deletes the currently authenticated user and logs them out.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/user/remove';
$response = $client->delete(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request DELETE \
    "http://localhost/api/user/remove" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/user/remove"
);

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

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

Example response (200):


{
    "success": true,
    "message": "user deleted successfully"
}
 

Request      

DELETE api/user/remove

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

Get Current User.

requires authentication

Retrieves the currently authenticated user with all relevant relations.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/user/current';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
    --get "http://localhost/api/user/current" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/user/current"
);

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

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

Example response (200):


{
  "id": 1,
  "email": "john.doe@example.com",
  "active": true,
  "contacts": [...],
  "formRoles": [...],
  "role": {...},
  "workspace": {...},
  "inGroups": {...},
  "formRoles": {...},
  "uploads": {...},
}
 

Request      

GET api/user/current

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

Get User(s).

requires authentication

Retrieves a single user (with relations) or a paginated list of users. Supports filtering, sorting, and eager loading of relations. Only admins can access all users; customers and guests have limited access.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/user/1';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'per_page' => 15,
            'page' => 1,
            'group_id' => 5,
            'with' => [
                'contacts',
            ],
            'paged' => true,
            'shortresult' => false,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
    --get "http://localhost/api/user/1" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"per_page\": 15,
    \"page\": 1,
    \"group_id\": 5,
    \"with\": [
        \"contacts\"
    ],
    \"paged\": true,
    \"shortresult\": false
}"
const url = new URL(
    "http://localhost/api/user/1"
);

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

let body = {
    "per_page": 15,
    "page": 1,
    "group_id": 5,
    "with": [
        "contacts"
    ],
    "paged": true,
    "shortresult": false
};

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

Example response (200):


{
  "id": 1,
  "email": "john.doe@example.com",
  "active": true,
  "contacts": [...],
  "formRoles": [...],
  "role": {...},
  "...other relations..."
}
 

Example response (403):


{
    "success": false,
    "message": "Unauthorized"
}
 

Request      

GET api/user/{user?}

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

user   integer  optional  

Example: 1

Body Parameters

per_page   integer  optional  

optional Number of results per page. Example: 15

page   integer  optional  

optional Page number. Example: 1

group_id   integer  optional  

optional Filter by group ID. Example: 5

with   string[]  optional  

optional Relations to include. Allowed: contacts,formRoles,role.

paged   boolean  optional  

optional Whether to paginate results. Example: true

shortresult   boolean  optional  

optional If true, returns a short result without relations. Example: false

Update User.

requires authentication

Updates the fields and attributes of an existing user. Only provided fields will be updated. Also updates contact and user attributes.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/user/1';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'email' => '"new.email@example.com"',
            'active' => true,
            'tfatype' => '"app"',
            'google2fa_secret' => '"SECRET"',
            'last_login' => '"2024-06-01"',
            'last_activity' => '"2024-06-01"',
            'password' => '|]|{+-',
            'active_language' => '"en"',
            '_data' => 'architecto',
            'attributes' => 'architecto',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
    "http://localhost/api/user/1" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"email\": \"\\\"new.email@example.com\\\"\",
    \"active\": true,
    \"tfatype\": \"\\\"app\\\"\",
    \"google2fa_secret\": \"\\\"SECRET\\\"\",
    \"last_login\": \"\\\"2024-06-01\\\"\",
    \"last_activity\": \"\\\"2024-06-01\\\"\",
    \"password\": \"|]|{+-\",
    \"active_language\": \"\\\"en\\\"\",
    \"_data\": \"architecto\",
    \"attributes\": \"architecto\"
}"
const url = new URL(
    "http://localhost/api/user/1"
);

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

let body = {
    "email": "\"new.email@example.com\"",
    "active": true,
    "tfatype": "\"app\"",
    "google2fa_secret": "\"SECRET\"",
    "last_login": "\"2024-06-01\"",
    "last_activity": "\"2024-06-01\"",
    "password": "|]|{+-",
    "active_language": "\"en\"",
    "_data": "architecto",
    "attributes": "architecto"
};

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

Example response (200):


{
    "success": true,
    "message": "user updated successfully",
    "refreshToken": true
}
 

Example response (422):


{
    "message": "The given data was invalid.",
    "errors": {
        "email": [
            "The email field must be a valid email address."
        ]
    }
}
 

Request      

POST api/user/{user?}

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

user   integer  optional  

Example: 1

Body Parameters

email   string  optional  

optional The new email address. Example: "new.email@example.com"

active   boolean  optional  

optional The active status. Example: true

tfatype   string  optional  

optional Two-factor authentication type. Allowed: email, app. Example: "app"

google2fa_secret   string  optional  

required_if:tfatype,app The Google 2FA secret. Example: "SECRET"

last_login   date  optional  

optional Last login date. Example: "2024-06-01"

last_activity   date  optional  

optional Last activity date. Example: "2024-06-01"

password   string  optional  

optional The new password. Example: |]|{+-

active_language   string  optional  

optional The active language. Allowed: de, en. Example: "en"

_data   mixed  optional  

optional Connection data for contact. Example: architecto

attributes   mixed  optional  

optional Any additional attributes for the user (ex. "foo", "bar"). Example: architecto

Version

Get Versioned Model.

requires authentication

Retrieves the model instance for the given version. Loads additional relations if specified in the request.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/version/1';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
    --get "http://localhost/api/version/1" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/version/1"
);

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

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

Example response (200):


{
  "id": 1,
  "versionable_type": "App\\Models\\FormLead",
  "versionable_id": 123,
  "...model fields and relations..."
}
 

Example response (404):


{
    "success": false,
    "message": "Model not found"
}
 

Request      

GET api/version/{version_id}

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

version_id   integer   

The ID of the version. Example: 1

Workspace

Check if User is Invitable to Workspace.

requires authentication

Checks if a user can be invited to the specified workspace and role.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/workspace/user';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'email' => '"john.doe@example.com"',
            'workspace' => 1,
            'role' => 2,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
    --get "http://localhost/api/workspace/user" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"email\": \"\\\"john.doe@example.com\\\"\",
    \"workspace\": 1,
    \"role\": 2
}"
const url = new URL(
    "http://localhost/api/workspace/user"
);

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

let body = {
    "email": "\"john.doe@example.com\"",
    "workspace": 1,
    "role": 2
};

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

Example response (200):


{
    "success": true,
    "message": "user already exists in workspace"
}
 

Example response (200):


{
    "success": true,
    "message": "role already assigned in workspace"
}
 

Example response (200):


{
    "success": false,
    "message": "user does not exist in workspace"
}
 

Example response (200):


{
    "success": false,
    "message": "role not assigned to user in workspace"
}
 

Request      

GET api/workspace/user

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

email   string   

The email address of the user. Example: "john.doe@example.com"

workspace   integer   

The workspace ID. Example: 1

role   integer  optional  

optional The role ID. Example: 2

Invite User to Workspace.

requires authentication

Invites a user to the specified workspace with the given role and group. Optionally sends an email invitation.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/workspace/user/invite';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'email' => '"john.doe@example.com"',
            'password' => '"secret123"',
            'workspace' => 1,
            'role' => 2,
            'tfatype' => '"email"',
            'firstname' => '"John"',
            'lastname' => '"Doe"',
            'salutation' => '"M"',
            'group_id' => 3,
            'google2fa_secret' => '"SECRET"',
            'without_mail' => false,
            'active_language' => '"en"',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
    "http://localhost/api/workspace/user/invite" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"email\": \"\\\"john.doe@example.com\\\"\",
    \"password\": \"\\\"secret123\\\"\",
    \"workspace\": 1,
    \"role\": 2,
    \"tfatype\": \"\\\"email\\\"\",
    \"firstname\": \"\\\"John\\\"\",
    \"lastname\": \"\\\"Doe\\\"\",
    \"salutation\": \"\\\"M\\\"\",
    \"group_id\": 3,
    \"google2fa_secret\": \"\\\"SECRET\\\"\",
    \"without_mail\": false,
    \"active_language\": \"\\\"en\\\"\"
}"
const url = new URL(
    "http://localhost/api/workspace/user/invite"
);

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

let body = {
    "email": "\"john.doe@example.com\"",
    "password": "\"secret123\"",
    "workspace": 1,
    "role": 2,
    "tfatype": "\"email\"",
    "firstname": "\"John\"",
    "lastname": "\"Doe\"",
    "salutation": "\"M\"",
    "group_id": 3,
    "google2fa_secret": "\"SECRET\"",
    "without_mail": false,
    "active_language": "\"en\""
};

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

Example response (201):


{
    "success": true,
    "message": "user invitation with given role to workspace succesful",
    "data": {
        "id": 1
    },
    "refreshToken": true
}
 

Example response (404):


{
    "success": false,
    "message": "workspace does not exist"
}
 

Example response (422):


{
    "message": "The given data was invalid."
}
 

Request      

POST api/workspace/user/invite

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

email   string   

The email address of the user. Example: "john.doe@example.com"

password   string   

The password for the user. Example: "secret123"

workspace   integer   

The workspace ID. Example: 1

role   integer   

The role ID. Example: 2

tfatype   string   

Two-factor authentication type. Example: "email"

firstname   string   

First name of the user. Example: "John"

lastname   string   

Last name of the user. Example: "Doe"

salutation   string   

Salutation (single character). Example: "M"

group_id   integer   

The group ID. Example: 3

google2fa_secret   string  optional  

required_if:tfatype,app The Google 2FA secret. Example: "SECRET"

without_mail   boolean  optional  

optional If true, does not send an email invitation. Example: false

active_language   string  optional  

optional The active language. Example: "en"

Resend Invitation to User for Workspace.

requires authentication

Resends the invitation email to the specified user for the given role in the workspace.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/workspace/user/resend';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'user' => 1,
            'role' => 2,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
    "http://localhost/api/workspace/user/resend" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"user\": 1,
    \"role\": 2
}"
const url = new URL(
    "http://localhost/api/workspace/user/resend"
);

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

let body = {
    "user": 1,
    "role": 2
};

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

Example response (200):


{
    "success": true,
    "message": "resending user invitation with given role to workspace successful",
    "refreshToken": true
}
 

Example response (422):


{
    "message": "The given data was invalid."
}
 

Request      

POST api/workspace/user/resend

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

user   integer   

The user ID. Example: 1

role   integer   

The role ID. Example: 2

Remove User from Workspace.

requires authentication

Removes the specified user from the workspace or removes a role from the user in the workspace.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/workspace/user/1';
$response = $client->delete(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'role' => 2,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request DELETE \
    "http://localhost/api/workspace/user/1" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"role\": 2
}"
const url = new URL(
    "http://localhost/api/workspace/user/1"
);

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

let body = {
    "role": 2
};

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

Example response (200):


{
    "success": true,
    "message": "user removed from workspace",
    "refreshToken": true
}
 

Example response (200):


{
    "success": true,
    "message": "role removed for user in workspace",
    "refreshToken": true
}
 

Example response (404):


{
    "success": false,
    "message": "no user with given role exists in workspace"
}
 

Request      

DELETE api/workspace/user/{user_id}

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

user_id   integer   

The ID of the user. Example: 1

Body Parameters

role   integer  optional  

optional The role ID to remove. Example: 2

Create Workspace.

requires authentication

Creates a new workspace with the provided name, frontend URL, languages, default language, contacts, avatar, and attributes.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/workspace';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'multipart/form-data',
            'Accept' => 'application/json',
        ],
        'multipart' => [
            [
                'name' => 'name',
                'contents' => '"My Workspace"'
            ],
            [
                'name' => 'frontend_url',
                'contents' => '"https://frontend.example.com"'
            ],
            [
                'name' => 'languages[]',
                'contents' => 'de'
            ],
            [
                'name' => 'default_language',
                'contents' => '"de"'
            ],
            [
                'name' => 'contacts[]',
                'contents' => 'architecto'
            ],
            [
                'name' => 'attributes[]',
                'contents' => 'architecto'
            ],
            [
                'name' => 'avatar',
                'contents' => fopen('/tmp/phpuIPTzM', 'r')
            ],
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
    "http://localhost/api/workspace" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: multipart/form-data" \
    --header "Accept: application/json" \
    --form "name="My Workspace""\
    --form "frontend_url="https://frontend.example.com""\
    --form "languages[]=de"\
    --form "default_language="de""\
    --form "contacts[]=architecto"\
    --form "attributes[]=architecto"\
    --form "avatar=@/tmp/phpuIPTzM" 
const url = new URL(
    "http://localhost/api/workspace"
);

const headers = {
    "Authorization": "Bearer {ACCESS_TOKEN}",
    "Content-Type": "multipart/form-data",
    "Accept": "application/json",
};

const body = new FormData();
body.append('name', '"My Workspace"');
body.append('frontend_url', '"https://frontend.example.com"');
body.append('languages[]', 'de');
body.append('default_language', '"de"');
body.append('contacts[]', 'architecto');
body.append('attributes[]', 'architecto');
body.append('avatar', document.querySelector('input[name="avatar"]').files[0]);

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

Example response (201):


{
    "success": true,
    "message": "workspace created successfully",
    "data": {
        "id": 1
    },
    "refreshToken": true
}
 

Example response (422):


{
    "message": "The given data was invalid.",
    "errors": {
        "name": [
            "The name field is required."
        ],
        "frontend_url": [
            "The frontend_url field is required."
        ],
        "contacts": [
            "The contacts field is required."
        ]
    }
}
 

Request      

POST api/workspace

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: multipart/form-data

Accept      

Example: application/json

Body Parameters

name   string   

The name of the workspace. Example: "My Workspace"

frontend_url   string   

The frontend URL of the workspace. Example: "https://frontend.example.com"

languages   string[]  optional  

optional Supported languages.

default_language   string  optional  

optional Default language. Example: "de"

contacts   string[]   

Array of contact data for the workspace.

avatar   file  optional  

optional Avatar image file (max 20MB). Example: /tmp/phpuIPTzM

attributes   string[]  optional  

optional Additional attributes for the workspace.

Get Workspace Details By Frontend URL.

Retrieves detailed information about a workspace by its frontend URL. The method normalizes the provided URL, searches for a matching workspace, and returns various workspace attributes and configuration values.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/workspace/url';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'frontend_url' => 'architecto',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
    --get "http://localhost/api/workspace/url" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"frontend_url\": \"architecto\"
}"
const url = new URL(
    "http://localhost/api/workspace/url"
);

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

let body = {
    "frontend_url": "architecto"
};

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

Example response (200):


{
    "id": 1,
    "name": "Workspace Name",
    "avatar": "https://example.com/avatar.png",
    "primaryColor": "#123456",
    "fastlaneInsurerProductId": 10,
    "fastlaneWorkspaceInsurerProductId": 20,
    "fastlaneModuleWorkspaceId": 30,
    "standardWorkspaceInsurerProductId": 40,
    "standardModuleWorkspaceId": 50,
    "standardModuleId": 60,
    "standardModuleProductId": 70,
    "currencyLocale": "de-DE",
    "currency": "EUR",
    "currencyPrefix": "€",
    "currencyThousandsSeparator": ".",
    "currencyDecimalSeparator": ",",
    "privacyUrl": "https://example.com/privacy",
    "termsUrl": "https://example.com/terms",
    "languages": [
        "de",
        "en"
    ],
    "defaultLanguage": "de",
    "footerMenu": []
}
 

Example response (422):


{
    "message": "The given data was invalid.",
    "errors": {
        "frontend_url": [
            "The frontend_url field is required."
        ]
    }
}
 

Request      

GET api/workspace/url

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

frontend_url   string   

The frontend_url of an existing record in the workspaces table. Example: architecto

Get Workspace(s).

requires authentication

Retrieves a single workspace (with relations) by ID or a paginated list of workspaces. Supports filtering, sorting, and eager loading of relations.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/workspace/architecto';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'per_page' => 15,
            'page' => 1,
            'with' => [
                'users',
            ],
            'paged' => true,
            'shortresult' => false,
            'with_inactive' => true,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
    --get "http://localhost/api/workspace/architecto" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"per_page\": 15,
    \"page\": 1,
    \"with\": [
        \"users\"
    ],
    \"paged\": true,
    \"shortresult\": false,
    \"with_inactive\": true
}"
const url = new URL(
    "http://localhost/api/workspace/architecto"
);

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

let body = {
    "per_page": 15,
    "page": 1,
    "with": [
        "users"
    ],
    "paged": true,
    "shortresult": false,
    "with_inactive": true
};

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

Example response (200):


{
  "id": 1,
  "name": "Workspace Name",
  "avatar": "url",
  "frontend_url": "https://frontend.example.com",
  "active": true,
  "languages": ["de", "en"],
  "default_language": "de",
  "users": [...],
  "sources": [...],
  "insurerProducts": [...],
  "contacts": [...],
  "workspaceAttributes": [...],
  "...other relations..."
}
 

Example response (403):


{
    "success": false,
    "message": "Unauthorized"
}
 

Example response (404):


{
    "success": false,
    "message": "workspace does not exist"
}
 

Request      

GET api/workspace/{workspace?}

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

workspace   string  optional  

Example: architecto

Body Parameters

per_page   integer  optional  

optional Number of results per page. Example: 15

page   integer  optional  

optional Page number. Example: 1

with   string[]  optional  

optional Relations to include. Allowed: users,sources,insurerProducts,contacts,workspaceAttributes,moduleWorkspace,collections,workspaceInsurerProducts.

paged   boolean  optional  

optional Whether to paginate results. Example: true

shortresult   boolean  optional  

optional If true, returns a short result without relations. Example: false

with_inactive   boolean  optional  

optional If true, includes inactive workspaces. Example: true

Update Workspace.

requires authentication

Updates the fields and contacts of an existing workspace. Only provided fields will be updated.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/workspace/architecto';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'multipart/form-data',
            'Accept' => 'application/json',
        ],
        'multipart' => [
            [
                'name' => 'frontend_url',
                'contents' => '"https://frontend.example.com"'
            ],
            [
                'name' => 'languages[]',
                'contents' => 'de'
            ],
            [
                'name' => 'default_language',
                'contents' => '"en"'
            ],
            [
                'name' => 'contacts[]',
                'contents' => 'architecto'
            ],
            [
                'name' => 'attributes[]',
                'contents' => 'architecto'
            ],
            [
                'name' => 'avatar',
                'contents' => fopen('/tmp/phpddPvPy', 'r')
            ],
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
    "http://localhost/api/workspace/architecto" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: multipart/form-data" \
    --header "Accept: application/json" \
    --form "frontend_url="https://frontend.example.com""\
    --form "languages[]=de"\
    --form "default_language="en""\
    --form "contacts[]=architecto"\
    --form "attributes[]=architecto"\
    --form "avatar=@/tmp/phpddPvPy" 
const url = new URL(
    "http://localhost/api/workspace/architecto"
);

const headers = {
    "Authorization": "Bearer {ACCESS_TOKEN}",
    "Content-Type": "multipart/form-data",
    "Accept": "application/json",
};

const body = new FormData();
body.append('frontend_url', '"https://frontend.example.com"');
body.append('languages[]', 'de');
body.append('default_language', '"en"');
body.append('contacts[]', 'architecto');
body.append('attributes[]', 'architecto');
body.append('avatar', document.querySelector('input[name="avatar"]').files[0]);

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

Example response (200):


{
    "success": true,
    "message": "workspace updated successfully",
    "refreshToken": true
}
 

Example response (404):


{
    "success": false,
    "message": "workspace does not exist"
}
 

Example response (422):


{
    "message": "The given data was invalid."
}
 

Request      

POST api/workspace/{workspace}

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: multipart/form-data

Accept      

Example: application/json

URL Parameters

workspace   string   

The workspace. Example: architecto

Body Parameters

frontend_url   string  optional  

optional The new frontend URL. Example: "https://frontend.example.com"

languages   string[]  optional  

optional Updated languages.

default_language   string  optional  

optional Updated default language. Example: "en"

contacts   string[]  optional  

optional Updated contacts for the workspace.

avatar   file  optional  

optional New avatar image file (max 20MB). Example: /tmp/phpddPvPy

attributes   string[]  optional  

optional Updated attributes for the workspace.

Delete Workspace.

requires authentication

Deletes the specified workspace.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/workspace/2';
$response = $client->delete(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request DELETE \
    "http://localhost/api/workspace/2" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/workspace/2"
);

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

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

Example response (200):


{
    "success": true,
    "message": "workspace deleted successfully",
    "refreshToken": true
}
 

Request      

DELETE api/workspace/{workspace?}

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

workspace   integer  optional  

Example: 2

WorkspaceInsurerProduct

Get Workspace Insurer Product(s).

requires authentication

Retrieves a single workspace insurer product (with relations) or a paginated list of workspace insurer products for the given workspace. Supports filtering by module product, eager loading of relations, and pagination.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/workspace/2/insurerproduct/1';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'module_product_id' => 2,
            'per_page' => 15,
            'page' => 1,
            'with' => [
                'insurerProduct',
            ],
            'paged' => true,
            'shortresult' => false,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
    --get "http://localhost/api/workspace/2/insurerproduct/1" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"module_product_id\": 2,
    \"per_page\": 15,
    \"page\": 1,
    \"with\": [
        \"insurerProduct\"
    ],
    \"paged\": true,
    \"shortresult\": false
}"
const url = new URL(
    "http://localhost/api/workspace/2/insurerproduct/1"
);

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

let body = {
    "module_product_id": 2,
    "per_page": 15,
    "page": 1,
    "with": [
        "insurerProduct"
    ],
    "paged": true,
    "shortresult": false
};

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

Example response (200):


{
  "id": 1,
  "workspace_id": 2,
  "insurer_product_id": 3,
  "insurerProduct": {...},
  "insuranceAnnouncements": [...],
  "insurerAvbs": [...],
  "insuranceOffers": [...],
  "insurerTariffConstructionCosts": [...],
  "moduleObjectWorkspaceInsurerProduct": [...]
}
 

Example response (403):


{
    "success": false,
    "message": "Unauthorized"
}
 

Example response (404):


{
    "success": false,
    "message": "workspace insurer product not found"
}
 

Request      

GET api/workspace/{workspace_id}/insurerproduct/{insurerproduct?}

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

workspace_id   integer   

The ID of the workspace. Example: 2

insurerproduct   integer  optional  

Example: 1

Body Parameters

module_product_id   integer  optional  

optional Filter by module product ID. Example: 2

per_page   integer  optional  

optional Number of results per page. Example: 15

page   integer  optional  

optional Page number. Example: 1

with   string[]  optional  

optional Relations to include. Allowed: insurerProduct,workspaceInsurerProductAttributes,workspace,insuranceAnnouncements,insurerAvbs,insuranceOffers,insurerTariffConstructionCosts,moduleObjectWorkspaceInsurerProduct.

paged   boolean  optional  

optional Whether to paginate results. Example: true

shortresult   boolean  optional  

optional If true, returns a short result without relations. Example: false

Add an Insurer Product to Workspace.

requires authentication

Assigns the specified insurer product to the given workspace. If the product is already assigned, returns an error.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/workspace/2/insurerproduct/1';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'attributes' => 'architecto',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
    "http://localhost/api/workspace/2/insurerproduct/1" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"attributes\": \"architecto\"
}"
const url = new URL(
    "http://localhost/api/workspace/2/insurerproduct/1"
);

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

let body = {
    "attributes": "architecto"
};

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

Example response (200):


{
    "success": false,
    "message": "insurer product already in workspace",
    "refreshToken": true
}
 

Example response (201):


{
    "success": true,
    "message": "insurer product assigned to workspace",
    "data": {
        "id": 1
    },
    "refreshToken": true
}
 

Request      

POST api/workspace/{workspace_id}/insurerproduct/{insurerproduct_id}

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

workspace_id   integer   

The ID of the workspace. Example: 2

insurerproduct_id   integer   

The ID of the insurerproduct. Example: 1

Body Parameters

attributes   mixed  optional  

optional Additional attributes for the workspace insurer product (ex. "fop", "bar"). Example: architecto

Edit Workspace Insurer Product.

requires authentication

Updates the attributes of an existing workspace insurer product. Only provided fields will be updated.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/workspace/2/insurerproduct/1/edit';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'attributes' => 'architecto',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
    "http://localhost/api/workspace/2/insurerproduct/1/edit" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"attributes\": \"architecto\"
}"
const url = new URL(
    "http://localhost/api/workspace/2/insurerproduct/1/edit"
);

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

let body = {
    "attributes": "architecto"
};

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

Example response (200):


{
    "success": true,
    "message": "workspace insurer product updated",
    "refreshToken": true
}
 

Example response (200):


{
    "success": false,
    "message": "insurer product is not assigned to workspace",
    "refreshToken": true
}
 

Request      

POST api/workspace/{workspace_id}/insurerproduct/{insurerproduct_id}/edit

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

workspace_id   integer   

The ID of the workspace. Example: 2

insurerproduct_id   integer   

The ID of the insurerproduct. Example: 1

Body Parameters

attributes   mixed  optional  

optional Attributes to update for the workspace insurer product (ex. "foo", "bar"). Example: architecto

Remove an Insurer Product from Workspace.

requires authentication

Deletes the specified insurer product from the workspace.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/workspace/2/insurerproduct/1';
$response = $client->delete(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request DELETE \
    "http://localhost/api/workspace/2/insurerproduct/1" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/workspace/2/insurerproduct/1"
);

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

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

Example response (200):


{
    "success": true,
    "message": "insurer product removed from workspace",
    "refreshToken": true
}
 

Example response (200):


{
    "success": false,
    "message": "insurer product is not assigned to workspace",
    "refreshToken": true
}
 

Request      

DELETE api/workspace/{workspace_id}/insurerproduct/{insurerproduct_id}

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

workspace_id   integer   

The ID of the workspace. Example: 2

insurerproduct_id   integer   

The ID of the insurerproduct. Example: 1

WorkspaceAttributes

Get Workspace Attribute(s).

requires authentication

Retrieves a single workspace attribute (with relations) or a list of attributes for the given workspace. Supports eager loading of the workspace relation.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/workspace/2/attribute/150';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
    --get "http://localhost/api/workspace/2/attribute/150" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/workspace/2/attribute/150"
);

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

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

Example response (200):


[
  {
    "id": 1,
    "workspace_id": 2,
    "name": "Attribute Name",
    "type": "string",
    "value_string": "Value",
    "category": "General",
    "workspace": {...}
  }
]
 

Example response (200):


{
  "id": 1,
  "workspace_id": 2,
  "name": "Attribute Name",
  "type": "string",
  "value_string": "Value",
  "category": "General",
  "workspace": {...}
}
 

Request      

GET api/workspace/{workspace_id}/attribute/{attribute?}

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

workspace_id   integer   

The ID of the workspace. Example: 2

attribute   integer  optional  

Example: 150

Create Workspace Attribute.

requires authentication

Creates a new attribute for the given workspace. Requires name, type, and value. Optionally, a category can be provided.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/workspace/2/attribute';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'name' => '"Location"',
            'type' => '"string"',
            'value' => '"Berlin"',
            'category' => '"General"',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
    "http://localhost/api/workspace/2/attribute" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"\\\"Location\\\"\",
    \"type\": \"\\\"string\\\"\",
    \"value\": \"\\\"Berlin\\\"\",
    \"category\": \"\\\"General\\\"\"
}"
const url = new URL(
    "http://localhost/api/workspace/2/attribute"
);

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

let body = {
    "name": "\"Location\"",
    "type": "\"string\"",
    "value": "\"Berlin\"",
    "category": "\"General\""
};

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

Example response (201):


{
    "success": true,
    "message": "workspace attribute created successfully",
    "data": {
        "id": 1
    },
    "refreshToken": true
}
 

Example response (422):


{
    "message": "The given data was invalid.",
    "errors": {
        "name": [
            "The name field is required."
        ],
        "type": [
            "The type field is required."
        ],
        "value": [
            "The value field is required."
        ]
    }
}
 

Request      

POST api/workspace/{workspace_id}/attribute

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

workspace_id   integer   

The ID of the workspace. Example: 2

Body Parameters

name   string   

The name of the attribute. Example: "Location"

type   string   

The type of the attribute. Allowed: bool, string, text, int, float, datetime. Example: "string"

value   string   

The value of the attribute. Example: "Berlin"

category   string  optional  

optional The category of the attribute. Example: "General"

Edit Workspace Attribute.

requires authentication

Updates the fields of an existing workspace attribute. Only provided fields will be updated.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/workspace/2/attribute/150';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'name' => '"Updated Location"',
            'type' => '"int"',
            'value' => '42',
            'category' => '"Details"',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
    "http://localhost/api/workspace/2/attribute/150" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"\\\"Updated Location\\\"\",
    \"type\": \"\\\"int\\\"\",
    \"value\": \"42\",
    \"category\": \"\\\"Details\\\"\"
}"
const url = new URL(
    "http://localhost/api/workspace/2/attribute/150"
);

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

let body = {
    "name": "\"Updated Location\"",
    "type": "\"int\"",
    "value": "42",
    "category": "\"Details\""
};

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

Example response (200):


{
    "success": true,
    "message": "workspace attribute updated successfully",
    "refreshToken": true
}
 

Example response (422):


{
    "message": "The given data was invalid.",
    "errors": {
        "value": [
            "The value field is required."
        ]
    }
}
 

Request      

POST api/workspace/{workspace_id}/attribute/{attribute_id}

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

workspace_id   integer   

The ID of the workspace. Example: 2

attribute_id   integer   

The ID of the attribute. Example: 150

Body Parameters

name   string  optional  

optional The new name of the attribute. Example: "Updated Location"

type   string  optional  

optional The new type of the attribute. Allowed: bool, string, text, int, float, datetime. Example: "int"

value   mixed   

The new value of the attribute. Type depends on attribute type. Example: 42

category   string  optional  

optional The new category of the attribute. Example: "Details"

Delete Workspace Attribute.

requires authentication

Deletes the specified workspace attribute.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/workspace/2/attribute/150';
$response = $client->delete(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request DELETE \
    "http://localhost/api/workspace/2/attribute/150" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "http://localhost/api/workspace/2/attribute/150"
);

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

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

Example response (200):


{
    "success": true,
    "message": "workspace attribute deleted successfully",
    "refreshToken": true
}
 

Request      

DELETE api/workspace/{workspace_id}/attribute/{attribute_id}

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

workspace_id   integer   

The ID of the workspace. Example: 2

attribute_id   integer   

The ID of the attribute. Example: 150

Zefix

Get Zefix Company Search Results.

requires authentication

Searches for Swiss companies using the Zefix API by name. Returns a list of matching companies and, if only one result is found, additional details including address, purpose, publications, and office information.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'http://localhost/api/zefix';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {ACCESS_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'search' => '"Swisscom"',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
    --get "http://localhost/api/zefix" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"search\": \"\\\"Swisscom\\\"\"
}"
const url = new URL(
    "http://localhost/api/zefix"
);

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

let body = {
    "search": "\"Swisscom\""
};

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

Example response (200):


{
  "search_result": [
    {
      "chid": "CHE123456789",
      "name": "Swisscom AG",
      "purpose": "Telecommunications",
      "publications": [...],
      "headOffices": [...],
      "furtherHeadOffices": [...],
      "branchOffices": [...]
    }
  ],
  "address": {
    "postal_code": "8000",
    "street_nr": "1",
    "street": "Bahnhofstrasse",
    "ch_number": "CHE123456789",
    "city": "Zurich",
    "name": "Swisscom AG",
    "region": "ZH",
    "country": "CH"
  }
}
 

Example response (422):


{
    "message": "The given data was invalid.",
    "errors": {
        "search": [
            "The search field is required."
        ]
    }
}
 

Request      

GET api/zefix

Headers

Authorization      

Example: Bearer {ACCESS_TOKEN}

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

search   string   

The company name to search for. Example: "Swisscom"