/api/collections/{collection.name}/records
/api/collections/{collection.name}/records
Requires Authorization: Admin TOKEN
header
Create a new {collection.name} record.
Body parameters could be sent as application/json
or
multipart/form-data
.
File upload is supported only via multipart/form-data
.
Param | Type | Description |
---|---|---|
Optional
id
|
String |
15 characters string to store as record ID.
If not set, it will be auto generated. |
{#if field.required}
Required
{:else}
Optional
{/if}
{field.name}
|
{CommonHelper.getFieldValueType(field)} |
{#if field.type === "text"}
Plain text value.
{:else if field.type === "number"}
Number value.
{:else if field.type === "json"}
JSON array or object.
{:else if field.type === "email"}
Email address.
{:else if field.type === "url"}
URL address.
{:else if field.type === "file"}
FormData object. Set to null to delete already uploaded file(s).
{:else if field.type === "relation"}
Relation record {field.options?.maxSelect > 1 ? "ids" : "id"}.
{:else if field.type === "user"}
User {field.options?.maxSelect > 1 ? "ids" : "id"}.
{/if}
|
Param | Type | Description |
---|---|---|
expand | String |
Auto expand relations when returning the created record. Ex.:
The expanded relations will be appended to the record under the @expand property (eg. {`"@expand": {"rel1": {...}, ...}`} ). Only the
relations that the user has permissions to view will be expanded.
|