Skip to main content
POST
/
workspaces
/
{workspaceId}
/
documents:importUrl
Import Workspace Document from URL
curl --request POST \
  --url https://api.raydocs.com/workspaces/{workspaceId}/documents:importUrl \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "url": "<string>",
  "filename": "<string>"
}
'
{
  "document": {
    "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "workspace_id": 123,
    "filename": "<string>",
    "mime": "<string>",
    "size": 123,
    "sha256": "<string>",
    "status": "uploaded",
    "source_type": "upload",
    "source_url": "<string>",
    "parsings": [
      {
        "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
        "config_hash": "<string>",
        "status": "queued",
        "parser_version": "<string>",
        "updated_at": "2023-11-07T05:31:56Z"
      }
    ],
    "created_at": "2023-11-07T05:31:56Z"
  },
  "dedup": {
    "reused": true,
    "matched_by": "<string>"
  },
  "document_ref": {
    "kind": "documentRef",
    "documentId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "workspaceId": 123,
    "filename": "<string>",
    "mime": "<string>",
    "size": 123,
    "sha256": "<string>",
    "source": {
      "type": "upload",
      "url": "<string>"
    },
    "createdAt": "2023-11-07T05:31:56Z"
  }
}
Import a remote document URL directly into your workspace document library.

Authentication & Scope

Requires documents-write.

Request

POST /workspaces/12/documents:importUrl HTTP/1.1
Host: api.raydocs.com
Authorization: Bearer <token>
Content-Type: application/json

{
  "url": "https://example.com/invoice.pdf",
  "filename": "invoice.pdf"
}

Response

201 Created when new, 200 OK when reused by sha256.
URL is provenance metadata only. Deduplication is content-based within the workspace.

Authorizations

Authorization
string
header
required

Personal Access Token created from the Raydocs dashboard. Include in the Authorization header: Bearer <your_token> See API Keys for token creation and management.

Path Parameters

workspaceId
integer
required

Body

application/json
url
string<uri>
required
filename
string

Response

Reused existing document by content hash

document
object
dedup
object
document_ref
object