curl --request POST \
--url https://api.wordsmith.ai/api/v1/files/upload-url \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"file_name": "<string>",
"content_type": "<string>"
}
'{
"upload_url": "https://s3.amazonaws.com/wordsmith-uploads/signed-url-here",
"job_id": "123e4567-e89b-12d3-a456-426614174000",
"content_type": "application/pdf"
}
Generate a presigned URL for uploading files to be used with the assistant
curl --request POST \
--url https://api.wordsmith.ai/api/v1/files/upload-url \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"file_name": "<string>",
"content_type": "<string>"
}
'{
"upload_url": "https://s3.amazonaws.com/wordsmith-uploads/signed-url-here",
"job_id": "123e4567-e89b-12d3-a456-426614174000",
"content_type": "application/pdf"
}
curl -X POST "https://api.wordsmith.ai/api/v1/files/upload-url" \
-H "Authorization: Bearer sk-ws-api1-your_api_key_here" \
-H "Content-Type: application/json" \
-d '{
"file_name": "contract.pdf",
"content_type": "application/pdf"
}'
upload_job_id when creating assistant
questions with file attachments.{
"upload_url": "https://s3.amazonaws.com/wordsmith-uploads/signed-url-here",
"job_id": "123e4567-e89b-12d3-a456-426614174000",
"content_type": "application/pdf"
}
# Step 1: Get upload URL (shown above)
# Step 2: Upload the file
curl -X PUT "https://s3.amazonaws.com/wordsmith-uploads/signed-url-here" \
-H "Content-Type: application/pdf" \
--data-binary @contract.pdf
# Step 3: Use upload_job_id in your assistant question
curl -X POST "https://api.wordsmith.ai/api/v1/assistants/default/questions" \
-H "Authorization: Bearer sk-ws-api1-your_api_key_here" \
-H "Content-Type: application/json" \
-d '{
"question": "Please review this contract",
"attachments": [
{
"upload_job_id": "123e4567-e89b-12d3-a456-426614174000"
}
]
}'
{
"error_code": "invalid_request_body",
"ws_api_error_code": "invalid_request_body",
"message": "Request body is invalid. Ensure it is valid JSON with 'file_name' and 'content_type' fields."
}
job_id from the response should be passed as upload_job_id when creating assistant questions