POST
/
api
/
external
/
v2
/
file_attachments
Upload a file
curl --request POST \
  --url https://app.pennylane.com/api/external/v2/file_attachments \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: multipart/form-data' \
  --form filename=Invoice42.pdf \
  --form file=@example-file
{
  "id": 123,
  "url": "http://www.pennylane.com/rails/active_storage/blobs/redirect/eyJfc..==--26d6e7391dd728fae2cde59bd3fbe4dd11e20a95/Invoice42.pdf",
  "filename": "<string>",
  "created_at": "2023-08-30T10:08:08.146343Z",
  "updated_at": "2023-08-30T10:08:08.146343Z"
}

Authorizations

Authorization
string
header
required

The access token received from the authorization server in the OAuth 2.0 flow.

Body

multipart/form-data
file
file
required

The file you want to upload. Allowed content types:

  • image/png
  • image/jpeg
  • image/tiff
  • image/bmp
  • image/gif
  • application/pdf
filename
string

Name of the file. If not provided, the default value will be the uploaded file name.

Example:

"Invoice42.pdf"

Response

Returns the created attachment

id
integer
required
url
string
required

URL to the uploaded file.

Example:

"http://www.pennylane.com/rails/active_storage/blobs/redirect/eyJfc..==--26d6e7391dd728fae2cde59bd3fbe4dd11e20a95/Invoice42.pdf"

filename
string
required
created_at
string<date-time>
required
Example:

"2023-08-30T10:08:08.146343Z"

updated_at
string<date-time>
required
Example:

"2023-08-30T10:08:08.146343Z"