Apply a reviewed personal table import with the Inbound API

Apply the exact table proposal you reviewed, check its application status, and verify the imported records.

Start with a prepared personal table import. Applying its proposal can create a table and start a separate job to import its rows. Use a test workspace and fictional data for the first run. The API key’s acting user needs permission to apply the table changes in that workspace.

Review the exact proposal

Use the base URL from API Access and load the API key from your secret manager. Set NIXA_PROPOSAL_ID to the proposal ID from the import session.

curl --silent --show-error --fail-with-body \
  "${NIXA_API_BASE_URL}/schema-changes/proposals/${NIXA_PROPOSAL_ID}" \
  -H "X-API-Key: ${NIXA_API_KEY}"

Check that data.status is ready, the proposed destination and fields match the source mapping, and the listed issues and impact are acceptable. For this example, proceed only with a proposal that creates a new personal table without destructive changes. Set NIXA_PROPOSAL_HASH to the complete data.proposalHash of that reviewed proposal.

Apply the reviewed proposal

Set NIXA_APPLICATION_KEY to a unique value for this application request. Keep that key with the proposal ID and hash so you can recover the same request if the response is interrupted. The application key is separate from the preparation’s importId. Leave confirmDestructive set to false for this example.

curl --silent --show-error --fail-with-body --include \
  --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}"

HTTP 202 means the application is queued, running, or being verified. For either 202 or 200, save data.application.applicationId and inspect data.application.status.

Check the application and the import separately

  1. Read GET /schema-changes/applications/{applicationId} using the returned application ID. Check data.status. If the application is still queued, running, or verifying, check it again later. If it shows failed or recovery_required, inspect that application and the original import session before attempting another application.
  2. When the application is verified, check the original import session using the import session ID. When the import itself shows completed, open the new table and verify a known row.

If the apply response is interrupted and you do not have an application ID, resend the same proposal ID, hash, application key, and confirmation value so the API can return the existing application. If the API reports 409, reload the proposal and check the original session. Review any changed or expired proposal before trying again.

Ask Mainbase AI

Ask about any feature in Mainbase. Find a setting, get step-by-step guidance, or troubleshoot a problem.

Open the AI assistant

Copy 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?