Creating Entries with the REST API v2

Introduction

The /entries and /forms/[FORM_ID]/entries endpoints are used to create entries.

Note: This endpoint is distinctly different from endpoints outlined in Submitting Forms with the REST API v2 which can be used to create entries by sending input values through the complete form submission process.

Authentication

See REST API v2 Authentication.

The capability gravityforms_edit_entries is required to use POST requests at these endpoints.
This can be filtered using gform_rest_api_capability_post_entries.

Creating an Entry

The /entries and /forms/[FORM_ID]/entries endpoint is used to create a single entry.

Method

These endpoints accept POST requests in order to create entries.

Path

/gf/v2/entries

or

/gf/v2/forms/[FORM_ID]/entries

Required Properties

The following properties are required when not using the form-specific endpoint.

KeyTypeDescription
form_idintegerThe Form ID for the entry.

Optional Properties

The request body can also include the following properties.

KeyTypeDescription
created_byintegerThe user ID of the entry submitter.
date_createdstringThe date the entry was created, in UTC.
ipstringThe IP address of the entry creator.
is_fulfilledintegerWhether the transaction has been fulfilled, if applicable.
is_readintegerWhether the entry has been read.
is_starredintegerWhether the entry is starred.
source_urlstringThe URL where the form was embedded.
statusstringThe status of the entry.
user_agentstringThe user agent string for the browser used to submit the entry.

Payment Properties

Payment properties only apply when payment fields are present.

KeyTypeDescription
payment_amountstringThe amount of the payment.
payment_datestringThe date of the payment.
payment_methodstringThe payment method for the payment.
payment_statusstringThe status of the payment.
transaction_idstringThe transaction ID for the payment.
transaction_typestringThe type of transaction.

Response

Success

A successful response will contain a JSON object of the newly created Entry Object.

KeyTypeDescription
[entry_property]mixedEntry properties of the Entry Object.

Failure

A failed response will provide a JSON string of the error code and message.

KeyTypeDescription
codestringError code.
missing_entry
messagestringHuman-readable error message.
data[status]integerHTTP response status code

Usage Examples

cURL Request

curl --location --request POST 'https://example.com/wp-json/gf/v2/entries' \
     --user 'ck_5f86565df60696c43af25f9194e106800770b8e9:cs_be0190310fefc061c564168670d0a96d68873c29' \
     --header 'Content-Type: application/json' \
     --data $'{
  "3": "neil@example.com",
  "4": "To the moon!",
  "form_id": 30,
  "1.6": "Armstrong",
  "1.3": "Neil"
}'

Response

{
  "form_id": 30,
  "1.3": "Neil",
  "1.6": "Armstrong",
  "3": "neil@example.com",
  "4": "To the moon!",
  "id": 159
}