---
title: REST API - Add Attachment to Subartifact Request
slug: rm/rest-api-add-attachment-to-subartifact-request
docTags: 
createdAt: 2026-06-09T13:38:46.199Z
---

```bash
api/v1/projects/{projectId}/artifacts/{artifactId}/subArtifacts/{subArtifactId}/attachments
```

# Description

Adds a single file attachment to the specified subartifact.

# URL Structure

```bash
[Blueprint_URI]/api/v1/projects/{projectId}/artifacts/{artifactId}/subArtifacts/{subArtifactId}/attachments
```

- `ProjectId`: The ID of the project containing the artifact you want to add the attachment to.
- `ArtifactId`: The ID of the artifact you want to add the attachment to.
- `SubArtifactId`: The ID of the subartifact you want to add the attachment to.

# Supported Methods

- ****[POST](docId\:Hsi_LzXS8g_RX_ydUdZKg)****

# Request Body

There are two ways to upload an attachment:

- To add an attachment as a part of the request body, use the `Content-MD5` header and manually calculate a MD5 token for the value.
- Instead of providing an attachment as a part of the request body, you have the option of adding different sets of data by using MultipartContent MIME. For MultiPartContent, you must specify the `Content-Type` header as `multipart/form-data` (that is, `Content-Type: multipart/form-data;boundary={token}`) and use boundary parameters. For more information on using MultipartContent, see [http://www.w3.org/Protocols/rfc1341/7\_2\_Multipart.html](http://www.w3.org/Protocols/rfc1341/7_2_Multipart.html).

  For a reference in C#, see [REST API - Using the Content-Type Multipart Method](docId:7wpvsZA2qZ1TiaNWjs7Qn).

# HTTP Status Codes

- 200: OK
- 201: Successfully Created
- 206: Partial Content
- 400: Bad Request
  This error can occur for a variety of reasons:
  - At least one URI or request body parameter is invalid, such as one of the [Filter](docId\:Sv9GjVErxCZcgqdn28J7U), Traces, Offset or Limit parameters.
  - A required value has not been provided.
  - If you are submitting a [POST](docId\:Hsi_LzXS8g_RX_ydUdZKg) or [PATCH](docId\:RcjvHRLbY6de-zGKeHxuI) request and have not added the `X-HTTP-Method-Override` parameter to your request header.
- 401: Unauthorized
  - The Blueprint token is missing, invalid or expired.
- 403: Forbidden
  - The applicable permissions are needed. For example, this error can occur when:
    - An Author or Collaborate license is needed for access.
    - Comment permissions are needed on the artifact.
    - Edit permissions are needed on the change summary job.
- 404: NotFound
  - Item is not found in the project. For example, this error can occur when:
    - Artifact not found.
    - Artifact type not found.
    - Project not found.
    - ALM target not found.
    - Change summary job not found.
    - User does not have edit permissions for this artifact, project or ALM target.
- 409: Conflict
  - Reason for failure can be found in the response body. Additional information may also be found in the log.
- 411: Length Required
  - If the Content-Length header is missing in the request.
- 413: Request Entity Too Large
  - If the provided file size is larger than allowed.
- 415: Unsupported Media Type
  - If the provided media type is not of MIME Multipart Content "form-data."
- 416: Request Range Not Satisfiable
  - If `offset `points to a part of a collection that is not available.
- 500: Internal Server Error
- 501: Not Implemented

# Examples

## XML Example

**Request URI**

```bash
https://production.blueprintcloud.com/api/v1/projects/220870/artifacts/220914/subArtifacts/229080/attachments
```

**Request Header (Using Request Body to Add Attachment)**

```bash
Authorization: BlueprintToken IzRJb4XcD4OOYewT/3/bclvTZ9tjRtwtvNXzlJlN6/j4jzp4TpEEI4jContent-MD5: 86E8C9EF442FFE19F3F7502B9E11B5E4Content-disposition: attachment;filename="BitmapAttachment.bmp"Content-Type: application/octet-streamContent-Length: 9270
```

**Response Body**

```xml
<?xml version="1.0" ?><Attachment xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.blueprintsys.com/blueprint/api/v1">  <FileName>BitmapAttachment.bmp</FileName>  <Id>8083</Id>  <Link>http://localhost:61928/api/v1/projects/206078/artifacts/206093/attachments/8083</Link></Attachment>
```

## JSON Example

**Request URI**

```bash
https://production.blueprintcloud.com/api/v1/projects/220870/artifacts/220914/subArtifacts/229080/attachments
```

**Request Header (Using Request Body to Add Attachment)**

```bash
Authorization: BlueprintToken IzRJb4XcD4OOYewT/3/bclvTZ9tjRtwtvNXzlJlN6/j4jzp4TpEEI4jContent-MD5: 86E8C9EF442FFE19F3F7502B9E11B5E4Content-disposition: attachment;filename="BitmapAttachment.bmp"Content-Type: application/octet-streamContent-Length: 9270
```

**Response Body**

```json
{    "Id": 8082,    "FileName": "BitmapAttachment.bmp",    "Link": "http://localhost:61928/api/v1/projects/206078/artifacts/206093/attachments/8082"}
```

