# 400 Bad Request When Uploading an Attachment

This article examines an error that might occur when you upload an attachment to an issue using YouTrack REST API. You can face this error when the `Content-Type` header for the multipart request is missing the boundary parameter.

## Error Message

```
400 Bad Request
```

## Request Details

Here are the details about a sample request that might result in this error.

| Attribute | Value |
| --- | --- |
| Request method | POST |
| Endpoint | `/api/issues/issueID/attachments?fields=id,name` |
| Request header | `Content-Type: multipart/form-data` |
| HTTP response code | 400 |

## Troubleshooting

Here are some possible causes and suggestions on how to overcome the error and upload the attachment.

### Cause

The `Content-Type` header is set to `multipart/form-data` without the boundary parameter. YouTrack needs the boundary value to parse the parts of the multipart request.

### Solution

Let your HTTP client set the `Content-Type` header for the multipart request. Most clients add the required boundary parameter automatically when you pass the attachment as multipart form data.

If you set the header manually, make sure it includes the boundary parameter that matches the request body:

```
Content-Type: multipart/form-data; boundary=----WebKitFormBoundaryExample
```

