---
updatedAt: 2026-07-21T14:55:00.000Z
agentTools:
  projectIndex: https://docs.sikoia.com/llms.txt
---

# Upload a document to an entity

### Uploads a document to a `case`, `person`, or `company`.

The document must be base64 encoded and included as a string in the file field.

Ensure that the `file_name` field includes the file extension.


The document must be base64 encoded and included as a string in the file field.Ensure that the `file_name` field includes the file extension.

# OpenAPI definition

```json
{
  "openapi": "3.0.1",
  "info": {
    "title": "Sikoia API",
    "termsOfService": "https://sikoia.com/About/Terms",
    "version": "1.0"
  },
  "servers": [
    {
      "url": "https://api.sikoia.com",
      "description": "API (Production)"
    },
    {
      "url": "https://oauth2.sikoia.com",
      "description": "Authorization Server (Production)"
    },
    {
      "url": "https://api-staging.sikoia.com",
      "description": "API (Staging)"
    },
    {
      "url": "https://oauth2-staging.sikoia.com",
      "description": "Authorization Server (Staging)"
    }
  ],
  "paths": {
    "/v2/documents": {
      "post": {
        "tags": [
          "Documents"
        ],
        "summary": "Upload a document to an entity",
        "description": "### Uploads a document to a `case`, `person`, or `company`.\r\n\r\nThe document must be base64 encoded and included as a string in the file field.\r\n\r\nEnsure that the `file_name` field includes the file extension.\r\n",
        "operationId": "POST_v2-documents",
        "requestBody": {
          "description": "",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SikoiaSharedModels.BusinessSupport.DocumentUpload.Request.DocumentUploadRequest"
              },
              "example": {
                "entity_id": "3f615611-3dc3-418b-bed5-a53c4390c97c",
                "entity_type": "person",
                "file": "c29tZSBlbmNvZGVkIGRhdGE=",
                "document_type": "BankStatement",
                "display_name": "January 2023 Bank Statement",
                "file_name": "January-2023-Bank-Statement.pdf"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Document",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SikoiaSharedModels.BusinessSupport.DocumentUpload.Response.DocumentUploadResponse"
                },
                "example": {
                  "document_id": "181eba57-b6b4-4288-8c97-f8299530f071",
                  "document_uri": "https://sikoialake.blob.core.windows.net/clientid/documents/181eba57-b6b4-4288-8c97-f8299530f071.pdf?sv=2021-08-06&st=2023-05-26T14%3A49%3A36Z&se=2023-05-26T14%3A59%3A36Z&sr=b&sp=r&sig=lMhD8hOX0USZid8RpkYGDZr3DQ8ouN6PDCXM1cRNI3w%3D",
                  "entity_type": "company",
                  "entity_id": "3f615611-3dc3-418b-bed5-a53c4390c97c",
                  "file_type": ".pdf",
                  "display_name": "January 2023 Bank Statement",
                  "document_type": "BankStatement",
                  "sikoia_document_type": "BankStatement",
                  "file_name": "January-2023-Bank-Statement.pdf",
                  "status": "Complete",
                  "datetime_created": "2023-02-10T10:59:46.0260000+00:00",
                  "date_created": "string",
                  "datetime_last_modified": "2023-02-10T10:59:46.0260000+00:00",
                  "date_uploaded": "string"
                }
              }
            }
          },
          "400": {
            "description": "Entity deleted/not found or invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SikoiaCore.Common.SikoiaErrorResponse"
                },
                "example": {
                  "type": "InvalidRequest",
                  "status": 400,
                  "title": "Validation Errors",
                  "detail": "Entity Id is required.",
                  "correlation_id": "1a08fbb0-a5aa-42f0-8108-82c22c60cb98"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SikoiaCore.Common.SikoiaErrorResponse"
                },
                "example": {
                  "type": "InvalidToken",
                  "status": 401,
                  "title": "Invalid Token",
                  "detail": "Invalid token",
                  "correlation_id": "c41b5937-a5d4-45ca-a396-f2e15c9e9600"
                }
              }
            }
          },
          "403": {
            "description": "Document upload not enabled",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SikoiaCore.Common.SikoiaErrorResponse"
                },
                "example": {
                  "type": "InsufficientPermissions",
                  "status": 403,
                  "title": "Service not enabled",
                  "detail": "Service is not currently enabled.",
                  "correlation_id": "0c43f683-9fab-4526-b0cb-0506b7629b8b"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SikoiaCore.Common.SikoiaErrorResponse"
                },
                "example": {
                  "type": "RateLimit",
                  "status": 429,
                  "title": "Too Many Requests",
                  "detail": "You've exceeded the maximum API request limit per minute. Please try again later.",
                  "correlation_id": "9feebce7-fa99-450a-af45-17a25bad3e20"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SikoiaCore.Common.SikoiaErrorResponse"
                },
                "example": {
                  "type": "ServerError",
                  "status": 500,
                  "title": "Internal Server Error",
                  "detail": "Something has gone wrong, please try again",
                  "correlation_id": "e64a888f-001a-491e-9087-ead8ee20ff7b"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "SikoiaCore.Common.SikoiaErrorResponse": {
        "title": "Error Response",
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "description": "The error type",
            "readOnly": true
          },
          "status": {
            "type": "integer",
            "description": "HTTP status code of the error",
            "format": "HttpCode",
            "readOnly": true
          },
          "title": {
            "type": "string",
            "description": "A short description of the error",
            "readOnly": true
          },
          "detail": {
            "type": "string",
            "description": "More details about what went wrong",
            "readOnly": true
          },
          "correlation_id": {
            "type": "string",
            "description": "Correlation ID, please include this in any support tickets raised",
            "readOnly": true
          }
        },
        "additionalProperties": false,
        "description": "See the [Response Guide](https://docs.sikoia.com/docs/api-behaviour#responses) for more detail "
      },
      "SikoiaSharedModels.BusinessSupport.DocumentUpload.Request.DocumentUploadRequest": {
        "title": "Upload File",
        "required": [
          "display_name",
          "entity_id",
          "entity_type",
          "file",
          "file_name"
        ],
        "type": "object",
        "properties": {
          "entity_id": {
            "minLength": 1,
            "type": "string",
            "description": "The `company_id`, `person_id` or `case_id` of the entity",
            "example": "3f615611-3dc3-418b-bed5-a53c4390c97c"
          },
          "entity_type": {
            "minLength": 1,
            "enum": [
              "company",
              "person",
              "case"
            ],
            "type": "string",
            "description": "The type of entity",
            "example": "person"
          },
          "file": {
            "minLength": 1,
            "type": "string",
            "description": "File data base64 encoded",
            "example": "c29tZSBlbmNvZGVkIGRhdGE="
          },
          "document_type": {
            "enum": [
              "BankStatement",
              "Payslip",
              "Identity",
              "Contract",
              "FactFind",
              "Other",
              "CompanyRegistration",
              "StakeholdersDisclosure",
              "UtilityBill",
              "CreditReport",
              "SavingsStatement",
              "SA302",
              "TaxOverview",
              "P45",
              "P60",
              "EmploymentLetter",
              "EmploymentContract",
              "ChildBenefitLetter",
              "BenefitAwardLetter",
              "StudentLoanLetter",
              "PensionStatement",
              "FinancialAccounts"
            ],
            "type": "string",
            "description": "The type of document",
            "nullable": true,
            "example": "BankStatement"
          },
          "display_name": {
            "minLength": 1,
            "type": "string",
            "description": "Display name",
            "example": "January 2023 Bank Statement"
          },
          "file_name": {
            "minLength": 1,
            "type": "string",
            "description": "File name including file extension",
            "example": "January-2023-Bank-Statement.pdf"
          }
        },
        "additionalProperties": false
      },
      "SikoiaSharedModels.BusinessSupport.DocumentUpload.Response.DocumentUploadResponse": {
        "title": "Document Response",
        "type": "object",
        "properties": {
          "document_id": {
            "type": "string",
            "description": "Sikoia ID for the document",
            "readOnly": true,
            "example": "181eba57-b6b4-4288-8c97-f8299530f071"
          },
          "document_uri": {
            "type": "string",
            "description": "The uri for the document",
            "readOnly": true,
            "example": "https://sikoialake.blob.core.windows.net/clientid/documents/181eba57-b6b4-4288-8c97-f8299530f071.pdf?sv=2021-08-06&st=2023-05-26T14%3A49%3A36Z&se=2023-05-26T14%3A59%3A36Z&sr=b&sp=r&sig=lMhD8hOX0USZid8RpkYGDZr3DQ8ouN6PDCXM1cRNI3w%3D"
          },
          "entity_type": {
            "enum": [
              "company",
              "person",
              "case"
            ],
            "type": "string",
            "description": "The type of entity",
            "readOnly": true
          },
          "entity_id": {
            "type": "string",
            "description": "The `company_id`, `person_id` or `case_id` of the entity",
            "readOnly": true,
            "example": "3f615611-3dc3-418b-bed5-a53c4390c97c"
          },
          "file_type": {
            "type": "string",
            "description": "The type of file",
            "readOnly": true,
            "example": ".pdf"
          },
          "display_name": {
            "type": "string",
            "description": "The display name of the document",
            "readOnly": true,
            "example": "January 2023 Bank Statement"
          },
          "document_type": {
            "enum": [
              "BankStatement",
              "Payslip",
              "Identity",
              "Contract",
              "FactFind",
              "Other",
              "CompanyRegistration",
              "StakeholdersDisclosure",
              "UtilityBill",
              "CreditReport",
              "SavingsStatement",
              "SA302",
              "TaxOverview",
              "P45",
              "P60",
              "EmploymentLetter",
              "EmploymentContract",
              "ChildBenefitLetter",
              "BenefitAwardLetter",
              "StudentLoanLetter",
              "PensionStatement",
              "FinancialAccounts"
            ],
            "type": "string",
            "description": "The type of document",
            "nullable": true,
            "readOnly": true,
            "example": "BankStatement"
          },
          "sikoia_document_type": {
            "enum": [
              "BankStatement",
              "Payslip",
              "Identity",
              "Contract",
              "FactFind",
              "Other",
              "CompanyRegistration",
              "StakeholdersDisclosure",
              "UtilityBill",
              "CreditReport",
              "SavingsStatement",
              "SA302",
              "TaxOverview",
              "P45",
              "P60",
              "EmploymentLetter",
              "EmploymentContract",
              "ChildBenefitLetter",
              "BenefitAwardLetter",
              "StudentLoanLetter",
              "PensionStatement",
              "FinancialAccounts"
            ],
            "type": "string",
            "description": "Document type, as classified by Sikoia's AI system",
            "nullable": true,
            "readOnly": true,
            "example": "BankStatement"
          },
          "file_name": {
            "type": "string",
            "description": "The name of the file",
            "readOnly": true,
            "example": "January-2023-Bank-Statement.pdf"
          },
          "status": {
            "type": "string",
            "description": "The status of the document upload. Possible values: `Complete`, `Failed`",
            "readOnly": true,
            "example": "Complete"
          },
          "datetime_created": {
            "type": "string",
            "description": "The time the document was created",
            "readOnly": true,
            "example": "2023-02-10T10:59:46.026Z"
          },
          "date_created": {
            "type": "string",
            "description": "Date Created",
            "format": "date-time",
            "readOnly": true,
            "deprecated": true
          },
          "datetime_last_modified": {
            "type": "string",
            "description": "The time the document was last modified",
            "readOnly": true,
            "example": "2023-02-10T10:59:46.026Z"
          },
          "date_uploaded": {
            "type": "string",
            "description": "Date Uploaded",
            "format": "date-time",
            "readOnly": true,
            "deprecated": true
          }
        },
        "additionalProperties": false
      }
    },
    "securitySchemes": {
      "authorizationHeader": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT"
      },
      "apiKeyHeader": {
        "type": "apiKey",
        "name": "apikey",
        "in": "header"
      }
    }
  },
  "security": [
    {
      "authorizationHeader": []
    },
    {
      "apiKeyHeader": []
    }
  ]
}
```