# Upload File

Upload a File. Use the returned Id when submitting a claim to attach it to that claim.

## Upload File

<mark style="color:green;">`POST`</mark> `https://api.xclaim.xcover-staging.com/partners/{partnerCode}/files`

Upload a File. Use the returned Id when submitting a claim to attach it to that claim.

#### Path Parameters

| Name                                          | Type   | Description |
| --------------------------------------------- | ------ | ----------- |
| partnerCode<mark style="color:red;">\*</mark> | String | eg. XYZ999  |

#### Headers

| Name                                            | Type   | Description          |
| ----------------------------------------------- | ------ | -------------------- |
| Authorization<mark style="color:red;">\*</mark> | String | Bearer {{JWT token}} |

{% tabs %}
{% tab title="422: Unprocessable Entity " %}
{% tabs %}
{% tab title="Request" %}

```json
{
    "file": null
}
```

{% endtab %}

{% tab title="Response" %}

```json
{
    "type": "exception",
    "message": "422 Unprocessable Content",
    "errors": {
        "file": [
            "The file field is required."
        ]
    }
}
```

{% endtab %}
{% endtabs %}
{% endtab %}

{% tab title="201: Created " %}
{% tabs %}
{% tab title="Request" %}

```json
{
    "file": "dummy.pdf <file-resource>"
}
```

{% endtab %}

{% tab title="Response" %}

```json
{
    "data": {
        "id": "37aa1591-fb82-441e-8fd8-f8d34f2f682d",
        "claimId": null,
        "location": "claim_files/91ad816a-535f-11ee-8e0c-0bc1ac93123a.pdf",
        "meta": {
            "dirname": ".",
            "basename": "dummy.pdf",
            "extension": "pdf",
            "filename": "dummy"
        },
        "createdAt": "2023-09-15T00:34:02+00:00",
        "updatedAt": "2023-09-15T00:34:02+00:00"
    }
}
```

{% endtab %}
{% endtabs %}
{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://partner-docs.covergenius.com/xclaim/claims/claim-files/upload-file.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
