New

is responsible for creating a new record in a given resource

Endpoint: /api/resources/[RESOURCE-ID]/actions/new

Method: POST

Request payload:

  • FormData object with all required fields for the given resource

Response:

  • meta

    • total - total number of records in the resource

    • perPage - number of records in a single page

    • page - number of requested page

    • direction- sorting direction, possible values asc,desc

    • sortBy- id of the sorting column

  • records - list of records with resource metadata

Example

Endpoint: https://demo.adminjs.co/admin/api/resources/User/actions/new

Payload:

{
    email: "client@adminjs.co",
    firstName: "ClientName",
    lastName: "ClientSurname",
    gender: "male",
    isMyFavourite: true
}

Last updated