---
title: "Add attchment to Comment"
method: POST
path: "/siteaudit/comments/{commentId}/attachments"
tags: ["Attachments"]
---

# Add attchment to Comment

`POST /siteaudit/comments/{commentId}/attachments`

## Request

- Base URL: `https://sb2api.servicechannel.com/v3`
- URL: `https://sb2api.servicechannel.com/v3/siteaudit/comments/{commentId}/attachments`
- Auth: OAuth 2
  - Authorization code: `https://sb2login.servicechannel.com/oauth/authorize`
  - Token URL: `https://sb2login.servicechannel.com/oauth/token`
- TypeScript: <https://skmtc.dev/servicechannel/apis/servicechannel-api-v-3/docs/siteaudit/comments/:commentId/attachments/post.ts> (a function with typed inputs; its response is checked against the schema)

Adds attchment to Comment. If Comment is not created yet specify {commentId} = -1.

## Path parameters

- `commentId` integer, required

## Request body `multipart/form-data`

- object
  - `file` string, binary, required: File to attach to Comment

## Response `201`

Created indicates that the request resulted in a new resource created before the response was sent.

## Other responses

- `400`: Bad Request - the request could not be understood or was missing required parameters. <br/>Error codes: <br/> 501 - Failed to upload attachment; <br/> 502 - Data not found. Returned if target Comment is not found; <br/> 503 - Request data is empty;
- `401`: Indicates that the requested resource requires authentication. <br/>Error codes: <br/> 504 - API call rejected by security permissions;
- `500`: Indicates that a generic error has occurred on the server.

---

[API](https://skmtc.dev/servicechannel/apis/servicechannel-api-v-3.md) - [All operations](https://skmtc.dev/servicechannel/apis/servicechannel-api-v-3/llms.txt) - [OpenAPI document](https://skmtc.dev/servicechannel/apis/servicechannel-api-v-3/revisions/d490d6596809?raw)
