Skip to content

Create

Creates a new record for the entity.

http
POST /api/{entity}
Content-Type: application/json

Request Body

Send the entity as a JSON object. Relationship fields only require the id:

http
POST /api/product
Content-Type: application/json

{
  "reference": "AB-001",
  "name": "Headphones",
  "price": 199.99,
  "category": { "id": 1 },
  "status": "IN_STOCK"
}

Response

200 OK — the created entity, with all fields populated (including resolved relationships):

json
{
  "reference": "AB-001",
  "name": "Headphones",
  "price": 199.99,
  "category": { "id": 1, "name": "Electronics" },
  "status": "IN_STOCK"
}

Notes

  • Auto-generated IDs: if the entity uses a generated ID (e.g., @GeneratedValue), the ID field must be omitted. Sending an ID for a generated-ID entity results in a 400 error.
  • Manual IDs: if the entity manages its own ID, the ID is required in the body. Sending a duplicate ID returns a 409 conflict.
  • Validation: all @NotNull, @Size, and other Jakarta Validation constraints are enforced on create.

Access Control

Requires the create authority for the entity. See RBAC.