Files
Update a file's extracted values (fields and table/list cells)
Update document form values for a file, for both scalar fields and table/list cells.
PATCH
/
v1
/
files
/
{fileId}
/
values
Update a file's extracted values (fields and table/list cells)
curl --request PATCH \
--url https://api.orion.file.ai/prod/v1/files/{fileId}/values \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"schemaValueId": "6a4bac981923768a61f47354",
"fieldPaths": [
{
"path": "/Supplier country",
"value": "Netherlands"
},
{
"path": "Line_items",
"cells": [
{
"rowIndex": 0,
"column": "gl_code",
"value": "1234"
},
{
"rowIndex": 1,
"column": "gl_code",
"value": "5678"
}
]
}
]
}
'import requests
url = "https://api.orion.file.ai/prod/v1/files/{fileId}/values"
payload = {
"schemaValueId": "6a4bac981923768a61f47354",
"fieldPaths": [
{
"path": "/Supplier country",
"value": "Netherlands"
},
{
"path": "Line_items",
"cells": [
{
"rowIndex": 0,
"column": "gl_code",
"value": "1234"
},
{
"rowIndex": 1,
"column": "gl_code",
"value": "5678"
}
]
}
]
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
schemaValueId: '6a4bac981923768a61f47354',
fieldPaths: [
{path: '/Supplier country', value: 'Netherlands'},
{
path: 'Line_items',
cells: [
{rowIndex: 0, column: 'gl_code', value: '1234'},
{rowIndex: 1, column: 'gl_code', value: '5678'}
]
}
]
})
};
fetch('https://api.orion.file.ai/prod/v1/files/{fileId}/values', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"success": true
}{
"type": "https://errors.file.ai/validation-failed",
"title": "Validation failed",
"status": 422,
"detail": "One or more fields are invalid.",
"instance": "/v1/files/upload",
"code": "VALIDATION_FAILED",
"requestId": "0f1c8e03-978e-40d5-bc93-6894a57f9324",
"errors": [
{
"code": "REQUIRED",
"detail": "must not be empty",
"pointer": "#/fileName",
"parameter": "limit"
}
],
"message": "Validation failed",
"error": "Unprocessable Entity",
"statusCode": 422,
"retryAfter": 42
}{
"type": "https://errors.file.ai/validation-failed",
"title": "Validation failed",
"status": 422,
"detail": "One or more fields are invalid.",
"instance": "/v1/files/upload",
"code": "VALIDATION_FAILED",
"requestId": "0f1c8e03-978e-40d5-bc93-6894a57f9324",
"errors": [
{
"code": "REQUIRED",
"detail": "must not be empty",
"pointer": "#/fileName",
"parameter": "limit"
}
],
"message": "Validation failed",
"error": "Unprocessable Entity",
"statusCode": 422,
"retryAfter": 42
}{
"type": "https://errors.file.ai/validation-failed",
"title": "Validation failed",
"status": 422,
"detail": "One or more fields are invalid.",
"instance": "/v1/files/upload",
"code": "VALIDATION_FAILED",
"requestId": "0f1c8e03-978e-40d5-bc93-6894a57f9324",
"errors": [
{
"code": "REQUIRED",
"detail": "must not be empty",
"pointer": "#/fileName",
"parameter": "limit"
}
],
"message": "Validation failed",
"error": "Unprocessable Entity",
"statusCode": 422,
"retryAfter": 42
}{
"type": "https://errors.file.ai/validation-failed",
"title": "Validation failed",
"status": 422,
"detail": "One or more fields are invalid.",
"instance": "/v1/files/upload",
"code": "VALIDATION_FAILED",
"requestId": "0f1c8e03-978e-40d5-bc93-6894a57f9324",
"errors": [
{
"code": "REQUIRED",
"detail": "must not be empty",
"pointer": "#/fileName",
"parameter": "limit"
}
],
"message": "Validation failed",
"error": "Unprocessable Entity",
"statusCode": 422,
"retryAfter": 42
}{
"type": "https://errors.file.ai/validation-failed",
"title": "Validation failed",
"status": 422,
"detail": "One or more fields are invalid.",
"instance": "/v1/files/upload",
"code": "VALIDATION_FAILED",
"requestId": "0f1c8e03-978e-40d5-bc93-6894a57f9324",
"errors": [
{
"code": "REQUIRED",
"detail": "must not be empty",
"pointer": "#/fileName",
"parameter": "limit"
}
],
"message": "Validation failed",
"error": "Unprocessable Entity",
"statusCode": 422,
"retryAfter": 42
}{
"type": "https://errors.file.ai/validation-failed",
"title": "Validation failed",
"status": 422,
"detail": "One or more fields are invalid.",
"instance": "/v1/files/upload",
"code": "VALIDATION_FAILED",
"requestId": "0f1c8e03-978e-40d5-bc93-6894a57f9324",
"errors": [
{
"code": "REQUIRED",
"detail": "must not be empty",
"pointer": "#/fileName",
"parameter": "limit"
}
],
"message": "Validation failed",
"error": "Unprocessable Entity",
"statusCode": 422,
"retryAfter": 42
}Request · Response · Guide: Extract fields
More details
More details
The
schemaValueId field is the id returned by GET /files/:fileId/values (the form value id).The fieldPaths field is an array of updates. Each entry must specify exactly one of:-
value: the new value for a scalar field. Thepathis the field title (the leading slash is optional, e.g./Supplier country). -
cells: cell-level updates for a table/list field. Thepathis the table field title (e.g.Line_items). Each cell contains:-
rowIndex: the zero-based row index within the table. -
column: the column title (must match one of the table columns). -
value: the new cell value.
-
Authorizations
API key for authentication
Headers
Optional opaque key (max 255 chars, UUIDv4 recommended) making this request idempotent for 24h: a retry with the same key and body replays the original response with Idempotent-Replayed: true.
Path Parameters
Body
application/json
The file values to update
The body is of type string.
Response
The file values are updated
⌘I
Update a file's extracted values (fields and table/list cells)
curl --request PATCH \
--url https://api.orion.file.ai/prod/v1/files/{fileId}/values \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"schemaValueId": "6a4bac981923768a61f47354",
"fieldPaths": [
{
"path": "/Supplier country",
"value": "Netherlands"
},
{
"path": "Line_items",
"cells": [
{
"rowIndex": 0,
"column": "gl_code",
"value": "1234"
},
{
"rowIndex": 1,
"column": "gl_code",
"value": "5678"
}
]
}
]
}
'import requests
url = "https://api.orion.file.ai/prod/v1/files/{fileId}/values"
payload = {
"schemaValueId": "6a4bac981923768a61f47354",
"fieldPaths": [
{
"path": "/Supplier country",
"value": "Netherlands"
},
{
"path": "Line_items",
"cells": [
{
"rowIndex": 0,
"column": "gl_code",
"value": "1234"
},
{
"rowIndex": 1,
"column": "gl_code",
"value": "5678"
}
]
}
]
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
schemaValueId: '6a4bac981923768a61f47354',
fieldPaths: [
{path: '/Supplier country', value: 'Netherlands'},
{
path: 'Line_items',
cells: [
{rowIndex: 0, column: 'gl_code', value: '1234'},
{rowIndex: 1, column: 'gl_code', value: '5678'}
]
}
]
})
};
fetch('https://api.orion.file.ai/prod/v1/files/{fileId}/values', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"success": true
}{
"type": "https://errors.file.ai/validation-failed",
"title": "Validation failed",
"status": 422,
"detail": "One or more fields are invalid.",
"instance": "/v1/files/upload",
"code": "VALIDATION_FAILED",
"requestId": "0f1c8e03-978e-40d5-bc93-6894a57f9324",
"errors": [
{
"code": "REQUIRED",
"detail": "must not be empty",
"pointer": "#/fileName",
"parameter": "limit"
}
],
"message": "Validation failed",
"error": "Unprocessable Entity",
"statusCode": 422,
"retryAfter": 42
}{
"type": "https://errors.file.ai/validation-failed",
"title": "Validation failed",
"status": 422,
"detail": "One or more fields are invalid.",
"instance": "/v1/files/upload",
"code": "VALIDATION_FAILED",
"requestId": "0f1c8e03-978e-40d5-bc93-6894a57f9324",
"errors": [
{
"code": "REQUIRED",
"detail": "must not be empty",
"pointer": "#/fileName",
"parameter": "limit"
}
],
"message": "Validation failed",
"error": "Unprocessable Entity",
"statusCode": 422,
"retryAfter": 42
}{
"type": "https://errors.file.ai/validation-failed",
"title": "Validation failed",
"status": 422,
"detail": "One or more fields are invalid.",
"instance": "/v1/files/upload",
"code": "VALIDATION_FAILED",
"requestId": "0f1c8e03-978e-40d5-bc93-6894a57f9324",
"errors": [
{
"code": "REQUIRED",
"detail": "must not be empty",
"pointer": "#/fileName",
"parameter": "limit"
}
],
"message": "Validation failed",
"error": "Unprocessable Entity",
"statusCode": 422,
"retryAfter": 42
}{
"type": "https://errors.file.ai/validation-failed",
"title": "Validation failed",
"status": 422,
"detail": "One or more fields are invalid.",
"instance": "/v1/files/upload",
"code": "VALIDATION_FAILED",
"requestId": "0f1c8e03-978e-40d5-bc93-6894a57f9324",
"errors": [
{
"code": "REQUIRED",
"detail": "must not be empty",
"pointer": "#/fileName",
"parameter": "limit"
}
],
"message": "Validation failed",
"error": "Unprocessable Entity",
"statusCode": 422,
"retryAfter": 42
}{
"type": "https://errors.file.ai/validation-failed",
"title": "Validation failed",
"status": 422,
"detail": "One or more fields are invalid.",
"instance": "/v1/files/upload",
"code": "VALIDATION_FAILED",
"requestId": "0f1c8e03-978e-40d5-bc93-6894a57f9324",
"errors": [
{
"code": "REQUIRED",
"detail": "must not be empty",
"pointer": "#/fileName",
"parameter": "limit"
}
],
"message": "Validation failed",
"error": "Unprocessable Entity",
"statusCode": 422,
"retryAfter": 42
}{
"type": "https://errors.file.ai/validation-failed",
"title": "Validation failed",
"status": 422,
"detail": "One or more fields are invalid.",
"instance": "/v1/files/upload",
"code": "VALIDATION_FAILED",
"requestId": "0f1c8e03-978e-40d5-bc93-6894a57f9324",
"errors": [
{
"code": "REQUIRED",
"detail": "must not be empty",
"pointer": "#/fileName",
"parameter": "limit"
}
],
"message": "Validation failed",
"error": "Unprocessable Entity",
"statusCode": 422,
"retryAfter": 42
}