Discussions

Ask a Question
Back to All

File detail - API Response and Webhook event contains outdated file name

When requesting data for a file with a given ID, the API response contains outdated filename information.

Meaning that when a filename is changed through the Copilot web interface, the API and webhook event does not contain the updated information.

For example,

GET https://api.copilot.com/v1/files/XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX

returns the following response:

{
  "channelId": "XXXXXXXXX/XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX",
  "createdAt": "2024-03-27T00:17:13.172432669Z",
  "creatorId": "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX",
  "downloadUrl": "XXX",
  "id": "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX",
  "linkUrl": "",
  "name": "original name.csv",
  "object": "file",
  "path": "TEST PATH/original name.csv",
  "size": 782596
}

Even though the current filename is TEST NEW NAME.csv, the old original name.csv is returned.

A similar result is posted to the registered webhook endpoint when a filename is updated:

Copilot Event :: file.updated {
  channelId: 'XXXXXXXXX/XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX',
  createdAt: '2024-03-27T00:17:13.172432669Z',
  creatorId: 'XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX',
  id: 'XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX',
  linkUrl: '',
  name: 'original name.csv',
  object: 'file',
  path: 'TEST PATH/original name.csv',
}
Screenshot of Copilot web interface

Screenshot of Copilot web interface