Restore a deleted table field with the Inbound API
Restore a retained field by ID and verify its saved values on a known record.
Use an active test table whose schema the API key’s acting user can manage. Use a deleted custom field with a known ID and a known record that held a value. If you only know the field’s name, find and restore it under Deleted fields in Mainbase.
Prepare the restore
Read GET /entities/{entityId} and check data.tableCapabilities.canManageSchema. Replace 123 with the table ID and "456" with the deleted field’s original id from your schema records, as a JSON string. Use the base URL from API Access and load the key from your secret manager.
curl --silent --show-error --fail-with-body \
--request POST "${NIXA_API_BASE_URL}/schema-changes/proposals" \
-H "X-API-Key: ${NIXA_API_KEY}" \
-H 'Content-Type: application/json' \
--data '{"operation":{"kind":"restore_field","entityId":123,"fieldId":"456"}}'
In the HTTP 201 response, check that data.status is ready. In data.operations, look for create_field with a restoredFromTrashHash. Check the intended field ID and name before applying. If data.issues reports a name collision or an unavailable field, check Deleted fields and the active schema before trying again.
Apply and verify the retained value
Set NIXA_PROPOSAL_ID and NIXA_PROPOSAL_HASH from the reviewed proposal. Choose a unique NIXA_APPLICATION_KEY for this restore.
curl --silent --show-error --fail-with-body \
--request POST "${NIXA_API_BASE_URL}/schema-changes/proposals/${NIXA_PROPOSAL_ID}/apply" \
-H "X-API-Key: ${NIXA_API_KEY}" \
-H 'Content-Type: application/json' \
--data "{\"proposalHash\":\"${NIXA_PROPOSAL_HASH}\",\"idempotencyKey\":\"${NIXA_APPLICATION_KEY}\",\"confirmDestructive\":false}"
- Save
data.application.applicationId. ReadGET /schema-changes/applications/{applicationId}untildata.statusreachesverified. If it reportsfailedorrecovery_required, inspect the application before starting another proposal. - Reread the table schema. Verify the original field ID is in
data.fieldsand note itsdataKey. Read the known record withGET /entities/{entityId}/records/{recordId}and check its value under that key. Use a key whose acting user can read that record and field.
If the response to the apply request is interrupted, check whether the field has returned before preparing another restore. Reuse the same proposal ID, hash, application key, and confirmation value if you retry the original request.
Ask Mainbase AI
Ask about any feature in Mainbase. Find a setting, get step-by-step guidance, or troubleshoot a problem.
Open the AI assistantCopy a question to get started
- How do I create a Kanban view?
- How do I invite a teammate?
- Why is a record missing from this view?