POST
/
v1
/
fixer
JavaScript
import Benchify from 'benchify';

const client = new Benchify({
  apiKey: 'My API Key',
});

const response = await client.fixer.run({ files: [{ contents: 'contents', path: 'x' }] });

console.log(response.data);
{
  "data": {
    "status": {
      "file_to_composite_status": {},
      "composite_status": "FIXED_EVERYTHING"
    },
    "suggested_changes": {
      "diff": "<string>"
    },
    "bundle": {
      "build_system": "OLIVE_TEMPLATE",
      "files": [
        {
          "path": "<string>",
          "contents": "<string>"
        }
      ],
      "status": "SUCCESS",
      "template_path": "<string>"
    },
    "fix_types_used": [
      "import_export"
    ]
  },
  "meta": {
    "trace_id": "<string>",
    "external_id": "<string>"
  },
  "error": {
    "code": "<string>",
    "message": "<string>",
    "details": "",
    "suggestions": []
  }
}

Authorizations

Authorization
string
header
required

Benchify API Key. Obtain a key from the Benchify web portal under Settings > Credentials. Provide the key in the Authorization header as Bearer $BENCHIFY_KEY.

Body

application/json

Request model for the /api/fixer endpoint

files
RequestTestFile · object[]
required

List of files to process

Required array length: 1 - 1000 elements
fix_types
enum<string>[]

Configuration for which fix types to apply

fixes
object | null
deprecated

DEPRECATED: use fix_types instead. Legacy boolean flags container. DEPRECATED: legacy boolean flags for which fixes to apply.

bundle
boolean
default:false

Whether to bundle the project (experimental)

template_id
string | null

ID of the template to use for the fixer process

Maximum length: 300
response_format
enum<string>

Format for the response (diff, changed_files, or all_files)

Available options:
DIFF,
CHANGED_FILES,
ALL_FILES
meta
object | null

Meta information for the request Meta information for API requests

Response

Successful Response

Wrapped response model for benchify-api compatibility

data
object
required

The actual response data

meta
object

Meta information

error
object | null

The error from the API query