---
title: "Get a pre-authorized S3 upload form (use to upload a file on the client side)"
description: "GET /attachments/s3_form — Files must be uploaded to S3 before they can be attached to deals, notes, calls or meetings, and this request returns everything needed for that upload."
canonical_url: https://developer.onepagecrm.com/api/reference/attachments/get-attachments-s3_form/
source: Markdown mirror of https://developer.onepagecrm.com/api/reference/attachments/get-attachments-s3_form/
---

`GET /attachments/s3_form`

Files must be uploaded to S3 before they can be attached to deals, notes, calls or meetings, and this request returns everything needed for that upload. Send a POST request to the URL in the response and include every param from the fields construct as form fields of that upload. Most can be sent as they are, but key must be constructed as {contact_id}/{timestamp}/{filename}, the filename field must match the filename at the end of key, and file is the file to upload. After a successful upload the file can be attached. Maximum file size is 10 MB; each account has 1 GB of storage per user. Additional information on the upload process: https://docs.aws.amazon.com/AmazonS3/latest/API/sigv4-post-example.html

Resource: [Attachments](https://developer.onepagecrm.com/api/reference/attachments/) · [API Reference](https://developer.onepagecrm.com/api/reference/)

## Request

```bash
curl "https://app.onepagecrm.com/api/v3/attachments/s3_form" \
  -u $user_id:$api_key
```

Authentication is HTTP Basic — `user_id` as username, `api_key` as password.
See https://developer.onepagecrm.com/api/authentication/.

## Query parameters

| Name | Type | Description |
| --- | --- | --- |
| `contact_id` | string | Contact to be associated with the attachment |

## Responses

### 200

OK

```json
{
  "status": 0,
  "message": "OK",
  "timestamp": 1528373119,
  "data": {
    "quota": 1073741824,
    "display_quota": "1024MB",
    "url": "https://s3-us-west-1.amazonaws.com/onepagecrm-ud2-us-west-1/",
    "fields": {
      "key": "",
      "x-ignore-pattern": "59bacde236aebd7842f8be7x/__timestamp__/${filename}",
      "acl": "private",
      "success_action_status": 201,
      "policy": "aBcDe...aBcDe=",
      "x-amz-algorithm": "AWS4-HMAC-SHA256",
      "x-amz-credential": "ABCDE...ABCDE/20170914/us-west-1/s3/aws4_request",
      "x-amz-date": "20170914T184346Z",
      "x-amz-signature": "aBcDe...aBcDe"
    }
  }
}
```

Standard error responses: 400, 401, 403, 404, 409, 500 — shared across the API. See https://developer.onepagecrm.com/api/errors/.

## Related guides

- [Authentication](https://developer.onepagecrm.com/api/authentication/)
- [Errors](https://developer.onepagecrm.com/api/errors/)
- [Rate limits](https://developer.onepagecrm.com/api/rate-limits/)
