Skip to main content
Version: 8.3

Endpoints for working with files via OData 4

Level: advanced
note

This functionality is available for Creatio 8.3.2 and later.

Since version 8.3.2, Creatio provides a dedicated API that exposes OData 4 endpoints for managing files. Before working with these endpoints, review the file data model and relationship patterns to understand how files are linked to business objects and which objects and request parameters are used in different scenarios. Learn more: File data model and relationship patterns.

Create a file

To create a file using OData 4, perform the following steps:

  1. Create a metadata record for the file.
  2. Upload the binary file content.

1. Create a metadata record for the file

Request string

POST {CreatioURL}/0/odata/{FileObjectName}

Create a file metadata record using OData 4. The record defines the file name and how the file is linked to a parent object. Before creating a file, choose the approach for linking files. Learn more: Relationship patterns.

Request headers

Header

Description

Content-Type

The media type of the request body. For example, "application/json; odata=verbose; IEEE754Compatible=true." Learn more: Content-Type Header Field (official RFC Editor documentation).

Accept

The preferred response format returned by the server. For example, "application/json; odata=verbose" specifies JSON with an additional OData formatting parameter. Learn more: Accept header (MDN Web Docs).

Request body

The request body must contain a JSON object that includes file metadata. These parameters define the file name and the object record to which the file will be attached.

Parameter

Description

Name

The name of the file displayed in Creatio.

RecordSchemaName

The code of the parent "Object" type schema to attach the file. Required for polymorphic relationship via "Uploaded file" (SysFile code) object.

RecordId

The ID of the record in the object to which the file is attached. For example, the ID of a dedicated activity, contact, case, etc.

For object-specific file objects, for example, "Contact attachment" (ContactFile code) or "File and link of activity" (ActivityFile code), use the corresponding reference column, such as ContactId or ActivityId instead of RecordSchemaName and RecordId.

2. Upload the binary file content

Request string

PUT {CreatioURL}/0/odata/{FileObjectName}({FileId})/Data

Upload the binary content after file metadata creation using OData 4. To do this, use the Id value returned in the response of the metadata creation request.

Request headers

Header

Description

Content-Type

The media type of the request body. For example, "application/octet-stream; IEEE754Compatible=true" when sending raw file bytes. Learn more: Content-Type Header Field (official RFC Editor documentation).

Request body

Pass the binary content of the file in the request body, for example, as, Type: File (binary).

The body must contain only the raw bytes of the file without any JSON wrapper.

Usage example

View the example that creates a file using polymorphic relationship via "Uploaded file" (SysFile code) object:

  1. Create a metadata record for the file named "Meeting_Notes_2025.pdf" and attach it to the record in the Activity object whose ID is "c449d832-a4cc-4b01-b9d5-8a071d0855d7" below.

    POST https://mycreatio.com/0/odata/SysFile HTTP/1.1
    Content-Type: application/json; odata=verbose; IEEE754Compatible=true
    Accept: application/json; odata=verbose

    {
    "Name": "Meeting_Notes_2025.pdf",
    "RecordSchemaName": "Activity",
    "RecordId": "c449d832-a4cc-4b01-b9d5-8a071d0855d7"
    }
  2. Upload the binary file content for the file whose ID is "410006e1-ca4e-4502-a9ec-e54d922d2c00" below.

    PUT https://mycreatio.com/0/odata/SysFile(410006e1-ca4e-4502-a9ec-e54d922d2c00)/Data HTTP/1.1
    Content-Type: application/octet-stream; IEEE754Compatible=true

    [Binary file data]

View the example that creates a file using direct foreign key relationship via the ContactFile object-specific object:

  1. Create a metadata record for the file named "Meeting_Notes_2025.pdf" and attach it to the record in the "Contact" (Contact code) object whose ID is "c449d832-a4cc-4b01-b9d5-8a071d0855d7" below.

    POST https://mycreatio.com/0/odata/ContactFile HTTP/1.1
    Content-Type: application/json

    {
    "Name": "Meeting_Notes_2025.pdf",
    "ContactId": "c449d832-a4cc-4b01-b9d5-8a071d0855d7"
    }
  2. Upload the binary file content for the file whose ID is "520117f2-db5f-5613-b0ed-f65e833e3d11" below.

    PUT https://mycreatio.com/0/odata/ContactFile(520117f2-db5f-5613-b0ed-f65e833e3d11)/Data HTTP/1.1
    Content-Type: application/octet-stream

    [Binary file data]

Read a file

Request string

GET {CreatioURL}/0/odata/{FileObjectName}({FileId})/Data

Retrieve binary data and metadata for files using OData 4.

Usage example

View the example that retrieves the binary content of the file whose ID is "410006e1-ca4e-4502-a9ec-e54d922d2c00" from the "Uploaded file" (SysFile code) object below.

GET https://mycreatio.com/0/odata/SysFile(410006e1-ca4e-4502-a9ec-e54d922d2c00)/Data HTTP/1.1

The response body includes headers described below.

Header

Description

Content-Type

The media type of the file. For example, "application/pdf." Learn more: Content-Type Header Field (official RFC Editor documentation).

Content-Length

The size of the file in bytes. Creatio uses this header to validate that the full file content was transmitted. Learn more: Content-Length header (MDN Web Docs).

Update a file

Request string

PUT {CreatioURL}/0/odata/{FileObjectName}({FileId})/Data

Replace the binary content of an existing file using OData 4. To do this, use the existing file ID.

Request headers

Header

Description

Content-Type

The media type of the request body. For example, "application/octet-stream; IEEE754Compatible=true" when sending raw file bytes. Learn more: Content-Type Header Field (official RFC Editor documentation).

Request body

Pass the binary content of the file in the request body, for example, as, Type: File (binary).

The body must contain only the raw bytes of the file without any JSON wrapper.

Usage example

View the example that replaces the binary content of the file whose ID in the "Uploaded file" (SysFile code) object is "7f9653ca-b81d-4e46-b1b3-a0a743b6c4e5" below.

PUT https://mycreatio.com/0/odata/SysFile(7f9653ca-b81d-4e46-b1b3-a0a743b6c4e5)/Data HTTP/1.1
Content-Type: application/octet-stream; IEEE754Compatible=true

[New binary file data]

Delete a file

Request string

DELETE {CreatioURL}/0/odata/{FileObjectName}({FileId})

Remove both the file metadata from the object and the corresponding binary data stored either in the object column or in an external file storage, for example, AWS S3 or Azure Blob, using OData 4. Before deleting a file, ensure that a backup is available because this operation is irreversible.

Request headers

Header

Description

Content-Type

The media type of the request body. For example, "application/octet-stream; IEEE754Compatible=true" when sending raw file bytes. Learn more: Content-Type Header Field (official RFC Editor documentation).

Usage example

View the example that deletes the file whose ID in the "Uploaded file" (SysFile code) object is "410006e1-ca4e-4502-a9ec-e54d922d2c00" below.

DELETE https://mycreatio.com/0/odata/SysFile(410006e1-ca4e-4502-a9ec-e54d922d2c00) HTTP/1.1
Content-Type: application/octet-stream; IEEE754Compatible=true

See also

File data model and relationship patterns