v51

latestOpenAPI 3.1.0raw.githubusercontent.com2026-08-041351024.8 MB
Direct costs

Get direct cost attachment

The Get direct cost attachment endpoint returns a specific attachment for a given directCostId and attachmentId.

Direct costs are business expenses that don't impact Accounts Payable.

get/companies/{companyId}/connections/{connectionId}/data/directCosts/{directCostId}/attachments/{attachmentId}

Path parameters

attachmentIdstring uuid required
Example:8a210b68-6988-11ed-a1eb-0242ac120002

Unique identifier for an attachment.

Response

Success

idstring

Identifier for the attachment, unique for the company in the accounting software.

namestring nullable

Name of the attachment file.

contentTypestring nullable

File type of the attachment. This is represented by appending the file type to the IETF standard file naming requirements. For example, for a jpeg file the output is image/jpeg.

Supported file types vary per platform.

dateCreatedstring

In Codat's data model, dates and times are represented using the <a class="external" href="https://en.wikipedia.org/wiki/ISO_8601" target="_blank">ISO 8601 standard</a>. Date and time fields are formatted as strings; for example:

2020-10-08T22:40:50Z
2021-01-01T00:00:00

When syncing data that contains DateTime fields from Codat, make sure you support the following cases when reading time information:

  • Coordinated Universal Time (UTC): 2021-11-15T06:00:00Z
  • Unqualified local time: 2021-11-15T01:00:00
  • UTC time offsets: 2021-11-15T01:00:00-05:00

Time zones

Not all dates from Codat will contain information about time zones.
Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced.

fileSizeinteger nullable

File size in bytes. For example, if this reads 46153, then the file size is 46kb.

includeWhenSentboolean

If true, then the attachment is included with the associated invoice, bill or direct costs when it is printed, emailed, or sent to a customer, if the underlying accounting software allows this.

modifiedDatestring

The date when the record was last fetched from the accounting software, commerce software, or open banking provider and updated in Codat’s data cache.

Use it to identify and retrieve records that have changed since your last fetch. For example, filtering modifiedDate to today will provide new records updated in Codat today.

This date is populated for all data types except for attachments, balance sheets, company information, and profit & loss reports (read more).

In Codat's data model, dates and times are represented using the <a class="external" href="https://en.wikipedia.org/wiki/ISO_8601" target="_blank">ISO 8601 standard</a>.

sourceModifiedDatestring

The date when a record was last modified in the accounting software, usually by the business or a business process. For example, when payments are made against an invoice.

It is not populated (read more) when:

  • Pulling attachments
  • The accounting software does not provide modification dates for a data type
  • A record has been deleted from the source platform and Codat doesn't have a record of when the deletion occurred
  • A record has been voided. For certain platforms that soft delete records, isDeleted metadata is used to identify void records

In Codat's data model, dates and times are represented using the <a class="external" href="https://en.wikipedia.org/wiki/ISO_8601" target="_blank">ISO 8601 standard</a>.

Example response

{
  "dateCreated": "2022-10-23T00:00:00Z",
  "modifiedDate": "2022-10-23T00:00:00Z",
  "sourceModifiedDate": "2022-10-23T00:00:00Z"
}