About Add File to Project

I followed the API documentation to upload a file to the project. I want to add a custom field (for example, a file checksum), but it doesn’t work.

curl -s -X POST "$CROWDIN_API/projects/$PROJECT_ID/files" \
                -H "Authorization: Bearer $CROWDIN_API_TOKEN" \
                -H "Content-Type: application/json" \
                -d "{\"storageId\": $storageId, \
                     \"name\": \"$(basename "$file")\", \
                     \"branchId\": $BRANCH_ID, \
                     \"directoryId\": $DIRECTORY_ID, \
                     \"fields\": { \
                        \"checksum\": \"$local_file_checksum\" \
                    } \
                  }"

errors:
{"errors":[{"error":{"key":"fields","errors":[{"code":"unknownField","message":"Unknown field provided (checksum)"}]}}]}

https://support.crowdin.com/developer/enterprise/api/v2/#tag/Source-Files/operation/api.projects.files.post

Hello,

Fields is only available to Crowdin Enterprise customers. Before setting a field via the API, it should be configured in the UI. You can find more information here Fields | Enterprise Docs

If you are using crowdin.com, you could try to use File Context field to store extra information needed. This is not at all elegant and may even confuse linguists, but should solve the problem if you really need this information during the file translation lifecycle.

Thank you for your support. I found a way to add the field to the File object using the API
https://support.crowdin.com/developer/enterprise/api/v2/#tag/Fields