BREAGEN Logo
Schema Builder

Default Schema

Default Schema Operations provide functionality to manage default schemas, including creating, retrieving, updating, and deleting schema definitions.

Get Default Schema Pages GET /v1/api/default_schema/pages/

Resource URL/v1/api/default_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/default_schema/pages/?page=1&limit=10' \
-H 'accept: application/json'

Example Response

{
	"total": 25,
	"items": [
		{
			"schema_id": 1,
			"schema_name": "customer_schema",
			"display_name": "Customer Schema",
			"created_user": "[email protected]",
			"created_at": "2024-01-15T10:30:00Z"
		},
		{
			"schema_id": 2,
			"schema_name": "product_schema",
			"display_name": "Product Schema",
			"created_user": "[email protected]",
			"created_at": "2024-01-16T14:20:00Z"
		}
	],
	"page": 1,
	"total_pages": 3
}

Get All Default Schemas GET /v1/api/default_schema/all/

Resource URL/v1/api/default_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/default_schema/all/' \
-H 'accept: application/json'

Example Response

{
	"schemas": [
		{
			"schema_id": 1,
			"schema_name": "customer_schema",
			"display_name": "Customer Schema",
			"json_schema": {
				"type": "object",
				"properties": {
					"name": { "type": "string" },
					"email": { "type": "string" }
				}
			},
			"created_user": "[email protected]"
		}
	]
}

Get One Default Schema GET /v1/api/default_schema/{default_schema_id}

Resource URL/v1/api/default_schema/{default_schema_id}
Response FormatJSON
Requires AuthenticationYes
Rate LimitedYes
HTTPSYes

Parameters

ParameterDescriptionRequiredType
default_schema_idID of the schemaYesinteger

Example Request

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

Example Response

{
	"schema_id": 1,
	"schema_name": "customer_schema",
	"display_name": "Customer Schema",
	"json_schema": {
		"type": "object",
		"properties": {
			"name": { "type": "string" },
			"email": { "type": "string" }
		}
	},
	"created_user": "[email protected]"
}

Update Default Schema PUT /v1/api/default_schema/{default_schema_id}

Resource URL/v1/api/default_schema/{default_schema_id}
Response FormatJSON
Requires AuthenticationYes
Rate LimitedYes
HTTPSYes

Parameters

ParameterDescriptionRequiredType
default_schema_idID of the schemaYesinteger

Request Body

{
	"schema_name": "updated_customer_schema",
	"display_name": "Updated Customer Schema",
	"json_schema": {
		"type": "object",
		"properties": {
			"name": { "type": "string" },
			"email": { "type": "string" },
			"phone": { "type": "string" }
		}
	},
	"created_user": "[email protected]"
}

Example Request

curl -X 'PUT' \
'https://api.braegen.ai/v1/api/default_schema/1' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-d '{
    "schema_name": "updated_customer_schema",
    "display_name": "Updated Customer Schema",
    "json_schema": {
        "type": "object",
        "properties": {
            "name": {"type": "string"},
            "email": {"type": "string"},
            "phone": {"type": "string"}
        }
    },
    "created_user": "[email protected]"
}'

Delete Default Schema DELETE /v1/api/default_schema/{default_schema_id}

Resource URL/v1/api/default_schema/{default_schema_id}
Response FormatJSON
Requires AuthenticationYes
Rate LimitedYes
HTTPSYes

Parameters

ParameterDescriptionRequiredType
default_schema_idID of the schemaYesinteger

Example Request

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

Create Default Schema POST /v1/api/default_schema/create

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

Request Body

{
	"schema_name": "new_customer_schema",
	"display_name": "New Customer Schema",
	"json_schema": {
		"type": "object",
		"properties": {
			"name": { "type": "string" },
			"email": { "type": "string" }
		}
	},
	"created_user": "[email protected]"
}

Example Request

curl -X 'POST' \
'https://api.braegen.ai/v1/api/default_schema/create' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-d '{
    "schema_name": "new_customer_schema",
    "display_name": "New Customer Schema",
    "json_schema": {
        "type": "object",
        "properties": {
            "name": {"type": "string"},
            "email": {"type": "string"}
        }
    },
    "created_user": "[email protected]"
}'

Example Response

{
	"schema_id": 3,
	"schema_name": "new_customer_schema",
	"display_name": "New Customer Schema",
	"json_schema": {
		"type": "object",
		"properties": {
			"name": { "type": "string" },
			"email": { "type": "string" }
		}
	},
	"created_user": "[email protected]",
	"created_at": "2024-01-17T09:15:00Z"
}