Skip to content
Suomi

Start an upload of a reference document for the organisation's templates

POST
/v1/organisation/reference-documents/uploads
Code sample: Shell / cURL
curl --request POST \
--url https://api.whatsbuilt.fi/v1/organisation/reference-documents/uploads \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "filename": "example", "content_type": "application/pdf", "byte_size": 1 }'

Answers a presigned PUT for one PDF. Upload it, then call createOrganisationReferenceDocument with the key. Needs an integration that is an admin of its organisation.

Media typeapplication/json
object
filename
required
string
>= 1 characters <= 255 characters /^[^\u0000-\u001f\u007f]+$/
content_type
required
string
Allowed values: application/pdf
byte_size
required
integer format: int64
>= 1 <= 20971520

Where to upload

Media typeapplication/json

Where to upload.

object
key
required

Pass it to createReferenceDocument, or createOrganisationReferenceDocument, once the upload has finished

string
upload_url
required
string
method
required
string
Allowed values: PUT
headers
required

Send exactly these headers with the PUT

object
key
additional properties
string
expires_in
required
integer format: int64

Example

{
"method": "PUT"
}

VALIDATION_ERROR, DOCUMENT_TYPE_NOT_ALLOWED or DOCUMENT_TOO_LARGE

Media typeapplication/json

The error body of every /v1 answer of 400 or more.

object
error
required

A sentence for people; it may change

string
code
required

Part of the contract

string
details

What the code names, where it names something

request_id
required

The X-Request-Id of the call

string

Example generated

{
"error": "example",
"code": "example",
"details": "example",
"request_id": "example"
}

Missing, malformed, expired or revoked token

Media typeapplication/json

The error body of every /v1 answer of 400 or more.

object
error
required

A sentence for people; it may change

string
code
required

Part of the contract

string
details

What the code names, where it names something

request_id
required

The X-Request-Id of the call

string

Example generated

{
"error": "example",
"code": "example",
"details": "example",
"request_id": "example"
}

INSUFFICIENT_SCOPE; INSUFFICIENT_ROLE when the integration is not an admin of its organisation

Media typeapplication/json

The error body of every /v1 answer of 400 or more.

object
error
required

A sentence for people; it may change

string
code
required

Part of the contract

string
details

What the code names, where it names something

request_id
required

The X-Request-Id of the call

string

Example generated

{
"error": "example",
"code": "example",
"details": "example",
"request_id": "example"
}

No such document

Media typeapplication/json

The error body of every /v1 answer of 400 or more.

object
error
required

A sentence for people; it may change

string
code
required

Part of the contract

string
details

What the code names, where it names something

request_id
required

The X-Request-Id of the call

string

Example generated

{
"error": "example",
"code": "example",
"details": "example",
"request_id": "example"
}

IDEMPOTENCY_KEY_REUSED: the key was used with another body

Media typeapplication/json

The error body of every /v1 answer of 400 or more.

object
error
required

A sentence for people; it may change

string
code
required

Part of the contract

string
details

What the code names, where it names something

request_id
required

The X-Request-Id of the call

string

Example generated

{
"error": "example",
"code": "example",
"details": "example",
"request_id": "example"
}

RATE_LIMITED; wait for Retry-After seconds

Media typeapplication/json

The error body of every /v1 answer of 400 or more.

object
error
required

A sentence for people; it may change

string
code
required

Part of the contract

string
details

What the code names, where it names something

request_id
required

The X-Request-Id of the call

string

Example generated

{
"error": "example",
"code": "example",
"details": "example",
"request_id": "example"
}