# 2.Create Documents

After obtaining the access token in previous step, the portal/application lets the user choose the documents to be signed. Either by letting them upload the documents to the portal or select documents that the portal already has access to. Next, the portal creates each of the Document resources of the API by sending the PDF document. The portal must send a request to create a document signature process operation for each of the documents.

<mark style="color:green;">`POST`</mark> \*\*<https://stg-id.uaepass.ae/trustedx-resources/esignsp/v2/documents**&#x20>;

HTTP/1.1

#### Headers

| Name                                            | Type   | Value                                                                  |
| ----------------------------------------------- | ------ | ---------------------------------------------------------------------- |
| Auhtorization                                   | String | Bearer fd1d9c5fc74fad4acc02eed62a81caf3d5d5a2017a18a253380fc18f2918574 |
| Content-Type                                    | String | multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW    |
| Postman-Token<mark style="color:red;">\*</mark> | String | 0cb4e517-8db9-473c-7b14-0ca2555bc199                                   |

#### Body

| Name     | Type   | Value                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| -------- | ------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| signers  | String | <p>\[{ "signature\_policy\_id": "urn:safelayer:eidas:policies:sign:document:pdf", "parameters": { "type": "pades-baseline", "signature\_field": { "name": "Sign1", "location": { "page": { "number": "2" }, "rectangle": { "x": 100, "y": 50, "height": 150, "width": 400 } }, "appearance": { "signature\_details": { "font": { "size": 15, "style": "italic",<br>"embed": true }, "details": \[{ "type": "subject", "title": "Signer Name: " }, { "type": "date", "title": "Signature Date: " }] } } } } }]</p> |
| document | String | file1.pdf                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |

{% code overflow="wrap" fullWidth="false" %}

```json
[{ "signature_policy_id": "urn:safelayer:eidas:policies:sign:document:pdf", "parameters": {
 "type": "pades-baseline",
 "signature_field": 
 {
  "name": "Sign1", 
  "location": {
   "page": {
    "number": "2" 
    }, 
    "rectangle":
     {
      "x": 100, "y": 50, "height": 150, "width": 400 
      } 
      },
   "appearance":
    { 
    "signature_details": 
    {
     "font": 
    {
     "size": 15, "style": "italic",
"embed": true 
},
 "details":
 [{ 
 "type": "subject", "title": "Signer Name: "
  },
  { 
  "type": "date", "title": "Signature Date: " 
  }]
   } 
   }
    }
     } 
     }]
```

{% endcode %}

In response to each request, the server responds with a message like the following:

**Response**

{% tabs %}
{% tab title="201" %}

```json
{
    "id": "t2mtk7bsp5vq8i1e3rqb6aejab1ivia5",
    "self": "https://stg-id.uaepass.ae/trustedx-resources/esignsp/v2/documents/t2mtk7bsp5vq8i1e3rqb6aejab1ivia5",
    "signers": [
        {
            "id": "65lrfbflu2uilclpmvvv0nmucdadsgsg",
            "self": "https://stg-id.uaepass.ae/trustedx-resources/esignsp/v2/documents/t2mtk7bsp5vq8i1e3rqb6aejab1ivia5/signers/65lrfbflu2uilclpmvvv0nmucdadsgsg"
        }
    ]
}

```

{% endtab %}

{% tab title="400" %}

```json
{
  "error": "Invalid request"
}
```

{% 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://docs.uaepass.ae/feature-guides/signature-integration-guide/digital-signature-multiple-document/signing-guide/untitled/2.create-documents.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.
