Documents

Create a profile document

POST create document

Endpoint

POST /api/v1/users/profile/documents

Parameters

Name Description
document[name] required Document name
document[file] required Document file

Request

Route

POST /api/v1/users/profile/documents

Headers

Accept: application/json
Content-Type: application/json
Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiIxODU5Iiwic2NwIjoidXNlciIsImF1ZCI6bnVsbCwiaWF0IjoxNzYwOTUwNDc4LCJleHAiOjE3NjM1NDI0NzgsImp0aSI6IjNlMzVkZWI2LTllNDQtNGM3NS05NGY4LWIzZmU0NmEyY2UzYyJ9.cKNYE6Az-zTesFaN1nAnaRUFhwZFyj9XpW2l-Z2b7Qk
Host: example.org
Cookie: 

Body

{
  "document": {
    "file": "eyJfcmFpbHMiOnsiZGF0YSI6MzEsInB1ciI6ImJsb2JfaWQifX0=--88ff9c99b80d68e57f07401692209c5170b6a02c",
    "name": "occaecati"
  }
}

Response

Simulated Response

Status

200

Headers

x-frame-options: SAMEORIGIN
x-xss-protection: 0
x-content-type-options: nosniff
x-permitted-cross-domain-policies: none
referrer-policy: strict-origin-when-cross-origin
content-type: application/json; charset=utf-8
vary: Accept, Origin
etag: W/"1eb382f5af76dab00932f4b89c3dac3e"
cache-control: max-age=0, private, must-revalidate
x-request-id: 81536fc8-5dfe-4c0c-a7c5-d89f616a5326
x-runtime: 0.073632
content-length: 366

Body

{
  "document": {
    "id": 1,
    "file": {
      "id": 27,
      "signed_id": "eyJfcmFpbHMiOnsiZGF0YSI6MzEsInB1ciI6ImJsb2JfaWQifX0=--88ff9c99b80d68e57f07401692209c5170b6a02c",
      "byte_size": 596,
      "filename": "test",
      "url": "http://localhost:3000/rails/active_storage/blobs/redirect/eyJfcmFpbHMiOnsiZGF0YSI6MzEsInB1ciI6ImJsb2JfaWQifX0=--88ff9c99b80d68e57f07401692209c5170b6a02c/test"
    },
    "name": "occaecati"
  }
}