Endpoint:

POST /api/v1/properties/[property_id]/elements.json

Creates a new element and returns its GET response.

Response:

{
    "body": "Welcome to Sapwood's documentation! ...",
    "created_at": "2016-12-09T14:44:39.990Z",
    "description": "Welcome to Sapwood! ...",
    "id": 1,
    "name": "Overview",
    "position": "1",
    "slug": "overview",
    "template_name": "Documentation:Guide",
    "title": "Overview",
    "updated_at": "2016-12-10T16:57:37.807Z"
}

Required Parameters:

Note that this is a POST request, which means your parameters should be sent as JSON and not as query parameters.

api_key

The property's API key for the property under which you wish to create the element.

template_name

The name of the template under which the element should be created. It must match the title of a template within the property.

[primary_field]

Each template must specify a primary_field attribute (which is what sets the element's title attribute, along with some other logic). What this parameter is will change depending on the template. You will need to consult your property's configuration to find the primary field.

Optional Parameters:

The other parameters you wish to include will also depend on your the new element's template's configuration.

One GOTCHA! here is that an element field should be sent as an integer representing the id of element to which you're creating the association, while an elements field can be a series of comma-separated integers also representing id attributes.