Fields
Add, change and remove the fields (columns) of a table. See Field types for every type and the values it accepts.
Background and examples: Field types
List or get fields
/v1/schema/table/field
Retrieves field(s) from a specified table within a project. Can fetch either a single field or all fields in the table. This endpoint provides detailed information about table columns including their data types, constraints, and metadata.
Parameters
-
projectuuid query required The GUID of the project containing the table. Format: GUID (e.g., "3fa85f64-5717-4562-b3fc-2c963f66afa6"). This identifies the project context for the field query.
-
tableinteger (int64) query required The ID of the table containing the fields. Format: long integer (e.g., 123). This specifies which table's field definitions to retrieve.
-
fieldinteger (int64) query The ID of a specific field to retrieve. Format: long integer (e.g., 456). When provided, returns only the specified field. When omitted, returns all fields in the table.
Responses
- 200 Successfully retrieved field(s). Response contains field metadata including: field ID, name, data type, max length, precision, scale, nullability, default value, auto-increment settings, and foreign key relationships.
- 400 Bad request. Invalid project GUID or table/field ID format.
- 401 Unauthorized. The user is not authenticated.
- 403 Forbidden. The user does not have Schema-level Read permission (Permission ID: 10) for this project.
- 404 Not found. The specified project, table, or field could not be found in the system.
- 500 Internal server error. An unexpected error occurred while retrieving field information.
Request
curl -X GET 'https://api.stellards.io/v1/schema/table/field?project=PROJECT_ID&table=TABLE_ID' \
-H 'Authorization: Bearer ACCESS_TOKEN'
const response = await fetch("https://api.stellards.io/v1/schema/table/field?project=PROJECT_ID&table=TABLE_ID", {
headers: {
Authorization: "Bearer ACCESS_TOKEN",
},
});
const result = await response.json();
console.log(result);
import requests
response = requests.get(
"https://api.stellards.io/v1/schema/table/field?project=PROJECT_ID&table=TABLE_ID",
headers={"Authorization": "Bearer ACCESS_TOKEN"},
)
print(response.json())
using System.Net.Http.Headers;
using var client = new HttpClient();
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", "ACCESS_TOKEN");
var response = await client.GetAsync("https://api.stellards.io/v1/schema/table/field?project=PROJECT_ID&table=TABLE_ID");
Console.WriteLine(await response.Content.ReadAsStringAsync());
uses
System.Classes, System.SysUtils, System.Net.HttpClient, System.Net.URLClient;
var
Client: THTTPClient;
Response: IHTTPResponse;
begin
Client := THTTPClient.Create;
try
Client.CustomHeaders['Authorization'] := 'Bearer ACCESS_TOKEN';
Response := Client.Get('https://api.stellards.io/v1/schema/table/field?project=PROJECT_ID&table=TABLE_ID');
Writeln(Response.ContentAsString);
finally
Client.Free;
end;
end;
Response 200
{
"isSuccess": true,
"messages": []
}
Create a field
/v1/schema/table/field
Creates a new field (column) in a specified table within a project. This endpoint adds a new column definition to the table schema. The field configuration includes data type, constraints, default values, and other column properties.
Parameters
-
projectuuid query required The GUID of the project containing the table. Format: GUID (e.g., "3fa85f64-5717-4562-b3fc-2c963f66afa6"). This identifies the project context where the field will be created.
-
tableinteger (int64) query required The ID of the table to add the field to. Format: long integer (e.g., 123). This specifies the target table for the new column.
Request body application/json
The field definition object containing the new field's properties.
-
namestring required The field's name, unique in the table.
-
typestring required The field type, as listed in Field types: for example NVarChar(255), Int, Decimal(18,2), Date, Json or Enum.
-
optionsstring[] For an Enum field: the full list of options. Leave it out on an update to keep the current ones.
-
replaceOptionsobject For an Enum field: per removed option, the option records that use it get instead, or null to clear them.
Responses
- 201 Field created successfully. Response contains the complete field definition including the newly assigned field ID, name, data type, and all configured properties.
- 400 Bad request. Returned if: 1) Field name already exists in the table, 2) Invalid data type specified, 3) Invalid field configuration (e.g., auto-increment on non-integer type), 4) Required properties missing from request body.
- 401 Unauthorized. The user is not authenticated.
- 403 Forbidden. The user does not have Schema-level Modify permission (Permission ID: 9) for this project.
- 404 Not found. The specified project, table, or referenced field type could not be found in the system.
- 500 Internal server error. An unexpected database error occurred while creating the field. The field may not have been created.
Request
curl -X POST 'https://api.stellards.io/v1/schema/table/field?project=PROJECT_ID&table=TABLE_ID' \
-H 'Authorization: Bearer ACCESS_TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"name": "Status",
"type": "Enum",
"options": [
"new",
"paid",
"shipped"
]
}'
const response = await fetch("https://api.stellards.io/v1/schema/table/field?project=PROJECT_ID&table=TABLE_ID", {
method: "POST",
headers: {
Authorization: "Bearer ACCESS_TOKEN",
"Content-Type": "application/json",
},
body: JSON.stringify({
"name": "Status",
"type": "Enum",
"options": [
"new",
"paid",
"shipped"
]
}),
});
const result = await response.json();
console.log(result);
import requests
response = requests.post(
"https://api.stellards.io/v1/schema/table/field?project=PROJECT_ID&table=TABLE_ID",
headers={"Authorization": "Bearer ACCESS_TOKEN"},
json={
"name": "Status",
"type": "Enum",
"options": ["new", "paid", "shipped"],
},
)
print(response.json())
using System.Net.Http.Headers;
using System.Text;
using var client = new HttpClient();
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", "ACCESS_TOKEN");
var body = new StringContent("""
{
"name": "Status",
"type": "Enum",
"options": [
"new",
"paid",
"shipped"
]
}
""", Encoding.UTF8, "application/json");
var response = await client.PostAsync("https://api.stellards.io/v1/schema/table/field?project=PROJECT_ID&table=TABLE_ID", body);
Console.WriteLine(await response.Content.ReadAsStringAsync());
uses
System.Classes, System.SysUtils, System.Net.HttpClient, System.Net.URLClient;
var
Client: THTTPClient;
Response: IHTTPResponse;
Body: TStringStream;
begin
Client := THTTPClient.Create;
Body := TStringStream.Create(
'{' +
' "name": "Status",' +
' "type": "Enum",' +
' "options": [' +
' "new",' +
' "paid",' +
' "shipped"' +
' ]' +
'}',
TEncoding.UTF8);
try
Client.CustomHeaders['Authorization'] := 'Bearer ACCESS_TOKEN';
Client.ContentType := 'application/json';
Response := Client.Post('https://api.stellards.io/v1/schema/table/field?project=PROJECT_ID&table=TABLE_ID', Body);
Writeln(Response.ContentAsString);
finally
Body.Free;
Client.Free;
end;
end;
Response 201
{
"messages": [],
"isSuccess": true,
"data": {
"id": 412,
"name": "Customers",
"type": "NVarChar(255)",
"options": [
"new",
"paid",
"shipped"
]
}
}
Update a field
/v1/schema/table/field
Updates an existing field's (column's) definition in a specified table. This allows modification of column properties such as name, data type, constraints, and other metadata. Note: Some changes may require data migration or may be restricted if data exists in the column.
Parameters
-
projectuuid query required The GUID of the project containing the table. Format: GUID (e.g., "3fa85f64-5717-4562-b3fc-2c963f66afa6"). This identifies the project context for the field update.
-
tableinteger (int64) query required The ID of the table containing the field. Format: long integer (e.g., 123). This specifies the table that owns the field being updated.
-
fieldinteger (int64) query required The ID of the field to update. Format: long integer (e.g., 456). This identifies which field definition to modify.
Request body application/json
The updated field definition object containing the new field properties. Note: Only properties included in the request will be updated; omitted properties remain unchanged.
-
namestring required The field's name, unique in the table.
-
typestring required The field type, as listed in Field types: for example NVarChar(255), Int, Decimal(18,2), Date, Json or Enum.
-
optionsstring[] For an Enum field: the full list of options. Leave it out on an update to keep the current ones.
-
replaceOptionsobject For an Enum field: per removed option, the option records that use it get instead, or null to clear them.
Responses
- 200 Field updated successfully. Response contains the complete updated field definition including field ID, name, data type, and all configured properties.
- 400 Bad request. Returned if: 1) New field name conflicts with an existing field in the table, 2) Invalid data type specified, 3) Data type change is incompatible with existing data, 4) Invalid constraint configuration, 5) Attempting to make a nullable field non-nullable when NULL values exist.
- 401 Unauthorized. The user is not authenticated.
- 403 Forbidden. The user does not have Schema-level Modify permission (Permission ID: 9) for this project.
- 404 Not found. The specified project, table, field, or referenced field type could not be found in the system.
- 500 Internal server error. An unexpected database error occurred during the field update. The field definition may not have been modified.
Request
curl -X PUT 'https://api.stellards.io/v1/schema/table/field?project=PROJECT_ID&table=TABLE_ID&field=FIELD_ID' \
-H 'Authorization: Bearer ACCESS_TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"name": "Status",
"type": "Enum",
"options": [
"new",
"paid",
"sent"
],
"replaceOptions": {
"shipped": "sent"
}
}'
const response = await fetch("https://api.stellards.io/v1/schema/table/field?project=PROJECT_ID&table=TABLE_ID&field=FIELD_ID", {
method: "PUT",
headers: {
Authorization: "Bearer ACCESS_TOKEN",
"Content-Type": "application/json",
},
body: JSON.stringify({
"name": "Status",
"type": "Enum",
"options": [
"new",
"paid",
"sent"
],
"replaceOptions": {
"shipped": "sent"
}
}),
});
const result = await response.json();
console.log(result);
import requests
response = requests.put(
"https://api.stellards.io/v1/schema/table/field?project=PROJECT_ID&table=TABLE_ID&field=FIELD_ID",
headers={"Authorization": "Bearer ACCESS_TOKEN"},
json={
"name": "Status",
"type": "Enum",
"options": ["new", "paid", "sent"],
"replaceOptions": {
"shipped": "sent",
},
},
)
print(response.json())
using System.Net.Http.Headers;
using System.Text;
using var client = new HttpClient();
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", "ACCESS_TOKEN");
var body = new StringContent("""
{
"name": "Status",
"type": "Enum",
"options": [
"new",
"paid",
"sent"
],
"replaceOptions": {
"shipped": "sent"
}
}
""", Encoding.UTF8, "application/json");
var response = await client.PutAsync("https://api.stellards.io/v1/schema/table/field?project=PROJECT_ID&table=TABLE_ID&field=FIELD_ID", body);
Console.WriteLine(await response.Content.ReadAsStringAsync());
uses
System.Classes, System.SysUtils, System.Net.HttpClient, System.Net.URLClient;
var
Client: THTTPClient;
Response: IHTTPResponse;
Body: TStringStream;
begin
Client := THTTPClient.Create;
Body := TStringStream.Create(
'{' +
' "name": "Status",' +
' "type": "Enum",' +
' "options": [' +
' "new",' +
' "paid",' +
' "sent"' +
' ],' +
' "replaceOptions": {' +
' "shipped": "sent"' +
' }' +
'}',
TEncoding.UTF8);
try
Client.CustomHeaders['Authorization'] := 'Bearer ACCESS_TOKEN';
Client.ContentType := 'application/json';
Response := Client.Put('https://api.stellards.io/v1/schema/table/field?project=PROJECT_ID&table=TABLE_ID&field=FIELD_ID', Body);
Writeln(Response.ContentAsString);
finally
Body.Free;
Client.Free;
end;
end;
Response 200
{
"messages": [],
"isSuccess": true,
"data": {
"id": 412,
"name": "Customers",
"type": "NVarChar(255)",
"options": [
"new",
"paid",
"shipped"
]
}
}
Delete a field
/v1/schema/table/field
Deletes a field (column) from a specified table. This permanently removes the field definition and all data stored in that column. Warning: This operation is irreversible and will result in data loss for all records in the column.
Parameters
-
projectuuid query required The GUID of the project containing the table. Format: GUID (e.g., "3fa85f64-5717-4562-b3fc-2c963f66afa6"). This identifies the project context for the field deletion.
-
tableinteger (int64) query required The ID of the table containing the field. Format: long integer (e.g., 123). This specifies the table from which the field will be removed.
-
fieldinteger (int64) query required The ID of the field to delete. Format: long integer (e.g., 456). This identifies which field/column will be permanently removed from the table schema.
Responses
- 200 Field deleted successfully. The field definition and all associated data have been permanently removed from the table.
- 400 Bad request. Returned if: 1) Invalid project GUID or table/field ID format, 2) The field is part of a primary key or has dependent foreign key relationships that prevent deletion.
- 401 Unauthorized. The user is not authenticated.
- 403 Forbidden. The user does not have Schema-level Modify permission (Permission ID: 9) for this project.
- 404 Not found. The specified project, table, or field could not be found in the system.
- 500 Internal server error. An unexpected database error occurred during field deletion. The field may or may not have been deleted.
Request
curl -X DELETE 'https://api.stellards.io/v1/schema/table/field?project=PROJECT_ID&table=TABLE_ID&field=FIELD_ID' \
-H 'Authorization: Bearer ACCESS_TOKEN'
const response = await fetch("https://api.stellards.io/v1/schema/table/field?project=PROJECT_ID&table=TABLE_ID&field=FIELD_ID", {
method: "DELETE",
headers: {
Authorization: "Bearer ACCESS_TOKEN",
},
});
const result = await response.json();
console.log(result);
import requests
response = requests.delete(
"https://api.stellards.io/v1/schema/table/field?project=PROJECT_ID&table=TABLE_ID&field=FIELD_ID",
headers={"Authorization": "Bearer ACCESS_TOKEN"},
)
print(response.json())
using System.Net.Http.Headers;
using var client = new HttpClient();
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", "ACCESS_TOKEN");
var response = await client.DeleteAsync("https://api.stellards.io/v1/schema/table/field?project=PROJECT_ID&table=TABLE_ID&field=FIELD_ID");
Console.WriteLine(await response.Content.ReadAsStringAsync());
uses
System.Classes, System.SysUtils, System.Net.HttpClient, System.Net.URLClient;
var
Client: THTTPClient;
Response: IHTTPResponse;
begin
Client := THTTPClient.Create;
try
Client.CustomHeaders['Authorization'] := 'Bearer ACCESS_TOKEN';
Response := Client.Delete('https://api.stellards.io/v1/schema/table/field?project=PROJECT_ID&table=TABLE_ID&field=FIELD_ID');
Writeln(Response.ContentAsString);
finally
Client.Free;
end;
end;
List fields Path-style route
/project/{project}/table/{table}/field
Retrieves all fields from a table using RESTful route parameters. This endpoint returns a collection of all field definitions for the specified table.
Parameters
-
projectuuid path required The GUID of the project containing the table. Format: GUID (e.g., "3fa85f64-5717-4562-b3fc-2c963f66afa6"). Provided as a route parameter in the URL path.
-
tableinteger (int64) path required The ID of the table to retrieve fields from. Format: long integer (e.g., 123). Provided as a route parameter in the URL path.
Responses
- 200 Successfully retrieved all fields. Response contains an array of field objects, each including: field ID, name, data type, max length, precision, scale, nullability, default value, auto-increment settings, unique constraints, primary key status, and foreign key relationships.
- 400 Bad request. Invalid project GUID or table ID format in the route parameters.
- 401 Unauthorized. The user is not authenticated.
- 403 Forbidden. The user does not have Schema-level Read permission (Permission ID: 10) for this project.
- 404 Not found. The specified project or table could not be found in the system.
- 500 Internal server error. An unexpected error occurred while retrieving field information.
Request
curl -X GET 'https://api.stellards.io/project/PROJECT_ID/table/TABLE_ID/field' \
-H 'Authorization: Bearer ACCESS_TOKEN'
const response = await fetch("https://api.stellards.io/project/PROJECT_ID/table/TABLE_ID/field", {
headers: {
Authorization: "Bearer ACCESS_TOKEN",
},
});
const result = await response.json();
console.log(result);
import requests
response = requests.get(
"https://api.stellards.io/project/PROJECT_ID/table/TABLE_ID/field",
headers={"Authorization": "Bearer ACCESS_TOKEN"},
)
print(response.json())
using System.Net.Http.Headers;
using var client = new HttpClient();
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", "ACCESS_TOKEN");
var response = await client.GetAsync("https://api.stellards.io/project/PROJECT_ID/table/TABLE_ID/field");
Console.WriteLine(await response.Content.ReadAsStringAsync());
uses
System.Classes, System.SysUtils, System.Net.HttpClient, System.Net.URLClient;
var
Client: THTTPClient;
Response: IHTTPResponse;
begin
Client := THTTPClient.Create;
try
Client.CustomHeaders['Authorization'] := 'Bearer ACCESS_TOKEN';
Response := Client.Get('https://api.stellards.io/project/PROJECT_ID/table/TABLE_ID/field');
Writeln(Response.ContentAsString);
finally
Client.Free;
end;
end;
Response 200
{
"messages": [],
"isSuccess": true,
"data": [
{
"id": 412,
"name": "Customers",
"type": "NVarChar(255)",
"options": [
"new",
"paid",
"shipped"
]
}
]
}
Create a field Path-style route
/project/{project}/table/{table}/field
Creates a new field (column) in a table using RESTful route parameters. This endpoint adds a new column definition to the table schema.
Parameters
-
projectuuid path required The GUID of the project containing the table. Format: GUID (e.g., "3fa85f64-5717-4562-b3fc-2c963f66afa6"). Provided as a route parameter in the URL path.
-
tableinteger (int64) path required The ID of the table to add the field to. Format: long integer (e.g., 123). Provided as a route parameter in the URL path.
Request body application/json
The field definition object in the request body. See FieldController.AddAsync for complete field definition schema.
-
namestring required The field's name, unique in the table.
-
typestring required The field type, as listed in Field types: for example NVarChar(255), Int, Decimal(18,2), Date, Json or Enum.
-
optionsstring[] For an Enum field: the full list of options. Leave it out on an update to keep the current ones.
-
replaceOptionsobject For an Enum field: per removed option, the option records that use it get instead, or null to clear them.
Responses
- 201 Field created successfully. Response contains the complete field definition including the newly assigned field ID and all configured properties.
- 400 Bad request. Field name already exists, invalid data type, or invalid field configuration.
- 401 Unauthorized. The user is not authenticated.
- 403 Forbidden. The user does not have Schema-level Modify permission (Permission ID: 9) for this project.
- 404 Not found. The specified project, table, or referenced field type could not be found.
- 500 Internal server error. An unexpected database error occurred while creating the field.
Request
curl -X POST 'https://api.stellards.io/project/PROJECT_ID/table/TABLE_ID/field' \
-H 'Authorization: Bearer ACCESS_TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"name": "Status",
"type": "Enum",
"options": [
"new",
"paid",
"shipped"
]
}'
const response = await fetch("https://api.stellards.io/project/PROJECT_ID/table/TABLE_ID/field", {
method: "POST",
headers: {
Authorization: "Bearer ACCESS_TOKEN",
"Content-Type": "application/json",
},
body: JSON.stringify({
"name": "Status",
"type": "Enum",
"options": [
"new",
"paid",
"shipped"
]
}),
});
const result = await response.json();
console.log(result);
import requests
response = requests.post(
"https://api.stellards.io/project/PROJECT_ID/table/TABLE_ID/field",
headers={"Authorization": "Bearer ACCESS_TOKEN"},
json={
"name": "Status",
"type": "Enum",
"options": ["new", "paid", "shipped"],
},
)
print(response.json())
using System.Net.Http.Headers;
using System.Text;
using var client = new HttpClient();
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", "ACCESS_TOKEN");
var body = new StringContent("""
{
"name": "Status",
"type": "Enum",
"options": [
"new",
"paid",
"shipped"
]
}
""", Encoding.UTF8, "application/json");
var response = await client.PostAsync("https://api.stellards.io/project/PROJECT_ID/table/TABLE_ID/field", body);
Console.WriteLine(await response.Content.ReadAsStringAsync());
uses
System.Classes, System.SysUtils, System.Net.HttpClient, System.Net.URLClient;
var
Client: THTTPClient;
Response: IHTTPResponse;
Body: TStringStream;
begin
Client := THTTPClient.Create;
Body := TStringStream.Create(
'{' +
' "name": "Status",' +
' "type": "Enum",' +
' "options": [' +
' "new",' +
' "paid",' +
' "shipped"' +
' ]' +
'}',
TEncoding.UTF8);
try
Client.CustomHeaders['Authorization'] := 'Bearer ACCESS_TOKEN';
Client.ContentType := 'application/json';
Response := Client.Post('https://api.stellards.io/project/PROJECT_ID/table/TABLE_ID/field', Body);
Writeln(Response.ContentAsString);
finally
Body.Free;
Client.Free;
end;
end;
Response 201
{
"messages": [],
"isSuccess": true,
"data": {
"id": 412,
"name": "Customers",
"type": "NVarChar(255)",
"options": [
"new",
"paid",
"shipped"
]
}
}
Get a field Path-style route
/project/{project}/table/{table}/field/{field}
Retrieves a specific field from a table using RESTful route parameters. This RESTful endpoint provides field details including data type, constraints, and metadata.
Parameters
-
projectuuid path required The GUID of the project containing the table. Format: GUID (e.g., "3fa85f64-5717-4562-b3fc-2c963f66afa6"). Provided as a route parameter in the URL path.
-
tableinteger (int64) path required The ID of the table containing the field. Format: long integer (e.g., 123). Provided as a route parameter in the URL path.
-
fieldinteger (int64) path required The ID of the specific field to retrieve. Format: long integer (e.g., 456). Provided as a route parameter in the URL path.
Responses
- 200 Successfully retrieved the field. Response contains complete field metadata including: field ID, name, data type, max length, precision, scale, nullability, default value, auto-increment settings, unique constraints, primary key status, and foreign key relationships.
- 400 Bad request. Invalid project GUID or table/field ID format in the route parameters.
- 401 Unauthorized. The user is not authenticated.
- 403 Forbidden. The user does not have Schema-level Read permission (Permission ID: 10) for this project.
- 404 Not found. The specified project, table, or field could not be found in the system.
- 500 Internal server error. An unexpected error occurred while retrieving field information.
Request
curl -X GET 'https://api.stellards.io/project/PROJECT_ID/table/TABLE_ID/field/FIELD_ID' \
-H 'Authorization: Bearer ACCESS_TOKEN'
const response = await fetch("https://api.stellards.io/project/PROJECT_ID/table/TABLE_ID/field/FIELD_ID", {
headers: {
Authorization: "Bearer ACCESS_TOKEN",
},
});
const result = await response.json();
console.log(result);
import requests
response = requests.get(
"https://api.stellards.io/project/PROJECT_ID/table/TABLE_ID/field/FIELD_ID",
headers={"Authorization": "Bearer ACCESS_TOKEN"},
)
print(response.json())
using System.Net.Http.Headers;
using var client = new HttpClient();
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", "ACCESS_TOKEN");
var response = await client.GetAsync("https://api.stellards.io/project/PROJECT_ID/table/TABLE_ID/field/FIELD_ID");
Console.WriteLine(await response.Content.ReadAsStringAsync());
uses
System.Classes, System.SysUtils, System.Net.HttpClient, System.Net.URLClient;
var
Client: THTTPClient;
Response: IHTTPResponse;
begin
Client := THTTPClient.Create;
try
Client.CustomHeaders['Authorization'] := 'Bearer ACCESS_TOKEN';
Response := Client.Get('https://api.stellards.io/project/PROJECT_ID/table/TABLE_ID/field/FIELD_ID');
Writeln(Response.ContentAsString);
finally
Client.Free;
end;
end;
Response 200
{
"messages": [],
"isSuccess": true,
"data": [
{
"id": 412,
"name": "Customers",
"type": "NVarChar(255)",
"options": [
"new",
"paid",
"shipped"
]
}
]
}
Update a field Path-style route
/project/{project}/table/{table}/field/{field}
Updates an existing field's definition using RESTful route parameters. This allows modification of column properties.
Parameters
-
projectuuid path required The GUID of the project containing the table. Format: GUID. Provided as a route parameter in the URL path.
-
tableinteger (int64) path required The ID of the table containing the field. Format: long integer. Provided as a route parameter in the URL path.
-
fieldinteger (int64) path required The ID of the field to update. Format: long integer. Provided as a route parameter in the URL path.
Request body application/json
The updated field definition in the request body. See FieldController.UpdateAsync for complete schema.
-
namestring required The field's name, unique in the table.
-
typestring required The field type, as listed in Field types: for example NVarChar(255), Int, Decimal(18,2), Date, Json or Enum.
-
optionsstring[] For an Enum field: the full list of options. Leave it out on an update to keep the current ones.
-
replaceOptionsobject For an Enum field: per removed option, the option records that use it get instead, or null to clear them.
Responses
- 200 Field updated successfully. Response contains the complete updated field definition.
- 400 Bad request. Field name conflicts, invalid data type, or incompatible changes.
- 401 Unauthorized. The user is not authenticated.
- 403 Forbidden. The user does not have Schema-level Modify permission (Permission ID: 9).
- 404 Not found. The specified project, table, or field could not be found.
- 500 Internal server error. An unexpected database error occurred during field update.
Request
curl -X PUT 'https://api.stellards.io/project/PROJECT_ID/table/TABLE_ID/field/FIELD_ID' \
-H 'Authorization: Bearer ACCESS_TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"name": "Status",
"type": "Enum",
"options": [
"new",
"paid",
"sent"
],
"replaceOptions": {
"shipped": "sent"
}
}'
const response = await fetch("https://api.stellards.io/project/PROJECT_ID/table/TABLE_ID/field/FIELD_ID", {
method: "PUT",
headers: {
Authorization: "Bearer ACCESS_TOKEN",
"Content-Type": "application/json",
},
body: JSON.stringify({
"name": "Status",
"type": "Enum",
"options": [
"new",
"paid",
"sent"
],
"replaceOptions": {
"shipped": "sent"
}
}),
});
const result = await response.json();
console.log(result);
import requests
response = requests.put(
"https://api.stellards.io/project/PROJECT_ID/table/TABLE_ID/field/FIELD_ID",
headers={"Authorization": "Bearer ACCESS_TOKEN"},
json={
"name": "Status",
"type": "Enum",
"options": ["new", "paid", "sent"],
"replaceOptions": {
"shipped": "sent",
},
},
)
print(response.json())
using System.Net.Http.Headers;
using System.Text;
using var client = new HttpClient();
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", "ACCESS_TOKEN");
var body = new StringContent("""
{
"name": "Status",
"type": "Enum",
"options": [
"new",
"paid",
"sent"
],
"replaceOptions": {
"shipped": "sent"
}
}
""", Encoding.UTF8, "application/json");
var response = await client.PutAsync("https://api.stellards.io/project/PROJECT_ID/table/TABLE_ID/field/FIELD_ID", body);
Console.WriteLine(await response.Content.ReadAsStringAsync());
uses
System.Classes, System.SysUtils, System.Net.HttpClient, System.Net.URLClient;
var
Client: THTTPClient;
Response: IHTTPResponse;
Body: TStringStream;
begin
Client := THTTPClient.Create;
Body := TStringStream.Create(
'{' +
' "name": "Status",' +
' "type": "Enum",' +
' "options": [' +
' "new",' +
' "paid",' +
' "sent"' +
' ],' +
' "replaceOptions": {' +
' "shipped": "sent"' +
' }' +
'}',
TEncoding.UTF8);
try
Client.CustomHeaders['Authorization'] := 'Bearer ACCESS_TOKEN';
Client.ContentType := 'application/json';
Response := Client.Put('https://api.stellards.io/project/PROJECT_ID/table/TABLE_ID/field/FIELD_ID', Body);
Writeln(Response.ContentAsString);
finally
Body.Free;
Client.Free;
end;
end;
Response 200
{
"messages": [],
"isSuccess": true,
"data": {
"id": 412,
"name": "Customers",
"type": "NVarChar(255)",
"options": [
"new",
"paid",
"shipped"
]
}
}
Delete a field Path-style route
/project/{project}/table/{table}/field/{field}
Deletes a field (column) from a table using RESTful route parameters. This permanently removes the field and all its data. Warning: This operation is irreversible and will result in data loss.
Parameters
-
projectuuid path required The GUID of the project containing the table. Format: GUID. Provided as a route parameter in the URL path.
-
tableinteger (int64) path required The ID of the table containing the field. Format: long integer. Provided as a route parameter in the URL path.
-
fieldinteger (int64) path required The ID of the field to delete. Format: long integer. Provided as a route parameter in the URL path.
Responses
- 200 Field deleted successfully. The field definition and all associated data have been permanently removed.
- 400 Bad request. The field may be part of a primary key or have dependent foreign key relationships.
- 401 Unauthorized. The user is not authenticated.
- 403 Forbidden. The user does not have Schema-level Modify permission (Permission ID: 9).
- 404 Not found. The specified project, table, or field could not be found.
- 500 Internal server error. An unexpected database error occurred during field deletion.
Request
curl -X DELETE 'https://api.stellards.io/project/PROJECT_ID/table/TABLE_ID/field/FIELD_ID' \
-H 'Authorization: Bearer ACCESS_TOKEN'
const response = await fetch("https://api.stellards.io/project/PROJECT_ID/table/TABLE_ID/field/FIELD_ID", {
method: "DELETE",
headers: {
Authorization: "Bearer ACCESS_TOKEN",
},
});
const result = await response.json();
console.log(result);
import requests
response = requests.delete(
"https://api.stellards.io/project/PROJECT_ID/table/TABLE_ID/field/FIELD_ID",
headers={"Authorization": "Bearer ACCESS_TOKEN"},
)
print(response.json())
using System.Net.Http.Headers;
using var client = new HttpClient();
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", "ACCESS_TOKEN");
var response = await client.DeleteAsync("https://api.stellards.io/project/PROJECT_ID/table/TABLE_ID/field/FIELD_ID");
Console.WriteLine(await response.Content.ReadAsStringAsync());
uses
System.Classes, System.SysUtils, System.Net.HttpClient, System.Net.URLClient;
var
Client: THTTPClient;
Response: IHTTPResponse;
begin
Client := THTTPClient.Create;
try
Client.CustomHeaders['Authorization'] := 'Bearer ACCESS_TOKEN';
Response := Client.Delete('https://api.stellards.io/project/PROJECT_ID/table/TABLE_ID/field/FIELD_ID');
Writeln(Response.ContentAsString);
finally
Client.Free;
end;
end;