Skip to main content
Upload a file to a specific client in a provider connection. This allows Filed to send files back to your platform for a client.
mutation UploadConnectionFile($connectionId: ID!, $clientKey: String!, $file: FileUploadInput!) {
  uploadConnectionFile(connectionId: $connectionId, clientKey: $clientKey, file: $file) {
    success
    message
  }
}

Arguments

connectionId
ID!
required
The ID of the provider connection. This identifies which integration connection to upload the file to.
clientKey
String!
required
The client identifier from your platform. This should match the id returned from get connection clients.
file
FileUploadInput!
required
File upload input containing file details.

Returns

success
Boolean!
Whether the upload was successful.
message
String
Success or error message describing the result of the upload operation.

Example

curl -X POST https://gateway.filed.com/graphql \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer <accessToken>" \
  -H "source-platform: my-sample-platform" \
  -d '{
    "query": "mutation UploadConnectionFile($connectionId: ID!, $clientKey: String!, $file: FileUploadInput!) { uploadConnectionFile(connectionId: $connectionId, clientKey: $clientKey, file: $file) { success message } }",
    "variables": {
      "connectionId": "connection_789",
      "clientKey": "client-12345",
      "file": {
        "fileName": "tax-return-2024.pdf",
        "contentType": "application/pdf",
        "tusdEndpoint": "https://api.example.com/files/upload"
      }
    }
  }'
{
  "data": {
    "uploadConnectionFile": {
      "success": true,
      "message": "File uploaded successfully"
    }
  }
}
TUS Protocol: Filed uses the TUS (resumable upload) protocol for file uploads. Your platform needs to implement a TUS-compatible endpoint. The tusdEndpoint should point to your TUS upload endpoint that accepts file uploads for the specified client.
After the mutation succeeds, Filed will upload the file to your platform using the TUS endpoint. Ensure your platform’s TUS endpoint is configured to accept uploads for the specified client and connection.

Troubleshooting

Problem: Upload fails with invalid client key Solutions:
  • Verify the clientKey matches a valid client ID from your platform
  • Ensure the client exists and is accessible through this connection
  • Check that the connection credentials have permission to upload files for this client
Problem: TUS endpoint not accessible or invalid Solutions:
  • Verify the tusdEndpoint URL is correct and accessible
  • Ensure your platform implements a TUS-compatible upload endpoint
  • Test the TUS endpoint manually to ensure it accepts uploads
  • Check that the endpoint accepts uploads for the specified client
Problem: File upload fails after mutation succeeds Solutions:
  • Verify your TUS endpoint is properly configured
  • Check file size limits and ensure the file doesn’t exceed them
  • Ensure the endpoint has proper error handling and returns appropriate TUS responses
  • Review TUS protocol implementation to ensure compatibility