---
title: "Upload credit report XML"
method: POST
path: "/v1/book/upload/credit-xml"
tags: ["File Uploads"]
---

# Upload credit report XML

`POST /v1/book/upload/credit-xml`

## Request

- Base URL: `https://api.ocrolus.com`
- URL: `https://api.ocrolus.com/v1/book/upload/credit-xml`
- Auth: OAuth 2
  - Client credentials
  - Token URL: `https://auth.ocrolus.com/oauth/token`

Uploads a MISMO credit report XML file to a <<glossary:Book>>.

---

After you have [created a Book](https://docs.ocrolus.com/reference/book-add), call this endpoint to upload one credit report XML file to it. The file must be a MISMO credit report that contains `RESPONSE_GROUP` and `CREDIT_RESPONSE` elements. Ocrolus stores the file and processes it asynchronously. Send the file as a `multipart/form-data` encoded payload. To learn more, see the [multipart/form-data](https://docs.ocrolus.com/reference/multipartform-data-payloads) guide.

> 📘 Accepted does not mean parsed
  > - A `200` response means the XML file was accepted and queued for processing. Processing of the credit report continues after the response is returned.
  > - The maximum payload size is 200 MB.

## Restrictions

| Rule | What happens |
|---|---|
| One file per request | Only the `credit_file` part is read. Any other file part is ignored. |
| XML files only | The filename must end in `.xml`, and the MIME type must be `application/xml` or `text/xml`. |
| Book with no loan data | The upload is still accepted if the XML itself is valid. |
| Duplicate uploads | Uploading the same file again is not rejected. |
| Processing timing | Parsing starts after the response is returned. |

## Request body `multipart/form-data`

- object
  - `book_uuid` string, uuid, required: UUID of the <<glossary:Book>> to upload the credit report XML file to.
  - `credit_file` string, binary, required: One credit report XML file. The filename must end in `.xml`, and the MIME type must be `application/xml` or `text/xml`.

## Response `200`

Success. The credit report XML file was accepted and queued for processing.

- object
  - `status` integer: A numerical code that indicates the status of the request.
  - `response` object: An object received from the server that potentially contains data.
    - `message` string: Confirms that the credit report XML file was accepted. Processing continues asynchronously.
  - `message` string: A textual description that indicates details about this response's status.

## Other responses

- `400`: Bad Request. Request validation errors return an `error` field. Errors from processing the XML or reading the `book_uuid` return `type` and `msg` fields.
- `403`: Forbidden. The caller cannot update the Book.
- `415`: Unsupported Media Type. The file is not XML, or its MIME type is not `application/xml` or `text/xml`.
- `500`: Internal Server Error

---

[API](https://skmtc.dev/ocrolus/apis/file-uploads.md) - [All operations](https://skmtc.dev/ocrolus/apis/file-uploads/llms.txt) - [OpenAPI document](https://skmtc.dev/ocrolus/apis/file-uploads/revisions/f5da69c79aff?raw)
