---
title: "Attach temporary file"
method: POST
path: "/rest/servicedeskapi/servicedesk/{serviceDeskId}/attachTemporaryFile"
tags: ["Servicedesk"]
---

# Attach temporary file

`POST /rest/servicedeskapi/servicedesk/{serviceDeskId}/attachTemporaryFile`

This method adds one or more temporary attachments to a service desk, which can then be permanently attached to a customer request using [servicedeskapi/request/\{issueIdOrKey\}/attachment](#api-request-issueIdOrKey-attachment-post).

**Note**: It is possible for a service desk administrator to turn off the ability to add attachments to a service desk.

This method expects a multipart request. The media-type multipart/form-data is defined in RFC 1867. Most client libraries have classes that make dealing with multipart posts simple. For instance, in Java the Apache HTTP Components library provides [MultiPartEntity](http://hc.apache.org/httpcomponents-client-ga/httpmime/apidocs/org/apache/http/entity/mime/MultipartEntity.html).

Because this method accepts multipart/form-data, it has XSRF protection on it. This means you must submit a header of X-Atlassian-Token: no-check with the request or it will be blocked.

The name of the multipart/form-data parameter that contains the attachments must be `file`.

For example, to upload a file called `myfile.txt` in the Service Desk with ID 10001 use

    curl -D- -u customer:customer -X POST -H "X-ExperimentalApi: opt-in" -H "X-Atlassian-Token: no-check" -F "file=@myfile.txt" https://your-domain.atlassian.net/rest/servicedeskapi/servicedesk/10001/attachTemporaryFile

**[Permissions](#permissions) required**: Permission to add attachments in this Service Desk.

## Path parameters

- `serviceDeskId` string, required

## Response `201`

Returns if the file(s) were attached.

## Other responses

- `400` — Returned if the attachments are not valid, or exceed the maximum configured attachment size.
- `401` — Returned if the user is not logged in.
- `403` — Returned if the user does not have permission to complete this request.
- `404` — Returned if the service desk does not exist.
- `413` — Returned if more than 60 files are requested to be uploaded.
- `500` — Internal Server Error.

---

[API](https://skmtc.net/atlassian/apis/service-management-public-rest-api.md) · [All operations](https://skmtc.net/atlassian/apis/service-management-public-rest-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/atlassian/service-management-public-rest-api/versions/0c91941a1ff9/schema)
