For clean Markdown of any page, append .md to the page URL. For a complete documentation index, see https://documentation.apexverify.com/api-reference/apex-verify-api/format/llms.txt. For full documentation content, see https://documentation.apexverify.com/api-reference/apex-verify-api/format/llms-full.txt.

# 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

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: openapi
  version: 1.0.0
paths:
  /v1/format:
    post:
      operationId: normalization-v-1-format-post
      summary: Data Format Normalization
      description: >-
        Normalize Data Format. Accepts a TXT file containing line-return
        delimited content.
      tags:
        - subpackage_format
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FormatNormalizationModelResponse'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequestResponse'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFoundResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TooManyRequestsResponse'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InternalServerErrorResponse'
      requestBody:
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                file:
                  type: string
                  format: binary
                  description: Data Format file content to upload for normalization.
                type:
                  $ref: '#/components/schemas/BatchVerificationTypeEnum'
                  description: Type of data to apply to the formatting.
                target_country:
                  $ref: '#/components/schemas/CountryCodeIso2Enum'
                  description: Country against which the format should be processed.
              required:
                - file
                - type
                - target_country
servers:
  - url: https://api.apexverify.com
components:
  schemas:
    BatchVerificationTypeEnum:
      type: string
      enum:
        - email
        - phone
      title: BatchVerificationTypeEnum
    CountryCodeIso2Enum:
      type: string
      enum:
        - AF
        - AL
        - DZ
        - AS
        - AD
        - AO
        - AI
        - AG
        - AR
        - AM
        - AW
        - AU
        - AT
        - AZ
        - BH
        - BD
        - BB
        - BY
        - BE
        - BZ
        - BJ
        - BM
        - BT
        - BO
        - BA
        - BW
        - BR
        - IO
        - BN
        - BG
        - BF
        - BI
        - KH
        - CM
        - CA
        - CV
        - KY
        - CF
        - TD
        - CL
        - CN
        - CO
        - KM
        - CG
        - CD
        - CK
        - CR
        - CI
        - HR
        - CU
        - CY
        - CZ
        - DK
        - DJ
        - DM
        - DO
        - TL
        - EC
        - EG
        - SV
        - GQ
        - ER
        - EE
        - ET
        - FK
        - FO
        - FJ
        - FI
        - FR
        - PF
        - GA
        - GE
        - DE
        - GH
        - GI
        - GR
        - GL
        - GD
        - GP
        - GT
        - GG
        - GN
        - GW
        - GY
        - HT
        - HN
        - HK
        - HU
        - IS
        - IN
        - ID
        - IR
        - IQ
        - IE
        - IL
        - IT
        - JM
        - JP
        - JE
        - JO
        - KZ
        - KE
        - KR
        - KW
        - KG
        - LA
        - LV
        - LB
        - LS
        - LR
        - LY
        - LI
        - LT
        - LU
        - MO
        - MK
        - MG
        - MW
        - MY
        - MV
        - ML
        - MT
        - MQ
        - MR
        - MU
        - YT
        - MX
        - MD
        - MC
        - MN
        - ME
        - MS
        - MA
        - MZ
        - MM
        - NA
        - NR
        - NP
        - NL
        - NC
        - NZ
        - NI
        - NE
        - NG
        - NU
        - NF
        - MP
        - 'NO'
        - OM
        - PK
        - PW
        - PS
        - PA
        - PG
        - PY
        - PE
        - PH
        - PL
        - PT
        - QA
        - RE
        - RO
        - RU
        - RW
        - KN
        - LC
        - PM
        - VC
        - BL
        - MF
        - WS
        - SM
        - ST
        - SA
        - SN
        - RS
        - SC
        - SL
        - SG
        - SK
        - SI
        - SB
        - SO
        - ZA
        - GS
        - SS
        - ES
        - LK
        - SD
        - SR
        - SZ
        - SE
        - CH
        - SY
        - TW
        - TJ
        - TZ
        - TH
        - TG
        - TO
        - TT
        - TN
        - TR
        - TM
        - TC
        - UG
        - UA
        - AE
        - GB
        - US
        - UM
        - UY
        - UZ
        - VU
        - VE
        - VN
        - VG
        - YE
        - ZM
        - ZW
        - CW
        - SX
      title: CountryCodeIso2Enum
    FormatNormalizationModelResponse:
      type: object
      additionalProperties:
        type: string
      title: FormatNormalizationModelResponse
    BadRequestResponse:
      type: object
      properties:
        message:
          type: string
          default: Bad Request
      title: BadRequestResponse
    NotFoundResponse:
      type: object
      properties:
        message:
          type: string
          default: Not Found
      title: NotFoundResponse
    ValidationErrorLocItems:
      oneOf:
        - type: string
        - type: integer
      title: ValidationErrorLocItems
    ValidationErrorCtx:
      type: object
      properties: {}
      title: ValidationErrorCtx
    ValidationError:
      type: object
      properties:
        loc:
          type: array
          items:
            $ref: '#/components/schemas/ValidationErrorLocItems'
        msg:
          type: string
        type:
          type: string
        input:
          description: Any type
        ctx:
          $ref: '#/components/schemas/ValidationErrorCtx'
      required:
        - loc
        - msg
        - type
      title: ValidationError
    HTTPValidationError:
      type: object
      properties:
        detail:
          type: array
          items:
            $ref: '#/components/schemas/ValidationError'
      title: HTTPValidationError
    TooManyRequestsResponse:
      type: object
      properties:
        message:
          type: string
          default: Too Many Requests
      title: TooManyRequestsResponse
    InternalServerErrorResponse:
      type: object
      properties:
        message:
          type: string
          default: >-
            Internal Server Error. Please contact support at
            contact@apexverify.com...
      title: InternalServerErrorResponse

```

## SDK Code Examples

```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()
```