Skip to main content
POST
/
documents
/
v2
/
rs
Create a new document
curl --request POST \
  --url https://z52mnqg347.execute-api.eu-west-3.amazonaws.com/main/documents/v2/rs \
  --header 'Authorization: Bearer <token>' \
  --header 'content-type: <content-type>' \
  --header 'x-session-token: <x-session-token>' \
  --data '
{
  "document": {
    "name": "example.jpg",
    "mimeType": "image/jpeg",
    "size": 1024
  },
  "origin": {
    "type": "PLAN",
    "id": 123
  },
  "labelId": 1,
  "siteIds": [
    1,
    2,
    3
  ],
  "technicalInstallationIds": [
    1,
    2,
    3
  ]
}
'
{
  "data": {
    "document": {
      "id": 1,
      "name": "Document Name",
      "type": 1,
      "updatedAt": "2024-12-09T14:23:00.000Z",
      "createdAt": "2024-01-15T08:45:00.000Z",
      "s3key": "Document storage key",
      "mimeType": "application/pdf",
      "size": 1024,
      "originType": "PLAN",
      "labelId": 1,
      "technicalInstallationIds": [
        1,
        2,
        3
      ],
      "buildingWorkId": 1,
      "reportId": 1,
      "contractId": 1,
      "trainingInterventionId": 1,
      "planId": 1,
      "createdById": 1
    },
    "presignedUrl": "https://example.com/presigned-url"
  }
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Headers

content-type
string
required

Content type, must be "application/json".

Allowed value: "application/json"
x-session-token
string
required

Session token used for authenticating the request.

Example:

"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiIxMjM0NTY3ODkwIiwic2Vzc2lvbklkIjoiYWJjZGVmMTIzNDU2IiwiaWF0IjoxNjA1MDk3ODk5LCJleHAiOjE2MDUxODQyOTl9.4XRQ1iXDyvEj5LgPZHbmTmzOZs98M3YPOzgf3MhxjaI"

Body

application/json

Details required to create a document

document
object
required
origin
object
required
labelId
integer

Identifier of the associated label.

Required range: -9007199254740991 <= x <= 9007199254740991
Example:

1

siteIds
integer[]

Array of site identifiers associated with the document.

Maximum array length: 50
Required range: -9007199254740991 <= x <= 9007199254740991
Example:
[1, 2, 3]
technicalInstallationIds
integer[]

Array of installation technique identifiers associated with the document.

Maximum array length: 50
Required range: -9007199254740991 <= x <= 9007199254740991
Example:
[1, 2, 3]

Response

201 - application/json

Document created successfully

data
object
required