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.eyJzdWIiOiIxOTA2Iiwic2NwIjoidXNlciIsImF1ZCI6bnVsbCwiaWF0IjoxNzYzNjI2NDE0LCJleHAiOjE3NjYyMTg0MTQsImp0aSI6IjJiNjc0ZjAwLTM1N2EtNDhkMS1iZjYyLWQ2MmY1Nzg1NWUyYiJ9.GRpABmy0LH7okP6uf58i5tokcOFhaMxwEvz2bg1FJu0
Host: example.org
Cookie: 

Body

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

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/"f0994bd38226600fac7c4c7a21a46ff9"
cache-control: max-age=0, private, must-revalidate
x-request-id: a66ad210-3c28-45f2-955c-f06b4c5fab3d
x-runtime: 0.078588
content-length: 359

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": "ut"
  }
}