Skip to main content

Create a Custom Field

POST 

/v2/settings/extensions/custom-apis/:custom_api_id/fields

Create a Custom Field

Request

Path Parameters

    custom_api_id stringrequired

    The id of the Custom API.

    Example: 3fa85f64-5717-4562-b3fc-2c963f66afa6

Body

    data object required
    anyOf
    type string

    Specifies the type of the resource object, use custom_field for Custom Field.

    name string

    Possible values: non-empty and <= 255 characters

    Specifies the name of this Custom Field.

    description string

    Possible values: <= 255 characters

    Specifies the description for this Custom API.

    slug string

    Possible values: non-empty and <= 63 characters

    Specifies a slug that must be unique within the scope of the Custom API. This slug will be value as the key in the JSON Object in all entries.

    field_type string

    Possible values: [string, integer, boolean, float]

    Specifies the type of the field. This field cannot be updated.

    use_as_url_slug boolean

    Enabling this field will mean Custom API Entries created in this Custom API will use this value in the URL instead of the id attribute. In order to set this field, the field must be a string, and unique, not allow null values, no entries have been created yet, and this field cannot be set to true on another custom field. This field cannot be updated. In addition to any validation rules you create, the values must be Unreserved URL Characters (i.e., be alpha-numeric, or one of -, ., _ or ~).

    presentation object
    sort_order integer

    Possible values: <= 1000

    Default value: 0

    Specifies the order of the field in the User Interface.

    links object
    meta object
    timestamps objectrequired
    validation object
    boolean object
    allow_null_values booleannull

    Default value: true

    When set to true, this allows null values for that field on Custom API Entries. When set to false, storing null values is not permitted.

    immutable booleannull

    When set to true, prevents changing the field.

Responses

Created

Schema
    data object required
    anyOf
    id uuid

    The unique identifier of the Custom Field.

    type string

    Specifies the type of the resource object, use custom_field for Custom Field.

    name string

    Possible values: non-empty and <= 255 characters

    Specifies the name of this Custom Field.

    description string

    Possible values: <= 255 characters

    Specifies the description for this Custom API.

    slug string

    Possible values: non-empty and <= 63 characters

    Specifies a slug that must be unique within the scope of the Custom API. This slug will be value as the key in the JSON Object in all entries.

    field_type string

    Possible values: [string, integer, boolean, float]

    Specifies the type of the field. This field cannot be updated.

    use_as_url_slug boolean

    Enabling this field will mean Custom API Entries created in this Custom API will use this value in the URL instead of the id attribute. In order to set this field, the field must be a string, and unique, not allow null values, no entries have been created yet, and this field cannot be set to true on another custom field. This field cannot be updated. In addition to any validation rules you create, the values must be Unreserved URL Characters (i.e., be alpha-numeric, or one of -, ., _ or ~).

    presentation object
    sort_order integer

    Possible values: <= 1000

    Default value: 0

    Specifies the order of the field in the User Interface.

    links object
    self uri
    meta object
    timestamps objectrequired
    updated_at stringrequired

    Specifies the date the entity is created.

    created_at stringrequired

    Specifies the date the entity is last updated.

    validation object
    boolean object
    allow_null_values booleannull

    Default value: true

    When set to true, this allows null values for that field on Custom API Entries. When set to false, storing null values is not permitted.

    immutable booleannull

    When set to true, prevents changing the field.

Loading...