Record an uploaded reference document for the organisation's templates
curl --request POST \ --url https://api.whatsbuilt.fi/v1/organisation/reference-documents \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "key": "example", "filename": "example" }'Checks that the upload finished and is a PDF, and records it for the organisation; attach it with an organisation template write. Sending the same key again returns the same document with 200, so a repeat needs no Idempotency-Key.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”object
Example generated
{ "key": "example", "filename": "example"}Responses
Section titled “Responses”The document this key was recorded as before
A reference document of the organisation’s templates.
object
Example generated
{ "id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "filename": "example", "content_type": "example", "byte_size": 1, "uploaded_by": "example", "uploaded_by_name": "example", "created_at": "example", "changed_at": "example"}The document
A reference document of the organisation’s templates.
object
Example generated
{ "id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "filename": "example", "content_type": "example", "byte_size": 1, "uploaded_by": "example", "uploaded_by_name": "example", "created_at": "example", "changed_at": "example"}DOCUMENT_UPLOAD_INCOMPLETE, DOCUMENT_CONTENT_MISMATCH, DOCUMENT_TOO_LARGE or a key of another organisation
The error body of every /v1 answer of 400 or more.
object
A sentence for people; it may change
Part of the contract
What the code names, where it names something
The X-Request-Id of the call
Example generated
{ "error": "example", "code": "example", "details": "example", "request_id": "example"}Missing, malformed, expired or revoked token
The error body of every /v1 answer of 400 or more.
object
A sentence for people; it may change
Part of the contract
What the code names, where it names something
The X-Request-Id of the call
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
The error body of every /v1 answer of 400 or more.
object
A sentence for people; it may change
Part of the contract
What the code names, where it names something
The X-Request-Id of the call
Example generated
{ "error": "example", "code": "example", "details": "example", "request_id": "example"}No such document
The error body of every /v1 answer of 400 or more.
object
A sentence for people; it may change
Part of the contract
What the code names, where it names something
The X-Request-Id of the call
Example generated
{ "error": "example", "code": "example", "details": "example", "request_id": "example"}IDEMPOTENCY_KEY_REUSED: the key was used with another body
The error body of every /v1 answer of 400 or more.
object
A sentence for people; it may change
Part of the contract
What the code names, where it names something
The X-Request-Id of the call
Example generated
{ "error": "example", "code": "example", "details": "example", "request_id": "example"}RATE_LIMITED; wait for Retry-After seconds
The error body of every /v1 answer of 400 or more.
object
A sentence for people; it may change
Part of the contract
What the code names, where it names something
The X-Request-Id of the call
Example generated
{ "error": "example", "code": "example", "details": "example", "request_id": "example"}