# Create EDD Responses

<table data-header-hidden><thead><tr><th width="74.8046875" align="center"></th><th></th></tr></thead><tbody><tr><td align="center"><mark style="color:blue;"><strong>POST</strong></mark> </td><td>https://api.sfox.com/v1/enterprise/eddq/responses</td></tr></tbody></table>

Submit a user's responses to an EDD request.

{% hint style="info" %}
For additional details regarding EDD and completing EDD requests, see our [Enhanced Due Diligence (EDD) guide](https://docs.sfox.com/connect/introduction/guides/onboarding/enhanced-due-diligence-edd).
{% endhint %}

***

## Request

All ***required*** prompts (`is_required` = `true`) must be answered. Excluding a response to a required prompt in your request will result in an error response and responses included in your request will not be recorded/must be re-submitted in a new request.

For [EDD prompts](https://docs.sfox.com/connect/rest-api/end-users/get-edd-prompts) with `response_type` = `File-Upload`  prompts, you will submit ***the file name only*** in this request.&#x20;

* `response` must be set to the file name ***excluding*** the extension (e.g. `.jpg`, `.pdf`) For example, if you are submitting a document with file name `por_file.png`, you would set the `response` = `por_file`.
* After creating EDD responses here, you must submit the file itself either via a [Submit Documents](https://docs.sfox.com/connect/rest-api/end-users/submit-documents) request or [SFTP](https://docs.sfox.com/connect/rest-api/end-users/submit-documents/submit-documents-sftp).

### Body Parameters

<table><thead><tr><th width="246">Parameter</th><th width="86">Type</th><th>Description</th></tr></thead><tbody><tr><td><strong><code>user_id</code></strong> <mark style="color:red;">required</mark></td><td>string</td><td>The unique user ID of the user that you will be submitting responses for.</td></tr><tr><td><strong><code>prompts</code></strong> <mark style="color:red;">required</mark></td><td>string</td><td>The list of prompts applicable to the requested EDDQ.</td></tr><tr><td><strong><code>ddq_prompt_id</code></strong> <mark style="color:red;">required</mark></td><td>string</td><td><a href="../get-edd-prompts#response-body">The unique <code>id</code> retrieved from the list of EDD prompts</a>.</td></tr><tr><td><strong><code>response</code></strong> <mark style="color:red;">required</mark></td><td>string</td><td>The response from your end user.</td></tr><tr><td><strong><code>optional_free_form</code></strong></td><td>string</td><td>The optional response from your end user if <code>optional_free_form</code> = <code>true</code></td></tr></tbody></table>

### Example Requests

{% tabs %}
{% tab title="EDDQ - Individual" %}

```json
{ 
  "user_id": "${USER_ID}",
  "prompts": {
    "1": { "response": "hello"},
    "2": { "response": "hello"},
    "3": { "response": "hello"},
    "4": { "response": "hello"},
    "5": { "response": "hello"},
    "4": { "response": "hello", "optional_free_form":"hello world"},
    "52": {"response": "id_file"},
    "53": {"response": "por_file"}
  }
}
```

{% endtab %}

{% tab title="EDDQ - Business" %}

```json
{ 
  "user_id":"${USER_ID}",
  "prompts": {
    "6": { "response": "hello"},
    "7": { "response": "hello"},
    "8": { "response": "Custody of Virtual Currency"},
    "9": { "response": "hello"},
    "10": { "response": "hello"},
    "12": { "response": "hello"},
    "13": { "response": "hello"},
    "14": { "response": "hello"},
    "15": { "response": "hello"},
    "16": { "response": "hello"},
    "17": { "response": "hello"},
    "19": { "response": "Yes"},
    "20": { "response": "No"},
    "21": { "response": "Yes", "optional_free_form":"hello world"},
    "22": { "response": "Yes"},
    "23": { "response": "Yes"},
    "24": { "response": "Yes"},
    "25": { "response": "hello world"},
    "26": { "response": "hello world"},
    "27": { "response": "Yes"},
    "28": { "response": "Yes"},
    "29": { "response": "Yes"},
    "30": { "response": "No"},
    "31": { "response": "Yes"},
    "32": { "response": "Yes"},
    "33": { "response": "Yes"},
    "34": { "response": "Yes"},
    "35": { "response": "Yes"},
    "36": { "response": "Yes"},
    "37": { "response": "Yes"},
    "38": { "response": "Yes"},
    "39": { "response": "Yes"},
    "40": { "response": "Yes"},
    "41": { "response": "Yes"},
    "42": { "response": "Yes"},
    "43": { "response": "Yes"},
    "44": { "response": "Yes"},
    "45": { "response": "Yes"},
    "46": { "response": "Yes"},
    "47": { "response": "Yes"},
    "48": { "response": "Yes"},
    "49": { "response": "Yes"},
    "50": { "response": "Yes"},
    "54": { "response": "formation_documents_file"},
    "55": {"response":"principal_place_of_business_file"}
  }
} 
```

{% endtab %}
{% endtabs %}

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

```sh
curl -X POST \
  -H 'Content-Type: application/json' \
  -H  "Authorization: Bearer ${ENTERPRISE_API_KEY}" \
  --data '{
  "user_id": "${USER_ID}",
  "prompts": {
    "1": {"response": "${Response to prompt ID 1}"},
    "2": {"response": "${Response to prompt ID 2}"},
    "3": {"response": "${Response to prompt ID 3}"},
    "52": {"response": "${filename1}"},
    "53": {"response": "${filename2}"}
  }
}' \
'https://api.sfox.com/v1/enterprise/eddq/responses'
```

{% endtab %}

{% tab title="NodeJS" %}

```javascript
const axios = require('axios');

let data = JSON.stringify({
  "user_id": "${USER_ID}",
  "prompts": {
    "1": {"response": "${Response to prompt ID 1}"},
    "2": {"response": "${Response to prompt ID 2}"},
    "3": {"response": "${Response to prompt ID 3}"},
    "52": {"response": "${filename1}"},
    "53": {"response": "${filename2}"}
  }
});

let config = {
  method: 'post',
  maxBodyLength: Infinity,
  url: 'https://api.sfox.com/v1/enterprise/eddq/responses',
  headers: { 
    'Content-Type': 'application/json', 
    'Authorization': `Bearer ${process.env.ENTERPRISE_API_KEY}`, 
  },
  data : data
};

axios.request(config)
  .then((response) => {
    console.log(response.status);
    console.log(response.data);
  })
  .catch((error) => {
    console.log(error.response.status);
    console.log(error.response.data);
  });

```

{% endtab %}

{% tab title="Python" %}

```python
import requests
import os

data = {
  "user_id": "${USER_ID}",
  "prompts": {
    "1": {"response": "${Response to prompt ID 1}"},
    "2": {"response": "${Response to prompt ID 2}"},
    "3": {"response": "${Response to prompt ID 3}"},
    "52": {"response": "${filename1}"},
    "53": {"response": "${filename2}"}
  }
}

response = requests.post(
    'https://api.sfox.com/v1/enterprise/eddq/responses',
  headers={ 
    'Authorization': f"Bearer {os.environ['ENTERPRISE_API_KEY']}" 
  },
  json=data
)

print(response.status_code)
print(response.json())

```

{% endtab %}
{% endtabs %}

## Response

<details>

<summary><mark style="color:green;"><strong>200</strong></mark><strong>: OK</strong></summary>

{% code title="All prompts" %}

```json
{
    "data": {
        "success": true
    }
}
```

{% endcode %}

</details>
