> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://documentation.apexverify.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://documentation.apexverify.com/_mcp/server.

# Data Format Normalization

POST https://api.apexverify.com/v1/format
Content-Type: multipart/form-data

Normalize Data Format. Accepts a TXT file containing line-return delimited content.

Reference: https://documentation.apexverify.com/api-reference/apex-verify-api/format/normalization-v-1-format-post

## Request

### Body (multipart/form-data)

This endpoint expects a multipart form containing a file.

- `file` (file, required) — Data Format file content to upload for normalization.
- `type` (enum, required) — Type of data to apply to the formatting.
- `target_country` (enum, required) — Country against which the format should be processed.

## Response

### 200

Successful Response

- `map from string to string`

## Errors

### 400 Bad Request Error

Bad Request

- `message` (string, optional, default: Bad Request)

### 404 Not Found Error

Not Found

- `message` (string, optional, default: Not Found)

### 422 Unprocessable Entity Error

Validation Error

- `detail` (list of ValidationError, optional)

### 429 Too Many Requests Error

Too Many Requests

- `message` (string, optional, default: Too Many Requests)

### 500 Internal Server Error

Internal Server Error

- `message` (string, optional, default: Internal Server Error. Please contact support at contact@apexverify.com...)

## Types

### ValidationError

- `loc` (list of ValidationErrorLocItems, required)
- `msg` (string, required)
- `type` (string, required)
- `input` (any, optional)
- `ctx` (ValidationErrorCtx, optional)

### ValidationErrorLocItems

- string
- integer

### ValidationErrorCtx

## Examples

**Request**

```json
{
  "file": "<file: string>",
  "type": "email",
  "target_country": "SG"
}
```

**Response**

```json
{}
```

**SDK Code**

```python
import requests

url = "https://api.apexverify.com/v1/format"

files = { "file": "open('string', 'rb')" }
payload = {
    "type": "email",
    "target_country": "SG"
}

response = requests.post(url, data=payload, files=files)

print(response.json())
```

```javascript
const url = 'https://api.apexverify.com/v1/format';
const form = new FormData();
form.append('file', 'string');
form.append('type', 'email');
form.append('target_country', 'SG');

const options = {method: 'POST'};

options.body = form;

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.apexverify.com/v1/format"

	payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"string\"\r\nContent-Type: application/octet-stream\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"type\"\r\n\r\nemail\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"target_country\"\r\n\r\nSG\r\n-----011000010111000001101001--\r\n")

	req, _ := http.NewRequest("POST", url, payload)

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.apexverify.com/v1/format")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"string\"\r\nContent-Type: application/octet-stream\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"type\"\r\n\r\nemail\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"target_country\"\r\n\r\nSG\r\n-----011000010111000001101001--\r\n"

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.apexverify.com/v1/format")
  .body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"string\"\r\nContent-Type: application/octet-stream\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"type\"\r\n\r\nemail\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"target_country\"\r\n\r\nSG\r\n-----011000010111000001101001--\r\n")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.apexverify.com/v1/format', [
  'multipart' => [
    [
        'name' => 'file',
        'filename' => 'string',
        'contents' => null
    ],
    [
        'name' => 'type',
        'contents' => 'email'
    ],
    [
        'name' => 'target_country',
        'contents' => 'SG'
    ]
  ]
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.apexverify.com/v1/format");
var request = new RestRequest(Method.POST);
request.AddParameter("undefined", "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"string\"\r\nContent-Type: application/octet-stream\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"type\"\r\n\r\nemail\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"target_country\"\r\n\r\nSG\r\n-----011000010111000001101001--\r\n", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation
let parameters = [
  [
    "name": "file",
    "fileName": "string"
  ],
  [
    "name": "type",
    "value": "email"
  ],
  [
    "name": "target_country",
    "value": "SG"
  ]
]

let boundary = "---011000010111000001101001"

var body = ""
var error: NSError? = nil
for param in parameters {
  let paramName = param["name"]!
  body += "--\(boundary)\r\n"
  body += "Content-Disposition:form-data; name=\"\(paramName)\""
  if let filename = param["fileName"] {
    let contentType = param["content-type"]!
    let fileContent = String(contentsOfFile: filename, encoding: String.Encoding.utf8)
    if (error != nil) {
      print(error as Any)
    }
    body += "; filename=\"\(filename)\"\r\n"
    body += "Content-Type: \(contentType)\r\n\r\n"
    body += fileContent
  } else if let paramValue = param["value"] {
    body += "\r\n\r\n\(paramValue)"
  }
}

let request = NSMutableURLRequest(url: NSURL(string: "https://api.apexverify.com/v1/format")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```