Endpoint Actions
Endpoint actions call a URL directly from action schema.
Use endpoint actions when no custom client handler is needed.
Basic endpoint action
TS
export const usersSchema = {
resource: "users",
identity: {
key: "id",
param: "id"
},
actions: {
row: [
{
key: "archive",
label: "Archive",
icon: "lucide:archive",
endpoint: { url: "/api/users/:id/archive", method: "POST" },
refreshOnSuccess: true
}
]
}
} as const;Operation endpoint fallback
If an action does not define endpoint, VibeFlui can resolve from schema.endpoint.
TS
export const usersSchema = {
resource: "users",
identity: {
key: "id",
param: "id"
},
endpoint: {
delete: { url: "/api/users/:id", method: "DELETE" }
},
actions: {
delete: {
enabled: true,
label: "Delete",
icon: "lucide:trash-2",
variant: "danger",
confirm: true
}
}
} as const;Endpoint item shapes
TS
export const stringEndpoint = "/api/users";TS
export const objectEndpoint = {
url: "/api/users/:id/archive",
method: "POST",
headers: {
"Accept": "application/json"
},
query: {
source: "table"
}
} as const;Resolution with identity
TS
identity: {
key: "id",
param: "id"
}For row { id: "user_1" }, /api/users/:id/archive resolves to /api/users/user_1/archive.
Response contract
JSON
{
"status": true,
"code": 200,
"message": "User archived"
}When not to use endpoint actions
Use a registry handler instead when the action must:
- Open a local UI flow.
- Compose multiple requests.
- Use local preview state in documentation.
- Transform data before a request in custom ways.
- Integrate with an app-specific client.