Docs menu

Check file legacy

POST /v1/organisations/{organisation_id}/workspaces/{workspace_id}/file-checks Deprecated

Checks a file of a kind Ivy reads as configuration (a flow, connections.ivy.yaml, a space app manifest) as Ivy does, without saving anything: a version of a file, or draft text. The Files view, the agents' tools and saves by agents report the same problems.

Authentication

Send an API key, or an access token from your organisation’s identity provider, in the Authorization header. How API keys work

Scope the API key needs: files:read

Security schemes in the OpenAPI document: session_cookie (cookie __Host-ivy_session)bearer (bearer)api_key (bearer)

Parameters

  • organisation_id path string required
  • workspace_id path string required

Request body

application/json CheckFile required

  • content string | null

    Draft text, instead of file_id; needs kind or path.

  • file_id string | null

    Checks the file's readable version, or version_id.

  • kind FileKind | null
  • path string | null

    Where the draft would be saved, such as notes/notes.ivy-app.toml: decides the kind when kind is absent, and an app manifest's id.

  • version_id string | null

Responses

  • 200 application/json FileCheck

    The problems Ivy finds in the file as it reads its kind; valid when none is an error

  • 401 application/json ErrorBody

    unauthenticated

  • 403 application/json ErrorBody

    workspace_content_restricted, insufficient_scope

  • 404 application/json ErrorBody

    No such file or version in this space

  • 409 application/json ErrorBody

    file_scanning, file_quarantined, file_scan_failed

  • 422 application/json ErrorBody

    not_checkable: Ivy has no check for the file's kind; file_too_large, invalid_encoding, validation_failed

  • 429 application/json ErrorBody

    rate_limited: the API key's requests per minute are used up; retry after Retry-After seconds

  • 500 application/json ErrorBody

    internal

  • 503 application/json ErrorBody

    storage_unavailable; or unavailable: the database is briefly unavailable; retry after Retry-After seconds

Error codes

Errors come back as an ErrorBody whose code is one of these.

  • 401 unauthenticated
  • 403 workspace_content_restrictedinsufficient_scope
  • 404 not_found generic code for this status
  • 409 file_scanningfile_quarantinedfile_scan_failed
  • 422 not_checkablefile_too_largeinvalid_encodingvalidation_failed
  • 429 rate_limited
  • 500 internal
  • 503 storage_unavailableunavailable

Examples

curl
curl -X POST "$IVY_API_URL/v1/organisations/$ORGANISATION_ID/workspaces/$WORKSPACE_ID/file-checks" \
  -H "Authorization: Bearer $IVY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
JavaScript SDK
import { client, checkFileLegacy } from "@spacivapp/ivy-sdk";

client.setConfig({
  baseUrl: process.env.IVY_API_URL,
  headers: { Authorization: `Bearer ${process.env.IVY_API_KEY}` },
});

const { data, error, response } = await checkFileLegacy({
  path: { organisation_id: organisationId, workspace_id: workspaceId },
  body: {},
});
Example request body
{
  "content": "string",
  "file_id": "file_123",
  "kind": "workflow",
  "path": "string",
  "version_id": "version_123"
}
Example response (200)
{
  "file_id": "file_123",
  "kind": "workflow",
  "path_changes": [
    "string"
  ],
  "problems": [
    {
      "code": "not_found",
      "column": 0,
      "hint": "string",
      "line": 0,
      "message": "A short explanation for people",
      "path": "string",
      "reference": {
        "page": "string",
        "section": "string"
      },
      "severity": "error"
    }
  ],
  "reference": {
    "page": "string",
    "section": "string"
  },
  "valid": false,
  "version_id": "version_123"
}