Get Form

API endpoint to retrieve details about a specific form

Get Form

This endpoint retrieves detailed information about a specific form.

Endpoint

GET /forms/{formId}

Authentication

Requires an API key.

Path Parameters

ParameterTypeDescription
formIdstringThe ID of the form to retrieve

Response

200: OK

Returns an object containing detailed information about the form.

Response Fields:

FieldTypeDescription
idstringUnique identifier for the form
namestringName of the form
descriptionstringDescription of the form
formTypestringType of form (e.g., "feedback", "contact", "waitlist")
createdAtstringISO 8601 timestamp when the form was created
updatedAtstringISO 8601 timestamp when the form was last updated
submissionCountintegerNumber of submissions received
emailSettingsobjectEmail notification settings for the form
emailSettings.enabledbooleanWhether email notifications are enabled
emailSettings.developerNotificationsEnabledbooleanWhether developer notifications are enabled
usersJoinedSettingsobjectUsers joined counter settings (for waitlist forms)
usersJoinedSettings.enabledbooleanWhether the users joined counter is enabled
usersJoinedSettings.countintegerNumber of users who have joined the waitlist

Example Response:

{
  "id": "form_123abc",
  "name": "Customer Feedback",
  "description": "Collect feedback from customers",
  "formType": "feedback",
  "createdAt": "2023-01-15T12:00:00Z",
  "updatedAt": "2023-01-16T09:30:00Z",
  "submissionCount": 42,
  "emailSettings": {
    "enabled": true,
    "developerNotificationsEnabled": true
  },
  "usersJoinedSettings": null
}

400: Bad Request

Returned when the request parameters are invalid.

401: Unauthorized

Returned when the API key is missing or invalid.

403: Forbidden

Returned when the API key does not have access to the specified form.

404: Not Found

Returned when the form with the specified ID does not exist.

429: Too Many Requests

Returned when the rate limit is exceeded.

Example Request

curl -X GET "https://app.mantlz.com/api/v1/forms/form_123abc" \
  -H "X-API-Key: mk_your_api_key_here"

Example in JavaScript

async function getForm(formId) {
  try {
    const response = await fetch(`https://app.mantlz.com/api/v1/forms/${formId}`, {
      method: 'GET',
      headers: {
        'X-API-Key': 'mk_your_api_key_here'
      }
    });
    
    if (!response.ok) {
      throw new Error(`API error: ${response.status}`);
    }
    
    const data = await response.json();
    return data;
  } catch (error) {
    console.error('Error getting form details:', error);
    throw error;
  }
}