

Granular API key management with per-form access controls, expiration dates, and rate limits.
API for Ninja Forms is the best, most powerful, and feature-complete REST API solution for Ninja Forms. Effortlessly export and integrate your form submissions with external applications, webhooks, and analytics platforms with unparalleled speed, reliability, and security.
Whether you need automated Excel reporting, instant PDF downloads, structured JSON data feeds, or real-time data synchronization, API for Ninja Forms delivers a best-in-class integration experience built for modern developers and business workflows.
page/per_page or cursor sync via since_id/before_id./form/{id}/submission/{sub_id}) with cross-form ownership validation.Pass your API key in the standard HTTP Authorization header:
Authorization: Bearer YOUR_API_KEY
Discover Authorized Forms:
GET /wp-json/nf-submissions/v1/forms
Returns all forms the authenticated key is authorized to access, with total submission counts and field counts.
Retrieve Submissions (with Pagination & Sorting):
GET /wp-json/nf-submissions/v1/form/{form_id}
Query parameters:
page (default: 1): Page number for offset pagination.per_page / limit (default: 50, max: 500): Number of records per page.offset: Explicit record offset (overrides page).since_id / after_id: Retrieve only submissions with ID greater than this value (cursor pagination).before_id / max_id: Retrieve only submissions with ID less than this value.order: asc (default) or desc.orderby: date (default), id, title, or modified.begin_date & end_date: Filter by submission date range (YYYY-MM-DD).format: json (default), csv, xlsx, pdf, xml, or jsonl.Retrieve Single Submission:
GET /wp-json/nf-submissions/v1/form/{form_id}/submission/{submission_id}
Returns the exact submission record. Validates that the submission belongs to the specified form.
Retrieve Form Field Metadata:
GET /wp-json/nf-submissions/v1/form/{form_id}/fields
Returns the list of field labels, keys, and types for the specified form.
When retrieving submissions in JSON format, standard pagination headers are included in the response:
* X-WP-Total: Total count of matching submissions.
* X-WP-TotalPages: Total calculated pages.
* X-WP-Page: Current page number.
* X-WP-PerPage: Records per page limit.
* X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset: Rate-limiting status (if enabled).
When payload encryption is enabled on an API key:
* Text Feeds (JSON, CSV, XML, JSONL): Encrypted as a JSON envelope containing iv, tag, and ciphertext.
* Binary Streams (PDF, XLSX): Delivered as raw binary (.enc extension) with cryptographic headers (X-Crypto-IV, X-Crypto-Tag, X-Crypto-Nonce, X-Crypto-Algorithm).
$data = json_decode( $response, true );
// Graceful error handling for invalid API key or server error
if ( 200 !== $http_status || ! is_array( $data ) || isset( $data[‘code’] ) ) {
$error = $data[‘message’] ?? ‘Failed to retrieve forms’;
exit( “API Error ({$http_status}): {$error}\n” );
}
foreach ( $data as $form ) {
echo “Form ID: {$form[‘id’]} | Title: {$form[‘title’]} | Submissions: {$form[‘submissions_count’]}\n”;
}
`
$data = json_decode( $response, true );
if ( 200 !== $http_status || ! is_array( $data ) || isset( $data[‘code’] ) ) {
$error = $data[‘message’] ?? ‘Failed to retrieve submissions’;
exit( “API Error ({$http_status}): {$error}\n” );
}
$submissions = $data;
`
if ( 200 === $http_status ) {
file_put_contents( ‘submissions.pdf’, $file_contents );
} else {
$error = json_decode( $file_contents, true );
echo “API Error ({$http_status}): ” . ( $error[‘message’] ?? ‘Download failed’ ) . “\n”;
}
`
if ( is_wp_error( $response ) ) {
exit( ‘Network Error: ‘ . $response->get_error_message() );
}
$status = wp_remote_retrieve_response_code( $response );
$data = json_decode( wp_remote_retrieve_body( $response ), true );
// Graceful error handling for invalid API key or server error
if ( 200 !== $status || ! is_array( $data ) || isset( $data[‘code’] ) ) {
$error = $data[‘message’] ?? ‘Failed to retrieve forms’;
exit( “API Error ({$status}): {$error}\n” );
}
foreach ( $data as $form ) {
echo “Form ID: {$form[‘id’]} | Title: {$form[‘title’]} | Submissions: {$form[‘submissions_count’]}\n”;
}
`
if ( is_wp_error( $response ) ) {
exit( ‘Network Error: ‘ . $response->get_error_message() );
}
$status = wp_remote_retrieve_response_code( $response );
$data = json_decode( wp_remote_retrieve_body( $response ), true );
if ( 200 !== $status || ! is_array( $data ) || isset( $data[‘code’] ) ) {
$error = $data[‘message’] ?? ‘Failed to retrieve submissions’;
exit( “API Error ({$status}): {$error}\n” );
}
$submissions = $data;
`
This plugin bundles and utilizes the following open-source library:
For support and feature requests, please visit https://sightfactory.com