> For the complete documentation index, see [llms.txt](https://docs.africanies.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.africanies.com/file.md).

# File

## Generate signed URL for file uploads.

> This endpoint generates pre-signed URLs for uploading shipment-related files directly to S3.\
> \
> Use this endpoint before calling shipment purchase when you need to attach supporting files.\
> \
> Important shipment guidance:\
> \- For shipments going to European countries, invoice documents are required.\
> \- Item photos are optional, but recommended for all destinations (including non-European shipments).\
> \
> Typical flow:\
> 1\. Request signed URLs with this endpoint.\
> 2\. Upload each file directly to S3 using the returned \`upload\_url\`.\
> 3\. Send the returned \`s3\_key\` values in shipment endpoints (eg. \`documents\_s3\_key\`, \`photos\_s3\_key\`).

```json
{"openapi":"3.0.3","info":{"title":"AfricanIES - Sandbox API Documentation","version":"1.0.0"},"tags":[{"name":"File","description":""}],"servers":[{"url":"https://api-sandbox.africaniestest.com"}],"security":[{"default":[]}],"components":{"securitySchemes":{"default":{"type":"apiKey","name":"Authorization","in":"header","description":"Use your base64-encoded public_key:private_key value."}}},"paths":{"/api/v1/file/generate":{"post":{"summary":"Generate signed URL for file uploads.","operationId":"generateSignedURLForFileUploads","description":"This endpoint generates pre-signed URLs for uploading shipment-related files directly to S3.\n\nUse this endpoint before calling shipment purchase when you need to attach supporting files.\n\nImportant shipment guidance:\n- For shipments going to European countries, invoice documents are required.\n- Item photos are optional, but recommended for all destinations (including non-European shipments).\n\nTypical flow:\n1. Request signed URLs with this endpoint.\n2. Upload each file directly to S3 using the returned `upload_url`.\n3. Send the returned `s3_key` values in shipment endpoints (eg. `documents_s3_key`, `photos_s3_key`).","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"status_code":{"type":"integer"},"message":{"type":"string"},"data":{"type":"array","items":{"type":"object","properties":{"file_name":{"type":"string"},"upload_url":{"type":"string"},"s3_key":{"type":"string"}}}}}}}}},"422":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"status_code":{"type":"integer"},"message":{"type":"string"},"data":{"type":"object","properties":{"files":{"type":"array","items":{"type":"string"}}}}}}}}},"500":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"status_code":{"type":"integer"},"message":{"type":"string"},"data":{"type":"array"}}}}}}},"tags":["File"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"files":{"type":"array","description":"List of files you want to upload. Include one object per file. For invoice uploads, use `documents/invoice`. For item photos, use `images/items`.","items":{"type":"string"}}},"required":["files"]}}}}}}}}
```
