BREAGEN Logo
Schema Builder

Custom Schema

Custom Schema Operations provide functionality to manage custom schemas, including creating, retrieving, updating, and deleting custom schema definitions. These endpoints also support version data management.

Get Custom Schema Pages GET /v1/api/custom_schema/pages/

Resource URL/v1/api/custom_schema/pages/
Response FormatJSON
Requires AuthenticationYes
Rate LimitedYes
HTTPSYes

Parameters

ParameterDescriptionRequiredType
pagePage number for paginationYesinteger
limitNumber of items per pageYesinteger
user_idFilter schemas by user (optional)Nostring

Example Request

curl -X 'GET' \
'https://api.braegen.ai/v1/api/custom_schema/pages/?page=1&limit=10' \
-H 'accept: application/json'

Example Response

{
	"total": 15,
	"items": [
		{
			"schema_id": 1,
			"base_schema_name": "customer_schema",
			"custom_schema_name": "retail_customer",
			"display_name": "Retail Customer Schema",
			"created_user": "[email protected]",
			"created_at": "2024-01-15T10:30:00Z"
		},
		{
			"schema_id": 2,
			"base_schema_name": "product_schema",
			"custom_schema_name": "electronics_product",
			"display_name": "Electronics Product Schema",
			"created_user": "[email protected]",
			"created_at": "2024-01-16T14:20:00Z"
		}
	],
	"page": 1,
	"total_pages": 2
}

Get All Custom Schemas GET /v1/api/custom_schema/all/

Resource URL/v1/api/custom_schema/all/
Response FormatJSON
Requires AuthenticationYes
Rate LimitedYes
HTTPSYes

Parameters

ParameterDescriptionRequiredType
user_idFilter schemas by user (optional)Nostring

Example Request

curl -X 'GET' \
'https://api.braegen.ai/v1/api/custom_schema/all/' \
-H 'accept: application/json'

Example Response

{
	"schemas": [
		{
			"schema_id": 1,
			"base_schema_name": "customer_schema",
			"custom_schema_name": "retail_customer",
			"display_name": "Retail Customer Schema",
			"created_user": "[email protected]"
		}
	]
}

Get All Default And Custom Schemas GET /v1/api/custom_schema/all_schemas/{user_id}

Resource URL/v1/api/custom_schema/all_schemas/{user_id}
Response FormatJSON
Requires AuthenticationYes
Rate LimitedYes
HTTPSYes

Parameters

ParameterDescriptionRequiredType
user_idID of the userYesstring

Example Request

curl -X 'GET' \
'https://api.braegen.ai/v1/api/custom_schema/all_schemas/[email protected]' \
-H 'accept: application/json'

Example Response

{
	"default_schemas": [
		{
			"schema_id": 1,
			"schema_name": "customer_schema",
			"display_name": "Customer Schema"
		}
	],
	"custom_schemas": [
		{
			"schema_id": 1,
			"base_schema_name": "customer_schema",
			"custom_schema_name": "retail_customer",
			"display_name": "Retail Customer Schema"
		}
	]
}

Get One Custom Schema GET /v1/api/custom_schema/{custom_schema_id}

Resource URL/v1/api/custom_schema/{custom_schema_id}
Response FormatJSON
Requires AuthenticationYes
Rate LimitedYes
HTTPSYes

Parameters

ParameterDescriptionRequiredType
custom_schema_idID of the schemaYesinteger

Example Request

curl -X 'GET' \
'https://api.braegen.ai/v1/api/custom_schema/1' \
-H 'accept: application/json'

Example Response

{
	"schema_id": 1,
	"base_schema_name": "customer_schema",
	"custom_schema_name": "retail_customer",
	"display_name": "Retail Customer Schema",
	"created_user": "[email protected]"
}

Update Custom Schema PUT /v1/api/custom_schema/{custom_schema_id}

Resource URL/v1/api/custom_schema/{custom_schema_id}
Response FormatJSON
Requires AuthenticationYes
Rate LimitedYes
HTTPSYes

Parameters

ParameterDescriptionRequiredType
custom_schema_idID of the schemaYesinteger

Request Body

{
	"custom_schema_name": "updated_retail_customer",
	"display_name": "Updated Retail Customer Schema",
	"created_user": "[email protected]"
}

Example Request

curl -X 'PUT' \
'https://api.braegen.ai/v1/api/custom_schema/1' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-d '{
    "custom_schema_name": "updated_retail_customer",
    "display_name": "Updated Retail Customer Schema",
    "created_user": "[email protected]"
}'

Delete Custom Schema DELETE /v1/api/custom_schema/{custom_schema_id}

Resource URL/v1/api/custom_schema/{custom_schema_id}
Response FormatJSON
Requires AuthenticationYes
Rate LimitedYes
HTTPSYes

Parameters

ParameterDescriptionRequiredType
custom_schema_idID of the schemaYesinteger

Example Request

curl -X 'DELETE' \
'https://api.braegen.ai/v1/api/custom_schema/1' \
-H 'accept: application/json'

Create Custom Schema POST /v1/api/custom_schema/create

Resource URL/v1/api/custom_schema/create
Response FormatJSON
Requires AuthenticationYes
Rate LimitedYes
HTTPSYes

Request Body

{
	"base_schema_name": "customer_schema",
	"custom_schema_name": "retail_customer",
	"display_name": "Retail Customer Schema",
	"created_user": "[email protected]"
}

Example Request

curl -X 'POST' \
'https://api.braegen.ai/v1/api/custom_schema/create' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-d '{
    "base_schema_name": "customer_schema",
    "custom_schema_name": "retail_customer",
    "display_name": "Retail Customer Schema",
    "created_user": "[email protected]"
}'

Example Response

{
	"schema_id": 3,
	"base_schema_name": "customer_schema",
	"custom_schema_name": "retail_customer",
	"display_name": "Retail Customer Schema",
	"created_user": "[email protected]",
	"created_at": "2024-01-17T09:15:00Z"
}

Create Custom Schema With Version Data POST /v1/api/custom_schema/create_with_version_data

Resource URL/v1/api/custom_schema/create_with_version_data
Response FormatJSON
Requires AuthenticationYes
Rate LimitedYes
HTTPSYes

Request Body

{
	"base_schema_name": "customer_schema",
	"custom_schema_name": "retail_customer",
	"display_name": "Retail Customer Schema",
	"created_user": "[email protected]",
	"version_data": {
		"version": "1.0.0",
		"json_schema": {
			"type": "object",
			"properties": {
				"name": { "type": "string" },
				"email": { "type": "string" },
				"loyalty_tier": { "type": "string" }
			}
		}
	}
}

Example Request

curl -X 'POST' \
'https://api.braegen.ai/v1/api/custom_schema/create_with_version_data' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-d '{
    "base_schema_name": "customer_schema",
    "custom_schema_name": "retail_customer",
    "display_name": "Retail Customer Schema",
    "created_user": "[email protected]",
    "version_data": {
        "version": "1.0.0",
        "json_schema": {
            "type": "object",
            "properties": {
                "name": {"type": "string"},
                "email": {"type": "string"},
                "loyalty_tier": {"type": "string"}
            }
        }
    }
}'

Example Response

{
	"schema_id": 4,
	"base_schema_name": "customer_schema",
	"custom_schema_name": "retail_customer",
	"display_name": "Retail Customer Schema",
	"created_user": "[email protected]",
	"created_at": "2024-01-17T09:20:00Z",
	"version_id": 1,
	"version": "1.0.0"
}