MENU navbar-image

Introduction

The API resources allows you to use most of the features of Garchi Headless CMS to create your own Headless app.

This documentation is for v2 and aims to provide all the information you need to work with our API. As you scroll, you'll see code examples for working with the API in different programming languages in the dark area to the right (or as part of the content on mobile). You can switch the language used with the tabs at the top right (or from the nav menu at the top left on mobile).

The JavaScript and PHP examples use the official SDKs (@garchicms/garchi-node-sdk and garchicms/garchi-sdk-php); the other languages call the REST API directly. Every request is authenticated with your API token, sent as a bearer token in the Authorization header (Authorization: Bearer {YOUR_API_TOKEN}). The SDKs add that header for you when you pass your token to the client.

The API has a rate limit of 600 requests per minute. If more than 600 requests are made within a 1 minute sliding window, the API will return a 429 "Too Many Requests" status code until the rate limit resets.

The rate limit window is measured in 1 minute intervals. If the rate limit is exceeded at 10:05, requests will be throttled until at least 10:06. The rate limit counter is reset after each 1 minute window has passed, allowing another 600 requests. Getting throttled does not permanently block access; your code should handle the 429 response by retrying requests later.

Base URL

https://garchi.co.uk

Plan limits and quota errors

Endpoints that create resources count against your plan's allowances, exactly as the dashboard and AI agents do. The API cannot create more than your plan allows.

Resource Allowance applies to Create endpoint
Spaces Your whole account POST /api/v2/space
Pages Each space POST /api/v2/space/{uid}/create_page
Items Each space POST /api/v2/item
Categories Each space POST /api/v2/category

The current allowances for each plan are listed on the pricing page.

When an allowance has been reached, nothing is created and the API responds with HTTP 422 and a limit error:

{
  "message": "The items allowance for this plan has been reached.",
  "errors": {
    "limit": ["The items allowance for this plan has been reached."]
  }
}

Use the error key to tell the cases apart:

Errors are always returned as JSON.

Authenticating requests

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

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

You can retrieve your token by visiting your dashboard. To create a new token click here.

Spaces

List all spaces

requires authentication

Example request:
curl --request GET \
    --get "https://garchi.co.uk/api/v2/spaces?size=10" \
    --header "Authorization: Bearer {YOUR_API_TOKEN}"
// npm install @garchicms/garchi-node-sdk
import GarchiCMS from "@garchicms/garchi-node-sdk";

// The SDK sends your API token as "Authorization: Bearer <token>" on every request.
const garchi = new GarchiCMS({ api_key: "YOUR_API_TOKEN" });

const response = await garchi.space.getAll({
    size: 10,
});
// composer require garchicms/garchi-sdk-php
use GarchiCMS\GarchiCMS;

// The SDK sends your API token as "Authorization: Bearer <token>" on every request.
$garchi = new GarchiCMS("YOUR_API_TOKEN");

$response = $garchi->space->getAll([
    'size' => 10,
]);
import requests
import json

url = 'https://garchi.co.uk/api/v2/spaces'
params = {
  'size': '10',
}
headers = {
  'Authorization': 'Bearer {YOUR_API_TOKEN}'
}

response = requests.request('GET', url, headers=headers, params=params)
response.json()
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.nio.file.Path;

String baseUrl = "https://garchi.co.uk";
String endpointUri = "api/v2/spaces"; 

URI url = URI.create(baseUrl + endpointUri);

HttpClient client = HttpClient.newHttpClient();
HttpRequest.Builder builder = HttpRequest.newBuilder(url);



Map<Object, Object> params = {
  "size": "10",
};
builder.uri(URI.create(url + "?" + toQueryString(params)));

builder.header("Authorization", "Bearer {YOUR_API_TOKEN}");


HttpResponse<String> response = client.send(builder.build(), HttpResponse.BodyHandlers.ofString());

// Parse JSON response
JSONObject json = new JSONObject(response.body());

use Illuminate\Support\Facades\Http;

$url = 'https://garchi.co.uk/api/v2/spaces';

$headers = [
  'Authorization' => 'Bearer {YOUR_API_TOKEN}'
]

$client = Http::withHeaders($headers);




$queryParams = {
  'size': '10',
};

$url .= '?'. $queryParams;




$response = $client->GET($url);

$responseBody = $response->json();

Example response (200):



{
    "data": [
        {
            "uid": "3d5f84d6-8914-4061-b9be-cbdd8bcd806fb6138bbf-296e-44b4-9cf1-03b1",
            "name": "Jane Doe",
            "logo_url": "https://assets.garchi.co.uk/examples/seller-logo.jpg",
            "number_of_items": 3,
            "agent_description": "This is ai agent description"
        }
    ],
    "links": {
        "first": "https://garchi.co.uk/api/v2/spaces?page=1",
        "last": "https://garchi.co.uk/api/v2/spaces?page=1",
        "prev": null,
        "next": null
    },
    "meta": {
        "current_page": 1,
        "from": 1,
        "last_page": 1,
        "links": [
            {
                "url": null,
                "label": "&laquo; Previous",
                "active": false
            },
            {
                "url": "https://garchi.co.uk/api/v2/spaces?page=1",
                "label": "1",
                "active": true
            },
            {
                "url": null,
                "label": "Next &raquo;",
                "active": false
            }
        ],
        "path": "https://garchi.co.uk/api/v2/spaces",
        "per_page": 10,
        "to": 1,
        "total": 1
    }
}
 

Request   

GET api/v2/spaces

Query Parameters

size  integer optional  

Number of records to fetch in one page. By default it is set to 10.

Get Space details

requires authentication

Example request:
curl --request GET \
    --get "https://garchi.co.uk/api/v2/space/3d5f84d6-8914-4061-b9be-cbdd8bcd806fb6138bbf-296e-44b4-9cf1-03b1" \
    --header "Authorization: Bearer {YOUR_API_TOKEN}"
// npm install @garchicms/garchi-node-sdk
import GarchiCMS from "@garchicms/garchi-node-sdk";

// The SDK sends your API token as "Authorization: Bearer <token>" on every request.
const garchi = new GarchiCMS({ api_key: "YOUR_API_TOKEN" });

const response = await garchi.space.get("3d5f84d6-8914-4061-b9be-cbdd8bcd806fb6138bbf-296e-44b4-9cf1-03b1");
// composer require garchicms/garchi-sdk-php
use GarchiCMS\GarchiCMS;

// The SDK sends your API token as "Authorization: Bearer <token>" on every request.
$garchi = new GarchiCMS("YOUR_API_TOKEN");

$response = $garchi->space->get('3d5f84d6-8914-4061-b9be-cbdd8bcd806fb6138bbf-296e-44b4-9cf1-03b1');
import requests
import json

url = 'https://garchi.co.uk/api/v2/space/3d5f84d6-8914-4061-b9be-cbdd8bcd806fb6138bbf-296e-44b4-9cf1-03b1'
headers = {
  'Authorization': 'Bearer {YOUR_API_TOKEN}'
}

response = requests.request('GET', url, headers=headers)
response.json()
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.nio.file.Path;

String baseUrl = "https://garchi.co.uk";
String endpointUri = "api/v2/space/3d5f84d6-8914-4061-b9be-cbdd8bcd806fb6138bbf-296e-44b4-9cf1-03b1"; 

URI url = URI.create(baseUrl + endpointUri);

HttpClient client = HttpClient.newHttpClient();
HttpRequest.Builder builder = HttpRequest.newBuilder(url);




builder.header("Authorization", "Bearer {YOUR_API_TOKEN}");


HttpResponse<String> response = client.send(builder.build(), HttpResponse.BodyHandlers.ofString());

// Parse JSON response
JSONObject json = new JSONObject(response.body());

use Illuminate\Support\Facades\Http;

$url = 'https://garchi.co.uk/api/v2/space/3d5f84d6-8914-4061-b9be-cbdd8bcd806fb6138bbf-296e-44b4-9cf1-03b1';

$headers = [
  'Authorization' => 'Bearer {YOUR_API_TOKEN}'
]

$client = Http::withHeaders($headers);






$response = $client->GET($url);

$responseBody = $response->json();

Example response (200):



{
    "data": {
        "uid": "52690642-cc29-4c4d-a9dc-752d4036869e9b64f419-c900-49a8-9109-208a",
        "name": "Jane Doe",
        "logo_url": "https://assets.garchi.co.uk/examples/seller-logo.svg",
        "number_of_items": 24,
        "agent_description": "This is agent description"
    }
}
 

Request   

GET api/v2/space/{uid}

URL Parameters

uid  string  

space uid

Create a new space

requires authentication

Creates a new space.

Example request:
curl --request POST \
    "https://garchi.co.uk/api/v2/space" \
    --header "Authorization: Bearer {YOUR_API_TOKEN}" \
    --header "Content-Type: multipart/form-data" \
    --form "name="Jane Doe"" \
    --form "logo=@/path/to/logo.png" 
// npm install @garchicms/garchi-node-sdk
import GarchiCMS from "@garchicms/garchi-node-sdk";

// The SDK sends your API token as "Authorization: Bearer <token>" on every request.
const garchi = new GarchiCMS({ api_key: "YOUR_API_TOKEN" });

const response = await garchi.space.create({
    name: "Jane Doe",
    logo: logoFile, // a File or Blob, e.g. from an <input type="file">
});
// composer require garchicms/garchi-sdk-php
use GarchiCMS\GarchiCMS;

// The SDK sends your API token as "Authorization: Bearer <token>" on every request.
$garchi = new GarchiCMS("YOUR_API_TOKEN");

$response = $garchi->space->create([
    'name' => 'Jane Doe',
    'logo' => '/path/to/logo.png', // path to an image file
]);
import requests
import json

url = 'https://garchi.co.uk/api/v2/space'
files = {
  'logo': open('/path/to/logo.png', 'rb')
}
payload = {
    "name": "\"Jane Doe\""
}
headers = {
  'Authorization': 'Bearer {YOUR_API_TOKEN}',
  'Content-Type': 'multipart/form-data'
}

response = requests.request('POST', url, headers=headers, files=files, data=payload)
response.json()
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.nio.file.Path;

String baseUrl = "https://garchi.co.uk";
String endpointUri = "api/v2/space"; 

URI url = URI.create(baseUrl + endpointUri);

HttpClient client = HttpClient.newHttpClient();
HttpRequest.Builder builder = HttpRequest.newBuilder(url);


Map<Object, Path> files = new HashMap<>(); 

files.put("logo", Path.of("/path/to/logo.png"));  

builder.POST(HttpRequest.BodyPublishers.ofByteArray(files));


String body = {
    "name": "\"Jane Doe\""
};
builder.POST(HttpRequest.BodyPublishers.ofString(body));


builder.header("Authorization", "Bearer {YOUR_API_TOKEN}");
builder.header("Content-Type", "multipart/form-data");


HttpResponse<String> response = client.send(builder.build(), HttpResponse.BodyHandlers.ofString());

// Parse JSON response
JSONObject json = new JSONObject(response.body());

use Illuminate\Support\Facades\Http;

$url = 'https://garchi.co.uk/api/v2/space';

$headers = [
  'Authorization' => 'Bearer {YOUR_API_TOKEN}',
  'Content-Type' => 'multipart/form-data'
]

$client = Http::withHeaders($headers);



$body = {
    "name": "\"Jane Doe\""
};

$client->withBody($body);





$response = $client->POST($url);

$responseBody = $response->json();

Example response (200):



{
    "data": {
        "uid": "3cbec0da-0c9f-4cd3-99e3-0b962477816dededd79c-d150-45ec-93b6-859c2f52b234",
        "name": "Jane Doe",
        "logo_url": "NA",
        "number_of_items": null,
        "agent_description": "NA"
    }
}
 

Example response (Plan allowance reached):



{
    "message": "The space allowance for this plan has been reached.",
    "errors": {
        "limit": [
            "The space allowance for this plan has been reached."
        ]
    }
}
 

Request   

POST api/v2/space

Body Parameters

name  string  

Seller's full name

logo  file optional  

Seller's logo image file

Delete a space record

requires authentication

Deletes space record and associated records.

Example request:
curl --request POST \
    "https://garchi.co.uk/api/v2/delete/space/635c09ed-d55f-407d-a4c0-45f5ad9f2b44c2321f02-a835-4024-9b83-c4a1" \
    --header "Authorization: Bearer {YOUR_API_TOKEN}"
const url = new URL(
    "https://garchi.co.uk/api/v2/delete/space/635c09ed-d55f-407d-a4c0-45f5ad9f2b44c2321f02-a835-4024-9b83-c4a1"
);

const headers = {
    "Authorization": "Bearer {YOUR_API_TOKEN}",
    "Accept": "application/json",
};


fetch(url, {
    method: "POST",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->post(
    'https://garchi.co.uk/api/v2/delete/space/635c09ed-d55f-407d-a4c0-45f5ad9f2b44c2321f02-a835-4024-9b83-c4a1',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_API_TOKEN}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://garchi.co.uk/api/v2/delete/space/635c09ed-d55f-407d-a4c0-45f5ad9f2b44c2321f02-a835-4024-9b83-c4a1'
headers = {
  'Authorization': 'Bearer {YOUR_API_TOKEN}'
}

response = requests.request('POST', url, headers=headers)
response.json()
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.nio.file.Path;

String baseUrl = "https://garchi.co.uk";
String endpointUri = "api/v2/delete/space/635c09ed-d55f-407d-a4c0-45f5ad9f2b44c2321f02-a835-4024-9b83-c4a1"; 

URI url = URI.create(baseUrl + endpointUri);

HttpClient client = HttpClient.newHttpClient();
HttpRequest.Builder builder = HttpRequest.newBuilder(url);




builder.header("Authorization", "Bearer {YOUR_API_TOKEN}");


HttpResponse<String> response = client.send(builder.build(), HttpResponse.BodyHandlers.ofString());

// Parse JSON response
JSONObject json = new JSONObject(response.body());

use Illuminate\Support\Facades\Http;

$url = 'https://garchi.co.uk/api/v2/delete/space/635c09ed-d55f-407d-a4c0-45f5ad9f2b44c2321f02-a835-4024-9b83-c4a1';

$headers = [
  'Authorization' => 'Bearer {YOUR_API_TOKEN}'
]

$client = Http::withHeaders($headers);






$response = $client->POST($url);

$responseBody = $response->json();

Example response (200):



{
    "data": "Space details deleted successfully"
}
 

Request   

POST api/v2/delete/space/{uid}

URL Parameters

uid  string  

Seller's uid

Update a space

requires authentication

Updates space details.

Example request:
curl --request POST \
    "https://garchi.co.uk/api/v2/update/space/635c09ed-d55f-407d-a4c0-45f5ad9f2b44c2321f02-a835-4024-9b83-c4a1" \
    --header "Authorization: Bearer {YOUR_API_TOKEN}" \
    --header "Content-Type: multipart/form-data" \
    --form "name="Jane Doe"" \
    --form "logo=@/path/to/logo.png" 
// npm install @garchicms/garchi-node-sdk
import GarchiCMS from "@garchicms/garchi-node-sdk";

// The SDK sends your API token as "Authorization: Bearer <token>" on every request.
const garchi = new GarchiCMS({ api_key: "YOUR_API_TOKEN" });

const response = await garchi.space.update("635c09ed-d55f-407d-a4c0-45f5ad9f2b44c2321f02-a835-4024-9b83-c4a1", {
    name: "Jane Doe",
    logo: logoFile, // a File or Blob, e.g. from an <input type="file">
});
// composer require garchicms/garchi-sdk-php
use GarchiCMS\GarchiCMS;

// The SDK sends your API token as "Authorization: Bearer <token>" on every request.
$garchi = new GarchiCMS("YOUR_API_TOKEN");

$response = $garchi->space->update('635c09ed-d55f-407d-a4c0-45f5ad9f2b44c2321f02-a835-4024-9b83-c4a1', [
    'name' => 'Jane Doe',
    'logo' => '/path/to/logo.png', // path to an image file
]);
import requests
import json

url = 'https://garchi.co.uk/api/v2/update/space/635c09ed-d55f-407d-a4c0-45f5ad9f2b44c2321f02-a835-4024-9b83-c4a1'
files = {
  'logo': open('/path/to/logo.png', 'rb')
}
payload = {
    "name": "\"Jane Doe\""
}
headers = {
  'Authorization': 'Bearer {YOUR_API_TOKEN}',
  'Content-Type': 'multipart/form-data'
}

response = requests.request('POST', url, headers=headers, files=files, data=payload)
response.json()
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.nio.file.Path;

String baseUrl = "https://garchi.co.uk";
String endpointUri = "api/v2/update/space/635c09ed-d55f-407d-a4c0-45f5ad9f2b44c2321f02-a835-4024-9b83-c4a1"; 

URI url = URI.create(baseUrl + endpointUri);

HttpClient client = HttpClient.newHttpClient();
HttpRequest.Builder builder = HttpRequest.newBuilder(url);


Map<Object, Path> files = new HashMap<>(); 

files.put("logo", Path.of("/path/to/logo.png"));  

builder.POST(HttpRequest.BodyPublishers.ofByteArray(files));


String body = {
    "name": "\"Jane Doe\""
};
builder.POST(HttpRequest.BodyPublishers.ofString(body));


builder.header("Authorization", "Bearer {YOUR_API_TOKEN}");
builder.header("Content-Type", "multipart/form-data");


HttpResponse<String> response = client.send(builder.build(), HttpResponse.BodyHandlers.ofString());

// Parse JSON response
JSONObject json = new JSONObject(response.body());

use Illuminate\Support\Facades\Http;

$url = 'https://garchi.co.uk/api/v2/update/space/635c09ed-d55f-407d-a4c0-45f5ad9f2b44c2321f02-a835-4024-9b83-c4a1';

$headers = [
  'Authorization' => 'Bearer {YOUR_API_TOKEN}',
  'Content-Type' => 'multipart/form-data'
]

$client = Http::withHeaders($headers);



$body = {
    "name": "\"Jane Doe\""
};

$client->withBody($body);





$response = $client->POST($url);

$responseBody = $response->json();

Example response (200):



{
    "data": "Space details updated successfully"
}
 

Request   

POST api/v2/update/space/{uid}

URL Parameters

uid  string  

Seller's uid

Body Parameters

name  string optional  

Seller's full name

logo  file optional  

Seller's logo image file

Category

Create a category

requires authentication

Creates a new cateogry for a space

Example request:
curl --request POST \
    "https://garchi.co.uk/api/v2/category" \
    --header "Authorization: Bearer {YOUR_API_TOKEN}" \
    --header "Content-Type: application/json" \
    --data "{
    \"space_uid\": \"635c09ed-d55f-407d-a4c0-45f5ad9f2b44c2321f02-a835-4024-9b83-c4a1\",
    \"category\": \"pariatur\"
}"
// npm install @garchicms/garchi-node-sdk
import GarchiCMS from "@garchicms/garchi-node-sdk";

// The SDK sends your API token as "Authorization: Bearer <token>" on every request.
const garchi = new GarchiCMS({ api_key: "YOUR_API_TOKEN" });

const response = await garchi.category.create({
    space_uid: "635c09ed-d55f-407d-a4c0-45f5ad9f2b44c2321f02-a835-4024-9b83-c4a1",
    category: "pariatur",
});
// composer require garchicms/garchi-sdk-php
use GarchiCMS\GarchiCMS;

// The SDK sends your API token as "Authorization: Bearer <token>" on every request.
$garchi = new GarchiCMS("YOUR_API_TOKEN");

$response = $garchi->category->create([
    'space_uid' => '635c09ed-d55f-407d-a4c0-45f5ad9f2b44c2321f02-a835-4024-9b83-c4a1',
    'category' => 'pariatur',
]);
import requests
import json

url = 'https://garchi.co.uk/api/v2/category'
payload = {
    "space_uid": "635c09ed-d55f-407d-a4c0-45f5ad9f2b44c2321f02-a835-4024-9b83-c4a1",
    "category": "pariatur"
}
headers = {
  'Authorization': 'Bearer {YOUR_API_TOKEN}',
  'Content-Type': 'application/json'
}

response = requests.request('POST', url, headers=headers, json=payload)
response.json()
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.nio.file.Path;

String baseUrl = "https://garchi.co.uk";
String endpointUri = "api/v2/category"; 

URI url = URI.create(baseUrl + endpointUri);

HttpClient client = HttpClient.newHttpClient();
HttpRequest.Builder builder = HttpRequest.newBuilder(url);


String body = {
    "space_uid": "635c09ed-d55f-407d-a4c0-45f5ad9f2b44c2321f02-a835-4024-9b83-c4a1",
    "category": "pariatur"
};
builder.POST(HttpRequest.BodyPublishers.ofString(body));


builder.header("Authorization", "Bearer {YOUR_API_TOKEN}");
builder.header("Content-Type", "application/json");


HttpResponse<String> response = client.send(builder.build(), HttpResponse.BodyHandlers.ofString());

// Parse JSON response
JSONObject json = new JSONObject(response.body());

use Illuminate\Support\Facades\Http;

$url = 'https://garchi.co.uk/api/v2/category';

$headers = [
  'Authorization' => 'Bearer {YOUR_API_TOKEN}',
  'Content-Type' => 'application/json'
]

$client = Http::withHeaders($headers);



$body = {
    "space_uid": "635c09ed-d55f-407d-a4c0-45f5ad9f2b44c2321f02-a835-4024-9b83-c4a1",
    "category": "pariatur"
};

$client->withBody($body);





$response = $client->POST($url);

$responseBody = $response->json();

Example response (200):



{
    "data": {
        "id": 43,
        "name": "Events",
        "rank": 1,
        "created_at": "2024-05-01 10:12:45"
    }
}
 

Example response (Plan allowance reached):



{
    "message": "The categories allowance for this plan has been reached.",
    "errors": {
        "limit": [
            "The categories allowance for this plan has been reached."
        ]
    }
}
 

Request   

POST api/v2/category

Body Parameters

space_uid  string  

UID of the space.

category  string  

Category name

Delete a category

requires authentication

Deletes a category and all the associated items of that category for a space

Example request:
curl --request POST \
    "https://garchi.co.uk/api/v2/delete/category/635c09ed-d55f-407d-a4c0-45f5ad9f2b44c2321f02-a835-4024-9b83-c4a1/43" \
    --header "Authorization: Bearer {YOUR_API_TOKEN}"
// npm install @garchicms/garchi-node-sdk
import GarchiCMS from "@garchicms/garchi-node-sdk";

// The SDK sends your API token as "Authorization: Bearer <token>" on every request.
const garchi = new GarchiCMS({ api_key: "YOUR_API_TOKEN" });

const response = await garchi.category.delete({
    space_uid: "635c09ed-d55f-407d-a4c0-45f5ad9f2b44c2321f02-a835-4024-9b83-c4a1",
    category_id: 43,
});
// composer require garchicms/garchi-sdk-php
use GarchiCMS\GarchiCMS;

// The SDK sends your API token as "Authorization: Bearer <token>" on every request.
$garchi = new GarchiCMS("YOUR_API_TOKEN");

$response = $garchi->category->delete([
    'space_uid' => '635c09ed-d55f-407d-a4c0-45f5ad9f2b44c2321f02-a835-4024-9b83-c4a1',
    'category_id' => 43,
]);
import requests
import json

url = 'https://garchi.co.uk/api/v2/delete/category/635c09ed-d55f-407d-a4c0-45f5ad9f2b44c2321f02-a835-4024-9b83-c4a1/43'
headers = {
  'Authorization': 'Bearer {YOUR_API_TOKEN}'
}

response = requests.request('POST', url, headers=headers)
response.json()
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.nio.file.Path;

String baseUrl = "https://garchi.co.uk";
String endpointUri = "api/v2/delete/category/635c09ed-d55f-407d-a4c0-45f5ad9f2b44c2321f02-a835-4024-9b83-c4a1/43"; 

URI url = URI.create(baseUrl + endpointUri);

HttpClient client = HttpClient.newHttpClient();
HttpRequest.Builder builder = HttpRequest.newBuilder(url);




builder.header("Authorization", "Bearer {YOUR_API_TOKEN}");


HttpResponse<String> response = client.send(builder.build(), HttpResponse.BodyHandlers.ofString());

// Parse JSON response
JSONObject json = new JSONObject(response.body());

use Illuminate\Support\Facades\Http;

$url = 'https://garchi.co.uk/api/v2/delete/category/635c09ed-d55f-407d-a4c0-45f5ad9f2b44c2321f02-a835-4024-9b83-c4a1/43';

$headers = [
  'Authorization' => 'Bearer {YOUR_API_TOKEN}'
]

$client = Http::withHeaders($headers);






$response = $client->POST($url);

$responseBody = $response->json();

Example response (200):



{
    "data": "Category deleted successfully"
}
 

Request   

POST api/v2/delete/category/{space_uid}/{category_id}

URL Parameters

space_uid  string  

UID of the space.

category_id  integer  

Id of the category.

Update a category

requires authentication

Update a cateogry for a space

Example request:
curl --request POST \
    "https://garchi.co.uk/api/v2/update/category/43" \
    --header "Authorization: Bearer {YOUR_API_TOKEN}" \
    --header "Content-Type: application/json" \
    --data "{
    \"space_uid\": \"635c09ed-d55f-407d-a4c0-45f5ad9f2b44c2321f02-a835-4024-9b83-c4a1\",
    \"category\": \"magni\"
}"
// npm install @garchicms/garchi-node-sdk
import GarchiCMS from "@garchicms/garchi-node-sdk";

// The SDK sends your API token as "Authorization: Bearer <token>" on every request.
const garchi = new GarchiCMS({ api_key: "YOUR_API_TOKEN" });

const response = await garchi.category.update({
    category_id: 43,
    space_uid: "635c09ed-d55f-407d-a4c0-45f5ad9f2b44c2321f02-a835-4024-9b83-c4a1",
    category: "magni",
});
// composer require garchicms/garchi-sdk-php
use GarchiCMS\GarchiCMS;

// The SDK sends your API token as "Authorization: Bearer <token>" on every request.
$garchi = new GarchiCMS("YOUR_API_TOKEN");

$response = $garchi->category->update([
    'category_id' => 43,
    'space_uid' => '635c09ed-d55f-407d-a4c0-45f5ad9f2b44c2321f02-a835-4024-9b83-c4a1',
    'category' => 'magni',
]);
import requests
import json

url = 'https://garchi.co.uk/api/v2/update/category/43'
payload = {
    "space_uid": "635c09ed-d55f-407d-a4c0-45f5ad9f2b44c2321f02-a835-4024-9b83-c4a1",
    "category": "magni"
}
headers = {
  'Authorization': 'Bearer {YOUR_API_TOKEN}',
  'Content-Type': 'application/json'
}

response = requests.request('POST', url, headers=headers, json=payload)
response.json()
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.nio.file.Path;

String baseUrl = "https://garchi.co.uk";
String endpointUri = "api/v2/update/category/43"; 

URI url = URI.create(baseUrl + endpointUri);

HttpClient client = HttpClient.newHttpClient();
HttpRequest.Builder builder = HttpRequest.newBuilder(url);


String body = {
    "space_uid": "635c09ed-d55f-407d-a4c0-45f5ad9f2b44c2321f02-a835-4024-9b83-c4a1",
    "category": "magni"
};
builder.POST(HttpRequest.BodyPublishers.ofString(body));


builder.header("Authorization", "Bearer {YOUR_API_TOKEN}");
builder.header("Content-Type", "application/json");


HttpResponse<String> response = client.send(builder.build(), HttpResponse.BodyHandlers.ofString());

// Parse JSON response
JSONObject json = new JSONObject(response.body());

use Illuminate\Support\Facades\Http;

$url = 'https://garchi.co.uk/api/v2/update/category/43';

$headers = [
  'Authorization' => 'Bearer {YOUR_API_TOKEN}',
  'Content-Type' => 'application/json'
]

$client = Http::withHeaders($headers);



$body = {
    "space_uid": "635c09ed-d55f-407d-a4c0-45f5ad9f2b44c2321f02-a835-4024-9b83-c4a1",
    "category": "magni"
};

$client->withBody($body);





$response = $client->POST($url);

$responseBody = $response->json();

Example response (200):



{
    "data": "Category updated successfully"
}
 

Request   

POST api/v2/update/category/{category_id}

URL Parameters

category_id  integer  

Id of the category.

Body Parameters

space_uid  string  

UID of the space.

category  string  

Category name

Get all Categories for a space

requires authentication

Returns all the categories of the specified space.

Example request:
curl --request GET \
    --get "https://garchi.co.uk/api/v2/space/b5f0d08a-7600-4b9e-81e9-1ffaf5ddb8d2cf268eeb-000a-4bfd-bba6-09ab/categories" \
    --header "Authorization: Bearer {YOUR_API_TOKEN}"
// npm install @garchicms/garchi-node-sdk
import GarchiCMS from "@garchicms/garchi-node-sdk";

// The SDK sends your API token as "Authorization: Bearer <token>" on every request.
const garchi = new GarchiCMS({ api_key: "YOUR_API_TOKEN" });

const response = await garchi.space.categories("b5f0d08a-7600-4b9e-81e9-1ffaf5ddb8d2cf268eeb-000a-4bfd-bba6-09ab");
// composer require garchicms/garchi-sdk-php
use GarchiCMS\GarchiCMS;

// The SDK sends your API token as "Authorization: Bearer <token>" on every request.
$garchi = new GarchiCMS("YOUR_API_TOKEN");

$response = $garchi->space->categories('b5f0d08a-7600-4b9e-81e9-1ffaf5ddb8d2cf268eeb-000a-4bfd-bba6-09ab');
import requests
import json

url = 'https://garchi.co.uk/api/v2/space/b5f0d08a-7600-4b9e-81e9-1ffaf5ddb8d2cf268eeb-000a-4bfd-bba6-09ab/categories'
headers = {
  'Authorization': 'Bearer {YOUR_API_TOKEN}'
}

response = requests.request('GET', url, headers=headers)
response.json()
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.nio.file.Path;

String baseUrl = "https://garchi.co.uk";
String endpointUri = "api/v2/space/b5f0d08a-7600-4b9e-81e9-1ffaf5ddb8d2cf268eeb-000a-4bfd-bba6-09ab/categories"; 

URI url = URI.create(baseUrl + endpointUri);

HttpClient client = HttpClient.newHttpClient();
HttpRequest.Builder builder = HttpRequest.newBuilder(url);




builder.header("Authorization", "Bearer {YOUR_API_TOKEN}");


HttpResponse<String> response = client.send(builder.build(), HttpResponse.BodyHandlers.ofString());

// Parse JSON response
JSONObject json = new JSONObject(response.body());

use Illuminate\Support\Facades\Http;

$url = 'https://garchi.co.uk/api/v2/space/b5f0d08a-7600-4b9e-81e9-1ffaf5ddb8d2cf268eeb-000a-4bfd-bba6-09ab/categories';

$headers = [
  'Authorization' => 'Bearer {YOUR_API_TOKEN}'
]

$client = Http::withHeaders($headers);






$response = $client->GET($url);

$responseBody = $response->json();

Example response (200):



{
    "data": [
        {
            "id": 43,
            "name": "Events",
            "rank": 1,
            "created_at": "2024-05-01 10:12:45"
        },
        {
            "id": 44,
            "name": "Workshops",
            "rank": 2,
            "created_at": "2024-05-02 08:30:10"
        }
    ]
}
 

Request   

GET api/v2/space/{uid}/categories

URL Parameters

uid  string  

Uid of the space.

Get all Categories

requires authentication

Returns all the categories for all the spaces.

Example request:
curl --request GET \
    --get "https://garchi.co.uk/api/v2/categories" \
    --header "Authorization: Bearer {YOUR_API_TOKEN}"
// npm install @garchicms/garchi-node-sdk
import GarchiCMS from "@garchicms/garchi-node-sdk";

// The SDK sends your API token as "Authorization: Bearer <token>" on every request.
const garchi = new GarchiCMS({ api_key: "YOUR_API_TOKEN" });

const response = await garchi.category.getAll();
// composer require garchicms/garchi-sdk-php
use GarchiCMS\GarchiCMS;

// The SDK sends your API token as "Authorization: Bearer <token>" on every request.
$garchi = new GarchiCMS("YOUR_API_TOKEN");

$response = $garchi->category->getAll();
import requests
import json

url = 'https://garchi.co.uk/api/v2/categories'
headers = {
  'Authorization': 'Bearer {YOUR_API_TOKEN}'
}

response = requests.request('GET', url, headers=headers)
response.json()
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.nio.file.Path;

String baseUrl = "https://garchi.co.uk";
String endpointUri = "api/v2/categories"; 

URI url = URI.create(baseUrl + endpointUri);

HttpClient client = HttpClient.newHttpClient();
HttpRequest.Builder builder = HttpRequest.newBuilder(url);




builder.header("Authorization", "Bearer {YOUR_API_TOKEN}");


HttpResponse<String> response = client.send(builder.build(), HttpResponse.BodyHandlers.ofString());

// Parse JSON response
JSONObject json = new JSONObject(response.body());

use Illuminate\Support\Facades\Http;

$url = 'https://garchi.co.uk/api/v2/categories';

$headers = [
  'Authorization' => 'Bearer {YOUR_API_TOKEN}'
]

$client = Http::withHeaders($headers);






$response = $client->GET($url);

$responseBody = $response->json();

Example response (200):



{
    "data": [
        {
            "id": 43,
            "name": "Events",
            "rank": 1,
            "created_at": "2024-05-01 10:12:45"
        },
        {
            "id": 44,
            "name": "Workshops",
            "rank": 2,
            "created_at": "2024-05-02 08:30:10"
        }
    ]
}
 

Request   

GET api/v2/categories

Item

Create a new item

requires authentication

Adds a new item for a space

Example request:
curl --request POST \
    "https://garchi.co.uk/api/v2/item" \
    --header "Authorization: Bearer {YOUR_API_TOKEN}" \
    --header "Content-Type: application/json" \
    --data "{
    \"space_uid\": \"ca457162-6d04-4c3a-a3f6-2ab3e21b0fd00cca6914-5e72-4d54-b9db-fcf9\",
    \"name\": \"\\\"item ABC\\\"\",
    \"categories\": [
        44,
        45
    ],
    \"sku\": \"SKU11111\",
    \"stock\": 5,
    \"price\": \"10\",
    \"scratched_price\": 5,
    \"detail_description\": \"This is an amazing <b>item<\\/b>\",
    \"agent_description\": \"A lightweight product summary that helps AI agents understand when to recommend this item.\",
    \"external_url\": \"https:\\/\\/productabc.com\",
    \"slug\": \"item-abc\",
    \"parent_id\": 48
}"
// npm install @garchicms/garchi-node-sdk
import GarchiCMS from "@garchicms/garchi-node-sdk";

// The SDK sends your API token as "Authorization: Bearer <token>" on every request.
const garchi = new GarchiCMS({ api_key: "YOUR_API_TOKEN" });

const response = await garchi.dataItem.create({
    space_uid: "ca457162-6d04-4c3a-a3f6-2ab3e21b0fd00cca6914-5e72-4d54-b9db-fcf9",
    name: "item ABC",
    categories: [44, 45],
    sku: "SKU11111",
    stock: 5,
    price: 10,
    scratched_price: 5,
    detail_description: "This is an amazing <b>item</b>",
    agent_description: "A lightweight product summary that helps AI agents understand when to recommend this item.",
    external_url: "https://productabc.com",
    slug: "item-abc",
    parent_id: 48,
});
// composer require garchicms/garchi-sdk-php
use GarchiCMS\GarchiCMS;

// The SDK sends your API token as "Authorization: Bearer <token>" on every request.
$garchi = new GarchiCMS("YOUR_API_TOKEN");

$response = $garchi->dataItem->create([
    'space_uid' => 'ca457162-6d04-4c3a-a3f6-2ab3e21b0fd00cca6914-5e72-4d54-b9db-fcf9',
    'name' => 'item ABC',
    'categories' => [44, 45],
    'sku' => 'SKU11111',
    'stock' => 5,
    'price' => 10,
    'scratched_price' => 5,
    'detail_description' => 'This is an amazing <b>item</b>',
    'agent_description' => 'A lightweight product summary that helps AI agents understand when to recommend this item.',
    'external_url' => 'https://productabc.com',
    'slug' => 'item-abc',
    'parent_id' => 48,
]);
import requests
import json

url = 'https://garchi.co.uk/api/v2/item'
payload = {
    "space_uid": "ca457162-6d04-4c3a-a3f6-2ab3e21b0fd00cca6914-5e72-4d54-b9db-fcf9",
    "name": "\"item ABC\"",
    "categories": [
        44,
        45
    ],
    "sku": "SKU11111",
    "stock": 5,
    "price": "10",
    "scratched_price": 5,
    "detail_description": "This is an amazing <b>item<\/b>",
    "agent_description": "A lightweight product summary that helps AI agents understand when to recommend this item.",
    "external_url": "https:\/\/productabc.com",
    "slug": "item-abc",
    "parent_id": 48
}
headers = {
  'Authorization': 'Bearer {YOUR_API_TOKEN}',
  'Content-Type': 'application/json'
}

response = requests.request('POST', url, headers=headers, json=payload)
response.json()
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.nio.file.Path;

String baseUrl = "https://garchi.co.uk";
String endpointUri = "api/v2/item"; 

URI url = URI.create(baseUrl + endpointUri);

HttpClient client = HttpClient.newHttpClient();
HttpRequest.Builder builder = HttpRequest.newBuilder(url);


String body = {
    "space_uid": "ca457162-6d04-4c3a-a3f6-2ab3e21b0fd00cca6914-5e72-4d54-b9db-fcf9",
    "name": "\"item ABC\"",
    "categories": [
        44,
        45
    ],
    "sku": "SKU11111",
    "stock": 5,
    "price": "10",
    "scratched_price": 5,
    "detail_description": "This is an amazing <b>item<\/b>",
    "agent_description": "A lightweight product summary that helps AI agents understand when to recommend this item.",
    "external_url": "https:\/\/productabc.com",
    "slug": "item-abc",
    "parent_id": 48
};
builder.POST(HttpRequest.BodyPublishers.ofString(body));


builder.header("Authorization", "Bearer {YOUR_API_TOKEN}");
builder.header("Content-Type", "application/json");


HttpResponse<String> response = client.send(builder.build(), HttpResponse.BodyHandlers.ofString());

// Parse JSON response
JSONObject json = new JSONObject(response.body());

use Illuminate\Support\Facades\Http;

$url = 'https://garchi.co.uk/api/v2/item';

$headers = [
  'Authorization' => 'Bearer {YOUR_API_TOKEN}',
  'Content-Type' => 'application/json'
]

$client = Http::withHeaders($headers);



$body = {
    "space_uid": "ca457162-6d04-4c3a-a3f6-2ab3e21b0fd00cca6914-5e72-4d54-b9db-fcf9",
    "name": "\"item ABC\"",
    "categories": [
        44,
        45
    ],
    "sku": "SKU11111",
    "stock": 5,
    "price": "10",
    "scratched_price": 5,
    "detail_description": "This is an amazing <b>item<\/b>",
    "agent_description": "A lightweight product summary that helps AI agents understand when to recommend this item.",
    "external_url": "https:\/\/productabc.com",
    "slug": "item-abc",
    "parent_id": 48
};

$client->withBody($body);





$response = $client->POST($url);

$responseBody = $response->json();

Example response (200):



{
    "data": {
        "item_id": 50,
        "sku": "SKU111111",
        "external_link": null,
        "slug": "item-abc",
        "parent_id": null,
        "children_count": 0,
        "name": "Item ABC",
        "stock": 5,
        "price": 10,
        "scratched_price": 5,
        "one_liner": null,
        "description": "This is an amazing <b>item</b>",
        "delivery_type": null,
        "main_image": "NA",
        "other_images": [],
        "space": {
            "uid": "ca457162-6d04-4c3a-a3f6-2ab3e21b0fd00cca6914-5e72-4d54-b9db-fcf9",
            "name": "Shop XYZ"
        },
        "avg_rating": null,
        "scheduled_for": null,
        "agent_description": "A lightweight product summary that helps AI agents understand when to recommend this item.",
        "created": "2026-10-12 10:15:00",
        "updated": "2026-10-12 10:15:00"
    }
}
 

Example response (Plan allowance reached):



{
    "message": "The items allowance for this plan has been reached.",
    "errors": {
        "limit": [
            "The items allowance for this plan has been reached."
        ]
    }
}
 

Request   

POST api/v2/item

Body Parameters

space_uid  string  

UID of the space.

name  string  

Name of the item.

categories  integer[]  

Ids of the categories to which the item should belong.

sku  string. optional  

SKU of the item if applicable.

stock  integer optional  

Quantity/stock of the item.

price  Price optional  

of the item.

scratched_price  number optional  

Marketing or promotional price of the item.

detail_description  string. optional  

Detail description body of the item.

agent_description  string optional  

AI-facing description of the item.

external_url  string. optional  

If the item is an external item and has an external url.

slug  string. optional  

Slug of the item.

parent_id  integer optional  

Id of the item this item is inside, such as the product a variant belongs to. It must be in the same space, and items nest up to three levels.

Delete an item

requires authentication

Deletes an item and it's associated meta data and attributes for a space

Example request:
curl --request POST \
    "https://garchi.co.uk/api/v2/delete/item" \
    --header "Authorization: Bearer {YOUR_API_TOKEN}" \
    --header "Content-Type: application/json" \
    --data "{
    \"item_id\": 50,
    \"space_uid\": \"ca457162-6d04-4c3a-a3f6-2ab3e21b0fd00cca6914-5e72-4d54-b9db-fcf9\"
}"
// npm install @garchicms/garchi-node-sdk
import GarchiCMS from "@garchicms/garchi-node-sdk";

// The SDK sends your API token as "Authorization: Bearer <token>" on every request.
const garchi = new GarchiCMS({ api_key: "YOUR_API_TOKEN" });

const response = await garchi.dataItem.delete({
    item_id: 50,
    space_uid: "ca457162-6d04-4c3a-a3f6-2ab3e21b0fd00cca6914-5e72-4d54-b9db-fcf9",
});
// composer require garchicms/garchi-sdk-php
use GarchiCMS\GarchiCMS;

// The SDK sends your API token as "Authorization: Bearer <token>" on every request.
$garchi = new GarchiCMS("YOUR_API_TOKEN");

$response = $garchi->dataItem->delete([
    'item_id' => 50,
    'space_uid' => 'ca457162-6d04-4c3a-a3f6-2ab3e21b0fd00cca6914-5e72-4d54-b9db-fcf9',
]);
import requests
import json

url = 'https://garchi.co.uk/api/v2/delete/item'
payload = {
    "item_id": 50,
    "space_uid": "ca457162-6d04-4c3a-a3f6-2ab3e21b0fd00cca6914-5e72-4d54-b9db-fcf9"
}
headers = {
  'Authorization': 'Bearer {YOUR_API_TOKEN}',
  'Content-Type': 'application/json'
}

response = requests.request('POST', url, headers=headers, json=payload)
response.json()
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.nio.file.Path;

String baseUrl = "https://garchi.co.uk";
String endpointUri = "api/v2/delete/item"; 

URI url = URI.create(baseUrl + endpointUri);

HttpClient client = HttpClient.newHttpClient();
HttpRequest.Builder builder = HttpRequest.newBuilder(url);


String body = {
    "item_id": 50,
    "space_uid": "ca457162-6d04-4c3a-a3f6-2ab3e21b0fd00cca6914-5e72-4d54-b9db-fcf9"
};
builder.POST(HttpRequest.BodyPublishers.ofString(body));


builder.header("Authorization", "Bearer {YOUR_API_TOKEN}");
builder.header("Content-Type", "application/json");


HttpResponse<String> response = client.send(builder.build(), HttpResponse.BodyHandlers.ofString());

// Parse JSON response
JSONObject json = new JSONObject(response.body());

use Illuminate\Support\Facades\Http;

$url = 'https://garchi.co.uk/api/v2/delete/item';

$headers = [
  'Authorization' => 'Bearer {YOUR_API_TOKEN}',
  'Content-Type' => 'application/json'
]

$client = Http::withHeaders($headers);



$body = {
    "item_id": 50,
    "space_uid": "ca457162-6d04-4c3a-a3f6-2ab3e21b0fd00cca6914-5e72-4d54-b9db-fcf9"
};

$client->withBody($body);





$response = $client->POST($url);

$responseBody = $response->json();

Example response (200):



{
    "data": "Item deleted successfully"
}
 

Request   

POST api/v2/delete/item

Body Parameters

item_id  integer optional  

required. Id of the item.

space_uid  string optional  

required. UID of the space.

Update a item

requires authentication

Update a item for a space

Example request:
curl --request POST \
    "https://garchi.co.uk/api/v2/update/item" \
    --header "Authorization: Bearer {YOUR_API_TOKEN}" \
    --header "Content-Type: application/json" \
    --data "{
    \"item_id\": 50,
    \"space_uid\": \"ca457162-6d04-4c3a-a3f6-2ab3e21b0fd00cca6914-5e72-4d54-b9db-fcf9\",
    \"name\": \"\\\"item ABC\\\"\",
    \"sku\": \"SKU11111\",
    \"stock\": 5,
    \"categories\": [
        44
    ],
    \"price\": 10,
    \"scratched_price\": \"5\",
    \"detail_description\": \"This is an amazing <b>item<\\/b>\",
    \"agent_description\": \"A lightweight product summary that helps AI agents understand when to recommend this item.\",
    \"external_url\": \"https:\\/\\/itemabc.com\",
    \"make_public\": \"true\",
    \"slug\": \"item-abc\",
    \"parent_id\": 48
}"
// npm install @garchicms/garchi-node-sdk
import GarchiCMS from "@garchicms/garchi-node-sdk";

// The SDK sends your API token as "Authorization: Bearer <token>" on every request.
const garchi = new GarchiCMS({ api_key: "YOUR_API_TOKEN" });

const response = await garchi.dataItem.update({
    item_id: 50,
    space_uid: "ca457162-6d04-4c3a-a3f6-2ab3e21b0fd00cca6914-5e72-4d54-b9db-fcf9",
    name: "item ABC",
    sku: "SKU11111",
    stock: 5,
    categories: [44],
    price: 10,
    scratched_price: 5,
    detail_description: "This is an amazing <b>item</b>",
    agent_description: "A lightweight product summary that helps AI agents understand when to recommend this item.",
    external_url: "https://itemabc.com",
    make_public: "true",
    slug: "item-abc",
    parent_id: 48,
});
// composer require garchicms/garchi-sdk-php
use GarchiCMS\GarchiCMS;

// The SDK sends your API token as "Authorization: Bearer <token>" on every request.
$garchi = new GarchiCMS("YOUR_API_TOKEN");

$response = $garchi->dataItem->update([
    'item_id' => 50,
    'space_uid' => 'ca457162-6d04-4c3a-a3f6-2ab3e21b0fd00cca6914-5e72-4d54-b9db-fcf9',
    'name' => 'item ABC',
    'sku' => 'SKU11111',
    'stock' => 5,
    'categories' => [44],
    'price' => 10,
    'scratched_price' => 5,
    'detail_description' => 'This is an amazing <b>item</b>',
    'agent_description' => 'A lightweight product summary that helps AI agents understand when to recommend this item.',
    'external_url' => 'https://itemabc.com',
    'make_public' => 'true',
    'slug' => 'item-abc',
    'parent_id' => 48,
]);
import requests
import json

url = 'https://garchi.co.uk/api/v2/update/item'
payload = {
    "item_id": 50,
    "space_uid": "ca457162-6d04-4c3a-a3f6-2ab3e21b0fd00cca6914-5e72-4d54-b9db-fcf9",
    "name": "\"item ABC\"",
    "sku": "SKU11111",
    "stock": 5,
    "categories": [
        44
    ],
    "price": 10,
    "scratched_price": "5",
    "detail_description": "This is an amazing <b>item<\/b>",
    "agent_description": "A lightweight product summary that helps AI agents understand when to recommend this item.",
    "external_url": "https:\/\/itemabc.com",
    "make_public": "true",
    "slug": "item-abc",
    "parent_id": 48
}
headers = {
  'Authorization': 'Bearer {YOUR_API_TOKEN}',
  'Content-Type': 'application/json'
}

response = requests.request('POST', url, headers=headers, json=payload)
response.json()
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.nio.file.Path;

String baseUrl = "https://garchi.co.uk";
String endpointUri = "api/v2/update/item"; 

URI url = URI.create(baseUrl + endpointUri);

HttpClient client = HttpClient.newHttpClient();
HttpRequest.Builder builder = HttpRequest.newBuilder(url);


String body = {
    "item_id": 50,
    "space_uid": "ca457162-6d04-4c3a-a3f6-2ab3e21b0fd00cca6914-5e72-4d54-b9db-fcf9",
    "name": "\"item ABC\"",
    "sku": "SKU11111",
    "stock": 5,
    "categories": [
        44
    ],
    "price": 10,
    "scratched_price": "5",
    "detail_description": "This is an amazing <b>item<\/b>",
    "agent_description": "A lightweight product summary that helps AI agents understand when to recommend this item.",
    "external_url": "https:\/\/itemabc.com",
    "make_public": "true",
    "slug": "item-abc",
    "parent_id": 48
};
builder.POST(HttpRequest.BodyPublishers.ofString(body));


builder.header("Authorization", "Bearer {YOUR_API_TOKEN}");
builder.header("Content-Type", "application/json");


HttpResponse<String> response = client.send(builder.build(), HttpResponse.BodyHandlers.ofString());

// Parse JSON response
JSONObject json = new JSONObject(response.body());

use Illuminate\Support\Facades\Http;

$url = 'https://garchi.co.uk/api/v2/update/item';

$headers = [
  'Authorization' => 'Bearer {YOUR_API_TOKEN}',
  'Content-Type' => 'application/json'
]

$client = Http::withHeaders($headers);



$body = {
    "item_id": 50,
    "space_uid": "ca457162-6d04-4c3a-a3f6-2ab3e21b0fd00cca6914-5e72-4d54-b9db-fcf9",
    "name": "\"item ABC\"",
    "sku": "SKU11111",
    "stock": 5,
    "categories": [
        44
    ],
    "price": 10,
    "scratched_price": "5",
    "detail_description": "This is an amazing <b>item<\/b>",
    "agent_description": "A lightweight product summary that helps AI agents understand when to recommend this item.",
    "external_url": "https:\/\/itemabc.com",
    "make_public": "true",
    "slug": "item-abc",
    "parent_id": 48
};

$client->withBody($body);





$response = $client->POST($url);

$responseBody = $response->json();

Example response (200):



{
    "data": "Item updated successfully"
}
 

Request   

POST api/v2/update/item

Body Parameters

item_id  integer optional  

required. Id of the item.

space_uid  string optional  

required. UID of the space.

name  string optional  

Name of the item.

sku  string optional  

SKU of the item if applicable.

stock  integer optional  

Quantity/stock of the item.

categories  integer[] optional  

Cateogory id to which the item should belong.

price  number optional  

Price of the item.

scratched_price  float. optional  

Marketing or promotional price of the item.

detail_description  string. optional  

Detail description body of the item.

agent_description  string optional  

AI-facing description of the item.

external_url  string. optional  

If the item is an external item and has an external url.

make_public  boolean. optional  

If the item should be made public or not.

slug  string. optional  

Slug of the item.

parent_id  integer optional  

Id of the item this item is inside, in the same space. Send null to take the item out on its own; leave it out to keep its place.

Create meta information about a item

requires authentication

This api allows you to add extra information or meta data for a item. The data is added as a key value pair

Example request:
curl --request POST \
    "https://garchi.co.uk/api/v2/item_meta" \
    --header "Authorization: Bearer {YOUR_API_TOKEN}" \
    --header "Content-Type: application/json" \
    --data "{
    \"meta\": [
        {
            \"key\": \"website\",
            \"value\": \"https:\\/\\/example.com\",
            \"type\": \"url\"
        }
    ],
    \"item_id\": 51
}"
// npm install @garchicms/garchi-node-sdk
import GarchiCMS from "@garchicms/garchi-node-sdk";

// The SDK sends your API token as "Authorization: Bearer <token>" on every request.
const garchi = new GarchiCMS({ api_key: "YOUR_API_TOKEN" });

const response = await garchi.dataItem.createMetaInfo({
    meta: [
        {
            key: "website",
            value: "https://example.com",
            type: "url",
        }
    ],
    item_id: 51,
});
// composer require garchicms/garchi-sdk-php
use GarchiCMS\GarchiCMS;

// The SDK sends your API token as "Authorization: Bearer <token>" on every request.
$garchi = new GarchiCMS("YOUR_API_TOKEN");

$response = $garchi->dataItem->createMetaInfo([
    'meta' => [
        [
            'key' => 'website',
            'value' => 'https://example.com',
            'type' => 'url',
        ],
    ],
    'item_id' => 51,
]);
import requests
import json

url = 'https://garchi.co.uk/api/v2/item_meta'
payload = {
    "meta": [
        {
            "key": "website",
            "value": "https:\/\/example.com",
            "type": "url"
        }
    ],
    "item_id": 51
}
headers = {
  'Authorization': 'Bearer {YOUR_API_TOKEN}',
  'Content-Type': 'application/json'
}

response = requests.request('POST', url, headers=headers, json=payload)
response.json()
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.nio.file.Path;

String baseUrl = "https://garchi.co.uk";
String endpointUri = "api/v2/item_meta"; 

URI url = URI.create(baseUrl + endpointUri);

HttpClient client = HttpClient.newHttpClient();
HttpRequest.Builder builder = HttpRequest.newBuilder(url);


String body = {
    "meta": [
        {
            "key": "website",
            "value": "https:\/\/example.com",
            "type": "url"
        }
    ],
    "item_id": 51
};
builder.POST(HttpRequest.BodyPublishers.ofString(body));


builder.header("Authorization", "Bearer {YOUR_API_TOKEN}");
builder.header("Content-Type", "application/json");


HttpResponse<String> response = client.send(builder.build(), HttpResponse.BodyHandlers.ofString());

// Parse JSON response
JSONObject json = new JSONObject(response.body());

use Illuminate\Support\Facades\Http;

$url = 'https://garchi.co.uk/api/v2/item_meta';

$headers = [
  'Authorization' => 'Bearer {YOUR_API_TOKEN}',
  'Content-Type' => 'application/json'
]

$client = Http::withHeaders($headers);



$body = {
    "meta": [
        {
            "key": "website",
            "value": "https:\/\/example.com",
            "type": "url"
        }
    ],
    "item_id": 51
};

$client->withBody($body);





$response = $client->POST($url);

$responseBody = $response->json();

Example response (200):



{
    "data": [
        {
            "id": 606,
            "key": "website",
            "value": "https://example.com",
            "type": "url"
        }
    ]
}
 

Request   

POST api/v2/item_meta

Body Parameters

meta  object[] optional  

required. Array of meta information.

meta[].key  string optional  

required. Key of for the meta information.

meta[].type  string optional  

required. Type of the key value. Allowed values are string, array, url, object, numeric, email, date, color, icon_hero, icon_lucid.

meta[].value  string optional  

required. Value for the key.

item_id  integer optional  

required. Id of the item.

Delete meta information about a item for a space

requires authentication

This api allows you to delete extra information or meta data for a item. The data is added as a key value pair

Example request:
curl --request POST \
    "https://garchi.co.uk/api/v2/delete/item_meta" \
    --header "Authorization: Bearer {YOUR_API_TOKEN}" \
    --header "Content-Type: application/json" \
    --data "{
    \"meta_id\": 55,
    \"item_id\": 51,
    \"space_uid\": \"ca457162-6d04-4c3a-a3f6-2ab3e21b0fd00cca6914-5e72-4d54-b9db-fcf9\"
}"
// npm install @garchicms/garchi-node-sdk
import GarchiCMS from "@garchicms/garchi-node-sdk";

// The SDK sends your API token as "Authorization: Bearer <token>" on every request.
const garchi = new GarchiCMS({ api_key: "YOUR_API_TOKEN" });

const response = await garchi.dataItem.deleteMetaInfo({
    meta_id: 55,
    item_id: 51,
    space_uid: "ca457162-6d04-4c3a-a3f6-2ab3e21b0fd00cca6914-5e72-4d54-b9db-fcf9",
});
// composer require garchicms/garchi-sdk-php
use GarchiCMS\GarchiCMS;

// The SDK sends your API token as "Authorization: Bearer <token>" on every request.
$garchi = new GarchiCMS("YOUR_API_TOKEN");

$response = $garchi->dataItem->deleteMetaInfo([
    'meta_id' => 55,
    'item_id' => 51,
    'space_uid' => 'ca457162-6d04-4c3a-a3f6-2ab3e21b0fd00cca6914-5e72-4d54-b9db-fcf9',
]);
import requests
import json

url = 'https://garchi.co.uk/api/v2/delete/item_meta'
payload = {
    "meta_id": 55,
    "item_id": 51,
    "space_uid": "ca457162-6d04-4c3a-a3f6-2ab3e21b0fd00cca6914-5e72-4d54-b9db-fcf9"
}
headers = {
  'Authorization': 'Bearer {YOUR_API_TOKEN}',
  'Content-Type': 'application/json'
}

response = requests.request('POST', url, headers=headers, json=payload)
response.json()
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.nio.file.Path;

String baseUrl = "https://garchi.co.uk";
String endpointUri = "api/v2/delete/item_meta"; 

URI url = URI.create(baseUrl + endpointUri);

HttpClient client = HttpClient.newHttpClient();
HttpRequest.Builder builder = HttpRequest.newBuilder(url);


String body = {
    "meta_id": 55,
    "item_id": 51,
    "space_uid": "ca457162-6d04-4c3a-a3f6-2ab3e21b0fd00cca6914-5e72-4d54-b9db-fcf9"
};
builder.POST(HttpRequest.BodyPublishers.ofString(body));


builder.header("Authorization", "Bearer {YOUR_API_TOKEN}");
builder.header("Content-Type", "application/json");


HttpResponse<String> response = client.send(builder.build(), HttpResponse.BodyHandlers.ofString());

// Parse JSON response
JSONObject json = new JSONObject(response.body());

use Illuminate\Support\Facades\Http;

$url = 'https://garchi.co.uk/api/v2/delete/item_meta';

$headers = [
  'Authorization' => 'Bearer {YOUR_API_TOKEN}',
  'Content-Type' => 'application/json'
]

$client = Http::withHeaders($headers);



$body = {
    "meta_id": 55,
    "item_id": 51,
    "space_uid": "ca457162-6d04-4c3a-a3f6-2ab3e21b0fd00cca6914-5e72-4d54-b9db-fcf9"
};

$client->withBody($body);





$response = $client->POST($url);

$responseBody = $response->json();

Example response (200):



{
    "data": "Item meta deleted successfully"
}
 

Request   

POST api/v2/delete/item_meta

Body Parameters

meta_id  integer  

Meta id of the item meta info.

item_id  integer optional  

required. Id of the item.

space_uid  string optional  

required. UID of the space.

Update meta information about a item for a space

requires authentication

This api allows you to update extra information or meta data for a item. The data is added as a key value pair

Example request:
curl --request POST \
    "https://garchi.co.uk/api/v2/update/item_meta" \
    --header "Authorization: Bearer {YOUR_API_TOKEN}" \
    --header "Content-Type: application/json" \
    --data "{
    \"key\": \"website\",
    \"type\": \"url\",
    \"value\": \"https:\\/\\/example.com\",
    \"meta_id\": 55,
    \"item_id\": 51
}"
// npm install @garchicms/garchi-node-sdk
import GarchiCMS from "@garchicms/garchi-node-sdk";

// The SDK sends your API token as "Authorization: Bearer <token>" on every request.
const garchi = new GarchiCMS({ api_key: "YOUR_API_TOKEN" });

const response = await garchi.dataItem.updateMetaInfo({
    key: "website",
    type: "url",
    value: "https://example.com",
    meta_id: 55,
    item_id: 51,
});
// composer require garchicms/garchi-sdk-php
use GarchiCMS\GarchiCMS;

// The SDK sends your API token as "Authorization: Bearer <token>" on every request.
$garchi = new GarchiCMS("YOUR_API_TOKEN");

$response = $garchi->dataItem->updateMetaInfo([
    'key' => 'website',
    'type' => 'url',
    'value' => 'https://example.com',
    'meta_id' => 55,
    'item_id' => 51,
]);
import requests
import json

url = 'https://garchi.co.uk/api/v2/update/item_meta'
payload = {
    "key": "website",
    "type": "url",
    "value": "https:\/\/example.com",
    "meta_id": 55,
    "item_id": 51
}
headers = {
  'Authorization': 'Bearer {YOUR_API_TOKEN}',
  'Content-Type': 'application/json'
}

response = requests.request('POST', url, headers=headers, json=payload)
response.json()
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.nio.file.Path;

String baseUrl = "https://garchi.co.uk";
String endpointUri = "api/v2/update/item_meta"; 

URI url = URI.create(baseUrl + endpointUri);

HttpClient client = HttpClient.newHttpClient();
HttpRequest.Builder builder = HttpRequest.newBuilder(url);


String body = {
    "key": "website",
    "type": "url",
    "value": "https:\/\/example.com",
    "meta_id": 55,
    "item_id": 51
};
builder.POST(HttpRequest.BodyPublishers.ofString(body));


builder.header("Authorization", "Bearer {YOUR_API_TOKEN}");
builder.header("Content-Type", "application/json");


HttpResponse<String> response = client.send(builder.build(), HttpResponse.BodyHandlers.ofString());

// Parse JSON response
JSONObject json = new JSONObject(response.body());

use Illuminate\Support\Facades\Http;

$url = 'https://garchi.co.uk/api/v2/update/item_meta';

$headers = [
  'Authorization' => 'Bearer {YOUR_API_TOKEN}',
  'Content-Type' => 'application/json'
]

$client = Http::withHeaders($headers);



$body = {
    "key": "website",
    "type": "url",
    "value": "https:\/\/example.com",
    "meta_id": 55,
    "item_id": 51
};

$client->withBody($body);





$response = $client->POST($url);

$responseBody = $response->json();

Example response (200):



{
    "data": "Item meta updated successfully"
}
 

Request   

POST api/v2/update/item_meta

Body Parameters

key  string. optional  

Key of for the meta information.

type  string. optional  

Type of the key value. Allowed values are string, array, url, object, numeric, email, date, color, icon_hero, icon_lucid.

value  string. optional  

Value for the key.

meta_id  integer  

Meta id of the item meta info.

item_id  integer optional  

required. Id of the item.

List all items for a space

requires authentication

Returns list of all the items with pagination links for a particular space

Example request:
curl --request GET \
    --get "https://garchi.co.uk/api/v2/space/reiciendis/items?size=3&order_key=price&order_by=desc&reactions=include&children=exclude&description=exclude" \
    --header "Authorization: Bearer {YOUR_API_TOKEN}"
// npm install @garchicms/garchi-node-sdk
import GarchiCMS from "@garchicms/garchi-node-sdk";

// The SDK sends your API token as "Authorization: Bearer <token>" on every request.
const garchi = new GarchiCMS({ api_key: "YOUR_API_TOKEN" });

const response = await garchi.dataItem.getBySpace({
    uid: "reiciendis",
    size: 3,
    order_key: "price",
    order_by: "desc",
    reactions: "include",
    children: "exclude",
    description: "exclude",
});
// composer require garchicms/garchi-sdk-php
use GarchiCMS\GarchiCMS;

// The SDK sends your API token as "Authorization: Bearer <token>" on every request.
$garchi = new GarchiCMS("YOUR_API_TOKEN");

$response = $garchi->dataItem->getBySpace([
    'uid' => 'reiciendis',
    'size' => 3,
    'order_key' => 'price',
    'order_by' => 'desc',
    'reactions' => 'include',
    'children' => 'exclude',
    'description' => 'exclude',
]);
import requests
import json

url = 'https://garchi.co.uk/api/v2/space/reiciendis/items'
params = {
  'size': '3',
  'order_key': 'price',
  'order_by': 'desc',
  'reactions': 'include',
  'children': 'exclude',
  'description': 'exclude',
}
headers = {
  'Authorization': 'Bearer {YOUR_API_TOKEN}'
}

response = requests.request('GET', url, headers=headers, params=params)
response.json()
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.nio.file.Path;

String baseUrl = "https://garchi.co.uk";
String endpointUri = "api/v2/space/reiciendis/items"; 

URI url = URI.create(baseUrl + endpointUri);

HttpClient client = HttpClient.newHttpClient();
HttpRequest.Builder builder = HttpRequest.newBuilder(url);



Map<Object, Object> params = {
  "size": "3",
  "order_key": "price",
  "order_by": "desc",
  "reactions": "include",
  "children": "exclude",
  "description": "exclude",
};
builder.uri(URI.create(url + "?" + toQueryString(params)));

builder.header("Authorization", "Bearer {YOUR_API_TOKEN}");


HttpResponse<String> response = client.send(builder.build(), HttpResponse.BodyHandlers.ofString());

// Parse JSON response
JSONObject json = new JSONObject(response.body());

use Illuminate\Support\Facades\Http;

$url = 'https://garchi.co.uk/api/v2/space/reiciendis/items';

$headers = [
  'Authorization' => 'Bearer {YOUR_API_TOKEN}'
]

$client = Http::withHeaders($headers);




$queryParams = {
  'size': '3',
  'order_key': 'price',
  'order_by': 'desc',
  'reactions': 'include',
  'children': 'exclude',
  'description': 'exclude',
};

$url .= '?'. $queryParams;




$response = $client->GET($url);

$responseBody = $response->json();

Example response (200):



{
    "data": [
        {
            "item_id": 26,
            "sku": "WD-101",
            "external_link": "",
            "slug": "example-product",
            "parent_id": null,
            "children_count": 0,
            "name": "Example Product",
            "stock": 100,
            "price": 40,
            "scratched_price": null,
            "one_liner": "Best book for beginners",
            "description": "<p><strong>This book is fantastic</strong></p>\n<ol>\n<li>This</li>\n<li>Book</li>\n<li>is</li>\n<li>Fantastic</li>\n</ol>",
            "categories": [
                {
                    "id": 22,
                    "name": "Web Development Bootcamp",
                    "rank": null
                }
            ],
            "delivery_type": "can_deliver",
            "main_image": "https://assets.garchi.co.uk/examples/product-main.png",
            "other_images": [
                "https://assets.garchi.co.uk/examples/product-1.png",
                "https://assets.garchi.co.uk/examples/product-2.png"
            ],
            "attributes": [
                {
                    "id": 16,
                    "name": "Book Cover",
                    "min": "1",
                    "options": [
                        {
                            "id": 29,
                            "sku": "WD-101-PAPER",
                            "name": "Paper",
                            "price": 0.5
                        },
                        {
                            "id": 30,
                            "sku": "WD-101-BOUND",
                            "name": "Binded",
                            "price": 1
                        }
                    ]
                }
            ],
            "space": {
                "uid": "b5f0d08a-7600-4b9e-81e9-1ffaf5ddb8d2cf268eeb-000a-4bfd-bba6-09ab",
                "name": "Books"
            },
            "avg_rating": null,
            "scheduled_for": null,
            "item_meta": [
                {
                    "id": 11,
                    "key": "website",
                    "value": "https://example.com",
                    "type": "url"
                }
            ],
            "reactions": [
                {
                    "reaction_id": "9b08ce6c-350c-4f00-9858-37a866bd626f",
                    "reaction": "like",
                    "user_identifier": "jane.doe@@example.com",
                    "created_at": "2024-01-07T09:54:12.000000Z",
                    "updated_at": "2024-01-07T09:54:12.000000Z"
                }
            ],
            "agent_description": "A beginner-friendly book that teaches web development step by step.",
            "created": "2022-11-06 20:52:39",
            "updated": "2023-07-08 15:09:16"
        }
    ],
    "links": {
        "first": "https://garchi.co.uk/api/v2/items?page=1",
        "last": "https://garchi.co.uk/api/v2/items?page=1",
        "prev": null,
        "next": null
    },
    "meta": {
        "current_page": 1,
        "from": 1,
        "last_page": 1,
        "links": [
            {
                "url": null,
                "label": "&laquo; Previous",
                "active": false
            },
            {
                "url": "https://garchi.co.uk/api/v2/items?page=1",
                "label": "1",
                "active": true
            },
            {
                "url": null,
                "label": "Next &raquo;",
                "active": false
            }
        ],
        "path": "https://garchi.co.uk/api/v2/items",
        "per_page": 10,
        "to": 1,
        "total": 1
    }
}
 

Request   

GET api/v2/space/{uid}/items

URL Parameters

uid  string  

Query Parameters

size  integer optional  

int. Max number of entries on one page or size of chunk per page. By default it is set to 10.

order_key  string optional  

string. Key to order the items by. Allowed values are name, price, created, meta.*. meta.* is useful if you want to order items based on the item meta information keys.

order_by  string optional  

string. Order by ascending or descending. Allowed values are asc, desc.

reactions  string optional  

string. If you want to include or exclude reactions for the items.

children  string optional  

Include the published items inside each item, in their order, one level deep. Defaults to exclude; every item always has children_count.

description  string optional  

string. If you want to include or exclude markdown description for the items.

requires authentication

Before you use this API make sure to create embeddings from your dashboard . This endpoint returns the list of items based on semantic search. The search is based on the description and name of the items. The response body is similar to list all items api .

Example request:
curl --request GET \
    --get "https://garchi.co.uk/api/v2/items/semantic-search?q=web+app&threshold=0.5&reactions=include&children=exclude&description=exclude" \
    --header "Authorization: Bearer {YOUR_API_TOKEN}"
// npm install @garchicms/garchi-node-sdk
import GarchiCMS from "@garchicms/garchi-node-sdk";

// The SDK sends your API token as "Authorization: Bearer <token>" on every request.
const garchi = new GarchiCMS({ api_key: "YOUR_API_TOKEN" });

const response = await garchi.dataItem.semanticSearch({
    q: "web app",
    threshold: 0.5,
    reactions: "include",
    children: "exclude",
    description: "exclude",
});
// composer require garchicms/garchi-sdk-php
use GarchiCMS\GarchiCMS;

// The SDK sends your API token as "Authorization: Bearer <token>" on every request.
$garchi = new GarchiCMS("YOUR_API_TOKEN");

$response = $garchi->dataItem->semanticSearch([
    'q' => 'web app',
    'threshold' => 0.5,
    'reactions' => 'include',
    'children' => 'exclude',
    'description' => 'exclude',
]);
import requests
import json

url = 'https://garchi.co.uk/api/v2/items/semantic-search'
params = {
  'q': 'web app',
  'threshold': '0.5',
  'reactions': 'include',
  'children': 'exclude',
  'description': 'exclude',
}
headers = {
  'Authorization': 'Bearer {YOUR_API_TOKEN}'
}

response = requests.request('GET', url, headers=headers, params=params)
response.json()
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.nio.file.Path;

String baseUrl = "https://garchi.co.uk";
String endpointUri = "api/v2/items/semantic-search"; 

URI url = URI.create(baseUrl + endpointUri);

HttpClient client = HttpClient.newHttpClient();
HttpRequest.Builder builder = HttpRequest.newBuilder(url);



Map<Object, Object> params = {
  "q": "web app",
  "threshold": "0.5",
  "reactions": "include",
  "children": "exclude",
  "description": "exclude",
};
builder.uri(URI.create(url + "?" + toQueryString(params)));

builder.header("Authorization", "Bearer {YOUR_API_TOKEN}");


HttpResponse<String> response = client.send(builder.build(), HttpResponse.BodyHandlers.ofString());

// Parse JSON response
JSONObject json = new JSONObject(response.body());

use Illuminate\Support\Facades\Http;

$url = 'https://garchi.co.uk/api/v2/items/semantic-search';

$headers = [
  'Authorization' => 'Bearer {YOUR_API_TOKEN}'
]

$client = Http::withHeaders($headers);




$queryParams = {
  'q': 'web app',
  'threshold': '0.5',
  'reactions': 'include',
  'children': 'exclude',
  'description': 'exclude',
};

$url .= '?'. $queryParams;




$response = $client->GET($url);

$responseBody = $response->json();

Example response (200):



{
    "data": [
        {
            "item_id": 26,
            "sku": "WD-101",
            "external_link": "",
            "slug": "example-product",
            "parent_id": null,
            "children_count": 0,
            "name": "Example Product",
            "stock": 100,
            "price": 40,
            "scratched_price": null,
            "one_liner": "Best book for beginners",
            "description": "<p><strong>This book is fantastic</strong></p>\n<ol>\n<li>This</li>\n<li>Book</li>\n<li>is</li>\n<li>Fantastic</li>\n</ol>",
            "categories": [
                {
                    "id": 22,
                    "name": "Web Development Bootcamp",
                    "rank": null
                }
            ],
            "delivery_type": "can_deliver",
            "main_image": "https://assets.garchi.co.uk/examples/product-main.png",
            "other_images": [
                "https://assets.garchi.co.uk/examples/product-1.png",
                "https://assets.garchi.co.uk/examples/product-2.png"
            ],
            "attributes": [
                {
                    "id": 16,
                    "name": "Book Cover",
                    "min": "1",
                    "options": [
                        {
                            "id": 29,
                            "sku": "WD-101-PAPER",
                            "name": "Paper",
                            "price": 0.5
                        },
                        {
                            "id": 30,
                            "sku": "WD-101-BOUND",
                            "name": "Binded",
                            "price": 1
                        }
                    ]
                }
            ],
            "space": {
                "uid": "b5f0d08a-7600-4b9e-81e9-1ffaf5ddb8d2cf268eeb-000a-4bfd-bba6-09ab",
                "name": "Books"
            },
            "avg_rating": null,
            "scheduled_for": null,
            "item_meta": [
                {
                    "id": 11,
                    "key": "website",
                    "value": "https://example.com",
                    "type": "url"
                }
            ],
            "reactions": [
                {
                    "reaction_id": "9b08ce6c-350c-4f00-9858-37a866bd626f",
                    "reaction": "like",
                    "user_identifier": "jane.doe@@example.com",
                    "created_at": "2024-01-07T09:54:12.000000Z",
                    "updated_at": "2024-01-07T09:54:12.000000Z"
                }
            ],
            "similarity": 0.82,
            "agent_description": "A beginner-friendly book that teaches web development step by step.",
            "created": "2022-11-06 20:52:39",
            "updated": "2023-07-08 15:09:16"
        }
    ]
}
 

requires authentication

This endpoint returns the list of featured items that you set from your dashboard. The response body is similar to list all items api .

Example request:
curl --request GET \
    --get "https://garchi.co.uk/api/v2/items/featured?reactions=include&children=exclude&description=exclude" \
    --header "Authorization: Bearer {YOUR_API_TOKEN}"
// npm install @garchicms/garchi-node-sdk
import GarchiCMS from "@garchicms/garchi-node-sdk";

// The SDK sends your API token as "Authorization: Bearer <token>" on every request.
const garchi = new GarchiCMS({ api_key: "YOUR_API_TOKEN" });

const response = await garchi.dataItem.featured({
    reactions: "include",
    children: "exclude",
    description: "exclude",
});
// composer require garchicms/garchi-sdk-php
use GarchiCMS\GarchiCMS;

// The SDK sends your API token as "Authorization: Bearer <token>" on every request.
$garchi = new GarchiCMS("YOUR_API_TOKEN");

$response = $garchi->dataItem->featured([
    'reactions' => 'include',
    'children' => 'exclude',
    'description' => 'exclude',
]);
import requests
import json

url = 'https://garchi.co.uk/api/v2/items/featured'
params = {
  'reactions': 'include',
  'children': 'exclude',
  'description': 'exclude',
}
headers = {
  'Authorization': 'Bearer {YOUR_API_TOKEN}'
}

response = requests.request('GET', url, headers=headers, params=params)
response.json()
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.nio.file.Path;

String baseUrl = "https://garchi.co.uk";
String endpointUri = "api/v2/items/featured"; 

URI url = URI.create(baseUrl + endpointUri);

HttpClient client = HttpClient.newHttpClient();
HttpRequest.Builder builder = HttpRequest.newBuilder(url);



Map<Object, Object> params = {
  "reactions": "include",
  "children": "exclude",
  "description": "exclude",
};
builder.uri(URI.create(url + "?" + toQueryString(params)));

builder.header("Authorization", "Bearer {YOUR_API_TOKEN}");


HttpResponse<String> response = client.send(builder.build(), HttpResponse.BodyHandlers.ofString());

// Parse JSON response
JSONObject json = new JSONObject(response.body());

use Illuminate\Support\Facades\Http;

$url = 'https://garchi.co.uk/api/v2/items/featured';

$headers = [
  'Authorization' => 'Bearer {YOUR_API_TOKEN}'
]

$client = Http::withHeaders($headers);




$queryParams = {
  'reactions': 'include',
  'children': 'exclude',
  'description': 'exclude',
};

$url .= '?'. $queryParams;




$response = $client->GET($url);

$responseBody = $response->json();

Example response (200):



{
    "data": [
        {
            "item_id": 26,
            "sku": "WD-101",
            "external_link": "",
            "slug": "example-product",
            "parent_id": null,
            "children_count": 0,
            "name": "Example Product",
            "stock": 100,
            "price": 40,
            "scratched_price": null,
            "one_liner": "Best book for beginners",
            "description": "<p><strong>This book is fantastic</strong></p>\n<ol>\n<li>This</li>\n<li>Book</li>\n<li>is</li>\n<li>Fantastic</li>\n</ol>",
            "categories": [
                {
                    "id": 22,
                    "name": "Web Development Bootcamp",
                    "rank": null
                }
            ],
            "delivery_type": "can_deliver",
            "main_image": "https://assets.garchi.co.uk/examples/product-main.png",
            "other_images": [
                "https://assets.garchi.co.uk/examples/product-1.png",
                "https://assets.garchi.co.uk/examples/product-2.png"
            ],
            "attributes": [
                {
                    "id": 16,
                    "name": "Book Cover",
                    "min": "1",
                    "options": [
                        {
                            "id": 29,
                            "sku": "WD-101-PAPER",
                            "name": "Paper",
                            "price": 0.5
                        },
                        {
                            "id": 30,
                            "sku": "WD-101-BOUND",
                            "name": "Binded",
                            "price": 1
                        }
                    ]
                }
            ],
            "space": {
                "uid": "b5f0d08a-7600-4b9e-81e9-1ffaf5ddb8d2cf268eeb-000a-4bfd-bba6-09ab",
                "name": "Books"
            },
            "avg_rating": null,
            "scheduled_for": null,
            "reactions": [
                {
                    "reaction_id": "9b08ce6c-350c-4f00-9858-37a866bd626f",
                    "reaction": "like",
                    "user_identifier": "jane.doe@@example.com",
                    "created_at": "2024-01-07T09:54:12.000000Z",
                    "updated_at": "2024-01-07T09:54:12.000000Z"
                }
            ],
            "agent_description": "A beginner-friendly book that teaches web development step by step.",
            "created": "2022-11-06 20:52:39",
            "updated": "2023-07-08 15:09:16"
        }
    ]
}
 

Get Item Details

requires authentication

Returns details of a single item based on the item_id or slug passed.

Example request:
curl --request GET \
    --get "https://garchi.co.uk/api/v2/item/3?reactions=include&children=exclude" \
    --header "Authorization: Bearer {YOUR_API_TOKEN}"
// npm install @garchicms/garchi-node-sdk
import GarchiCMS from "@garchicms/garchi-node-sdk";

// The SDK sends your API token as "Authorization: Bearer <token>" on every request.
const garchi = new GarchiCMS({ api_key: "YOUR_API_TOKEN" });

const response = await garchi.dataItem.get({
    item: "3",
    reactions: "include",
    children: "exclude",
});
// composer require garchicms/garchi-sdk-php
use GarchiCMS\GarchiCMS;

// The SDK sends your API token as "Authorization: Bearer <token>" on every request.
$garchi = new GarchiCMS("YOUR_API_TOKEN");

$response = $garchi->dataItem->get([
    'item' => '3',
    'reactions' => 'include',
    'children' => 'exclude',
]);
import requests
import json

url = 'https://garchi.co.uk/api/v2/item/3'
params = {
  'reactions': 'include',
  'children': 'exclude',
}
headers = {
  'Authorization': 'Bearer {YOUR_API_TOKEN}'
}

response = requests.request('GET', url, headers=headers, params=params)
response.json()
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.nio.file.Path;

String baseUrl = "https://garchi.co.uk";
String endpointUri = "api/v2/item/3"; 

URI url = URI.create(baseUrl + endpointUri);

HttpClient client = HttpClient.newHttpClient();
HttpRequest.Builder builder = HttpRequest.newBuilder(url);



Map<Object, Object> params = {
  "reactions": "include",
  "children": "exclude",
};
builder.uri(URI.create(url + "?" + toQueryString(params)));

builder.header("Authorization", "Bearer {YOUR_API_TOKEN}");


HttpResponse<String> response = client.send(builder.build(), HttpResponse.BodyHandlers.ofString());

// Parse JSON response
JSONObject json = new JSONObject(response.body());

use Illuminate\Support\Facades\Http;

$url = 'https://garchi.co.uk/api/v2/item/3';

$headers = [
  'Authorization' => 'Bearer {YOUR_API_TOKEN}'
]

$client = Http::withHeaders($headers);




$queryParams = {
  'reactions': 'include',
  'children': 'exclude',
};

$url .= '?'. $queryParams;




$response = $client->GET($url);

$responseBody = $response->json();

Example response (200):



{
    "data": [
        {
            "item_id": 26,
            "sku": "WD-101",
            "external_link": "",
            "slug": "example-product",
            "parent_id": null,
            "children_count": 0,
            "name": "Example Product",
            "stock": 100,
            "price": 40,
            "scratched_price": null,
            "one_liner": "Best book for beginners",
            "description": "<p><strong>This book is fantastic</strong></p>\n<ol>\n<li>This</li>\n<li>Book</li>\n<li>is</li>\n<li>Fantastic</li>\n</ol>",
            "categories": [
                {
                    "id": 22,
                    "name": "Web Development Bootcamp",
                    "rank": null
                }
            ],
            "delivery_type": "can_deliver",
            "main_image": "https://assets.garchi.co.uk/examples/product-main.png",
            "other_images": [
                "https://assets.garchi.co.uk/examples/product-1.png",
                "https://assets.garchi.co.uk/examples/product-2.png"
            ],
            "attributes": [
                {
                    "id": 16,
                    "name": "Book Cover",
                    "min": "1",
                    "options": [
                        {
                            "id": 29,
                            "sku": "WD-101-PAPER",
                            "name": "Paper",
                            "price": 0.5
                        },
                        {
                            "id": 30,
                            "sku": "WD-101-BOUND",
                            "name": "Binded",
                            "price": 1
                        }
                    ]
                }
            ],
            "space": {
                "uid": "b5f0d08a-7600-4b9e-81e9-1ffaf5ddb8d2cf268eeb-000a-4bfd-bba6-09ab",
                "name": "Books"
            },
            "avg_rating": null,
            "scheduled_for": null,
            "item_meta": [
                {
                    "id": 11,
                    "key": "website",
                    "value": "https://example.com",
                    "type": "url"
                }
            ],
            "reactions": [
                {
                    "reaction_id": "9b08ce6c-350c-4f00-9858-37a866bd626f",
                    "reaction": "like",
                    "user_identifier": "jane.doe@@example.com",
                    "created_at": "2024-01-07T09:54:12.000000Z",
                    "updated_at": "2024-01-07T09:54:12.000000Z"
                }
            ],
            "agent_description": "A beginner-friendly book that teaches web development step by step.",
            "created": "2022-11-06 20:52:39",
            "updated": "2023-07-08 15:09:16"
        }
    ]
}
 

Request   

GET api/v2/item/{item}

URL Parameters

item  string  

id or slug of the item.

Query Parameters

reactions  string optional  

If you want to include or exclude reactions for the items.

children  string optional  

Include the published items inside each item, in their order, one level deep. Defaults to exclude; every item always has children_count.

List all items

requires authentication

Returns list of all the items with pagination links. You can also use this api to search items by their name, slug, or category.

Example request:
curl --request GET \
    --get "https://garchi.co.uk/api/v2/items?size=10&search_keyword=Web+app+with&order_key=price&order_by=desc&reactions=include&children=exclude&description=exclude" \
    --header "Authorization: Bearer {YOUR_API_TOKEN}"
// npm install @garchicms/garchi-node-sdk
import GarchiCMS from "@garchicms/garchi-node-sdk";

// The SDK sends your API token as "Authorization: Bearer <token>" on every request.
const garchi = new GarchiCMS({ api_key: "YOUR_API_TOKEN" });

const response = await garchi.dataItem.getAll({
    size: 10,
    search_keyword: "Web app with",
    order_key: "price",
    order_by: "desc",
    reactions: "include",
    children: "exclude",
    description: "exclude",
});
// composer require garchicms/garchi-sdk-php
use GarchiCMS\GarchiCMS;

// The SDK sends your API token as "Authorization: Bearer <token>" on every request.
$garchi = new GarchiCMS("YOUR_API_TOKEN");

$response = $garchi->dataItem->getAll([
    'size' => 10,
    'search_keyword' => 'Web app with',
    'order_key' => 'price',
    'order_by' => 'desc',
    'reactions' => 'include',
    'children' => 'exclude',
    'description' => 'exclude',
]);
import requests
import json

url = 'https://garchi.co.uk/api/v2/items'
params = {
  'size': '10',
  'search_keyword': 'Web app with',
  'order_key': 'price',
  'order_by': 'desc',
  'reactions': 'include',
  'children': 'exclude',
  'description': 'exclude',
}
headers = {
  'Authorization': 'Bearer {YOUR_API_TOKEN}'
}

response = requests.request('GET', url, headers=headers, params=params)
response.json()
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.nio.file.Path;

String baseUrl = "https://garchi.co.uk";
String endpointUri = "api/v2/items"; 

URI url = URI.create(baseUrl + endpointUri);

HttpClient client = HttpClient.newHttpClient();
HttpRequest.Builder builder = HttpRequest.newBuilder(url);



Map<Object, Object> params = {
  "size": "10",
  "search_keyword": "Web app with",
  "order_key": "price",
  "order_by": "desc",
  "reactions": "include",
  "children": "exclude",
  "description": "exclude",
};
builder.uri(URI.create(url + "?" + toQueryString(params)));

builder.header("Authorization", "Bearer {YOUR_API_TOKEN}");


HttpResponse<String> response = client.send(builder.build(), HttpResponse.BodyHandlers.ofString());

// Parse JSON response
JSONObject json = new JSONObject(response.body());

use Illuminate\Support\Facades\Http;

$url = 'https://garchi.co.uk/api/v2/items';

$headers = [
  'Authorization' => 'Bearer {YOUR_API_TOKEN}'
]

$client = Http::withHeaders($headers);




$queryParams = {
  'size': '10',
  'search_keyword': 'Web app with',
  'order_key': 'price',
  'order_by': 'desc',
  'reactions': 'include',
  'children': 'exclude',
  'description': 'exclude',
};

$url .= '?'. $queryParams;




$response = $client->GET($url);

$responseBody = $response->json();

Example response (200):



{
    "data": [
        {
            "item_id": 26,
            "sku": "WD-101",
            "external_link": "",
            "slug": "example-product",
            "parent_id": null,
            "children_count": 0,
            "name": "Example Product",
            "stock": 100,
            "price": 40,
            "scratched_price": null,
            "one_liner": "Best book for beginners",
            "description": "<p><strong>This book is fantastic</strong></p>\n<ol>\n<li>This</li>\n<li>Book</li>\n<li>is</li>\n<li>Fantastic</li>\n</ol>",
            "categories": [
                {
                    "id": 22,
                    "name": "Web Development Bootcamp",
                    "rank": null
                }
            ],
            "delivery_type": "can_deliver",
            "main_image": "https://assets.garchi.co.uk/examples/product-main.png",
            "other_images": [
                "https://assets.garchi.co.uk/examples/product-1.png",
                "https://assets.garchi.co.uk/examples/product-2.png"
            ],
            "attributes": [
                {
                    "id": 16,
                    "name": "Book Cover",
                    "min": "1",
                    "options": [
                        {
                            "id": 29,
                            "sku": "WD-101-PAPER",
                            "name": "Paper",
                            "price": 0.5
                        },
                        {
                            "id": 30,
                            "sku": "WD-101-BOUND",
                            "name": "Binded",
                            "price": 1
                        }
                    ]
                }
            ],
            "space": {
                "uid": "b5f0d08a-7600-4b9e-81e9-1ffaf5ddb8d2cf268eeb-000a-4bfd-bba6-09ab",
                "name": "Books"
            },
            "avg_rating": null,
            "scheduled_for": null,
            "item_meta": [
                {
                    "id": 11,
                    "key": "website",
                    "value": "https://example.com",
                    "type": "url"
                }
            ],
            "reactions": [
                {
                    "reaction_id": "9b08ce6c-350c-4f00-9858-37a866bd626f",
                    "reaction": "like",
                    "user_identifier": "jane.doe@@example.com",
                    "created_at": "2024-01-07T09:54:12.000000Z",
                    "updated_at": "2024-01-07T09:54:12.000000Z"
                }
            ],
            "agent_description": "A beginner-friendly book that teaches web development step by step.",
            "created": "2022-11-06 20:52:39",
            "updated": "2023-07-08 15:09:16"
        }
    ],
    "links": {
        "first": "https://garchi.co.uk/api/v2/items?page=1",
        "last": "https://garchi.co.uk/api/v2/items?page=1",
        "prev": null,
        "next": null
    },
    "meta": {
        "current_page": 1,
        "from": 1,
        "last_page": 1,
        "links": [
            {
                "url": null,
                "label": "&laquo; Previous",
                "active": false
            },
            {
                "url": "https://garchi.co.uk/api/v2/items?page=1",
                "label": "1",
                "active": true
            },
            {
                "url": null,
                "label": "Next &raquo;",
                "active": false
            }
        ],
        "path": "https://garchi.co.uk/api/v2/items",
        "per_page": 10,
        "to": 1,
        "total": 1
    }
}
 

Request   

GET api/v2/items

Query Parameters

size  integer optional  

int. Max number of entries on one page or size of chunk per page. By default it is set to 10.

search_keyword  string optional  

string. Could be name of the item, slug of the item, or category name.

order_key  string optional  

string. Key to order the items by. Allowed values are name, price, created, meta.*. meta.* is useful if you want to order items based on the item meta information keys.

order_by  string optional  

string. Order by ascending or descending. Allowed values are asc, desc.

reactions  string optional  

string. If you want to include or exclude reactions for the items.

children  string optional  

Include the published items inside each item, in their order, one level deep. Defaults to exclude; every item always has children_count.

description  string optional  

string. If you want to include or exclude markdown description for the items.

Filter items

requires authentication

Based on the filters passed, does logically and of all filters and returns the list of items with pagination. The response body is similar to list all items api . The accepted filters are spaces, categories and priceOrder. If any of these filter is null or blank or empty then it will be ignored.

Example request:
curl --request POST \
    "https://garchi.co.uk/api/v2/items/filter?reactions=include&children=exclude&order_key=price&order_by=desc&description=exclude" \
    --header "Authorization: Bearer {YOUR_API_TOKEN}" \
    --header "Content-Type: application/json" \
    --data "{
    \"spaces\": \"[\'2z5088d1-8772-2912-ab9w-cbdd8bcd806fb6138bbf-296e-94b4-9cf1-03x1\']\",
    \"categories\": \"[23,4,1]\",
    \"priceOrder\": \"\\\"low-high\\\"\",
    \"size\": \"10\"
}"
// npm install @garchicms/garchi-node-sdk
import GarchiCMS from "@garchicms/garchi-node-sdk";

// The SDK sends your API token as "Authorization: Bearer <token>" on every request.
const garchi = new GarchiCMS({ api_key: "YOUR_API_TOKEN" });

const response = await garchi.dataItem.filter({
    query: {
        reactions: "include",
        children: "exclude",
        order_key: "price",
        order_by: "desc",
        description: "exclude",
    },
    body: {
        spaces: [
            "2z5088d1-8772-2912-ab9w-cbdd8bcd806fb6138bbf-296e-94b4-9cf1-03x1"
        ],
        categories: [23, 4, 1],
        priceOrder: "low-high",
        size: 10,
    },
});
// composer require garchicms/garchi-sdk-php
use GarchiCMS\GarchiCMS;

// The SDK sends your API token as "Authorization: Bearer <token>" on every request.
$garchi = new GarchiCMS("YOUR_API_TOKEN");

$response = $garchi->dataItem->filter([
    'query' => [
        'reactions' => 'include',
        'children' => 'exclude',
        'order_key' => 'price',
        'order_by' => 'desc',
        'description' => 'exclude',
    ],
    'body' => [
        'spaces' => [
            '2z5088d1-8772-2912-ab9w-cbdd8bcd806fb6138bbf-296e-94b4-9cf1-03x1',
        ],
        'categories' => [23, 4, 1],
        'priceOrder' => 'low-high',
        'size' => 10,
    ],
]);
import requests
import json

url = 'https://garchi.co.uk/api/v2/items/filter'
payload = {
    "spaces": "['2z5088d1-8772-2912-ab9w-cbdd8bcd806fb6138bbf-296e-94b4-9cf1-03x1']",
    "categories": "[23,4,1]",
    "priceOrder": "\"low-high\"",
    "size": "10"
}
params = {
  'reactions': 'include',
  'children': 'exclude',
  'order_key': 'price',
  'order_by': 'desc',
  'description': 'exclude',
}
headers = {
  'Authorization': 'Bearer {YOUR_API_TOKEN}',
  'Content-Type': 'application/json'
}

response = requests.request('POST', url, headers=headers, json=payload, params=params)
response.json()
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.nio.file.Path;

String baseUrl = "https://garchi.co.uk";
String endpointUri = "api/v2/items/filter"; 

URI url = URI.create(baseUrl + endpointUri);

HttpClient client = HttpClient.newHttpClient();
HttpRequest.Builder builder = HttpRequest.newBuilder(url);


String body = {
    "spaces": "['2z5088d1-8772-2912-ab9w-cbdd8bcd806fb6138bbf-296e-94b4-9cf1-03x1']",
    "categories": "[23,4,1]",
    "priceOrder": "\"low-high\"",
    "size": "10"
};
builder.POST(HttpRequest.BodyPublishers.ofString(body));

Map<Object, Object> params = {
  "reactions": "include",
  "children": "exclude",
  "order_key": "price",
  "order_by": "desc",
  "description": "exclude",
};
builder.uri(URI.create(url + "?" + toQueryString(params)));

builder.header("Authorization", "Bearer {YOUR_API_TOKEN}");
builder.header("Content-Type", "application/json");


HttpResponse<String> response = client.send(builder.build(), HttpResponse.BodyHandlers.ofString());

// Parse JSON response
JSONObject json = new JSONObject(response.body());

use Illuminate\Support\Facades\Http;

$url = 'https://garchi.co.uk/api/v2/items/filter';

$headers = [
  'Authorization' => 'Bearer {YOUR_API_TOKEN}',
  'Content-Type' => 'application/json'
]

$client = Http::withHeaders($headers);



$body = {
    "spaces": "['2z5088d1-8772-2912-ab9w-cbdd8bcd806fb6138bbf-296e-94b4-9cf1-03x1']",
    "categories": "[23,4,1]",
    "priceOrder": "\"low-high\"",
    "size": "10"
};

$client->withBody($body);



$queryParams = {
  'reactions': 'include',
  'children': 'exclude',
  'order_key': 'price',
  'order_by': 'desc',
  'description': 'exclude',
};

$url .= '?'. $queryParams;




$response = $client->POST($url);

$responseBody = $response->json();

Example response (200):



{
    "data": [
        {
            "item_id": 26,
            "sku": "WD-101",
            "external_link": "",
            "slug": "example-product",
            "parent_id": null,
            "children_count": 0,
            "name": "Example Product",
            "stock": 100,
            "price": 40,
            "scratched_price": null,
            "one_liner": "Best book for beginners",
            "description": "<p><strong>This book is fantastic</strong></p>\n<ol>\n<li>This</li>\n<li>Book</li>\n<li>is</li>\n<li>Fantastic</li>\n</ol>",
            "categories": [
                {
                    "id": 22,
                    "name": "Web Development Bootcamp",
                    "rank": null
                }
            ],
            "delivery_type": "can_deliver",
            "main_image": "https://assets.garchi.co.uk/examples/product-main.png",
            "other_images": [
                "https://assets.garchi.co.uk/examples/product-1.png",
                "https://assets.garchi.co.uk/examples/product-2.png"
            ],
            "attributes": [
                {
                    "id": 16,
                    "name": "Book Cover",
                    "min": "1",
                    "options": [
                        {
                            "id": 29,
                            "sku": "WD-101-PAPER",
                            "name": "Paper",
                            "price": 0.5
                        },
                        {
                            "id": 30,
                            "sku": "WD-101-BOUND",
                            "name": "Binded",
                            "price": 1
                        }
                    ]
                }
            ],
            "space": {
                "uid": "b5f0d08a-7600-4b9e-81e9-1ffaf5ddb8d2cf268eeb-000a-4bfd-bba6-09ab",
                "name": "Books"
            },
            "avg_rating": null,
            "scheduled_for": null,
            "item_meta": [
                {
                    "id": 11,
                    "key": "website",
                    "value": "https://example.com",
                    "type": "url"
                }
            ],
            "reactions": [
                {
                    "reaction_id": "9b08ce6c-350c-4f00-9858-37a866bd626f",
                    "reaction": "like",
                    "user_identifier": "jane.doe@@example.com",
                    "created_at": "2024-01-07T09:54:12.000000Z",
                    "updated_at": "2024-01-07T09:54:12.000000Z"
                }
            ],
            "agent_description": "A beginner-friendly book that teaches web development step by step.",
            "created": "2022-11-06 20:52:39",
            "updated": "2023-07-08 15:09:16"
        }
    ],
    "links": {
        "first": "https://garchi.co.uk/api/v2/items?page=1",
        "last": "https://garchi.co.uk/api/v2/items?page=1",
        "prev": null,
        "next": null
    },
    "meta": {
        "current_page": 1,
        "from": 1,
        "last_page": 1,
        "links": [
            {
                "url": null,
                "label": "&laquo; Previous",
                "active": false
            },
            {
                "url": "https://garchi.co.uk/api/v2/items?page=1",
                "label": "1",
                "active": true
            },
            {
                "url": null,
                "label": "Next &raquo;",
                "active": false
            }
        ],
        "path": "https://garchi.co.uk/api/v2/items",
        "per_page": 10,
        "to": 1,
        "total": 1
    }
}
 

Request   

POST api/v2/items/filter

Query Parameters

reactions  string optional  

string. If you want to include or exclude reactions for the items.

children  string optional  

Include the published items inside each item, in their order, one level deep. Defaults to exclude; every item always has children_count.

order_key  string optional  

string. Key to order the items by. Allowed values are name, price, created, meta.*. meta.* is useful if you want to order items based on the item meta information keys.

order_by  string optional  

string. Order by ascending or descending. Allowed values are asc, desc.

description  string optional  

string. If you want to include or exclude markdown description for the items.

Body Parameters

spaces  string[]. optional  

Array of uid of spaces.

categories  integer[]. optional  

Array of category id.

priceOrder  string. optional  

Takes either of one value. 'low-high', 'high-low'.

size  int. optional  

Size of the paginated data chunk.

Filter items by meta values

requires authentication

Based on the filters passed for the meta data (Extra details added for an item) and the operation specified, filters the items. Does logical and of the filters. The response body is similar to list all items api .

Example request:
curl --request POST \
    "https://garchi.co.uk/api/v2/items/filter/bymeta?order_key=price&order_by=desc&reactions=include&children=exclude" \
    --header "Authorization: Bearer {YOUR_API_TOKEN}" \
    --header "Content-Type: application/json" \
    --data "{
    \"meta_filters\": [
        {
            \"key\": \"date\",
            \"value\": \"[\'2021-11-21\', \'2020-12-12\']\",
            \"operator\": \"in\"
        }
    ]
}"
// npm install @garchicms/garchi-node-sdk
import GarchiCMS from "@garchicms/garchi-node-sdk";

// The SDK sends your API token as "Authorization: Bearer <token>" on every request.
const garchi = new GarchiCMS({ api_key: "YOUR_API_TOKEN" });

const response = await garchi.dataItem.filterByMeta({
    query: {
        order_key: "price",
        order_by: "desc",
        reactions: "include",
        children: "exclude",
    },
    body: {
        meta_filters: [
            {
                key: "date",
                value: ["2021-11-21", "2020-12-12"],
                operator: "in",
            }
        ],
    },
});
// composer require garchicms/garchi-sdk-php
use GarchiCMS\GarchiCMS;

// The SDK sends your API token as "Authorization: Bearer <token>" on every request.
$garchi = new GarchiCMS("YOUR_API_TOKEN");

$response = $garchi->dataItem->filterByMeta([
    'query' => [
        'order_key' => 'price',
        'order_by' => 'desc',
        'reactions' => 'include',
        'children' => 'exclude',
    ],
    'body' => [
        'meta_filters' => [
            [
                'key' => 'date',
                'value' => ['2021-11-21', '2020-12-12'],
                'operator' => 'in',
            ],
        ],
    ],
]);
import requests
import json

url = 'https://garchi.co.uk/api/v2/items/filter/bymeta'
payload = {
    "meta_filters": [
        {
            "key": "date",
            "value": "['2021-11-21', '2020-12-12']",
            "operator": "in"
        }
    ]
}
params = {
  'order_key': 'price',
  'order_by': 'desc',
  'reactions': 'include',
  'children': 'exclude',
}
headers = {
  'Authorization': 'Bearer {YOUR_API_TOKEN}',
  'Content-Type': 'application/json'
}

response = requests.request('POST', url, headers=headers, json=payload, params=params)
response.json()
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.nio.file.Path;

String baseUrl = "https://garchi.co.uk";
String endpointUri = "api/v2/items/filter/bymeta"; 

URI url = URI.create(baseUrl + endpointUri);

HttpClient client = HttpClient.newHttpClient();
HttpRequest.Builder builder = HttpRequest.newBuilder(url);


String body = {
    "meta_filters": [
        {
            "key": "date",
            "value": "['2021-11-21', '2020-12-12']",
            "operator": "in"
        }
    ]
};
builder.POST(HttpRequest.BodyPublishers.ofString(body));

Map<Object, Object> params = {
  "order_key": "price",
  "order_by": "desc",
  "reactions": "include",
  "children": "exclude",
};
builder.uri(URI.create(url + "?" + toQueryString(params)));

builder.header("Authorization", "Bearer {YOUR_API_TOKEN}");
builder.header("Content-Type", "application/json");


HttpResponse<String> response = client.send(builder.build(), HttpResponse.BodyHandlers.ofString());

// Parse JSON response
JSONObject json = new JSONObject(response.body());

use Illuminate\Support\Facades\Http;

$url = 'https://garchi.co.uk/api/v2/items/filter/bymeta';

$headers = [
  'Authorization' => 'Bearer {YOUR_API_TOKEN}',
  'Content-Type' => 'application/json'
]

$client = Http::withHeaders($headers);



$body = {
    "meta_filters": [
        {
            "key": "date",
            "value": "['2021-11-21', '2020-12-12']",
            "operator": "in"
        }
    ]
};

$client->withBody($body);



$queryParams = {
  'order_key': 'price',
  'order_by': 'desc',
  'reactions': 'include',
  'children': 'exclude',
};

$url .= '?'. $queryParams;




$response = $client->POST($url);

$responseBody = $response->json();

Example response (200):



{
    "data": [
        {
            "item_id": 26,
            "sku": "WD-101",
            "external_link": "",
            "slug": "example-product",
            "parent_id": null,
            "children_count": 0,
            "name": "Example Product",
            "stock": 100,
            "price": 40,
            "scratched_price": null,
            "one_liner": "Best book for beginners",
            "description": "<p><strong>This book is fantastic</strong></p>\n<ol>\n<li>This</li>\n<li>Book</li>\n<li>is</li>\n<li>Fantastic</li>\n</ol>",
            "categories": [
                {
                    "id": 22,
                    "name": "Web Development Bootcamp",
                    "rank": null
                }
            ],
            "delivery_type": "can_deliver",
            "main_image": "https://assets.garchi.co.uk/examples/product-main.png",
            "other_images": [
                "https://assets.garchi.co.uk/examples/product-1.png",
                "https://assets.garchi.co.uk/examples/product-2.png"
            ],
            "attributes": [
                {
                    "id": 16,
                    "name": "Book Cover",
                    "min": "1",
                    "options": [
                        {
                            "id": 29,
                            "sku": "WD-101-PAPER",
                            "name": "Paper",
                            "price": 0.5
                        },
                        {
                            "id": 30,
                            "sku": "WD-101-BOUND",
                            "name": "Binded",
                            "price": 1
                        }
                    ]
                }
            ],
            "space": {
                "uid": "b5f0d08a-7600-4b9e-81e9-1ffaf5ddb8d2cf268eeb-000a-4bfd-bba6-09ab",
                "name": "Books"
            },
            "avg_rating": null,
            "scheduled_for": null,
            "item_meta": [
                {
                    "id": 11,
                    "key": "website",
                    "value": "https://example.com",
                    "type": "url"
                }
            ],
            "reactions": [
                {
                    "reaction_id": "9b08ce6c-350c-4f00-9858-37a866bd626f",
                    "reaction": "like",
                    "user_identifier": "jane.doe@@example.com",
                    "created_at": "2024-01-07T09:54:12.000000Z",
                    "updated_at": "2024-01-07T09:54:12.000000Z"
                }
            ],
            "agent_description": "A beginner-friendly book that teaches web development step by step.",
            "created": "2022-11-06 20:52:39",
            "updated": "2023-07-08 15:09:16"
        }
    ]
}
 

Request   

POST api/v2/items/filter/bymeta

Query Parameters

order_key  string optional  

string. Key to order the items by. Allowed values are name, price, created, meta.*. meta.* is useful if you want to order items based on the item meta information keys.

order_by  string optional  

string. Order by ascending or descending. Allowed values are asc, desc.

reactions  string optional  

string. If you want to include or exclude reactions for the items.

children  string optional  

Include the published items inside each item, in their order, one level deep. Defaults to exclude; every item always has children_count.

Body Parameters

meta_filters  object[]  

Array of key value pairs where key refers to the meta key and value refers to the match you are looking for.

meta_filters[].key  required optional  

Key that you are looking for.

meta_filters[].value  required optional  

Value that should be matched for the specified key.

meta_filters[].operator  required optional  

Type of operator to be used. Allowed operators equals, in, like, gte, lte.

List items by list of ids

requires authentication

This endpoint returns list of items based on items_ids given. It could be use to list specific list of items on landing page. The response body is similar to list all items api .

Example request:
curl --request POST \
    "https://garchi.co.uk/api/v2/items/byids?order_key=price&order_by=desc&reactions=include&children=exclude&description=exclude" \
    --header "Authorization: Bearer {YOUR_API_TOKEN}" \
    --header "Content-Type: application/json" \
    --data "{
    \"item_ids\": [
        15,
        29
    ]
}"
// npm install @garchicms/garchi-node-sdk
import GarchiCMS from "@garchicms/garchi-node-sdk";

// The SDK sends your API token as "Authorization: Bearer <token>" on every request.
const garchi = new GarchiCMS({ api_key: "YOUR_API_TOKEN" });

const response = await garchi.dataItem.getByIds({
    query: {
        order_key: "price",
        order_by: "desc",
        reactions: "include",
        children: "exclude",
        description: "exclude",
    },
    body: {
        item_ids: [15, 29],
    },
});
// composer require garchicms/garchi-sdk-php
use GarchiCMS\GarchiCMS;

// The SDK sends your API token as "Authorization: Bearer <token>" on every request.
$garchi = new GarchiCMS("YOUR_API_TOKEN");

$response = $garchi->dataItem->getByIds([
    'query' => [
        'order_key' => 'price',
        'order_by' => 'desc',
        'reactions' => 'include',
        'children' => 'exclude',
        'description' => 'exclude',
    ],
    'body' => [
        'item_ids' => [15, 29],
    ],
]);
import requests
import json

url = 'https://garchi.co.uk/api/v2/items/byids'
payload = {
    "item_ids": [
        15,
        29
    ]
}
params = {
  'order_key': 'price',
  'order_by': 'desc',
  'reactions': 'include',
  'children': 'exclude',
  'description': 'exclude',
}
headers = {
  'Authorization': 'Bearer {YOUR_API_TOKEN}',
  'Content-Type': 'application/json'
}

response = requests.request('POST', url, headers=headers, json=payload, params=params)
response.json()
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.nio.file.Path;

String baseUrl = "https://garchi.co.uk";
String endpointUri = "api/v2/items/byids"; 

URI url = URI.create(baseUrl + endpointUri);

HttpClient client = HttpClient.newHttpClient();
HttpRequest.Builder builder = HttpRequest.newBuilder(url);


String body = {
    "item_ids": [
        15,
        29
    ]
};
builder.POST(HttpRequest.BodyPublishers.ofString(body));

Map<Object, Object> params = {
  "order_key": "price",
  "order_by": "desc",
  "reactions": "include",
  "children": "exclude",
  "description": "exclude",
};
builder.uri(URI.create(url + "?" + toQueryString(params)));

builder.header("Authorization", "Bearer {YOUR_API_TOKEN}");
builder.header("Content-Type", "application/json");


HttpResponse<String> response = client.send(builder.build(), HttpResponse.BodyHandlers.ofString());

// Parse JSON response
JSONObject json = new JSONObject(response.body());

use Illuminate\Support\Facades\Http;

$url = 'https://garchi.co.uk/api/v2/items/byids';

$headers = [
  'Authorization' => 'Bearer {YOUR_API_TOKEN}',
  'Content-Type' => 'application/json'
]

$client = Http::withHeaders($headers);



$body = {
    "item_ids": [
        15,
        29
    ]
};

$client->withBody($body);



$queryParams = {
  'order_key': 'price',
  'order_by': 'desc',
  'reactions': 'include',
  'children': 'exclude',
  'description': 'exclude',
};

$url .= '?'. $queryParams;




$response = $client->POST($url);

$responseBody = $response->json();

Example response (200):



{
    "data": [
        {
            "item_id": 26,
            "sku": "WD-101",
            "external_link": "",
            "slug": "example-product",
            "parent_id": null,
            "children_count": 0,
            "name": "Example Product",
            "stock": 100,
            "price": 40,
            "scratched_price": null,
            "one_liner": "Best book for beginners",
            "description": "<p><strong>This book is fantastic</strong></p>\n<ol>\n<li>This</li>\n<li>Book</li>\n<li>is</li>\n<li>Fantastic</li>\n</ol>",
            "categories": [
                {
                    "id": 22,
                    "name": "Web Development Bootcamp",
                    "rank": null
                }
            ],
            "delivery_type": "can_deliver",
            "main_image": "https://assets.garchi.co.uk/examples/product-main.png",
            "other_images": [
                "https://assets.garchi.co.uk/examples/product-1.png",
                "https://assets.garchi.co.uk/examples/product-2.png"
            ],
            "attributes": [
                {
                    "id": 16,
                    "name": "Book Cover",
                    "min": "1",
                    "options": [
                        {
                            "id": 29,
                            "sku": "WD-101-PAPER",
                            "name": "Paper",
                            "price": 0.5
                        },
                        {
                            "id": 30,
                            "sku": "WD-101-BOUND",
                            "name": "Binded",
                            "price": 1
                        }
                    ]
                }
            ],
            "space": {
                "uid": "b5f0d08a-7600-4b9e-81e9-1ffaf5ddb8d2cf268eeb-000a-4bfd-bba6-09ab",
                "name": "Books"
            },
            "avg_rating": null,
            "scheduled_for": null,
            "item_meta": [
                {
                    "id": 11,
                    "key": "website",
                    "value": "https://example.com",
                    "type": "url"
                }
            ],
            "reactions": [
                {
                    "reaction_id": "9b08ce6c-350c-4f00-9858-37a866bd626f",
                    "reaction": "like",
                    "user_identifier": "jane.doe@@example.com",
                    "created_at": "2024-01-07T09:54:12.000000Z",
                    "updated_at": "2024-01-07T09:54:12.000000Z"
                }
            ],
            "agent_description": "A beginner-friendly book that teaches web development step by step.",
            "created": "2022-11-06 20:52:39",
            "updated": "2023-07-08 15:09:16"
        }
    ]
}
 

Request   

POST api/v2/items/byids

Query Parameters

order_key  string optional  

string. Key to order the items by. Allowed values are name, price, created, meta.*. meta.* is useful if you want to order items based on the item meta information keys.

order_by  string optional  

string. Order by ascending or descending. Allowed values are asc, desc.

reactions  string optional  

string. If you want to include or exclude reactions for the items.

children  string optional  

Include the published items inside each item, in their order, one level deep. Defaults to exclude; every item always has children_count.

description  string optional  

string. If you want to include or exclude markdown description for the items.

Body Parameters

item_ids  integer[]  

List of item ids.

Query items

requires authentication

Find the published items of a space with any combination of conditions on their own fields and their metadata, including values nested inside JSON objects and lists.

A condition is `{"field": ..., "op": ..., "value": ...}`. Group conditions with `{"all": [...]}` (every one must match) or `{"any": [...]}` (at least one must match); groups can be nested. A plain list of conditions means all.

Item fields: item_id, name, slug, sku, price, scratched_price, stock, created, updated, category (category ids), type (item type slugs, such as "product").
Metadata fields: `meta.`, with dots into JSON objects, for example `meta.specs.weight`. A JSON list matches when any of its elements does: `meta.tags` eq "vegan", or `meta.variants.size` eq "M".

Operators: eq, ne, gt, gte, lt, lte, between ([from, to]), in, not_in, contains, starts_with, exists, not_exists, and has_all (lists: every value present). Numbers compare as numbers, ISO dates as dates, and text case-insensitively.

Sort by up to three item or metadata fields. Results are paginated and every item has the same shape as in the other item endpoints, with all of its metadata.

Example request:
curl --request POST \
    "https://garchi.co.uk/api/v2/space/ca457162-6d04-4c3a-a3f6-2ab3e21b0fd00cca6914-5e72-4d54-b9db-fcf9/items/query" \
    --header "Authorization: Bearer {YOUR_API_TOKEN}" \
    --header "Content-Type: application/json" \
    --data "{
    \"where\": {
        \"all\": [
            {
                \"field\": \"meta.color\",
                \"op\": \"in\",
                \"value\": [
                    \"red\",
                    \"blue\"
                ]
            },
            {
                \"field\": \"meta.specs.weight\",
                \"op\": \"lte\",
                \"value\": 2.5
            },
            {
                \"any\": [
                    {
                        \"field\": \"price\",
                        \"op\": \"lt\",
                        \"value\": 50
                    },
                    {
                        \"field\": \"meta.on_sale\",
                        \"op\": \"eq\",
                        \"value\": true
                    }
                ]
            }
        ]
    },
    \"sort\": [
        {
            \"field\": \"meta.specs.weight\",
            \"direction\": \"asc\"
        }
    ],
    \"page\": 1,
    \"size\": 10,
    \"reactions\": \"exclude\",
    \"children\": \"exclude\",
    \"description\": \"include\"
}"
// npm install @garchicms/garchi-node-sdk
import GarchiCMS from "@garchicms/garchi-node-sdk";

// The SDK sends your API token as "Authorization: Bearer <token>" on every request.
const garchi = new GarchiCMS({ api_key: "YOUR_API_TOKEN" });

const response = await garchi.dataItem.query({
    uid: "ca457162-6d04-4c3a-a3f6-2ab3e21b0fd00cca6914-5e72-4d54-b9db-fcf9",
    where: {
        all: [
            {
                field: "meta.color",
                op: "in",
                value: ["red", "blue"],
            },
            {
                field: "meta.specs.weight",
                op: "lte",
                value: 2.5,
            },
            {
                any: [
                    {
                        field: "price",
                        op: "lt",
                        value: 50,
                    },
                    {
                        field: "meta.on_sale",
                        op: "eq",
                        value: true,
                    }
                ],
            }
        ],
    },
    sort: [
        {
            field: "meta.specs.weight",
            direction: "asc",
        }
    ],
    page: 1,
    size: 10,
    reactions: "exclude",
    children: "exclude",
    description: "include",
});
// composer require garchicms/garchi-sdk-php
use GarchiCMS\GarchiCMS;

// The SDK sends your API token as "Authorization: Bearer <token>" on every request.
$garchi = new GarchiCMS("YOUR_API_TOKEN");

$response = $garchi->dataItem->query([
    'uid' => 'ca457162-6d04-4c3a-a3f6-2ab3e21b0fd00cca6914-5e72-4d54-b9db-fcf9',
    'where' => [
        'all' => [
            [
                'field' => 'meta.color',
                'op' => 'in',
                'value' => ['red', 'blue'],
            ],
            [
                'field' => 'meta.specs.weight',
                'op' => 'lte',
                'value' => 2.5,
            ],
            [
                'any' => [
                    [
                        'field' => 'price',
                        'op' => 'lt',
                        'value' => 50,
                    ],
                    [
                        'field' => 'meta.on_sale',
                        'op' => 'eq',
                        'value' => true,
                    ],
                ],
            ],
        ],
    ],
    'sort' => [
        [
            'field' => 'meta.specs.weight',
            'direction' => 'asc',
        ],
    ],
    'page' => 1,
    'size' => 10,
    'reactions' => 'exclude',
    'children' => 'exclude',
    'description' => 'include',
]);
import requests
import json

url = 'https://garchi.co.uk/api/v2/space/ca457162-6d04-4c3a-a3f6-2ab3e21b0fd00cca6914-5e72-4d54-b9db-fcf9/items/query'
payload = {
    "where": {
        "all": [
            {
                "field": "meta.color",
                "op": "in",
                "value": [
                    "red",
                    "blue"
                ]
            },
            {
                "field": "meta.specs.weight",
                "op": "lte",
                "value": 2.5
            },
            {
                "any": [
                    {
                        "field": "price",
                        "op": "lt",
                        "value": 50
                    },
                    {
                        "field": "meta.on_sale",
                        "op": "eq",
                        "value": true
                    }
                ]
            }
        ]
    },
    "sort": [
        {
            "field": "meta.specs.weight",
            "direction": "asc"
        }
    ],
    "page": 1,
    "size": 10,
    "reactions": "exclude",
    "children": "exclude",
    "description": "include"
}
headers = {
  'Authorization': 'Bearer {YOUR_API_TOKEN}',
  'Content-Type': 'application/json'
}

response = requests.request('POST', url, headers=headers, json=payload)
response.json()
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.nio.file.Path;

String baseUrl = "https://garchi.co.uk";
String endpointUri = "api/v2/space/ca457162-6d04-4c3a-a3f6-2ab3e21b0fd00cca6914-5e72-4d54-b9db-fcf9/items/query"; 

URI url = URI.create(baseUrl + endpointUri);

HttpClient client = HttpClient.newHttpClient();
HttpRequest.Builder builder = HttpRequest.newBuilder(url);


String body = {
    "where": {
        "all": [
            {
                "field": "meta.color",
                "op": "in",
                "value": [
                    "red",
                    "blue"
                ]
            },
            {
                "field": "meta.specs.weight",
                "op": "lte",
                "value": 2.5
            },
            {
                "any": [
                    {
                        "field": "price",
                        "op": "lt",
                        "value": 50
                    },
                    {
                        "field": "meta.on_sale",
                        "op": "eq",
                        "value": true
                    }
                ]
            }
        ]
    },
    "sort": [
        {
            "field": "meta.specs.weight",
            "direction": "asc"
        }
    ],
    "page": 1,
    "size": 10,
    "reactions": "exclude",
    "children": "exclude",
    "description": "include"
};
builder.POST(HttpRequest.BodyPublishers.ofString(body));


builder.header("Authorization", "Bearer {YOUR_API_TOKEN}");
builder.header("Content-Type", "application/json");


HttpResponse<String> response = client.send(builder.build(), HttpResponse.BodyHandlers.ofString());

// Parse JSON response
JSONObject json = new JSONObject(response.body());

use Illuminate\Support\Facades\Http;

$url = 'https://garchi.co.uk/api/v2/space/ca457162-6d04-4c3a-a3f6-2ab3e21b0fd00cca6914-5e72-4d54-b9db-fcf9/items/query';

$headers = [
  'Authorization' => 'Bearer {YOUR_API_TOKEN}',
  'Content-Type' => 'application/json'
]

$client = Http::withHeaders($headers);



$body = {
    "where": {
        "all": [
            {
                "field": "meta.color",
                "op": "in",
                "value": [
                    "red",
                    "blue"
                ]
            },
            {
                "field": "meta.specs.weight",
                "op": "lte",
                "value": 2.5
            },
            {
                "any": [
                    {
                        "field": "price",
                        "op": "lt",
                        "value": 50
                    },
                    {
                        "field": "meta.on_sale",
                        "op": "eq",
                        "value": true
                    }
                ]
            }
        ]
    },
    "sort": [
        {
            "field": "meta.specs.weight",
            "direction": "asc"
        }
    ],
    "page": 1,
    "size": 10,
    "reactions": "exclude",
    "children": "exclude",
    "description": "include"
};

$client->withBody($body);





$response = $client->POST($url);

$responseBody = $response->json();

Example response (200):



{
    "data": [
        {
            "item_id": 26,
            "sku": "WD-101",
            "external_link": "",
            "slug": "example-product",
            "parent_id": null,
            "children_count": 0,
            "name": "Example Product",
            "stock": 100,
            "price": 40,
            "scratched_price": null,
            "one_liner": "Best book for beginners",
            "description": "<p><strong>This book is fantastic</strong></p>\n<ol>\n<li>This</li>\n<li>Book</li>\n<li>is</li>\n<li>Fantastic</li>\n</ol>",
            "categories": [
                {
                    "id": 22,
                    "name": "Web Development Bootcamp",
                    "rank": null
                }
            ],
            "delivery_type": "can_deliver",
            "main_image": "https://assets.garchi.co.uk/examples/product-main.png",
            "other_images": [
                "https://assets.garchi.co.uk/examples/product-1.png",
                "https://assets.garchi.co.uk/examples/product-2.png"
            ],
            "attributes": [
                {
                    "id": 16,
                    "name": "Book Cover",
                    "min": "1",
                    "options": [
                        {
                            "id": 29,
                            "sku": "WD-101-PAPER",
                            "name": "Paper",
                            "price": 0.5
                        },
                        {
                            "id": 30,
                            "sku": "WD-101-BOUND",
                            "name": "Binded",
                            "price": 1
                        }
                    ]
                }
            ],
            "space": {
                "uid": "b5f0d08a-7600-4b9e-81e9-1ffaf5ddb8d2cf268eeb-000a-4bfd-bba6-09ab",
                "name": "Books"
            },
            "avg_rating": null,
            "scheduled_for": null,
            "item_meta": [
                {
                    "id": 11,
                    "key": "website",
                    "value": "https://example.com",
                    "type": "url"
                }
            ],
            "reactions": [
                {
                    "reaction_id": "9b08ce6c-350c-4f00-9858-37a866bd626f",
                    "reaction": "like",
                    "user_identifier": "jane.doe@@example.com",
                    "created_at": "2024-01-07T09:54:12.000000Z",
                    "updated_at": "2024-01-07T09:54:12.000000Z"
                }
            ],
            "agent_description": "A beginner-friendly book that teaches web development step by step.",
            "created": "2022-11-06 20:52:39",
            "updated": "2023-07-08 15:09:16"
        }
    ],
    "links": {
        "first": "https://garchi.co.uk/api/v2/items?page=1",
        "last": "https://garchi.co.uk/api/v2/items?page=1",
        "prev": null,
        "next": null
    },
    "meta": {
        "current_page": 1,
        "from": 1,
        "last_page": 1,
        "links": [
            {
                "url": null,
                "label": "&laquo; Previous",
                "active": false
            },
            {
                "url": "https://garchi.co.uk/api/v2/items?page=1",
                "label": "1",
                "active": true
            },
            {
                "url": null,
                "label": "Next &raquo;",
                "active": false
            }
        ],
        "path": "https://garchi.co.uk/api/v2/items",
        "per_page": 10,
        "to": 1,
        "total": 1
    }
}
 

Example response (404):



{
    "error": "Space not found"
}
 

Example response (422):



{
    "message": "The op for \"meta.color\" must be one of: eq, ne, gt, gte, lt, lte, between, in, not_in, contains, starts_with, exists, not_exists, has_all.",
    "errors": {
        "where.all.0.op": [
            "The op for \"meta.color\" must be one of: eq, ne, gt, gte, lt, lte, between, in, not_in, contains, starts_with, exists, not_exists, has_all."
        ]
    }
}
 

Request   

POST api/v2/space/{uid}/items/query

URL Parameters

uid  string  

UID of the space.

Body Parameters

where  object optional  

The filter: a condition, or a group {"all": [...]} / {"any": [...]}.

sort  object[] optional  

Up to three fields to sort by.

sort[].field  string  

An item field or meta..

sort[].direction  string optional  

asc or desc. Defaults to asc.

page  integer optional  

The page to return.

size  integer optional  

Items per page, up to 100. Defaults to 10.

reactions  string optional  

Include or exclude reactions for the items.

children  string optional  

Include the published items inside each item, in their order, one level deep. Defaults to exclude; every item always has children_count.

description  string optional  

Include or exclude the item description. Defaults to exclude.

List the items inside an item

requires authentication

Returns the published items inside an item, such as the variants of a product or the lessons of a course, in the order set in the dashboard. Each item has the same shape as in the other item endpoints, and its own `parent_id`.

Items can be nested up to three levels (Course → Module → Lesson); call this again with a child's id or slug to go one level deeper. The parent itself must be published, like every item the content API returns.

Example request:
curl --request GET \
    --get "https://garchi.co.uk/api/v2/space/ca457162-6d04-4c3a-a3f6-2ab3e21b0fd00cca6914-5e72-4d54-b9db-fcf9/items/oak-table/children?page=1&size=10&reactions=exclude&children=exclude&description=include" \
    --header "Authorization: Bearer {YOUR_API_TOKEN}"
// npm install @garchicms/garchi-node-sdk
import GarchiCMS from "@garchicms/garchi-node-sdk";

// The SDK sends your API token as "Authorization: Bearer <token>" on every request.
const garchi = new GarchiCMS({ api_key: "YOUR_API_TOKEN" });

const response = await garchi.dataItem.getChildren({
    uid: "ca457162-6d04-4c3a-a3f6-2ab3e21b0fd00cca6914-5e72-4d54-b9db-fcf9",
    item: "oak-table",
    page: 1,
    size: 10,
    reactions: "exclude",
    children: "exclude",
    description: "include",
});
// composer require garchicms/garchi-sdk-php
use GarchiCMS\GarchiCMS;

// The SDK sends your API token as "Authorization: Bearer <token>" on every request.
$garchi = new GarchiCMS("YOUR_API_TOKEN");

$response = $garchi->dataItem->getChildren([
    'uid' => 'ca457162-6d04-4c3a-a3f6-2ab3e21b0fd00cca6914-5e72-4d54-b9db-fcf9',
    'item' => 'oak-table',
    'page' => 1,
    'size' => 10,
    'reactions' => 'exclude',
    'children' => 'exclude',
    'description' => 'include',
]);
import requests
import json

url = 'https://garchi.co.uk/api/v2/space/ca457162-6d04-4c3a-a3f6-2ab3e21b0fd00cca6914-5e72-4d54-b9db-fcf9/items/oak-table/children'
params = {
  'page': '1',
  'size': '10',
  'reactions': 'exclude',
  'children': 'exclude',
  'description': 'include',
}
headers = {
  'Authorization': 'Bearer {YOUR_API_TOKEN}'
}

response = requests.request('GET', url, headers=headers, params=params)
response.json()
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.nio.file.Path;

String baseUrl = "https://garchi.co.uk";
String endpointUri = "api/v2/space/ca457162-6d04-4c3a-a3f6-2ab3e21b0fd00cca6914-5e72-4d54-b9db-fcf9/items/oak-table/children"; 

URI url = URI.create(baseUrl + endpointUri);

HttpClient client = HttpClient.newHttpClient();
HttpRequest.Builder builder = HttpRequest.newBuilder(url);



Map<Object, Object> params = {
  "page": "1",
  "size": "10",
  "reactions": "exclude",
  "children": "exclude",
  "description": "include",
};
builder.uri(URI.create(url + "?" + toQueryString(params)));

builder.header("Authorization", "Bearer {YOUR_API_TOKEN}");


HttpResponse<String> response = client.send(builder.build(), HttpResponse.BodyHandlers.ofString());

// Parse JSON response
JSONObject json = new JSONObject(response.body());

use Illuminate\Support\Facades\Http;

$url = 'https://garchi.co.uk/api/v2/space/ca457162-6d04-4c3a-a3f6-2ab3e21b0fd00cca6914-5e72-4d54-b9db-fcf9/items/oak-table/children';

$headers = [
  'Authorization' => 'Bearer {YOUR_API_TOKEN}'
]

$client = Http::withHeaders($headers);




$queryParams = {
  'page': '1',
  'size': '10',
  'reactions': 'exclude',
  'children': 'exclude',
  'description': 'include',
};

$url .= '?'. $queryParams;




$response = $client->GET($url);

$responseBody = $response->json();

Example response (200):



{
    "data": [
        {
            "item_id": 26,
            "sku": "WD-101",
            "external_link": "",
            "slug": "example-product",
            "parent_id": null,
            "children_count": 0,
            "name": "Example Product",
            "stock": 100,
            "price": 40,
            "scratched_price": null,
            "one_liner": "Best book for beginners",
            "description": "<p><strong>This book is fantastic</strong></p>\n<ol>\n<li>This</li>\n<li>Book</li>\n<li>is</li>\n<li>Fantastic</li>\n</ol>",
            "categories": [
                {
                    "id": 22,
                    "name": "Web Development Bootcamp",
                    "rank": null
                }
            ],
            "delivery_type": "can_deliver",
            "main_image": "https://assets.garchi.co.uk/examples/product-main.png",
            "other_images": [
                "https://assets.garchi.co.uk/examples/product-1.png",
                "https://assets.garchi.co.uk/examples/product-2.png"
            ],
            "attributes": [
                {
                    "id": 16,
                    "name": "Book Cover",
                    "min": "1",
                    "options": [
                        {
                            "id": 29,
                            "sku": "WD-101-PAPER",
                            "name": "Paper",
                            "price": 0.5
                        },
                        {
                            "id": 30,
                            "sku": "WD-101-BOUND",
                            "name": "Binded",
                            "price": 1
                        }
                    ]
                }
            ],
            "space": {
                "uid": "b5f0d08a-7600-4b9e-81e9-1ffaf5ddb8d2cf268eeb-000a-4bfd-bba6-09ab",
                "name": "Books"
            },
            "avg_rating": null,
            "scheduled_for": null,
            "item_meta": [
                {
                    "id": 11,
                    "key": "website",
                    "value": "https://example.com",
                    "type": "url"
                }
            ],
            "reactions": [
                {
                    "reaction_id": "9b08ce6c-350c-4f00-9858-37a866bd626f",
                    "reaction": "like",
                    "user_identifier": "jane.doe@@example.com",
                    "created_at": "2024-01-07T09:54:12.000000Z",
                    "updated_at": "2024-01-07T09:54:12.000000Z"
                }
            ],
            "agent_description": "A beginner-friendly book that teaches web development step by step.",
            "created": "2022-11-06 20:52:39",
            "updated": "2023-07-08 15:09:16"
        }
    ],
    "links": {
        "first": "https://garchi.co.uk/api/v2/items?page=1",
        "last": "https://garchi.co.uk/api/v2/items?page=1",
        "prev": null,
        "next": null
    },
    "meta": {
        "current_page": 1,
        "from": 1,
        "last_page": 1,
        "links": [
            {
                "url": null,
                "label": "&laquo; Previous",
                "active": false
            },
            {
                "url": "https://garchi.co.uk/api/v2/items?page=1",
                "label": "1",
                "active": true
            },
            {
                "url": null,
                "label": "Next &raquo;",
                "active": false
            }
        ],
        "path": "https://garchi.co.uk/api/v2/items",
        "per_page": 10,
        "to": 1,
        "total": 1
    }
}
 

Example response (404):



{
    "error": "Item not found"
}
 

Request   

GET api/v2/space/{uid}/items/{item}/children

URL Parameters

uid  string  

UID of the space.

item  string  

Id or slug of the parent item.

Query Parameters

page  integer optional  

The page to return.

size  integer optional  

Items per page, up to 100. Defaults to 10.

reactions  string optional  

Include or exclude reactions for the items.

children  string optional  

Include the published items inside each item, in their order, one level deep. Defaults to exclude; every item always has children_count.

description  string optional  

Include or exclude the item description. Defaults to exclude.

Headless Web

Get asset file for a space

requires authentication

This api is used to get the asset (media file) for a space based on the name of the asset.

Example request:
curl --request GET \
    --get "https://garchi.co.uk/api/v2/space/assets/logo?space_uid=635c09ed-d55f-407d-a4c0-45f5ad9f2b44c2321f02-a835-4024-9b83-c4a1" \
    --header "Authorization: Bearer {YOUR_API_TOKEN}"
// npm install @garchicms/garchi-node-sdk
import GarchiCMS from "@garchicms/garchi-node-sdk";

// The SDK sends your API token as "Authorization: Bearer <token>" on every request.
const garchi = new GarchiCMS({ api_key: "YOUR_API_TOKEN" });

const response = await garchi.headless.getAsset("logo", "635c09ed-d55f-407d-a4c0-45f5ad9f2b44c2321f02-a835-4024-9b83-c4a1");
// composer require garchicms/garchi-sdk-php
use GarchiCMS\GarchiCMS;

// The SDK sends your API token as "Authorization: Bearer <token>" on every request.
$garchi = new GarchiCMS("YOUR_API_TOKEN");

$response = $garchi->headless->getAsset('logo', '635c09ed-d55f-407d-a4c0-45f5ad9f2b44c2321f02-a835-4024-9b83-c4a1');
import requests
import json

url = 'https://garchi.co.uk/api/v2/space/assets/logo'
params = {
  'space_uid': '635c09ed-d55f-407d-a4c0-45f5ad9f2b44c2321f02-a835-4024-9b83-c4a1',
}
headers = {
  'Authorization': 'Bearer {YOUR_API_TOKEN}'
}

response = requests.request('GET', url, headers=headers, params=params)
response.json()
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.nio.file.Path;

String baseUrl = "https://garchi.co.uk";
String endpointUri = "api/v2/space/assets/logo"; 

URI url = URI.create(baseUrl + endpointUri);

HttpClient client = HttpClient.newHttpClient();
HttpRequest.Builder builder = HttpRequest.newBuilder(url);



Map<Object, Object> params = {
  "space_uid": "635c09ed-d55f-407d-a4c0-45f5ad9f2b44c2321f02-a835-4024-9b83-c4a1",
};
builder.uri(URI.create(url + "?" + toQueryString(params)));

builder.header("Authorization", "Bearer {YOUR_API_TOKEN}");


HttpResponse<String> response = client.send(builder.build(), HttpResponse.BodyHandlers.ofString());

// Parse JSON response
JSONObject json = new JSONObject(response.body());

use Illuminate\Support\Facades\Http;

$url = 'https://garchi.co.uk/api/v2/space/assets/logo';

$headers = [
  'Authorization' => 'Bearer {YOUR_API_TOKEN}'
]

$client = Http::withHeaders($headers);




$queryParams = {
  'space_uid': '635c09ed-d55f-407d-a4c0-45f5ad9f2b44c2321f02-a835-4024-9b83-c4a1',
};

$url .= '?'. $queryParams;




$response = $client->GET($url);

$responseBody = $response->json();

Example response (200):



{
    "id": "aaaaaaaa-aaaa-4aaa-8aaa-aaaaaaaaaaaa",
    "asset_id": "aaaaaaaa-aaaa-4aaa-8aaa-aaaaaaaaaaaa",
    "name": "logo",
    "path": "https://assets.garchi.co.uk/headlessweb/11111111-1111-4111-8111-11111111111122222222-2222-4222-8222-222/logo-1700000000.jpg",
    "size": "157.08KB",
    "type": "uploaded-image",
    "agent_description": "This is agent description"
}
 

Request   

GET api/v2/space/assets/{name}

URL Parameters

name  string  

Asset name.

Query Parameters

space_uid  string  

Space uid.

Get Page

requires authentication

This api is used to get a page by slug and space_uid.

Example request:
curl --request POST \
    "https://garchi.co.uk/api/v2/page" \
    --header "Authorization: Bearer {YOUR_API_TOKEN}" \
    --header "Content-Type: application/json" \
    --data "{
    \"space_uid\": \"635c09ed-d55f-407d-a4c0-45f5ad9f2b44c2321f02-a835-4024-9b83-c4a1\",
    \"slug\": \"\\/\",
    \"lang\": \"en-US\",
    \"mode\": \"draft\"
}"
// npm install @garchicms/garchi-node-sdk
import GarchiCMS from "@garchicms/garchi-node-sdk";

// The SDK sends your API token as "Authorization: Bearer <token>" on every request.
const garchi = new GarchiCMS({ api_key: "YOUR_API_TOKEN" });

const response = await garchi.headless.getPage({
    space_uid: "635c09ed-d55f-407d-a4c0-45f5ad9f2b44c2321f02-a835-4024-9b83-c4a1",
    slug: "/",
    lang: "en-US",
    mode: "draft",
});
// composer require garchicms/garchi-sdk-php
use GarchiCMS\GarchiCMS;

// The SDK sends your API token as "Authorization: Bearer <token>" on every request.
$garchi = new GarchiCMS("YOUR_API_TOKEN");

$response = $garchi->headless->getPage([
    'space_uid' => '635c09ed-d55f-407d-a4c0-45f5ad9f2b44c2321f02-a835-4024-9b83-c4a1',
    'slug' => '/',
    'lang' => 'en-US',
    'mode' => 'draft',
]);
import requests
import json

url = 'https://garchi.co.uk/api/v2/page'
payload = {
    "space_uid": "635c09ed-d55f-407d-a4c0-45f5ad9f2b44c2321f02-a835-4024-9b83-c4a1",
    "slug": "\/",
    "lang": "en-US",
    "mode": "draft"
}
headers = {
  'Authorization': 'Bearer {YOUR_API_TOKEN}',
  'Content-Type': 'application/json'
}

response = requests.request('POST', url, headers=headers, json=payload)
response.json()
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.nio.file.Path;

String baseUrl = "https://garchi.co.uk";
String endpointUri = "api/v2/page"; 

URI url = URI.create(baseUrl + endpointUri);

HttpClient client = HttpClient.newHttpClient();
HttpRequest.Builder builder = HttpRequest.newBuilder(url);


String body = {
    "space_uid": "635c09ed-d55f-407d-a4c0-45f5ad9f2b44c2321f02-a835-4024-9b83-c4a1",
    "slug": "\/",
    "lang": "en-US",
    "mode": "draft"
};
builder.POST(HttpRequest.BodyPublishers.ofString(body));


builder.header("Authorization", "Bearer {YOUR_API_TOKEN}");
builder.header("Content-Type", "application/json");


HttpResponse<String> response = client.send(builder.build(), HttpResponse.BodyHandlers.ofString());

// Parse JSON response
JSONObject json = new JSONObject(response.body());

use Illuminate\Support\Facades\Http;

$url = 'https://garchi.co.uk/api/v2/page';

$headers = [
  'Authorization' => 'Bearer {YOUR_API_TOKEN}',
  'Content-Type' => 'application/json'
]

$client = Http::withHeaders($headers);



$body = {
    "space_uid": "635c09ed-d55f-407d-a4c0-45f5ad9f2b44c2321f02-a835-4024-9b83-c4a1",
    "slug": "\/",
    "lang": "en-US",
    "mode": "draft"
};

$client->withBody($body);





$response = $client->POST($url);

$responseBody = $response->json();

Example response (200):



{
    "id": "55555555-5555-4555-8555-555555555555",
    "title": "Home",
    "slug": "/",
    "description": "a great space to be",
    "json_ld": "{\"@context\":\"https://schema.org\",\"@type\":\"WebPage\",\"name\":\"Home\"}",
    "agent_description": "The home page. It introduces the brand and links to the main sections.",
    "image": "https://assets.garchi.co.uk/headlesswebpages/33333333-3333-4333-8333-33333333333344444444-4444-4444-8444-444/some_file.png",
    "sections": [
        {
            "id": "99c21f3c-c434-4eb5-89ad-46e958a11081",
            "name": "Card",
            "description": "",
            "agent_description": "A card with a title, description and image.",
            "props": {
                "title": "This is great",
                "description": "Thanks for telling this",
                "image": "https://assets.garchi.co.uk/headlessweb/33333333-3333-4333-8333-33333333333344444444-4444-4444-8444-444/header-image-1700000001",
                "data-garchi-section-id": "99c21f3c-c434-4eb5-89ad-46e958a11081",
                "data-garchi-page-id": "55555555-5555-4555-8555-555555555555"
            },
            "children": [],
            "order": 0
        },
        {
            "id": "99c210e4-330d-458f-9af3-b5eea6af228d",
            "name": "Navbar",
            "description": "/components/Navbar",
            "agent_description": null,
            "props": {
                "title": "Home",
                "link": "https://google.com",
                "data-garchi-section-id": "99c210e4-330d-458f-9af3-b5eea6af228d",
                "data-garchi-page-id": "55555555-5555-4555-8555-555555555555"
            },
            "children": [
                {
                    "id": "99c3f4f6-7193-471e-a9c0-00ebca35811f",
                    "name": "Logo",
                    "description": "Main logo for the home page",
                    "agent_description": null,
                    "props": {
                        "src": "https://assets.garchi.co.uk/headlessweb/33333333-3333-4333-8333-33333333333344444444-4444-4444-8444-444/logo-1700000002",
                        "data-garchi-section-id": "99c3f4f6-7193-471e-a9c0-00ebca35811f",
                        "data-garchi-page-id": "55555555-5555-4555-8555-555555555555"
                    },
                    "children": [],
                    "order": 0
                }
            ],
            "order": 1
        }
    ],
    "created_at": "2026-01-28T18:27:52.000000Z",
    "last_updated": "2026-01-28T18:27:52.000000Z"
}
 

Request   

POST api/v2/page

Body Parameters

space_uid  string  

UID of the space.

slug  string  

Slug of the page.

lang  string optional  

i-18n Language code of the page. Default value is en-US

mode  required optional  

Mode of the page. Allowed values are draft, live.

Create or Update Section templates

requires authentication

This api is used to create or update section templates for a space. Section templates are used to create reusable sections on a page.

Example request:
curl --request POST \
    "https://garchi.co.uk/api/v2/section_template" \
    --header "Authorization: Bearer {YOUR_API_TOKEN}" \
    --header "Content-Type: application/json" \
    --data "{
    \"space_uid\": \"5f0b3b2d-3b4e-4b6e-8b3e-3e3e3e3e3e3e\",
    \"section_templates\": [
        {
            \"name\": \"HeroSection\",
            \"description\": \"This is a hero section.\",
            \"prev_name\": null,
            \"props\": [
                {
                    \"key\": \"icon\",
                    \"type\": \"select\",
                    \"allowed_values\": \"CheckIcon,CheckCircleIcon\"
                }
            ]
        }
    ]
}"
// npm install @garchicms/garchi-node-sdk
import GarchiCMS from "@garchicms/garchi-node-sdk";

// The SDK sends your API token as "Authorization: Bearer <token>" on every request.
const garchi = new GarchiCMS({ api_key: "YOUR_API_TOKEN" });

const response = await garchi.headless.createOrUpdateSectionTemplates({
    space_uid: "5f0b3b2d-3b4e-4b6e-8b3e-3e3e3e3e3e3e",
    section_templates: [
        {
            name: "HeroSection",
            description: "This is a hero section.",
            prev_name: null,
            props: [
                {
                    key: "icon",
                    type: "select",
                    allowed_values: "CheckIcon,CheckCircleIcon",
                }
            ],
        }
    ],
});
// composer require garchicms/garchi-sdk-php
use GarchiCMS\GarchiCMS;

// The SDK sends your API token as "Authorization: Bearer <token>" on every request.
$garchi = new GarchiCMS("YOUR_API_TOKEN");

$response = $garchi->headless->createOrUpdateSectionTemplates([
    'space_uid' => '5f0b3b2d-3b4e-4b6e-8b3e-3e3e3e3e3e3e',
    'section_templates' => [
        [
            'name' => 'HeroSection',
            'description' => 'This is a hero section.',
            'prev_name' => null,
            'props' => [
                [
                    'key' => 'icon',
                    'type' => 'select',
                    'allowed_values' => 'CheckIcon,CheckCircleIcon',
                ],
            ],
        ],
    ],
]);
import requests
import json

url = 'https://garchi.co.uk/api/v2/section_template'
payload = {
    "space_uid": "5f0b3b2d-3b4e-4b6e-8b3e-3e3e3e3e3e3e",
    "section_templates": [
        {
            "name": "HeroSection",
            "description": "This is a hero section.",
            "prev_name": null,
            "props": [
                {
                    "key": "icon",
                    "type": "select",
                    "allowed_values": "CheckIcon,CheckCircleIcon"
                }
            ]
        }
    ]
}
headers = {
  'Authorization': 'Bearer {YOUR_API_TOKEN}',
  'Content-Type': 'application/json'
}

response = requests.request('POST', url, headers=headers, json=payload)
response.json()
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.nio.file.Path;

String baseUrl = "https://garchi.co.uk";
String endpointUri = "api/v2/section_template"; 

URI url = URI.create(baseUrl + endpointUri);

HttpClient client = HttpClient.newHttpClient();
HttpRequest.Builder builder = HttpRequest.newBuilder(url);


String body = {
    "space_uid": "5f0b3b2d-3b4e-4b6e-8b3e-3e3e3e3e3e3e",
    "section_templates": [
        {
            "name": "HeroSection",
            "description": "This is a hero section.",
            "prev_name": null,
            "props": [
                {
                    "key": "icon",
                    "type": "select",
                    "allowed_values": "CheckIcon,CheckCircleIcon"
                }
            ]
        }
    ]
};
builder.POST(HttpRequest.BodyPublishers.ofString(body));


builder.header("Authorization", "Bearer {YOUR_API_TOKEN}");
builder.header("Content-Type", "application/json");


HttpResponse<String> response = client.send(builder.build(), HttpResponse.BodyHandlers.ofString());

// Parse JSON response
JSONObject json = new JSONObject(response.body());

use Illuminate\Support\Facades\Http;

$url = 'https://garchi.co.uk/api/v2/section_template';

$headers = [
  'Authorization' => 'Bearer {YOUR_API_TOKEN}',
  'Content-Type' => 'application/json'
]

$client = Http::withHeaders($headers);



$body = {
    "space_uid": "5f0b3b2d-3b4e-4b6e-8b3e-3e3e3e3e3e3e",
    "section_templates": [
        {
            "name": "HeroSection",
            "description": "This is a hero section.",
            "prev_name": null,
            "props": [
                {
                    "key": "icon",
                    "type": "select",
                    "allowed_values": "CheckIcon,CheckCircleIcon"
                }
            ]
        }
    ]
};

$client->withBody($body);





$response = $client->POST($url);

$responseBody = $response->json();

Example response (200):



{
    "message": "Section templates updated successfully"
}
 

Request   

POST api/v2/section_template

Body Parameters

space_uid  string  

The unique identifier of the space.

section_templates  object[]  

The section templates to be created or updated.

section_templates[].name  string  

The name of the section template.

section_templates[].description  string optional  

The description of the section template.

section_templates[].prev_name  string optional  

The previous name of the section template. This is used when updating a section template.

section_templates[].props  object[] optional  

The properties of the section template.

section_templates[].props[].key  string  

The key of the property.

section_templates[].props[].type  string  

The type of the property. Allowed values are text,longtext,media,richtext,select,icon_lucid,icon_hero,date

section_templates[].props[].allowed_values  string optional  

Comma separated allowed values for the prop. This is required if the type is select.

Add blank section

requires authentication

This api is used to add a blank section to a page.

Example request:
curl --request POST \
    "https://garchi.co.uk/api/v2/page/add_blank_section" \
    --header "Authorization: Bearer {YOUR_API_TOKEN}" \
    --header "Content-Type: application/json" \
    --data "{
    \"page_id\": \"019c05ef-4c27-719f-91b4-798de1d47a27\",
    \"section_template_id\": \"99999999-9999-4999-8999-999999999999\",
    \"parent_id\": \"019c05f0-fe11-7252-acdf-b8b2de361841\"
}"
// npm install @garchicms/garchi-node-sdk
import GarchiCMS from "@garchicms/garchi-node-sdk";

// The SDK sends your API token as "Authorization: Bearer <token>" on every request.
const garchi = new GarchiCMS({ api_key: "YOUR_API_TOKEN" });

const response = await garchi.headless.addBlankSectionToPage({
    page_id: "019c05ef-4c27-719f-91b4-798de1d47a27",
    section_template_id: "99999999-9999-4999-8999-999999999999",
    parent_id: "019c05f0-fe11-7252-acdf-b8b2de361841",
});
// composer require garchicms/garchi-sdk-php
use GarchiCMS\GarchiCMS;

// The SDK sends your API token as "Authorization: Bearer <token>" on every request.
$garchi = new GarchiCMS("YOUR_API_TOKEN");

$response = $garchi->headless->addBlankSectionToPage([
    'page_id' => '019c05ef-4c27-719f-91b4-798de1d47a27',
    'section_template_id' => '99999999-9999-4999-8999-999999999999',
    'parent_id' => '019c05f0-fe11-7252-acdf-b8b2de361841',
]);
import requests
import json

url = 'https://garchi.co.uk/api/v2/page/add_blank_section'
payload = {
    "page_id": "019c05ef-4c27-719f-91b4-798de1d47a27",
    "section_template_id": "99999999-9999-4999-8999-999999999999",
    "parent_id": "019c05f0-fe11-7252-acdf-b8b2de361841"
}
headers = {
  'Authorization': 'Bearer {YOUR_API_TOKEN}',
  'Content-Type': 'application/json'
}

response = requests.request('POST', url, headers=headers, json=payload)
response.json()
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.nio.file.Path;

String baseUrl = "https://garchi.co.uk";
String endpointUri = "api/v2/page/add_blank_section"; 

URI url = URI.create(baseUrl + endpointUri);

HttpClient client = HttpClient.newHttpClient();
HttpRequest.Builder builder = HttpRequest.newBuilder(url);


String body = {
    "page_id": "019c05ef-4c27-719f-91b4-798de1d47a27",
    "section_template_id": "99999999-9999-4999-8999-999999999999",
    "parent_id": "019c05f0-fe11-7252-acdf-b8b2de361841"
};
builder.POST(HttpRequest.BodyPublishers.ofString(body));


builder.header("Authorization", "Bearer {YOUR_API_TOKEN}");
builder.header("Content-Type", "application/json");


HttpResponse<String> response = client.send(builder.build(), HttpResponse.BodyHandlers.ofString());

// Parse JSON response
JSONObject json = new JSONObject(response.body());

use Illuminate\Support\Facades\Http;

$url = 'https://garchi.co.uk/api/v2/page/add_blank_section';

$headers = [
  'Authorization' => 'Bearer {YOUR_API_TOKEN}',
  'Content-Type' => 'application/json'
]

$client = Http::withHeaders($headers);



$body = {
    "page_id": "019c05ef-4c27-719f-91b4-798de1d47a27",
    "section_template_id": "99999999-9999-4999-8999-999999999999",
    "parent_id": "019c05f0-fe11-7252-acdf-b8b2de361841"
};

$client->withBody($body);





$response = $client->POST($url);

$responseBody = $response->json();

Example response (200):



{
    "id": "019c0618-798d-731a-8a7b-9af92c98155d",
    "name": "TwoColumnWithImage",
    "description": "layout/TwoColumnWithImage",
    "parent_id": null,
    "order": 1,
    "page_id": "019c0617-6ea4-72a5-9c97-4bffe1c4a2c9",
    "section_template_id": "99999999-9999-4999-8999-999999999999"
}
 

Request   

POST api/v2/page/add_blank_section

Body Parameters

page_id  string  

ID of the page.

section_template_id  string  

ID of the section template.

parent_id  string optional  

nullable ID of the parent section if adding as a nested section to a section.

Create Page

requires authentication

This api is used to create a headless page in a space.

Example request:
curl --request POST \
    "https://garchi.co.uk/api/v2/space/635c09ed-d55f-407d-a4c0-45f5ad9f2b44c2321f02-a835-4024-9b83-c4a1/create_page" \
    --header "Authorization: Bearer {YOUR_API_TOKEN}" \
    --header "Content-Type: application/json" \
    --data "{
    \"title\": \"Home\",
    \"description\": \"This is the home\",
    \"json_ld\": \"nisi\",
    \"path\": \"\\/\",
    \"agent_description\": \"This page introduces the brand and should help AI agents understand its purpose.\"
}"
// npm install @garchicms/garchi-node-sdk
import GarchiCMS from "@garchicms/garchi-node-sdk";

// The SDK sends your API token as "Authorization: Bearer <token>" on every request.
const garchi = new GarchiCMS({ api_key: "YOUR_API_TOKEN" });

const response = await garchi.headless.addPage({
    space_uid: "635c09ed-d55f-407d-a4c0-45f5ad9f2b44c2321f02-a835-4024-9b83-c4a1",
    title: "Home",
    description: "This is the home",
    json_ld: "nisi",
    path: "/",
    agent_description: "This page introduces the brand and should help AI agents understand its purpose.",
});
// composer require garchicms/garchi-sdk-php
use GarchiCMS\GarchiCMS;

// The SDK sends your API token as "Authorization: Bearer <token>" on every request.
$garchi = new GarchiCMS("YOUR_API_TOKEN");

$response = $garchi->headless->addPage([
    'space_uid' => '635c09ed-d55f-407d-a4c0-45f5ad9f2b44c2321f02-a835-4024-9b83-c4a1',
    'title' => 'Home',
    'description' => 'This is the home',
    'json_ld' => 'nisi',
    'path' => '/',
    'agent_description' => 'This page introduces the brand and should help AI agents understand its purpose.',
]);
import requests
import json

url = 'https://garchi.co.uk/api/v2/space/635c09ed-d55f-407d-a4c0-45f5ad9f2b44c2321f02-a835-4024-9b83-c4a1/create_page'
payload = {
    "title": "Home",
    "description": "This is the home",
    "json_ld": "nisi",
    "path": "\/",
    "agent_description": "This page introduces the brand and should help AI agents understand its purpose."
}
headers = {
  'Authorization': 'Bearer {YOUR_API_TOKEN}',
  'Content-Type': 'application/json'
}

response = requests.request('POST', url, headers=headers, json=payload)
response.json()
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.nio.file.Path;

String baseUrl = "https://garchi.co.uk";
String endpointUri = "api/v2/space/635c09ed-d55f-407d-a4c0-45f5ad9f2b44c2321f02-a835-4024-9b83-c4a1/create_page"; 

URI url = URI.create(baseUrl + endpointUri);

HttpClient client = HttpClient.newHttpClient();
HttpRequest.Builder builder = HttpRequest.newBuilder(url);


String body = {
    "title": "Home",
    "description": "This is the home",
    "json_ld": "nisi",
    "path": "\/",
    "agent_description": "This page introduces the brand and should help AI agents understand its purpose."
};
builder.POST(HttpRequest.BodyPublishers.ofString(body));


builder.header("Authorization", "Bearer {YOUR_API_TOKEN}");
builder.header("Content-Type", "application/json");


HttpResponse<String> response = client.send(builder.build(), HttpResponse.BodyHandlers.ofString());

// Parse JSON response
JSONObject json = new JSONObject(response.body());

use Illuminate\Support\Facades\Http;

$url = 'https://garchi.co.uk/api/v2/space/635c09ed-d55f-407d-a4c0-45f5ad9f2b44c2321f02-a835-4024-9b83-c4a1/create_page';

$headers = [
  'Authorization' => 'Bearer {YOUR_API_TOKEN}',
  'Content-Type' => 'application/json'
]

$client = Http::withHeaders($headers);



$body = {
    "title": "Home",
    "description": "This is the home",
    "json_ld": "nisi",
    "path": "\/",
    "agent_description": "This page introduces the brand and should help AI agents understand its purpose."
};

$client->withBody($body);





$response = $client->POST($url);

$responseBody = $response->json();

Example response (200):



{
    "id": "019c05dc-a705-702b-a203-0017f28066a5",
    "title": "Example page",
    "slug": "/example-page",
    "description": "This is an example page",
    "json_ld": null,
    "agent_description": "This is an example page",
    "image": null,
    "sections": [],
    "created_at": "2026-01-28T18:27:52.000000Z",
    "last_updated": "2026-01-28T18:27:52.000000Z"
}
 

Example response (Plan allowance reached):



{
    "message": "Page limit reached. This space has 3 of the 3 pages allowed per space on the Sandbox plan. Requests to add more will be refused until this space is below its limit of 3 pages.",
    "errors": {
        "limit": [
            "Page limit reached. This space has 3 of the 3 pages allowed per space on the Sandbox plan. Requests to add more will be refused until this space is below its limit of 3 pages."
        ]
    },
    "plan_limit": {
        "feature": "pages",
        "scope": "space",
        "period": null,
        "unit": "count",
        "used": 3,
        "limit": 3,
        "plan": "Sandbox",
        "period_ends_on": null,
        "starter_content_counts": false
    }
}
 

Request   

POST api/v2/space/{uid}/create_page

URL Parameters

uid  string  

UID of the space.

Body Parameters

title  string  

Title of the page.

description  string  

Description of the page.

json_ld  string optional  

nullable JSON-LD structured data for SEO.

path  string  

Path of the page.

agent_description  string optional  

AI-facing description of the page.

List Pages

requires authentication

This api is used to list pages in a space.

Example request:
curl --request GET \
    --get "https://garchi.co.uk/api/v2/space/nobis/pages" \
    --header "Authorization: Bearer {YOUR_API_TOKEN}"
// npm install @garchicms/garchi-node-sdk
import GarchiCMS from "@garchicms/garchi-node-sdk";

// The SDK sends your API token as "Authorization: Bearer <token>" on every request.
const garchi = new GarchiCMS({ api_key: "YOUR_API_TOKEN" });

const response = await garchi.space.listPages("nobis");
// composer require garchicms/garchi-sdk-php
use GarchiCMS\GarchiCMS;

// The SDK sends your API token as "Authorization: Bearer <token>" on every request.
$garchi = new GarchiCMS("YOUR_API_TOKEN");

$response = $garchi->space->listPages('nobis');
import requests
import json

url = 'https://garchi.co.uk/api/v2/space/nobis/pages'
headers = {
  'Authorization': 'Bearer {YOUR_API_TOKEN}'
}

response = requests.request('GET', url, headers=headers)
response.json()
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.nio.file.Path;

String baseUrl = "https://garchi.co.uk";
String endpointUri = "api/v2/space/nobis/pages"; 

URI url = URI.create(baseUrl + endpointUri);

HttpClient client = HttpClient.newHttpClient();
HttpRequest.Builder builder = HttpRequest.newBuilder(url);




builder.header("Authorization", "Bearer {YOUR_API_TOKEN}");


HttpResponse<String> response = client.send(builder.build(), HttpResponse.BodyHandlers.ofString());

// Parse JSON response
JSONObject json = new JSONObject(response.body());

use Illuminate\Support\Facades\Http;

$url = 'https://garchi.co.uk/api/v2/space/nobis/pages';

$headers = [
  'Authorization' => 'Bearer {YOUR_API_TOKEN}'
]

$client = Http::withHeaders($headers);






$response = $client->GET($url);

$responseBody = $response->json();

Example response (200):



[
    {
        "id": "66666666-6666-4666-8666-666666666666",
        "title": "Pricing",
        "slug": "/pricing",
        "description": "Generate amazing social media content from your video",
        "json_ld": null,
        "agent_description": null,
        "image": null,
        "sections": [
            {
                "id": "77777777-7777-4777-8777-777777777777",
                "page_id": "66666666-6666-4666-8666-666666666666",
                "section_template_id": "99999999-9999-4999-8999-999999999999",
                "parent_id": null,
                "order": 0,
                "createdBy": 186,
                "lastUpdatedBy": 186,
                "created_at": "2025-02-26T21:40:10.000000Z",
                "updated_at": "2025-02-26T21:40:10.000000Z",
                "deleted_at": null
            }
        ],
        "created_at": "2025-02-26T21:39:49.000000Z",
        "last_updated": "2025-07-25T19:08:57.000000Z"
    },
    {
        "id": "88888888-8888-4888-8888-888888888888",
        "title": "Privacy policy",
        "slug": "/privacy_policy",
        "description": "Privacy policy",
        "json_ld": null,
        "agent_description": null,
        "image": null,
        "sections": [],
        "created_at": "2025-02-26T21:39:49.000000Z",
        "last_updated": "2025-07-25T19:08:57.000000Z"
    }
]
 

Request   

GET api/v2/space/{uid}/pages

URL Parameters

uid  string  

List Section templates

requires authentication

This api is used to list section templates for a space. Section templates are used to create reusable sections on a page.

Example request:
curl --request GET \
    --get "https://garchi.co.uk/api/v2/space/5f0b3b2d-3b4e-4b6e-8b3e-3e3e3e3e3e3e/section_templates" \
    --header "Authorization: Bearer {YOUR_API_TOKEN}"
// npm install @garchicms/garchi-node-sdk
import GarchiCMS from "@garchicms/garchi-node-sdk";

// The SDK sends your API token as "Authorization: Bearer <token>" on every request.
const garchi = new GarchiCMS({ api_key: "YOUR_API_TOKEN" });

const response = await garchi.space.listSectionTemplates("5f0b3b2d-3b4e-4b6e-8b3e-3e3e3e3e3e3e");
// composer require garchicms/garchi-sdk-php
use GarchiCMS\GarchiCMS;

// The SDK sends your API token as "Authorization: Bearer <token>" on every request.
$garchi = new GarchiCMS("YOUR_API_TOKEN");

$response = $garchi->space->listSectionTemplates('5f0b3b2d-3b4e-4b6e-8b3e-3e3e3e3e3e3e');
import requests
import json

url = 'https://garchi.co.uk/api/v2/space/5f0b3b2d-3b4e-4b6e-8b3e-3e3e3e3e3e3e/section_templates'
headers = {
  'Authorization': 'Bearer {YOUR_API_TOKEN}'
}

response = requests.request('GET', url, headers=headers)
response.json()
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.nio.file.Path;

String baseUrl = "https://garchi.co.uk";
String endpointUri = "api/v2/space/5f0b3b2d-3b4e-4b6e-8b3e-3e3e3e3e3e3e/section_templates"; 

URI url = URI.create(baseUrl + endpointUri);

HttpClient client = HttpClient.newHttpClient();
HttpRequest.Builder builder = HttpRequest.newBuilder(url);




builder.header("Authorization", "Bearer {YOUR_API_TOKEN}");


HttpResponse<String> response = client.send(builder.build(), HttpResponse.BodyHandlers.ofString());

// Parse JSON response
JSONObject json = new JSONObject(response.body());

use Illuminate\Support\Facades\Http;

$url = 'https://garchi.co.uk/api/v2/space/5f0b3b2d-3b4e-4b6e-8b3e-3e3e3e3e3e3e/section_templates';

$headers = [
  'Authorization' => 'Bearer {YOUR_API_TOKEN}'
]

$client = Http::withHeaders($headers);






$response = $client->GET($url);

$responseBody = $response->json();

Example response (200):



[
    {
        "name": "TwoColumnWithImage",
        "description": "layout/TwoColumnWithImage",
        "agent_description": null,
        "prev_name": "",
        "props": [
            {
                "key": "image",
                "type": "media",
                "allowed_values": "",
                "id": "019c0618-0000-7000-8000-000000000100"
            },
            {
                "key": "image_position",
                "type": "select",
                "allowed_values": "left,right",
                "id": "019c0618-0000-7000-8000-000000000101"
            },
            {
                "key": "description",
                "type": "richtext",
                "allowed_values": "",
                "id": "019c0618-0000-7000-8000-000000000102"
            },
            {
                "key": "is_video",
                "type": "select",
                "allowed_values": "yes,no",
                "id": "019c0618-0000-7000-8000-000000000103"
            },
            {
                "key": "title",
                "type": "text",
                "allowed_values": "",
                "id": "019c0618-0000-7000-8000-000000000104"
            },
            {
                "key": "cta_text_2",
                "type": "text",
                "allowed_values": "",
                "id": "019c0618-0000-7000-8000-000000000105"
            },
            {
                "key": "cta_link_2",
                "type": "text",
                "allowed_values": "",
                "id": "019c0618-0000-7000-8000-000000000106"
            },
            {
                "key": "cta_text",
                "type": "text",
                "allowed_values": "",
                "id": "019c0618-0000-7000-8000-000000000107"
            },
            {
                "key": "cta_link",
                "type": "text",
                "allowed_values": "",
                "id": "019c0618-0000-7000-8000-000000000108"
            }
        ],
        "id": "99999999-9999-4999-8999-000000000001"
    },
    {
        "name": "FAQItem",
        "description": "",
        "agent_description": null,
        "prev_name": "",
        "props": [
            {
                "key": "answer",
                "type": "longtext",
                "allowed_values": "",
                "id": "019c0618-0000-7000-8000-000000000200"
            },
            {
                "key": "question",
                "type": "text",
                "allowed_values": "",
                "id": "019c0618-0000-7000-8000-000000000201"
            }
        ],
        "id": "99999999-9999-4999-8999-000000000002"
    },
    {
        "name": "PricingCard",
        "description": "garchi/PricingCard",
        "agent_description": null,
        "prev_name": "",
        "props": [
            {
                "key": "features",
                "type": "longtext",
                "allowed_values": "",
                "id": "019c0618-0000-7000-8000-000000000300"
            },
            {
                "key": "isFeatured",
                "type": "select",
                "allowed_values": "yes,no",
                "id": "019c0618-0000-7000-8000-000000000301"
            },
            {
                "key": "price",
                "type": "text",
                "allowed_values": "",
                "id": "019c0618-0000-7000-8000-000000000302"
            },
            {
                "key": "description",
                "type": "text",
                "allowed_values": "",
                "id": "019c0618-0000-7000-8000-000000000303"
            },
            {
                "key": "index",
                "type": "text",
                "allowed_values": "",
                "id": "019c0618-0000-7000-8000-000000000304"
            },
            {
                "key": "stripe_price_id",
                "type": "text",
                "allowed_values": "",
                "id": "019c0618-0000-7000-8000-000000000305"
            },
            {
                "key": "cta_text",
                "type": "text",
                "allowed_values": "",
                "id": "019c0618-0000-7000-8000-000000000306"
            },
            {
                "key": "name",
                "type": "text",
                "allowed_values": "",
                "id": "019c0618-0000-7000-8000-000000000307"
            }
        ],
        "id": "99999999-9999-4999-8999-000000000003"
    },
    {
        "name": "Markdown",
        "description": "Markdown",
        "agent_description": null,
        "prev_name": "",
        "props": [
            {
                "key": "content",
                "type": "richtext",
                "allowed_values": "",
                "id": "019c0618-0000-7000-8000-000000000400"
            },
            {
                "key": "className",
                "type": "text",
                "allowed_values": "",
                "id": "019c0618-0000-7000-8000-000000000401"
            }
        ],
        "id": "99999999-9999-4999-8999-000000000004"
    },
    {
        "name": "Feature",
        "description": "garchi/Feature",
        "agent_description": null,
        "prev_name": "",
        "props": [
            {
                "key": "icon",
                "type": "icon_lucid",
                "allowed_values": "",
                "id": "019c0618-0000-7000-8000-000000000500"
            },
            {
                "key": "title",
                "type": "text",
                "allowed_values": "",
                "id": "019c0618-0000-7000-8000-000000000501"
            },
            {
                "key": "description",
                "type": "longtext",
                "allowed_values": "",
                "id": "019c0618-0000-7000-8000-000000000502"
            }
        ],
        "id": "99999999-9999-4999-8999-000000000005"
    },
    {
        "name": "Features",
        "description": "garchi/Features",
        "agent_description": null,
        "prev_name": "",
        "props": [
            {
                "key": "title",
                "type": "text",
                "allowed_values": "",
                "id": "019c0618-0000-7000-8000-000000000600"
            },
            {
                "key": "subtitle",
                "type": "longtext",
                "allowed_values": "",
                "id": "019c0618-0000-7000-8000-000000000601"
            }
        ],
        "id": "99999999-9999-4999-8999-000000000006"
    },
    {
        "name": "YoutubeVideo",
        "description": "garchi/YoutubeVideo",
        "agent_description": null,
        "prev_name": "",
        "props": [
            {
                "key": "videoId",
                "type": "text",
                "allowed_values": "",
                "id": "019c0618-0000-7000-8000-000000000700"
            },
            {
                "key": "style",
                "type": "text",
                "allowed_values": "",
                "id": "019c0618-0000-7000-8000-000000000701"
            },
            {
                "key": "height",
                "type": "text",
                "allowed_values": "",
                "id": "019c0618-0000-7000-8000-000000000702"
            },
            {
                "key": "width",
                "type": "text",
                "allowed_values": "",
                "id": "019c0618-0000-7000-8000-000000000703"
            }
        ],
        "id": "99999999-9999-4999-8999-000000000007"
    },
    {
        "name": "Workflow",
        "description": "garchi/Workflow",
        "agent_description": null,
        "prev_name": "",
        "props": [
            {
                "key": "description",
                "type": "longtext",
                "allowed_values": "",
                "id": "019c0618-0000-7000-8000-000000000800"
            },
            {
                "key": "title",
                "type": "text",
                "allowed_values": "",
                "id": "019c0618-0000-7000-8000-000000000801"
            },
            {
                "key": "cta_text",
                "type": "text",
                "allowed_values": "",
                "id": "019c0618-0000-7000-8000-000000000802"
            }
        ],
        "id": "99999999-9999-4999-8999-000000000008"
    },
    {
        "name": "CTA",
        "description": "garchi/CTA",
        "agent_description": null,
        "prev_name": "",
        "props": [
            {
                "key": "ctaLink",
                "type": "text",
                "allowed_values": "",
                "id": "019c0618-0000-7000-8000-000000000900"
            },
            {
                "key": "title",
                "type": "text",
                "allowed_values": "",
                "id": "019c0618-0000-7000-8000-000000000901"
            },
            {
                "key": "description",
                "type": "longtext",
                "allowed_values": "",
                "id": "019c0618-0000-7000-8000-000000000902"
            },
            {
                "key": "ctaText",
                "type": "text",
                "allowed_values": "",
                "id": "019c0618-0000-7000-8000-000000000903"
            }
        ],
        "id": "99999999-9999-4999-8999-000000000009"
    },
    {
        "name": "Hero",
        "description": "garchi/Hero",
        "agent_description": null,
        "prev_name": "",
        "props": [
            {
                "key": "words",
                "type": "text",
                "allowed_values": "",
                "id": "019c0618-0000-7000-8000-000000001000"
            },
            {
                "key": "description",
                "type": "longtext",
                "allowed_values": "",
                "id": "019c0618-0000-7000-8000-000000001001"
            },
            {
                "key": "ctaLink",
                "type": "text",
                "allowed_values": "",
                "id": "019c0618-0000-7000-8000-000000001002"
            },
            {
                "key": "title",
                "type": "text",
                "allowed_values": "",
                "id": "019c0618-0000-7000-8000-000000001003"
            },
            {
                "key": "ctaText",
                "type": "text",
                "allowed_values": "",
                "id": "019c0618-0000-7000-8000-000000001004"
            }
        ],
        "id": "99999999-9999-4999-8999-000000000010"
    },
    {
        "name": "FAQ",
        "description": "ui/faq",
        "agent_description": null,
        "prev_name": "",
        "props": [],
        "id": "99999999-9999-4999-8999-000000000011"
    },
    {
        "name": "Pricing",
        "description": "garchi/Pricing",
        "agent_description": null,
        "prev_name": "",
        "props": [
            {
                "key": "title",
                "type": "text",
                "allowed_values": "",
                "id": "019c0618-0000-7000-8000-000000001200"
            },
            {
                "key": "subheading",
                "type": "text",
                "allowed_values": "",
                "id": "019c0618-0000-7000-8000-000000001201"
            }
        ],
        "id": "99999999-9999-4999-8999-000000000012"
    }
]
 

Request   

GET api/v2/space/{uid}/section_templates

URL Parameters

uid  string  

The unique identifier of the space.

Reviews

Create new review for the item

requires authentication

Example request:
curl --request POST \
    "https://garchi.co.uk/api/v2/reviews/item" \
    --header "Authorization: Bearer {YOUR_API_TOKEN}" \
    --header "Content-Type: application/json" \
    --data "{
    \"item_id\": 4,
    \"rating\": 4,
    \"review_body\": \"This is a best selling item.\",
    \"user_email\": \"jane.doe@example.com\",
    \"user_name\": \"Jane\",
    \"parent_id\": 4
}"
// npm install @garchicms/garchi-node-sdk
import GarchiCMS from "@garchicms/garchi-node-sdk";

// The SDK sends your API token as "Authorization: Bearer <token>" on every request.
const garchi = new GarchiCMS({ api_key: "YOUR_API_TOKEN" });

const response = await garchi.review.create({
    item_id: 4,
    rating: 4,
    review_body: "This is a best selling item.",
    user_email: "jane.doe@@example.com",
    user_name: "Jane",
    parent_id: 4,
});
// composer require garchicms/garchi-sdk-php
use GarchiCMS\GarchiCMS;

// The SDK sends your API token as "Authorization: Bearer <token>" on every request.
$garchi = new GarchiCMS("YOUR_API_TOKEN");

$response = $garchi->review->create([
    'item_id' => 4,
    'rating' => 4,
    'review_body' => 'This is a best selling item.',
    'user_email' => 'jane.doe@@example.com',
    'user_name' => 'Jane',
    'parent_id' => 4,
]);
import requests
import json

url = 'https://garchi.co.uk/api/v2/reviews/item'
payload = {
    "item_id": 4,
    "rating": 4,
    "review_body": "This is a best selling item.",
    "user_email": "jane.doe@example.com",
    "user_name": "Jane",
    "parent_id": 4
}
headers = {
  'Authorization': 'Bearer {YOUR_API_TOKEN}',
  'Content-Type': 'application/json'
}

response = requests.request('POST', url, headers=headers, json=payload)
response.json()
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.nio.file.Path;

String baseUrl = "https://garchi.co.uk";
String endpointUri = "api/v2/reviews/item"; 

URI url = URI.create(baseUrl + endpointUri);

HttpClient client = HttpClient.newHttpClient();
HttpRequest.Builder builder = HttpRequest.newBuilder(url);


String body = {
    "item_id": 4,
    "rating": 4,
    "review_body": "This is a best selling item.",
    "user_email": "jane.doe@example.com",
    "user_name": "Jane",
    "parent_id": 4
};
builder.POST(HttpRequest.BodyPublishers.ofString(body));


builder.header("Authorization", "Bearer {YOUR_API_TOKEN}");
builder.header("Content-Type", "application/json");


HttpResponse<String> response = client.send(builder.build(), HttpResponse.BodyHandlers.ofString());

// Parse JSON response
JSONObject json = new JSONObject(response.body());

use Illuminate\Support\Facades\Http;

$url = 'https://garchi.co.uk/api/v2/reviews/item';

$headers = [
  'Authorization' => 'Bearer {YOUR_API_TOKEN}',
  'Content-Type' => 'application/json'
]

$client = Http::withHeaders($headers);



$body = {
    "item_id": 4,
    "rating": 4,
    "review_body": "This is a best selling item.",
    "user_email": "jane.doe@example.com",
    "user_name": "Jane",
    "parent_id": 4
};

$client->withBody($body);





$response = $client->POST($url);

$responseBody = $response->json();

Example response (200):



{
    "data": {
        "review_id": 15,
        "review_body": "This is a best selling item",
        "rating": 4,
        "user": {
            "name": "Jane",
            "email": "jane.doe@@example.com"
        },
        "item_id": 15,
        "reviewed_at": "2022-02-23T23:00:45.000000Z",
        "parent": null
    }
}
 

Request   

POST api/v2/reviews/item

Body Parameters

item_id  integer  

id of the item.

rating  integer  

Number of stars or rating. Ranging from 1-5.

review_body  string optional  

Review body. Max 5000 characters.

user_email  string optional  

Email of the reviewer if the reviewer is authenticated using your or third party services like firebase, supabase etc.

user_name  string optional  

Name of the reviewer if the reviewer is authenticated using your or third party services like firebase, supabase etc.

parent_id  integer optional  

Id of the parent review.

Edit a review

requires authentication

Edits a review. Only provided fields will be updated rest will be ignored.

Example request:
curl --request POST \
    "https://garchi.co.uk/api/v2/reviews/edit" \
    --header "Authorization: Bearer {YOUR_API_TOKEN}" \
    --header "Content-Type: application/json" \
    --data "{
    \"review_id\": 4,
    \"review_body\": \"This is an amazing seller.\",
    \"rating\": 4
}"
// npm install @garchicms/garchi-node-sdk
import GarchiCMS from "@garchicms/garchi-node-sdk";

// The SDK sends your API token as "Authorization: Bearer <token>" on every request.
const garchi = new GarchiCMS({ api_key: "YOUR_API_TOKEN" });

const response = await garchi.review.update({
    review_id: 4,
    review_body: "This is an amazing seller.",
    rating: 4,
});
// composer require garchicms/garchi-sdk-php
use GarchiCMS\GarchiCMS;

// The SDK sends your API token as "Authorization: Bearer <token>" on every request.
$garchi = new GarchiCMS("YOUR_API_TOKEN");

$response = $garchi->review->update([
    'review_id' => 4,
    'review_body' => 'This is an amazing seller.',
    'rating' => 4,
]);
import requests
import json

url = 'https://garchi.co.uk/api/v2/reviews/edit'
payload = {
    "review_id": 4,
    "review_body": "This is an amazing seller.",
    "rating": 4
}
headers = {
  'Authorization': 'Bearer {YOUR_API_TOKEN}',
  'Content-Type': 'application/json'
}

response = requests.request('POST', url, headers=headers, json=payload)
response.json()
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.nio.file.Path;

String baseUrl = "https://garchi.co.uk";
String endpointUri = "api/v2/reviews/edit"; 

URI url = URI.create(baseUrl + endpointUri);

HttpClient client = HttpClient.newHttpClient();
HttpRequest.Builder builder = HttpRequest.newBuilder(url);


String body = {
    "review_id": 4,
    "review_body": "This is an amazing seller.",
    "rating": 4
};
builder.POST(HttpRequest.BodyPublishers.ofString(body));


builder.header("Authorization", "Bearer {YOUR_API_TOKEN}");
builder.header("Content-Type", "application/json");


HttpResponse<String> response = client.send(builder.build(), HttpResponse.BodyHandlers.ofString());

// Parse JSON response
JSONObject json = new JSONObject(response.body());

use Illuminate\Support\Facades\Http;

$url = 'https://garchi.co.uk/api/v2/reviews/edit';

$headers = [
  'Authorization' => 'Bearer {YOUR_API_TOKEN}',
  'Content-Type' => 'application/json'
]

$client = Http::withHeaders($headers);



$body = {
    "review_id": 4,
    "review_body": "This is an amazing seller.",
    "rating": 4
};

$client->withBody($body);





$response = $client->POST($url);

$responseBody = $response->json();

Example response (200):



{
    "message": "1 reviews updated"
}
 

Request   

POST api/v2/reviews/edit

Body Parameters

review_id  integer  

Id of the review.

review_body  string optional  

Review body. Max 5000 characters.

rating  integer  

Number of stars or rating. Ranging from 1-5.

Delete a review

requires authentication

Permenantly deletes a specific review.

Example request:
curl --request POST \
    "https://garchi.co.uk/api/v2/reviews/delete" \
    --header "Authorization: Bearer {YOUR_API_TOKEN}" \
    --header "Content-Type: application/json" \
    --data "{
    \"review_id\": 11
}"
// npm install @garchicms/garchi-node-sdk
import GarchiCMS from "@garchicms/garchi-node-sdk";

// The SDK sends your API token as "Authorization: Bearer <token>" on every request.
const garchi = new GarchiCMS({ api_key: "YOUR_API_TOKEN" });

const response = await garchi.review.delete(11);
// composer require garchicms/garchi-sdk-php
use GarchiCMS\GarchiCMS;

// The SDK sends your API token as "Authorization: Bearer <token>" on every request.
$garchi = new GarchiCMS("YOUR_API_TOKEN");

$response = $garchi->review->delete(11);
import requests
import json

url = 'https://garchi.co.uk/api/v2/reviews/delete'
payload = {
    "review_id": 11
}
headers = {
  'Authorization': 'Bearer {YOUR_API_TOKEN}',
  'Content-Type': 'application/json'
}

response = requests.request('POST', url, headers=headers, json=payload)
response.json()
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.nio.file.Path;

String baseUrl = "https://garchi.co.uk";
String endpointUri = "api/v2/reviews/delete"; 

URI url = URI.create(baseUrl + endpointUri);

HttpClient client = HttpClient.newHttpClient();
HttpRequest.Builder builder = HttpRequest.newBuilder(url);


String body = {
    "review_id": 11
};
builder.POST(HttpRequest.BodyPublishers.ofString(body));


builder.header("Authorization", "Bearer {YOUR_API_TOKEN}");
builder.header("Content-Type", "application/json");


HttpResponse<String> response = client.send(builder.build(), HttpResponse.BodyHandlers.ofString());

// Parse JSON response
JSONObject json = new JSONObject(response.body());

use Illuminate\Support\Facades\Http;

$url = 'https://garchi.co.uk/api/v2/reviews/delete';

$headers = [
  'Authorization' => 'Bearer {YOUR_API_TOKEN}',
  'Content-Type' => 'application/json'
]

$client = Http::withHeaders($headers);



$body = {
    "review_id": 11
};

$client->withBody($body);





$response = $client->POST($url);

$responseBody = $response->json();

Example response (200):



{
    "message": "1 reviews deleted"
}
 

Request   

POST api/v2/reviews/delete

Body Parameters

review_id  integer  

ID of the review

Get reviews for an item

requires authentication

Returns the reviews for an item

Example request:
curl --request GET \
    --get "https://garchi.co.uk/api/v2/reviews/item/15?size=10" \
    --header "Authorization: Bearer {YOUR_API_TOKEN}"
// npm install @garchicms/garchi-node-sdk
import GarchiCMS from "@garchicms/garchi-node-sdk";

// The SDK sends your API token as "Authorization: Bearer <token>" on every request.
const garchi = new GarchiCMS({ api_key: "YOUR_API_TOKEN" });

const response = await garchi.review.getByItem("15", {
    size: 10,
});
// composer require garchicms/garchi-sdk-php
use GarchiCMS\GarchiCMS;

// The SDK sends your API token as "Authorization: Bearer <token>" on every request.
$garchi = new GarchiCMS("YOUR_API_TOKEN");

$response = $garchi->review->getByItem('15', [
    'size' => 10,
]);
import requests
import json

url = 'https://garchi.co.uk/api/v2/reviews/item/15'
params = {
  'size': '10',
}
headers = {
  'Authorization': 'Bearer {YOUR_API_TOKEN}'
}

response = requests.request('GET', url, headers=headers, params=params)
response.json()
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.nio.file.Path;

String baseUrl = "https://garchi.co.uk";
String endpointUri = "api/v2/reviews/item/15"; 

URI url = URI.create(baseUrl + endpointUri);

HttpClient client = HttpClient.newHttpClient();
HttpRequest.Builder builder = HttpRequest.newBuilder(url);



Map<Object, Object> params = {
  "size": "10",
};
builder.uri(URI.create(url + "?" + toQueryString(params)));

builder.header("Authorization", "Bearer {YOUR_API_TOKEN}");


HttpResponse<String> response = client.send(builder.build(), HttpResponse.BodyHandlers.ofString());

// Parse JSON response
JSONObject json = new JSONObject(response.body());

use Illuminate\Support\Facades\Http;

$url = 'https://garchi.co.uk/api/v2/reviews/item/15';

$headers = [
  'Authorization' => 'Bearer {YOUR_API_TOKEN}'
]

$client = Http::withHeaders($headers);




$queryParams = {
  'size': '10',
};

$url .= '?'. $queryParams;




$response = $client->GET($url);

$responseBody = $response->json();

Example response (200):



{
    "data": [
        {
            "review_id": 15,
            "review_body": "This is a best selling item",
            "rating": 4,
            "user": {
                "name": "Jane",
                "email": "jane.doe@@example.com"
            },
            "item_id": 15,
            "reviewed_at": "2022-02-23T23:00:45.000000Z",
            "parent": null,
            "reactions": [
                {
                    "reaction_id": "9b08ce6c-350c-4f00-9858-37a866bd626f",
                    "reaction": "like",
                    "user_identifier": "jane.doe@@example.com",
                    "created_at": "2024-01-07T09:54:12.000000Z",
                    "updated_at": "2024-01-07T09:54:12.000000Z"
                }
            ],
            "replies": [
                {
                    "review_id": 16,
                    "review_body": "Thanks for the feedback!",
                    "rating": 5,
                    "user": {
                        "name": "Garchi Support",
                        "email": "support@@example.com"
                    },
                    "item_id": 15,
                    "reviewed_at": "2022-02-24T09:12:10.000000Z",
                    "parent": 15,
                    "reactions": [],
                    "replies": []
                }
            ]
        }
    ],
    "links": {
        "first": "https://garchi.co.uk/api/v2/reviews/item/15?page=1",
        "last": "https://garchi.co.uk/api/v2/reviews/item/15?page=1",
        "prev": null,
        "next": null
    },
    "meta": {
        "current_page": 1,
        "from": 1,
        "last_page": 1,
        "links": [
            {
                "url": null,
                "label": "&laquo; Previous",
                "active": false
            },
            {
                "url": "https://garchi.co.uk/api/v2/reviews/item/15?page=1",
                "label": "1",
                "active": true
            },
            {
                "url": null,
                "label": "Next &raquo;",
                "active": false
            }
        ],
        "path": "https://garchi.co.uk/api/v2/reviews/item/15",
        "per_page": 5,
        "to": 1,
        "total": 1
    }
}
 

Request   

GET api/v2/reviews/item/{item}

URL Parameters

item  string  

ID of the item

Query Parameters

size  integer optional  

Number of reviews per page. Default is set to 5.

Compound Query

Compound Query

requires authentication

Compound query is useful when you want to fetch data using complex filters. It is advisable to use compound query only in limited cases as it involves querying using multiple conditions which can be slow.
You need to provide the dataset to query, the fields to query, the conditions for the fields, the values for the conditions and the logic whether to perform logical and/or of the conditions.
Field restriction varies based on the dataset.

Allowed fields for items [item_id, name, slug, description, categories, ratings, price, created, published]

Allowed fields for categories [category_id, category_name]

Allowed fields for reviews [review_id, item_id, rating, review, created]

You can have duplicate fields in the fields array.

The response schema depends on the dataset. Depending on the dataset the response schema will be as follows:

items: list all items api .

reviews: get reviews for an item api .

categories: get all categories api .

Example request:
curl --request POST \
    "https://garchi.co.uk/api/v2/compound_query?order_key=created&order_by=desc" \
    --header "Authorization: Bearer {YOUR_API_TOKEN}" \
    --header "Content-Type: application/json" \
    --data "{
    \"dataset\": \"items\",
    \"fields\": [
        \"name\",
        \"price\"
    ],
    \"conditions\": [
        \"eq\",
        \"lte\"
    ],
    \"values\": [
        \"Apple\",
        100
    ],
    \"logic\": \"[\\\"and\\\"]\"
}"
// npm install @garchicms/garchi-node-sdk
import GarchiCMS from "@garchicms/garchi-node-sdk";

// The SDK sends your API token as "Authorization: Bearer <token>" on every request.
const garchi = new GarchiCMS({ api_key: "YOUR_API_TOKEN" });

const response = await garchi.compoundQuery.query({
    dataset: "items",
    fields: ["name", "price"],
    conditions: ["eq", "lte"],
    values: ["Apple", 100],
    logic: ["and"],
}, {
    order_key: "created",
    order_by: "desc",
});
// composer require garchicms/garchi-sdk-php
use GarchiCMS\GarchiCMS;

// The SDK sends your API token as "Authorization: Bearer <token>" on every request.
$garchi = new GarchiCMS("YOUR_API_TOKEN");

$response = $garchi->compoundQuery->query([
    'dataset' => 'items',
    'fields' => ['name', 'price'],
    'conditions' => ['eq', 'lte'],
    'values' => ['Apple', 100],
    'logic' => ['and'],
], [
    'order_key' => 'created',
    'order_by' => 'desc',
]);
import requests
import json

url = 'https://garchi.co.uk/api/v2/compound_query'
payload = {
    "dataset": "items",
    "fields": [
        "name",
        "price"
    ],
    "conditions": [
        "eq",
        "lte"
    ],
    "values": [
        "Apple",
        100
    ],
    "logic": "[\"and\"]"
}
params = {
  'order_key': 'created',
  'order_by': 'desc',
}
headers = {
  'Authorization': 'Bearer {YOUR_API_TOKEN}',
  'Content-Type': 'application/json'
}

response = requests.request('POST', url, headers=headers, json=payload, params=params)
response.json()
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.nio.file.Path;

String baseUrl = "https://garchi.co.uk";
String endpointUri = "api/v2/compound_query"; 

URI url = URI.create(baseUrl + endpointUri);

HttpClient client = HttpClient.newHttpClient();
HttpRequest.Builder builder = HttpRequest.newBuilder(url);


String body = {
    "dataset": "items",
    "fields": [
        "name",
        "price"
    ],
    "conditions": [
        "eq",
        "lte"
    ],
    "values": [
        "Apple",
        100
    ],
    "logic": "[\"and\"]"
};
builder.POST(HttpRequest.BodyPublishers.ofString(body));

Map<Object, Object> params = {
  "order_key": "created",
  "order_by": "desc",
};
builder.uri(URI.create(url + "?" + toQueryString(params)));

builder.header("Authorization", "Bearer {YOUR_API_TOKEN}");
builder.header("Content-Type", "application/json");


HttpResponse<String> response = client.send(builder.build(), HttpResponse.BodyHandlers.ofString());

// Parse JSON response
JSONObject json = new JSONObject(response.body());

use Illuminate\Support\Facades\Http;

$url = 'https://garchi.co.uk/api/v2/compound_query';

$headers = [
  'Authorization' => 'Bearer {YOUR_API_TOKEN}',
  'Content-Type' => 'application/json'
]

$client = Http::withHeaders($headers);



$body = {
    "dataset": "items",
    "fields": [
        "name",
        "price"
    ],
    "conditions": [
        "eq",
        "lte"
    ],
    "values": [
        "Apple",
        100
    ],
    "logic": "[\"and\"]"
};

$client->withBody($body);



$queryParams = {
  'order_key': 'created',
  'order_by': 'desc',
};

$url .= '?'. $queryParams;




$response = $client->POST($url);

$responseBody = $response->json();

Example response (200):



{
    "data": [
        {
            "item_id": 26,
            "sku": "WD-101",
            "external_link": "",
            "slug": "example-product",
            "parent_id": null,
            "children_count": 0,
            "name": "Example Product",
            "stock": 100,
            "price": 40,
            "scratched_price": null,
            "one_liner": "Best book for beginners",
            "description": "<p><strong>This book is fantastic</strong></p>\n<ol>\n<li>This</li>\n<li>Book</li>\n<li>is</li>\n<li>Fantastic</li>\n</ol>",
            "categories": [
                {
                    "id": 22,
                    "name": "Web Development Bootcamp",
                    "rank": null
                }
            ],
            "delivery_type": "can_deliver",
            "main_image": "https://assets.garchi.co.uk/examples/product-main.png",
            "other_images": [
                "https://assets.garchi.co.uk/examples/product-1.png",
                "https://assets.garchi.co.uk/examples/product-2.png"
            ],
            "attributes": [
                {
                    "id": 16,
                    "name": "Book Cover",
                    "min": "1",
                    "options": [
                        {
                            "id": 29,
                            "sku": "WD-101-PAPER",
                            "name": "Paper",
                            "price": 0.5
                        },
                        {
                            "id": 30,
                            "sku": "WD-101-BOUND",
                            "name": "Binded",
                            "price": 1
                        }
                    ]
                }
            ],
            "space": {
                "uid": "b5f0d08a-7600-4b9e-81e9-1ffaf5ddb8d2cf268eeb-000a-4bfd-bba6-09ab",
                "name": "Books"
            },
            "avg_rating": null,
            "scheduled_for": null,
            "item_meta": [
                {
                    "id": 11,
                    "key": "website",
                    "value": "https://example.com",
                    "type": "url"
                }
            ],
            "reactions": [
                {
                    "reaction_id": "9b08ce6c-350c-4f00-9858-37a866bd626f",
                    "reaction": "like",
                    "user_identifier": "jane.doe@@example.com",
                    "created_at": "2024-01-07T09:54:12.000000Z",
                    "updated_at": "2024-01-07T09:54:12.000000Z"
                }
            ],
            "agent_description": "A beginner-friendly book that teaches web development step by step.",
            "created": "2022-11-06 20:52:39",
            "updated": "2023-07-08 15:09:16"
        }
    ],
    "links": {
        "first": "https://garchi.co.uk/api/v2/items?page=1",
        "last": "https://garchi.co.uk/api/v2/items?page=1",
        "prev": null,
        "next": null
    },
    "meta": {
        "current_page": 1,
        "from": 1,
        "last_page": 1,
        "links": [
            {
                "url": null,
                "label": "&laquo; Previous",
                "active": false
            },
            {
                "url": "https://garchi.co.uk/api/v2/items?page=1",
                "label": "1",
                "active": true
            },
            {
                "url": null,
                "label": "Next &raquo;",
                "active": false
            }
        ],
        "path": "https://garchi.co.uk/api/v2/items",
        "per_page": 10,
        "to": 1,
        "total": 1
    }
}
 

Request   

POST api/v2/compound_query

Query Parameters

order_key  string optional  

string. Key to order the dataset by. Allowed values are any field allowed for that respective dataset.

order_by  string optional  

string. Order by ascending or descending. Allowed values are asc, desc.

Body Parameters

dataset  string optional  

required. The dataset to query. Allowed values are items, categories, reviews.

fields  string[] optional  

required. The fields for condition. The sequence matters.

conditions  string[] optional  

required. The conditions for the fields. The sequence matters. Allowed conditions eq,gte,lte,gt,lt,like,in,not_eq,not_in.

values  string[] optional  

required. The values for the conditions. The sequence matters.

logic  string[]. optional  

The logic to use for the conditions. The sequence matters. Allowed values are and, or.

Reaction

Mark a reaction

requires authentication

Creates a reaction for review, item. If the reaction already exists it will be deleted and a new one will be added.

Example request:
curl --request POST \
    "https://garchi.co.uk/api/v2/manage-reaction" \
    --header "Authorization: Bearer {YOUR_API_TOKEN}" \
    --header "Content-Type: application/json" \
    --data "{
    \"reaction\": \"like\",
    \"user_identifier\": \"jane.doe@example.com\",
    \"review_id\": 4,
    \"item_id\": 4,
    \"reaction_for\": \"review\"
}"
// npm install @garchicms/garchi-node-sdk
import GarchiCMS from "@garchicms/garchi-node-sdk";

// The SDK sends your API token as "Authorization: Bearer <token>" on every request.
const garchi = new GarchiCMS({ api_key: "YOUR_API_TOKEN" });

const response = await garchi.reaction.manage({
    reaction: "like",
    user_identifier: "jane.doe@@example.com",
    review_id: 4,
    item_id: 4,
    reaction_for: "review",
});
// composer require garchicms/garchi-sdk-php
use GarchiCMS\GarchiCMS;

// The SDK sends your API token as "Authorization: Bearer <token>" on every request.
$garchi = new GarchiCMS("YOUR_API_TOKEN");

$response = $garchi->reaction->manage([
    'reaction' => 'like',
    'user_identifier' => 'jane.doe@@example.com',
    'review_id' => 4,
    'item_id' => 4,
    'reaction_for' => 'review',
]);
import requests
import json

url = 'https://garchi.co.uk/api/v2/manage-reaction'
payload = {
    "reaction": "like",
    "user_identifier": "jane.doe@example.com",
    "review_id": 4,
    "item_id": 4,
    "reaction_for": "review"
}
headers = {
  'Authorization': 'Bearer {YOUR_API_TOKEN}',
  'Content-Type': 'application/json'
}

response = requests.request('POST', url, headers=headers, json=payload)
response.json()
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.nio.file.Path;

String baseUrl = "https://garchi.co.uk";
String endpointUri = "api/v2/manage-reaction"; 

URI url = URI.create(baseUrl + endpointUri);

HttpClient client = HttpClient.newHttpClient();
HttpRequest.Builder builder = HttpRequest.newBuilder(url);


String body = {
    "reaction": "like",
    "user_identifier": "jane.doe@example.com",
    "review_id": 4,
    "item_id": 4,
    "reaction_for": "review"
};
builder.POST(HttpRequest.BodyPublishers.ofString(body));


builder.header("Authorization", "Bearer {YOUR_API_TOKEN}");
builder.header("Content-Type", "application/json");


HttpResponse<String> response = client.send(builder.build(), HttpResponse.BodyHandlers.ofString());

// Parse JSON response
JSONObject json = new JSONObject(response.body());

use Illuminate\Support\Facades\Http;

$url = 'https://garchi.co.uk/api/v2/manage-reaction';

$headers = [
  'Authorization' => 'Bearer {YOUR_API_TOKEN}',
  'Content-Type' => 'application/json'
]

$client = Http::withHeaders($headers);



$body = {
    "reaction": "like",
    "user_identifier": "jane.doe@example.com",
    "review_id": 4,
    "item_id": 4,
    "reaction_for": "review"
};

$client->withBody($body);





$response = $client->POST($url);

$responseBody = $response->json();

Example response (Existing reaction removed):



{
    "message": "Reaction deleted"
}
 

Example response (200):



{
    "data": {
        "reaction_id": "9b08ce6c-350c-4f00-9858-37a866bd626f",
        "reaction": "like",
        "user_identifier": "jane.doe@@example.com",
        "created_at": "2024-01-07T09:54:12.000000Z",
        "updated_at": "2024-01-07T09:54:12.000000Z"
    }
}
 

Request   

POST api/v2/manage-reaction

Body Parameters

reaction  string  

Reaction type.

user_identifier  string  

User identifier Could be email or uid.

review_id  integer optional  

Only required if reaction for review.

item_id  integer optional  

Only required if reaction for an item.

reaction_for  string  

Allowed values are review, item.