Skip to main content

Create a Resource

The Create method adds a new entity to Deepser by sending an HTTP POST request with a JSON payload. The response returns the newly created entity, including its system-assigned ID.

Syntax

HTTP Method: POST

URL:

http://deepserhost/api/rest/[entities]/

Request body: A JSON object containing the fields for the new entity.

Example

The following request creates a new company:

URL:

http://deepserhost/api/rest/companies

Request body:


{
"name" : "ACME Portugal",
"description" : "ACME Portugal SA."
}

Response:


{
"name": "ACME Portugal",
"description": "ACME Portugal SA.",
"created_at": "2018-10-29 15:57:42",
"updated_at": "2018-10-29 15:57:42",
"entity_id": "8"
}

The entity_id field contains the unique identifier assigned to the newly created record.

note

Only fields included in the JSON payload are set. All other fields retain their default values. Ensure the field keys in your payload match the entity's field codes exactly.