Skip to content

Repository Management API

Manage repositories through the Management API. Requires JWT authentication.


POST /api/v1/management/databases/{databaseId}/repositories

Section titled “POST /api/v1/management/databases/{databaseId}/repositories”

Creates a new repository in a database.

Request:

{
"name": "companies",
"entityName": "Company",
"schema": {
"name": { "type": "string", "required": true },
"industry": { "type": "string", "required": false },
"employeeCount": { "type": "number", "required": false }
}
}
FieldTypeRequiredDescription
namestringYesRepository name
entityNamestringYesEntity type name
schemaobjectNoSchema definition for validation

Response (201 Created):

{
"repositoryId": "repo_abc123",
"databaseId": "db_abc123",
"name": "companies",
"entityName": "Company",
"createdAt": "2024-01-15T10:00:00Z"
}

GET /api/v1/management/databases/{databaseId}/repositories

Section titled “GET /api/v1/management/databases/{databaseId}/repositories”

Lists all repositories in a database.

Response (200 OK):

{
"repositories": [
{
"repositoryId": "repo_abc123",
"databaseId": "db_abc123",
"name": "companies",
"entityName": "Company",
"status": "Active",
"schema": {
"name": { "type": "string", "required": true }
},
"itemCount": 500,
"createdAt": "2024-01-15T10:00:00Z",
"updatedAt": "2024-01-15T10:30:00Z"
}
],
"nextCursor": null
}

GET /api/v1/management/databases/{databaseId}/repositories/{repositoryId}

Section titled “GET /api/v1/management/databases/{databaseId}/repositories/{repositoryId}”

Gets a specific repository by ID.

Response (200 OK): Same as individual repository in list response.


DELETE /api/v1/management/databases/{databaseId}/repositories/{repositoryId}

Section titled “DELETE /api/v1/management/databases/{databaseId}/repositories/{repositoryId}”

Deletes a repository and all its entities.

Response (204 No Content): Empty body on success.


Define schemas for entity validation:

{
"schema": {
"name": {
"type": "string",
"required": true,
"minLength": 1,
"maxLength": 100
},
"email": {
"type": "string",
"required": true,
"pattern": "^[^@]+@[^@]+\\.[^@]+$"
},
"age": {
"type": "number",
"required": false,
"min": 0,
"max": 150
},
"isActive": {
"type": "boolean",
"required": false,
"default": true
},
"tags": {
"type": "array",
"required": false,
"items": { "type": "string" }
}
}
}
TypeDescriptionValidation Options
stringText valueminLength, maxLength, pattern
numberNumeric valuemin, max
booleanTrue/false-
arrayList of valuesitems, minItems, maxItems
objectNested objectproperties

// Create repository
var createResult = await client.Repositories.CreateAsync(
"db_abc123",
new CreateRepositoryRequest(
Name: "customers",
EntityName: "Customer",
Schema: new Dictionary<string, SchemaField>
{
["name"] = new() { Type = "string", Required = true },
["email"] = new() { Type = "string", Required = true },
["tier"] = new() { Type = "string", Required = false }
}
)
);
// List repositories
var listResult = await client.Repositories.ListAsync("db_abc123");
foreach (var repo in listResult.Value.Repositories)
{
Console.WriteLine($"{repo.Name} ({repo.EntityName}): {repo.ItemCount} items");
}
// Get repository
var repoResult = await client.Repositories.GetAsync("db_abc123", "repo_abc123");
// Delete repository
var deleteResult = await client.Repositories.DeleteAsync("db_abc123", "repo_abc123");

FeatureRepositoryRaw Items
Schema validationYesNo
Auto-generated IDsYesNo
TimestampsAutomaticManual
Type safety (SDK)YesNo
FlexibilityStructuredFreeform