Restore Deleted Media

Add MCP server to your AI tool

Allow AI tools and LLMs to interact with the API documentation portal through MCP.

MCP server URL

https://apidocs.zerionsoftware.com/doc/iformbuilder-v81/mcp

Standard setup for AI tools providing an mcp.json file

mcp.json
{
  "iFormBuilder V81 MCP server": {
    "url": "https://apidocs.zerionsoftware.com/doc/iformbuilder-v81/mcp"
  }
}

Close
POST /profiles/{profile_id}/pages/{page_id}/media_restore

Restores media files that were deleted from a versioned S3 bucket (for example via DELETE .../media_upload) by removing the S3 delete marker, making the object readable again.

Request body

Send either a JSON array of { "url": ... } objects or a single { "url": ... } object. Both public https://...amazonaws.com/... URLs and privates3://{bucket}/{key} URLs (as returned for private media) are accepted. A request may contain at most 200 items; 201 or more returns 413 and nothing is restored.

Response

A plain JSON array with one entry per submitted item, in request order. Each entry has url and status; reason is added on PERMANENTLY_DELETED and RESTORE_FAILED, and version_id is added only on RESTORED.

status reason Meaning
RESTORED - Delete marker removed; the object is readable again. version_id is the id of the removed delete marker.
ALREADY_ACTIVE - The latest version has no delete marker. A no-op success, so replaying a request is idempotent.
PERMANENTLY_DELETED LIFECYCLE_EXPIRED, OBJECT_NEVER_EXISTED Nothing to restore: the versions have been expired by the bucket lifecycle, or no object with that key ever existed.
RESTORE_FAILED URL_REQUIRED, URL_OUT_OF_SCOPE, S3_CLIENT_UNAVAILABLE, AWS_SDK_ERROR, or the raw AWS error code returned by S3 (for example AccessDenied or NoSuchBucket) The item failed. Failures are per item and do not abort the rest of the batch (barring a server-side media configuration error, which fails the whole request). Malformed URLs and URLs on non-S3 hosts are reported as URL_OUT_OF_SCOPE.

HTTP status

  • 200 no item failed (RESTORED, ALREADY_ACTIVE and PERMANENTLY_DELETED all count as non-failures)
  • 207 some items failed and some did not
  • 400 every item failed, or the body was empty or malformed
  • 413 more than 200 items in one request
  • 401 no valid bearer token
  • 403 BASIC user, no record-modify permission on the page, or another profile's profile_id
  • 404 invalid page_id, or the page does not belong to the profile

Authorization

Standard bearer token. BASIC users are denied with 403 before any S3 call; COMPANY and SERVER users are allowed. The caller must also be able to modify records on the page.

Scope

Every URL must belong to the page in the path: its key must contain {profile_id}/{data_table_name}, where the data table name is resolved server-side from (profile_id, page_id). URLs outside that scope come back as RESTORE_FAILED / URL_OUT_OF_SCOPE rather than being looked up in S3.

Headers

  • Authorization string

    e.g. Bearer {access_token}

Path parameters

  • profile_id string Required

    id of the profile

  • page_id number Required

    id of the page

application/json
Body array[object] | object Required
One of:

Not more than 200 elements.

Hide attribute Show attribute object
  • url string Required

    public https://...amazonaws.com/... or privates3://{bucket}/{key} url of the media file

Responses

  • 200 application/json

    OK - no item in the batch failed (every status is RESTORED, ALREADY_ACTIVE or PERMANENTLY_DELETED).

    Hide response attributes Show response attributes object
    • url string | null Required

      the url exactly as submitted (null when the item had no url)

    • status string Required

      per-asset outcome

      Values are RESTORED, ALREADY_ACTIVE, PERMANENTLY_DELETED, or RESTORE_FAILED.

    • reason string

      present only on PERMANENTLY_DELETED and RESTORE_FAILED

    • version_id string

      present only on RESTORED; the S3 version id of the delete marker that was removed

  • 207 application/json

    Multi-Status - some items succeeded and some failed. The body has the same shape as 200; inspect each item's status.

    Hide response attributes Show response attributes object
    • url string | null Required

      the url exactly as submitted (null when the item had no url)

    • status string Required

      per-asset outcome

      Values are RESTORED, ALREADY_ACTIVE, PERMANENTLY_DELETED, or RESTORE_FAILED.

    • reason string

      present only on PERMANENTLY_DELETED and RESTORE_FAILED

    • version_id string

      present only on RESTORED; the S3 version id of the delete marker that was removed

  • 400

    Bad Request - either the body was empty or not valid JSON (standard error object body), or every item in the batch failed (same outcome array as 200, one entry per item).

  • 401

    Unauthorized - missing or invalid bearer token.

  • 403

    Forbidden - the token belongs to a BASIC user, the user cannot modify records on this page, or profile_id is not the caller's own profile.

  • 404

    Not Found - page_id is not a valid page id, or the page does not belong to profile_id.

  • 413

    Payload Too Large - more than 200 items were submitted. Split the batch and retry.

POST /profiles/{profile_id}/pages/{page_id}/media_restore
curl \
 --request POST 'https://api.iformbuilder.com/exzact/api/v81/[servername]/profiles/self/pages/{page_id}/media_restore' \
 --header "Content-Type: application/json" \
 --header "Authorization: Bearer {access_token}" \
 --data '[
  {
    "url": "https://zerion-iform-media-example.s3.amazonaws.com/app/67890/_data67890_inspection_form/field_1234.png"
  },
  {
    "url": "privates3://zerion-iform-private-media-example/app/67890/_data67890_inspection_form/field_5678.png"
  }
]'
Request examples
[
  {
    "url": "https://zerion-iform-media-example.s3.amazonaws.com/app/67890/_data67890_inspection_form/field_1234.png"
  },
  {
    "url": "privates3://zerion-iform-private-media-example/app/67890/_data67890_inspection_form/field_5678.png"
  }
]
{
  "url": "https://zerion-iform-media-example.s3.amazonaws.com/app/67890/_data67890_inspection_form/field_1234.png"
}
Response examples (200)
[
  {
    "url": "https://zerion-iform-media-example.s3.amazonaws.com/app/67890/_data67890_inspection_form/field_1234.png",
    "status": "ALREADY_ACTIVE"
  },
  {
    "url": "privates3://zerion-iform-private-media-example/app/67890/_data67890_inspection_form/field_5678.jpeg",
    "status": "RESTORED",
    "version_id": "tn1cpMCxjyrb_0ksm3HBGnz6ORIAMZ9O"
  }
]
Response examples (207)
[
  {
    "url": "https://zerion-iform-media-example.s3.amazonaws.com/app/67890/_data67890_inspection_form/field_1234.png",
    "status": "RESTORED",
    "version_id": "tn1cpMCxjyrb_0ksm3HBGnz6ORIAMZ9O"
  },
  {
    "url": "https://zerion-iform-media-example.s3.amazonaws.com/app/99999/_data99999_other_form/field_1.png",
    "status": "RESTORE_FAILED",
    "reason": "URL_OUT_OF_SCOPE"
  }
]