Move Upload
Learn how to move uploads between folders.
Endpoint
POST /v2/{team_id}/project/{project_id}/upload/${upload_id}/move/{folder_id}
Authentication
This endpoint requires an API key with the upload.edit scope.
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
team_id | String | Yes | The ID of the team |
project_id | String | Yes | The ID of the project |
folder_id | String | Yes | The ID of the destination folder |
upload_id | String | Yes | The ID of the upload to move |
Example Request
- cURL
- Typescript
- Python
- C#
curl -X POST \
'https://api.send.ai/v2/team_123456/project/proj_123456/upload/upld_123456468/move/folder_789012' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-H 'Content-Type: application/json'
const moveUpload = async (
teamId: string,
projectId: string,
folderId: string,
uploadId: string
): Promise<any> => {
const response = await fetch(
`https://api.send.ai/v2/${teamId}/project/${projectId}/upload/${uploadId}/move/${folderId}`,
{
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
}
);
if (!response.ok) {
throw new Error(`Failed to move upload: ${response.status} ${response.statusText}`);
}
return response.json();
};
// Example usage
moveUpload('team_123456', 'proj_123456', 'folder_789012', 'upl_abcdef123456')
.then(result => console.log(result))
.catch(error => console.error(error));
import requests
import json
def move_upload(team_id, project_id, folder_id, upload_id):
url = f'https://api.send.ai/v2/{team_id}/project/{project_id}/upload/${upload_id}/move/{folder_id}'
headers = {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
}
data = {
'upload_id': upload_id
}
response = requests.post(url, headers=headers, json=data)
response.raise_for_status() # Raise exception for 4XX/5XX responses
return response.json()
# Example usage
result = move_upload('team_123456', 'proj_123456', 'folder_789012', 'upl_abcdef123456')
print(result)
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;
using System.Text.Json;
using System.Threading.Tasks;
public class UploadService
{
private readonly HttpClient _client;
private readonly string _apiKey;
public UploadService(string apiKey)
{
_client = new HttpClient();
_client.BaseAddress = new Uri("https://api.send.ai/");
_apiKey = apiKey;
}
public async Task<object> MoveUploadAsync(
string teamId,
string projectId,
string folderId,
string uploadId)
{
// Create request content
var content = new StringContent(
JsonSerializer.Serialize(new { upload_id = uploadId }),
Encoding.UTF8,
"application/json");
// Set authorization header
_client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", _apiKey);
// Send request
var response = await _client.PostAsync(
$"v2/{teamId}/project/{projectId}/upload/${uploadId}/move/{folderId}",
content);
// Ensure success
response.EnsureSuccessStatusCode();
// Parse and return response
var jsonResponse = await response.Content.ReadAsStringAsync();
return JsonSerializer.Deserialize<object>(jsonResponse);
}
}
// Example usage
public class Program
{
public static async Task Main()
{
var uploadService = new UploadService("YOUR_API_KEY");
try
{
var result = await uploadService.MoveUploadAsync(
"team_123456",
"proj_123456",
"folder_789012",
"upl_abcdef123456"
);
Console.WriteLine(JsonSerializer.Serialize(result, new JsonSerializerOptions { WriteIndented = true }));
}
catch (Exception ex)
{
Console.WriteLine($"Error: {ex.Message}");
}
}
}
Response
{
"payload": {
"id": "upl_abcdef123456",
"name": "Invoice-2023-001",
"status": "IN_REVIEW",
"files": {},
"meta": [
{
"name": "reference",
"value": "INV-2023-001"
},
{
"name": "customer",
"value": "Acme Corp"
}
],
"folder_id": "folder_789012",
"created_at": "2023-06-15T10:30:00Z"
}
}
Response Parameters
| Parameter | Type | Description |
|---|---|---|
| id | string | Unique identifier for the upload |
| name | string | The name of the upload |
| status | string | Current status of the upload |
| files | object | Information about associated files |
| meta | array | Array of metadata key-value pairs |
| folder_id | string | ID of the new folder containing the upload |
| created_at | string | ISO timestamp of when the upload was created |
Error Codes
| Status Code | Description |
|---|---|
| 400 | Bad request, check your request parameters |
| 401 | Unauthorized, check your API key |
| 403 | Forbidden, you don't have access to this upload |
| 404 | Not found, the specified upload does not exist |
| 500 | Server error, please try again later |