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

# Extract Motorbike Registration Certificate

POST https://api.staple.io/v1/documents/extract/mrc
Content-Type: multipart/form-data

Extract the structured data from a document using the Motorbike Registration Certificate model in Staple. The document would NOT be left in the queue specified for any further manipulation.

Reference: https://docs.staple.ai/api-reference/v1/documents/extract-motorbike-registration-certificate

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: v1
  version: 1.0.0
paths:
  /v1/documents/extract/mrc:
    post:
      operationId: extractMotorbikeRegistrationCertificate
      summary: Extract Motorbike Registration Certificate
      description: >-
        Extract the structured data from a document using the Motorbike
        Registration Certificate model in Staple. The document would NOT be left
        in the queue specified for any further manipulation.
      tags:
        - documents
      parameters:
        - name: x-api-key
          in: header
          description: API key issued by Staple.
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/Documents_extractMotorbikeRegistrationCertificate_Response_200
      requestBody:
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                file:
                  type: string
                  format: binary
                  description: File to upload
              required:
                - file
servers:
  - url: https://api.staple.io
    description: https://api.staple.io
components:
  schemas:
    Documents_extractMotorbikeRegistrationCertificate_Response_200:
      type: object
      properties: {}
      description: Empty response body
      title: Documents_extractMotorbikeRegistrationCertificate_Response_200
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: API key issued by Staple.
    bearerAuth:
      type: http
      scheme: bearer
      description: JWT obtained from the login endpoint.

```

## Examples



**Request**

```json
{
  "file": "<file: string>"
}
```

**Response**

```json
{
  "Address": {
    "UICategory": "Personal Information",
    "UIName": "Address",
    "matches": [
      {
        "keyword": [
          59,
          157,
          291,
          188,
          175,
          172.5,
          "Địa chỉ ( Address ) :"
        ],
        "match": "158/12 Tuệ Tĩnh P12Q11",
        "matchmulti": null,
        "page": 0,
        "value": [
          53,
          189,
          459,
          233,
          256,
          211,
          "158/12 Tuệ Tĩnh P12Q11"
        ]
      }
    ]
  },
  "AddressLine1": {
    "UICategory": "Personal Information",
    "UIName": "Address Line 1",
    "matches": [
      {
        "keyword": null,
        "match": "158/12 TUỆ TĨNH",
        "page": null,
        "value": null
      }
    ]
  },
  "AddressLine2": {
    "UICategory": "Personal Information",
    "UIName": "Address Line 2",
    "matches": [
      {
        "keyword": null,
        "match": "P1",
        "page": null,
        "value": null
      }
    ]
  },
  "AddressLine3": {
    "UICategory": "Personal Information",
    "UIName": "Address Line 3",
    "matches": [
      {
        "keyword": null,
        "match": "2Q11",
        "page": null,
        "value": null
      }
    ]
  },
  "BigBoxes": [
    {
      "box": [
        59,
        51,
        469,
        129,
        264,
        90,
        "Tên chủ xe ( Owners full name ) :\nLÝ MUỘI\n"
      ],
      "page": 0
    },
    {
      "box": [
        634,
        51,
        1111,
        227,
        872.5,
        139,
        "Số máy ( Engine Nº ) :\nJF58E0224671\nSố khung ( Chassis Nº ) :\n5803EY224599\n"
      ],
      "page": 0
    },
    {
      "box": [
        53,
        157,
        459,
        233,
        256,
        195,
        "Địa chỉ ( Address ) :\n158/12 Tuệ Tĩnh P12Q11\n"
      ],
      "page": 0
    },
    {
      "box": [
        46,
        254,
        1066,
        472,
        556,
        363,
        "VSƠN\nSố loại ( Model code ) :\nHONDA\nNhãn hiệu ( Brand ) :\n108\nMàu sơn ( Color ) Xanh\nDung tích ( Capacity ) :\nĐăng ký xe có giá trị đến ngày ( date of expiry\n2018\n03\nQuận 11, ngày nay\nthắng\nTRƯỜNG CA QUÂN\nBiển số đăng ký ( Nº plate )\n( T )\n"
      ],
      "page": 0
    },
    {
      "box": [
        622,
        405,
        912,
        466,
        767,
        435.5,
        "TRƯỜNG CA QUÂN\n"
      ],
      "page": 0
    },
    {
      "box": [
        33,
        505,
        503,
        585,
        268,
        545,
        "59S2-321.31\n"
      ],
      "page": 0
    },
    {
      "box": [
        618,
        549,
        637,
        603,
        627.5,
        576,
        "CON\n"
      ],
      "page": 0
    },
    {
      "box": [
        740,
        527,
        906,
        578,
        823,
        552.5,
        "Lohn\n"
      ],
      "page": 0
    },
    {
      "box": [
        719,
        590,
        789,
        590,
        754,
        590,
        "QUAN\n"
      ],
      "page": 0
    },
    {
      "box": [
        36,
        618,
        359,
        719,
        197.5,
        668.5,
        "Đăng ký lần đầu ngày:\nDate of first registration\n21/08/2015\n"
      ],
      "page": 0
    },
    {
      "box": [
        502,
        623,
        1090,
        695,
        796,
        659,
        "Luậu Sản/ ,\nTHƯỢNG THANH\n"
      ],
      "page": 0
    },
    {
      "box": [
        179,
        836,
        1004,
        1366,
        591.5,
        1101,
        "CỘNG HÒA XÃ HỘI CHỦ NGHĨA VIỆT NAM\nSocialist Republic of Vietnam\nCÔNG AN THÀNH PHỐ HỒ CHÍ MINH\nHo Chi Minh city's Public Security\nCÔNG AN QUẬN 11\n11th district's Public security\nCHỨNG NHẬN ĐĂNG KÝ\nXE MÔ TÔ , XE MÁY\nMotorbike Registration Certificate\nSố ( Number ) :\n069305\n"
      ],
      "page": 0
    }
  ],
  "Brand": {
    "UICategory": "Vehicle Information",
    "UIName": "Brand",
    "matches": [
      {
        "keyword": [
          53,
          261,
          303,
          295,
          178,
          278,
          "Nhãn hiệu ( Brand ) :"
        ],
        "match": "HONDA",
        "matchmulti": null,
        "page": 0,
        "value": [
          310,
          260,
          435,
          293,
          372.5,
          276.5,
          "HONDA"
        ]
      }
    ]
  },
  "Color": {
    "UICategory": "Vehicle Information",
    "UIName": "Color",
    "matches": [
      {
        "keyword": null,
        "match": "Xanh",
        "matchmulti": null,
        "page": 0,
        "value": [
          283,
          298,
          360,
          333,
          321.5,
          315.5,
          "Xanh"
        ]
      }
    ]
  },
  "CurRegDate": {
    "UICategory": "Card Information",
    "UIName": "Current Registration Date",
    "matches": [
      {
        "keyword": null,
        "match": "11",
        "matchmulti": null,
        "page": 0,
        "value": [
          429,
          379,
          707,
          416,
          568,
          397.5,
          "Quận 11, ngày nay"
        ]
      }
    ]
  },
  "CurRegMonth": {
    "UICategory": "Card Information",
    "UIName": "Current Registration Month",
    "matches": [
      {
        "keyword": null,
        "match": "03",
        "matchmulti": null,
        "page": 0,
        "value": [
          784,
          364,
          853,
          394,
          818.5,
          379,
          "03\nthắng"
        ]
      }
    ]
  },
  "CurRegYear": {
    "UICategory": "Card Information",
    "UIName": "Current Registration Year",
    "matches": [
      {
        "keyword": null,
        "match": "2018",
        "matchmulti": null,
        "page": 0,
        "value": [
          989,
          360,
          1065,
          396,
          1027,
          378,
          "2018"
        ]
      }
    ]
  },
  "DetectedText": "Tên chủ xe ( Owners full name ) : LÝ MUỘI Số máy ( Engine Nº ) : JF58E0224671 Số khung ( Chassis Nº ) : 5803EY224599 Địa chỉ ( Address ) : 158/12 Tuệ Tĩnh P12Q11 Nhãn hiệu ( Brand ) : HONDA Số loại ( Model code ) : VSƠN Màu sơn ( Color ) Xanh Dung tích ( Capacity ) : 108 Đăng ký xe có giá trị đến ngày ( date of expiry 03 2018 Quận 11, ngày nay thắng Biển số đăng ký ( Nº plate ) ( T ) TRƯỜNG CA QUÂN 59S2-321.31 CON Lohn QUAN Đăng ký lần đầu ngày: Date of first registration 21/08/2015 THƯỢNG THANH Luậu Sản/ , CỘNG HÒA XÃ HỘI CHỦ NGHĨA VIỆT NAM Socialist Republic of Vietnam CÔNG AN THÀNH PHỐ HỒ CHÍ MINH Ho Chi Minh city's Public Security CÔNG AN QUẬN 11 11th district's Public security CHỨNG NHẬN ĐĂNG KÝ XE MÔ TÔ , XE MÁY Motorbike Registration Certificate Số ( Number ) : 069305 ",
  "DocSize": [
    [
      1537,
      1200,
      3
    ]
  ],
  "EngineNum": {
    "UICategory": "Vehicle Information",
    "UIName": "Engine Number",
    "matches": [
      {
        "keyword": [
          634,
          46,
          900,
          88,
          767,
          67,
          "Số máy ( Engine Nº ) :"
        ],
        "match": "JF58E0224671",
        "matchmulti": null,
        "page": 0,
        "value": [
          879,
          93,
          1109,
          125,
          994,
          109,
          "JF58E0224671"
        ]
      }
    ]
  },
  "FirstRegDate": {
    "UICategory": "Card Information",
    "UIName": "First Registration Date",
    "matches": [
      {
        "keyword": null,
        "match": "2015-08-21",
        "matchmulti": null,
        "page": 0,
        "value": [
          37,
          656,
          220,
          691,
          128.5,
          673.5,
          "Date of first registration\n21/08/2015"
        ]
      }
    ]
  },
  "FrameNum": {
    "UICategory": "Personal Information",
    "UIName": "Frame Number",
    "matches": [
      {
        "keyword": [
          636,
          150,
          929,
          189,
          782.5,
          169.5,
          "Số khung ( Chassis Nº ) :"
        ],
        "match": "5803EY224599",
        "matchmulti": null,
        "page": 0,
        "value": [
          882,
          192,
          1110,
          226,
          996,
          209,
          "5803EY224599"
        ]
      }
    ]
  },
  "IdNumber": {
    "UICategory": "Card Information",
    "UIName": "ID Number",
    "matches": [
      {
        "keyword": [
          179,
          836,
          1004,
          1366,
          591.5,
          1101,
          "CỘNG HÒA XÃ HỘI CHỦ NGHĨA VIỆT NAM\nSocialist Republic of Vietnam\nCÔNG AN THÀNH PHỐ HỒ CHÍ MINH\nHo Chi Minh city's Public Security\nCÔNG AN QUẬN 11\n11th district's Public security\nCHỨNG NHẬN ĐĂNG KÝ\nXE MÔ TÔ , XE MÁY\nMotorbike Registration Certificate\nSố ( Number ) :\n069305\n"
        ],
        "match": "069305",
        "matchmulti": null,
        "page": 0,
        "value": [
          672,
          1296,
          955,
          1365,
          813.5,
          1330.5,
          "069305"
        ]
      }
    ]
  },
  "Model": {
    "UICategory": "Vehicle Information",
    "UIName": "Model",
    "matches": [
      {
        "keyword": [
          643,
          259,
          907,
          292,
          775,
          275.5,
          "Số loại ( Model code ) :"
        ],
        "match": null,
        "matchmulti": null,
        "page": 0,
        "value": [
          915,
          258,
          1044,
          291,
          979.5,
          274.5,
          "VSƠN"
        ]
      }
    ]
  },
  "Name": {
    "UICategory": "Personal Information",
    "UIName": "Name",
    "matches": [
      {
        "keyword": [
          64,
          53,
          470,
          90,
          267,
          71.5,
          "Tên chủ xe ( Owners full name ) :"
        ],
        "match": "LÝ MUỘI",
        "matchmulti": null,
        "page": 0,
        "value": [
          59,
          88,
          196,
          127,
          127.5,
          107.5,
          "LÝ MUỘI"
        ]
      }
    ]
  },
  "POI1": {
    "UICategory": "Card Information",
    "UIName": "First Place of Issue",
    "matches": [
      {
        "keyword": [
          346,
          985,
          853,
          1030,
          599.5,
          1007.5,
          "Ho Chi Minh city's Public Security"
        ],
        "match": "CÔNG AN THÀNH PHỐ HỒ CHÍ MINH",
        "matchmulti": null,
        "page": 0,
        "value": [
          200,
          926,
          997,
          977,
          598.5,
          951.5,
          "CÔNG AN THÀNH PHỐ HỒ CHÍ MINH"
        ]
      }
    ]
  },
  "POI2": {
    "UICategory": "Card Information",
    "UIName": "Second Place of Issue",
    "matches": [
      {
        "keyword": [
          403,
          1069,
          811,
          1113,
          607,
          1091,
          "11th district's Public security"
        ],
        "match": "CÔNG AN QUẬN 11",
        "matchmulti": null,
        "page": 0,
        "value": [
          445,
          1024,
          760,
          1070,
          602.5,
          1047,
          "CÔNG AN QUẬN 11"
        ]
      }
    ]
  },
  "PlateNum": {
    "UICategory": "Personal Information",
    "UIName": "Plate Number",
    "matches": [
      {
        "keyword": [
          48,
          420,
          389,
          457,
          218.5,
          438.5,
          "Biển số đăng ký ( Nº plate )"
        ],
        "match": "59S2-321.31",
        "matchmulti": null,
        "page": 0,
        "value": [
          33,
          505,
          503,
          585,
          268,
          545,
          "59S2-321.31"
        ]
      }
    ]
  },
  "SmallBoxes": [
    {
      "box": [
        64,
        53,
        470,
        90,
        267,
        71.5,
        "Tên chủ xe ( Owners full name ) :"
      ],
      "page": 0
    },
    {
      "box": [
        59,
        88,
        196,
        127,
        127.5,
        107.5,
        "LÝ MUỘI"
      ],
      "page": 0
    },
    {
      "box": [
        634,
        46,
        900,
        88,
        767,
        67,
        "Số máy ( Engine Nº ) :"
      ],
      "page": 0
    },
    {
      "box": [
        879,
        93,
        1109,
        125,
        994,
        109,
        "JF58E0224671"
      ],
      "page": 0
    },
    {
      "box": [
        636,
        150,
        929,
        189,
        782.5,
        169.5,
        "Số khung ( Chassis Nº ) :"
      ],
      "page": 0
    },
    {
      "box": [
        882,
        192,
        1110,
        226,
        996,
        209,
        "5803EY224599"
      ],
      "page": 0
    },
    {
      "box": [
        59,
        157,
        291,
        188,
        175,
        172.5,
        "Địa chỉ ( Address ) :"
      ],
      "page": 0
    },
    {
      "box": [
        53,
        189,
        459,
        233,
        256,
        211,
        "158/12 Tuệ Tĩnh P12Q11"
      ],
      "page": 0
    },
    {
      "box": [
        53,
        261,
        303,
        295,
        178,
        278,
        "Nhãn hiệu ( Brand ) :"
      ],
      "page": 0
    },
    {
      "box": [
        310,
        260,
        435,
        293,
        372.5,
        276.5,
        "HONDA"
      ],
      "page": 0
    },
    {
      "box": [
        643,
        259,
        907,
        292,
        775,
        275.5,
        "Số loại ( Model code ) :"
      ],
      "page": 0
    },
    {
      "box": [
        915,
        258,
        1044,
        291,
        979.5,
        274.5,
        "VSƠN"
      ],
      "page": 0
    },
    {
      "box": [
        53,
        294,
        360,
        333,
        206.5,
        313.5,
        "Màu sơn ( Color ) Xanh"
      ],
      "page": 0
    },
    {
      "box": [
        642,
        294,
        919,
        331,
        780.5,
        312.5,
        "Dung tích ( Capacity ) :"
      ],
      "page": 0
    },
    {
      "box": [
        919,
        293,
        979,
        328,
        949,
        310.5,
        "108"
      ],
      "page": 0
    },
    {
      "box": [
        50,
        332,
        665,
        369,
        357.5,
        350.5,
        "Đăng ký xe có giá trị đến ngày ( date of expiry"
      ],
      "page": 0
    },
    {
      "box": [
        850,
        364,
        899,
        394,
        874.5,
        379,
        "03"
      ],
      "page": 0
    },
    {
      "box": [
        989,
        360,
        1065,
        396,
        1027,
        378,
        "2018"
      ],
      "page": 0
    },
    {
      "box": [
        429,
        379,
        707,
        416,
        568,
        397.5,
        "Quận 11, ngày nay"
      ],
      "page": 0
    },
    {
      "box": [
        784,
        382,
        853,
        416,
        818.5,
        399,
        "thắng"
      ],
      "page": 0
    },
    {
      "box": [
        48,
        420,
        389,
        457,
        218.5,
        438.5,
        "Biển số đăng ký ( Nº plate )"
      ],
      "page": 0
    },
    {
      "box": [
        430,
        439,
        476,
        476,
        453,
        457.5,
        "( T )"
      ],
      "page": 0
    },
    {
      "box": [
        622,
        404,
        912,
        467,
        767,
        435.5,
        "TRƯỜNG CA QUÂN"
      ],
      "page": 0
    },
    {
      "box": [
        33,
        505,
        503,
        585,
        268,
        545,
        "59S2-321.31"
      ],
      "page": 0
    },
    {
      "box": [
        618,
        549,
        637,
        603,
        627.5,
        576,
        "CON"
      ],
      "page": 0
    },
    {
      "box": [
        740,
        527,
        906,
        578,
        823,
        552.5,
        "Lohn"
      ],
      "page": 0
    },
    {
      "box": [
        719,
        590,
        789,
        590,
        754,
        590,
        "QUAN"
      ],
      "page": 0
    },
    {
      "box": [
        39,
        617,
        332,
        654,
        185.5,
        635.5,
        "Đăng ký lần đầu ngày:"
      ],
      "page": 0
    },
    {
      "box": [
        37,
        656,
        358,
        691,
        197.5,
        673.5,
        "Date of first registration"
      ],
      "page": 0
    },
    {
      "box": [
        48,
        688,
        220,
        719,
        134,
        703.5,
        "21/08/2015"
      ],
      "page": 0
    },
    {
      "box": [
        502,
        614,
        774,
        722,
        638,
        668,
        "THƯỢNG THANH"
      ],
      "page": 0
    },
    {
      "box": [
        866,
        589,
        1090,
        702,
        978,
        645.5,
        "Luậu Sản/ ,"
      ],
      "page": 0
    },
    {
      "box": [
        179,
        839,
        1009,
        892,
        594,
        865.5,
        "CỘNG HÒA XÃ HỘI CHỦ NGHĨA VIỆT NAM"
      ],
      "page": 0
    },
    {
      "box": [
        391,
        890,
        812,
        932,
        601.5,
        911,
        "Socialist Republic of Vietnam"
      ],
      "page": 0
    },
    {
      "box": [
        200,
        926,
        997,
        977,
        598.5,
        951.5,
        "CÔNG AN THÀNH PHỐ HỒ CHÍ MINH"
      ],
      "page": 0
    },
    {
      "box": [
        346,
        985,
        853,
        1030,
        599.5,
        1007.5,
        "Ho Chi Minh city's Public Security"
      ],
      "page": 0
    },
    {
      "box": [
        445,
        1024,
        760,
        1070,
        602.5,
        1047,
        "CÔNG AN QUẬN 11"
      ],
      "page": 0
    },
    {
      "box": [
        403,
        1069,
        811,
        1113,
        607,
        1091,
        "11th district's Public security"
      ],
      "page": 0
    },
    {
      "box": [
        296,
        1124,
        921,
        1183,
        608.5,
        1153.5,
        "CHỨNG NHẬN ĐĂNG KÝ"
      ],
      "page": 0
    },
    {
      "box": [
        347,
        1185,
        857,
        1242,
        602,
        1213.5,
        "XE MÔ TÔ , XE MÁY"
      ],
      "page": 0
    },
    {
      "box": [
        355,
        1250,
        856,
        1294,
        605.5,
        1272,
        "Motorbike Registration Certificate"
      ],
      "page": 0
    },
    {
      "box": [
        393,
        1289,
        625,
        1356,
        509,
        1322.5,
        "Số ( Number ) :"
      ],
      "page": 0
    },
    {
      "box": [
        672,
        1296,
        955,
        1365,
        813.5,
        1330.5,
        "069305"
      ],
      "page": 0
    }
  ]
}
```

**SDK Code**

```python Extract Motorbike Registration Certificate
import requests

url = "https://api.staple.io/v1/documents/extract/mrc"

files = { "file": "open('string', 'rb')" }
headers = {"x-api-key": "<apiKey>"}

response = requests.post(url, files=files, headers=headers)

print(response.json())
```

```javascript Extract Motorbike Registration Certificate
const url = 'https://api.staple.io/v1/documents/extract/mrc';
const form = new FormData();
form.append('file', 'string');

const options = {method: 'POST', headers: {'x-api-key': '<apiKey>'}};

options.body = form;

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

```go Extract Motorbike Registration Certificate
package main

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

func main() {

	url := "https://api.staple.io/v1/documents/extract/mrc"

	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\n")

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

	req.Header.Add("x-api-key", "<apiKey>")

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

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

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

}
```

```ruby Extract Motorbike Registration Certificate
require 'uri'
require 'net/http'

url = URI("https://api.staple.io/v1/documents/extract/mrc")

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

request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<apiKey>'
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\n"

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

```java Extract Motorbike Registration Certificate
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.staple.io/v1/documents/extract/mrc")
  .header("x-api-key", "<apiKey>")
  .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\n")
  .asString();
```

```php Extract Motorbike Registration Certificate
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.staple.io/v1/documents/extract/mrc', [
  'multipart' => [
    [
        'name' => 'file',
        'filename' => 'string',
        'contents' => null
    ]
  ]
  'headers' => [
    'x-api-key' => '<apiKey>',
  ],
]);

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

```csharp Extract Motorbike Registration Certificate
using RestSharp;

var client = new RestClient("https://api.staple.io/v1/documents/extract/mrc");
var request = new RestRequest(Method.POST);
request.AddHeader("x-api-key", "<apiKey>");
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\n", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Extract Motorbike Registration Certificate
import Foundation

let headers = ["x-api-key": "<apiKey>"]
let parameters = [
  [
    "name": "file",
    "fileName": "string"
  ]
]

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.staple.io/v1/documents/extract/mrc")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
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()
```