---
title: "Create an attachment from a URL"
method: POST
path: "/attachments.createFromUrl"
tags: ["Attachments"]
---

# Create an attachment from a URL

`POST /attachments.createFromUrl`

## Request

- Base URL: `https://app.getoutline.com/api`
- URL: `https://app.getoutline.com/api/attachments.createFromUrl`
- Auth: one of:
  - HTTP bearer
  - OAuth 2
    - Authorization code: `https://app.getoutline.com/oauth/authorize`
    - Token URL: `https://app.getoutline.com/oauth/token` scopes: `read`, `write`

Fetch a file from a remote URL and store it as an attachment. Unlike `attachments.create`, the server downloads and uploads the file, so the returned attachment is immediately available.

## Request body

- object
  - `url` string, uri, required: The remote URL to fetch the file from.
  - `documentId` string, uuid: Identifier for the associated document, if any.
  - `id` string, uuid: An optional client-generated identifier for the attachment.

## Response `200`

OK

- object
  - `data` Attachment
    - `contentType` string
    - `size` string: The size of the attachment in bytes. Returned as a string as the value may exceed the safe integer range.
    - `name` string
    - `url` string, uri
    - `documentId` string, uuid, nullable: Identifier for the associated document, if any.
    - `userId` string, uuid: Identifier for the user that created the attachment.

## Other responses

- `400`: The request failed one or more validations.
- `401`: The API key is missing or otherwise invalid.
- `403`: The current API key is not authorized to perform this action.
- `429`: The request was rate limited.

## Changes

- **2026-09-05** `6287bce7caad`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/defaulr/apis/outline-api/changes/attachments.createFromUrl/post.md)

---

[API](https://skmtc.dev/defaulr/apis/outline-api.md) - [All operations](https://skmtc.dev/defaulr/apis/outline-api/llms.txt) - [OpenAPI document](https://skmtc.dev/defaulr/apis/outline-api/revisions/5ddf01ffba84?raw)
