Zum Inhalt springen
Ressource · Files and account

Workspace files

A workspace file is a document stored in the workspace, such as a receipt or a bank statement.

workspace-files:readworkspace-files:write
MethodePfadZusammenfassung
GET…/filesList files attached to the workspace
GET…/files/searchSearch workspace files by attributes
POST…/files/moveMove a workspace file to a different folder or location
GET…/files/{fileId}/downloadGenerate a time-limited download URL for a workspace file

Die Pfade beginnen mit /workspaces/{workspaceId}. GET-Endpunkte brauchen workspace-files:read, die übrigen workspace-files:write.

Das Objekt WorkspaceFile

firestoreIdstringerforderlich
creationobjecterforderlich

When and by whom the resource was created.

2 untergeordnete Felder anzeigen
creationDateTimestringdate-timeerforderlich

Date and time when the resource was created.

createdBystring

ID of the user who created the resource, when recorded.

workspaceIdstringerforderlich

ID of the workspace.

sizeintegererforderlich
mimeTypestringerforderlich
filenamestringerforderlich
gcsPathstringerforderlich
Alle 14 Felder anzeigen
extensionstringerforderlich
checksumMd5string
checksumCrc32cstring
customMetadataRecord<string, string | boolean | number | null>erforderlich
scopestringerforderlich

Werteworkspace_attachmentbank_account_attachmentbank_transaction_attachmentbank_transaction_importbank_transaction_exportdraft_payment_attachmentinitiated_payment_attachmentinvoice_attachment

targetDocumentPathstring
targetDocumentIdstring
Das Objekt WorkspaceFile
{
  "firestoreId": "string",
  "creation": {
    "creationDateTime": "2026-03-02T09:15:00.000Z",
    "createdBy": "Xq3vT9mB2kLpR7sN4wYc8dZf1aHj"
  },
  "workspaceId": "Wk7fQ2xR9bLm4tZp8sNv",
  "size": 0,
  "mimeType": "string",
  "filename": "string",
  "gcsPath": "string",
  "extension": "string",
  "checksumMd5": "string",
  "checksumCrc32c": "string",
  "customMetadata": {
    "key": "string"
  },
  "scope": "workspace_attachment",
  "targetDocumentPath": "string",
  "targetDocumentId": "Hk2xNq8vR4tYw6ZbPj3c"
}
GET/workspaces/{workspaceId}/files

List files attached to the workspace

Bereichworkspace-files:read

Pfadparameter

workspaceIdstringerforderlich

ID of the workspace.

Abfrageparameter

limitinteger

Maximum number of items to return, from 1 to 100. A missing, invalid or non-positive value falls back to 20, and a larger value to 100.

Standard20

startAfterstring

Cursor of the page to return: the nextCursor of the previous page.

fieldsstring

Comma-separated property paths to include in the response, or in each item of a list. Use dots for nested paths.

idsstring[]

Comma-separated IDs of the items to return, up to 30. When set, limit, startAfter and the filters are ignored.

Rückgabe

200

List of items

dataWorkspaceFile[]erforderlich

Items of the page, in list order.

limitintegererforderlich

Page size of the request, or the number of requested ids.

nextCursorstring

Cursor of the next page, to pass as startAfter. Absent when the page holds fewer items than limit; a full last page still has one, and the page it points to is empty.

curl 'https://api.business.swayapp.io/v1/workspaces/Wk7fQ2xR9bLm4tZp8sNv/files' \
  -H "Authorization: Bearer $SWAY_API_KEY"
{
  "data": [
    {
      "firestoreId": "string",
      "creation": {
        "creationDateTime": "2026-03-02T09:15:00.000Z",
        "createdBy": "Xq3vT9mB2kLpR7sN4wYc8dZf1aHj"
      },
      "workspaceId": "Wk7fQ2xR9bLm4tZp8sNv",
      "size": 0,
      "mimeType": "string",
      "filename": "string",
      "gcsPath": "string",
      "extension": "string",
      "checksumMd5": "string",
      "checksumCrc32c": "string",
      "customMetadata": {
        "key": "string"
      },
      "scope": "workspace_attachment",
      "targetDocumentPath": "string",
      "targetDocumentId": "Hk2xNq8vR4tYw6ZbPj3c"
    }
  ],
  "limit": 0,
  "nextCursor": "string"
}
POST/workspaces/{workspaceId}/files/move

Move a workspace file to a different folder or location

Bereichworkspace-files:write

Pfadparameter

workspaceIdstringerforderlich

ID of the workspace.

Request-Body

oldPathstringerforderlich
newPathstringerforderlich

Rückgabe

204

No content

curl -X POST 'https://api.business.swayapp.io/v1/workspaces/Wk7fQ2xR9bLm4tZp8sNv/files/move' \
  -H "Authorization: Bearer $SWAY_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
  "oldPath": "string",
  "newPath": "string"
}'
{
  "error": {
    "code": "invalid-argument",
    "message": "Invalid request"
  }
}
GET/workspaces/{workspaceId}/files/{fileId}/download

Generate a time-limited download URL for a workspace file

Bereichworkspace-files:read

Pfadparameter

workspaceIdstringerforderlich

ID of the workspace.

fileIdstringerforderlich

ID of the workspace file.

Abfrageparameter

fieldsstring

Comma-separated property paths to include in the response, or in each item of a list. Use dots for nested paths.

Rückgabe

200

Successful response

dataFileDownloadUrlerforderlich
2 untergeordnete Felder anzeigen
downloadUrlstringerforderlich

Time-limited URL to download the file.

expiresAtstringerforderlich

Instant after which downloadUrl stops working.

curl 'https://api.business.swayapp.io/v1/workspaces/Wk7fQ2xR9bLm4tZp8sNv/files/Fl1qS6hV3nTx8mPc5wZr/download' \
  -H "Authorization: Bearer $SWAY_API_KEY"
{
  "data": {
    "downloadUrl": "string",
    "expiresAt": "2026-03-02T09:30:00.000Z"
  }
}

Bauen Sie auf Ihren eigenen Daten.

Erstellen Sie ein Konto, öffnen Sie Profil › Entwickler und erstellen Sie einen Schlüssel, der auf die nötigen Ressourcen begrenzt ist. Fragen zu einer Integration? Das Team beantwortet sie in einem Gespräch.