Document

Document

Document endpoints

Get All

Description


Get all documents.

Parameters


Responses


Type:

Array of Document objects


Example:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
{
    _id: "0f9c0b0b4f0c6b0017f0e3b1",
    type: "Document",
    entityType: "User",
    tags: [
        "2024",
        "W2"
    ],
    name: "Fassport",
    originalName: "Fassport",
    description: "Fassport",
    uploadedBy: "0f9c0b0b4f0c6b0017f0e3b1",
    uploadedAt: "2025-01-18T06:04:42.106Z",
    generatedBy: "0f9c0b0b4f0c6b0017f0e3b1",
    generatedAt: "2025-01-18T06:04:42.106Z",
    mimeType: "application/pdf",
    size: 1000
}

Type:

Error object


Example:

1
2
3
4
5
{
    name: "Invalid Role",
    message: "You do not have the required role to access this resource",
    status: 401
}

Type:

Error object


Example:

1
2
3
4
5
{
    name: "Entity not found",
    message: "Entity not found",
    status: 404
}

Type:

Error object


Example:

1
2
3
4
5
{
    name: "Internal Server Error",
    message: "Internal Server Error",
    status: 500
}

get

/document/

Request

1
2
3
4
curl https://app.fassport.co/api/v1/document/ \
    -X GET \
     \
    

Response

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
{
    _id: "0f9c0b0b4f0c6b0017f0e3b1",
    type: "Document",
    entityType: "User",
    tags: [
        "2024",
        "W2"
    ],
    name: "Fassport",
    originalName: "Fassport",
    description: "Fassport",
    uploadedBy: "0f9c0b0b4f0c6b0017f0e3b1",
    uploadedAt: "2025-01-18T06:04:42.106Z",
    generatedBy: "0f9c0b0b4f0c6b0017f0e3b1",
    generatedAt: "2025-01-18T06:04:42.106Z",
    mimeType: "application/pdf",
    size: 1000
}

Get by id

Description


Find the document that matches the {documentId} query parameter.

Parameters


headers

Authorization

string

Required

Description:

Bearer token - JWT

Example:

"Bearer <token>"

params

documentId

string

Required

Description:

The id of the document

Example:

"0f9c0b0b4f0c6b0017f0e3b1"

Responses


Type:

Document object


Example:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
{
    _id: "0f9c0b0b4f0c6b0017f0e3b1",
    type: "Document",
    entityType: "User",
    tags: [
        "2024",
        "W2"
    ],
    name: "Fassport",
    originalName: "Fassport",
    description: "Fassport",
    uploadedBy: "0f9c0b0b4f0c6b0017f0e3b1",
    uploadedAt: "2025-01-18T06:04:42.106Z",
    generatedBy: "0f9c0b0b4f0c6b0017f0e3b1",
    generatedAt: "2025-01-18T06:04:42.106Z",
    mimeType: "application/pdf",
    size: 1000
}

Type:

Error object


Example:

1
2
3
4
5
{
    name: "Invalid Role",
    message: "You do not have the required role to access this resource",
    status: 401
}

Type:

Error object


Example:

1
2
3
4
5
{
    name: "Entity not found",
    message: "Entity not found",
    status: 404
}

Type:

Error object


Example:

1
2
3
4
5
{
    name: "Internal Server Error",
    message: "Internal Server Error",
    status: 500
}

get

/document/:documentId

Request

1
2
3
4
curl https://app.fassport.co/api/v1/document/:documentId \
    -X GET \
    -H 'Authorization: Bearer <token>' \
    

Response

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
{
    _id: "0f9c0b0b4f0c6b0017f0e3b1",
    type: "Document",
    entityType: "User",
    tags: [
        "2024",
        "W2"
    ],
    name: "Fassport",
    originalName: "Fassport",
    description: "Fassport",
    uploadedBy: "0f9c0b0b4f0c6b0017f0e3b1",
    uploadedAt: "2025-01-18T06:04:42.106Z",
    generatedBy: "0f9c0b0b4f0c6b0017f0e3b1",
    generatedAt: "2025-01-18T06:04:42.106Z",
    mimeType: "application/pdf",
    size: 1000
}

Create

Description


Create a new document.

Parameters


headers

Authorization

string

Required

Description:

Bearer token - JWT

Example:

"Bearer <token>"

formData

file

file

Required

Description:

The file to upload

Example:

"file.pdf"

name

string

Required

Description:

The name of the document

Example:

"Fassport"

description

string

Description:

The description of the document

Example:

"Fassport"

tags

array

Description:

The tags of the document

Example:

tags

type

string

Description:

The type of the document

Options:

User | Application | Business | Document | Institution | Integration | Image | Offer | Lead | Pipeline | Campaign

Example:

"Document"

Responses


Type:

Document object


Example:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
{
    _id: "0f9c0b0b4f0c6b0017f0e3b1",
    type: "Document",
    entityType: "User",
    tags: [
        "2024",
        "W2"
    ],
    name: "Fassport",
    originalName: "Fassport",
    description: "Fassport",
    uploadedBy: "0f9c0b0b4f0c6b0017f0e3b1",
    uploadedAt: "2025-01-18T06:04:42.106Z",
    generatedBy: "0f9c0b0b4f0c6b0017f0e3b1",
    generatedAt: "2025-01-18T06:04:42.106Z",
    mimeType: "application/pdf",
    size: 1000
}

Type:

Error object


Example:

1
2
3
4
5
{
    name: "Invalid Role",
    message: "You do not have the required role to access this resource",
    status: 401
}

Type:

Error object


Example:

1
2
3
4
5
{
    name: "Entity not found",
    message: "Entity not found",
    status: 404
}

Type:

Error object


Example:

1
2
3
4
5
{
    name: "Internal Server Error",
    message: "Internal Server Error",
    status: 500
}

post

/document/

Request

1
2
3
4
5
curl https://app.fassport.co/api/v1/document/ \
    -X POST \
    -H 'Authorization: Bearer <token>' \
    -H \'Content-Type: application/json\' \
	--data-raw '{"name":"\"Fassport\"","description":"\"Fassport\"","type":"\"Document\""}'

Response

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
{
    _id: "0f9c0b0b4f0c6b0017f0e3b1",
    type: "Document",
    entityType: "User",
    tags: [
        "2024",
        "W2"
    ],
    name: "Fassport",
    originalName: "Fassport",
    description: "Fassport",
    uploadedBy: "0f9c0b0b4f0c6b0017f0e3b1",
    uploadedAt: "2025-01-18T06:04:42.106Z",
    generatedBy: "0f9c0b0b4f0c6b0017f0e3b1",
    generatedAt: "2025-01-18T06:04:42.106Z",
    mimeType: "application/pdf",
    size: 1000
}

Update

Description


Update the document that matches the {documentId} query parameter.

Parameters


headers

Authorization

string

Required

Description:

Bearer token - JWT

Example:

"Bearer <token>"

params

documentId

string

Required

Description:

The id of the document

Example:

"0f9c0b0b4f0c6b0017f0e3b1"

formData

file

file

Required

Description:

The file to upload

Example:

"file.pdf"

name

string

Required

Description:

The name of the document

Example:

"Fassport"

description

string

Description:

The description of the document

Example:

"Fassport"

tags

array

Description:

The tags of the document

Example:

tags

type

string

Description:

The type of the document

Options:

User | Application | Business | Document | Institution | Integration | Image | Offer | Lead | Pipeline | Campaign

Example:

"Document"

Responses


Type:

Document object


Example:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
{
    _id: "0f9c0b0b4f0c6b0017f0e3b1",
    type: "Document",
    entityType: "User",
    tags: [
        "2024",
        "W2"
    ],
    name: "Fassport",
    originalName: "Fassport",
    description: "Fassport",
    uploadedBy: "0f9c0b0b4f0c6b0017f0e3b1",
    uploadedAt: "2025-01-18T06:04:42.106Z",
    generatedBy: "0f9c0b0b4f0c6b0017f0e3b1",
    generatedAt: "2025-01-18T06:04:42.106Z",
    mimeType: "application/pdf",
    size: 1000
}

Type:

Error object


Example:

1
2
3
4
5
{
    name: "Invalid Role",
    message: "You do not have the required role to access this resource",
    status: 401
}

Type:

Error object


Example:

1
2
3
4
5
{
    name: "Entity not found",
    message: "Entity not found",
    status: 404
}

Type:

Error object


Example:

1
2
3
4
5
{
    name: "Internal Server Error",
    message: "Internal Server Error",
    status: 500
}

put

/document/:documentId

Request

1
2
3
4
5
curl https://app.fassport.co/api/v1/document/:documentId \
    -X PUT \
    -H 'Authorization: Bearer <token>' \
    -H \'Content-Type: application/json\' \
	--data-raw '{"name":"\"Fassport\"","description":"\"Fassport\"","type":"\"Document\""}'

Response

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
{
    _id: "0f9c0b0b4f0c6b0017f0e3b1",
    type: "Document",
    entityType: "User",
    tags: [
        "2024",
        "W2"
    ],
    name: "Fassport",
    originalName: "Fassport",
    description: "Fassport",
    uploadedBy: "0f9c0b0b4f0c6b0017f0e3b1",
    uploadedAt: "2025-01-18T06:04:42.106Z",
    generatedBy: "0f9c0b0b4f0c6b0017f0e3b1",
    generatedAt: "2025-01-18T06:04:42.106Z",
    mimeType: "application/pdf",
    size: 1000
}

Get events

Description


Get all events for the document that matches the {documentId} query parameter.

Parameters


headers

Authorization

string

Required

Description:

Bearer token - JWT

Example:

"Bearer <token>"

params

documentId

string

Required

Description:

The id of the document

Example:

"0f9c0b0b4f0c6b0017f0e3b1"

Responses


Type:

Array of Event objects


Example:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
{
    _id: "0f9c0b0b4f0c6b0017f0e3b1",
    type: "updated",
    message: "User 0f9c0b0b4f0c6b0017f0e3b1 updated forwarder 0f9c0b0b4f0c6b0017f0e3b1",
    user: "0f9c0b0b4f0c6b0017f0e3b1",
    entity: "0f9c0b0b4f0c6b0017f0e3b1",
    entityType: "Application",
    refs: [
        {
            entity: "0f9c0b0b4f0c6b0017f0e3b1",
            entityType: "Application"
        },
        {
            entity: "0f9c0b0b4f0c6b0017f0e3b1",
            entityType: "Business"
        }
    ]
}

Type:

Error object


Example:

1
2
3
4
5
{
    name: "Invalid Role",
    message: "You do not have the required role to access this resource",
    status: 401
}

Type:

Error object


Example:

1
2
3
4
5
{
    name: "Entity not found",
    message: "Entity not found",
    status: 404
}

Type:

Error object


Example:

1
2
3
4
5
{
    name: "Internal Server Error",
    message: "Internal Server Error",
    status: 500
}

get

/document/:documentId/events

Request

1
2
3
4
curl https://app.fassport.co/api/v1/document/:documentId/events \
    -X GET \
    -H 'Authorization: Bearer <token>' \
    

Response

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
{
    _id: "0f9c0b0b4f0c6b0017f0e3b1",
    type: "updated",
    message: "User 0f9c0b0b4f0c6b0017f0e3b1 updated forwarder 0f9c0b0b4f0c6b0017f0e3b1",
    user: "0f9c0b0b4f0c6b0017f0e3b1",
    entity: "0f9c0b0b4f0c6b0017f0e3b1",
    entityType: "Application",
    refs: [
        {
            entity: "0f9c0b0b4f0c6b0017f0e3b1",
            entityType: "Application"
        },
        {
            entity: "0f9c0b0b4f0c6b0017f0e3b1",
            entityType: "Business"
        }
    ]
}

Copyright © Fassport 2025 • Terms • Privacy •