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

# Add a new construction detail

POST https://api.rechain.co/public/v1/construction_details
Content-Type: multipart/form-data

Add a new construction detail

Reference: https://dev.rechain.co/api-reference/construction-detail/add-a-new-construction-detail

## Authentication

- `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer <token>`, where token is your auth token.

## Request

### Body (multipart/form-data)

This endpoint expects a multipart form.

- `constructionDetail` (ConstructionDetailsPostRequestBodyContentMultipartFormDataSchemaConstructionDetail, optional)

## Response

### 200

Successful operation

- `companyId` (string, optional)
- `createdAt` (datetime, optional)
- `description` (string, optional)
- `fileUrl` (string, optional)
- `id` (string, optional)
- `name` (string, optional)
- `updatedAt` (datetime, optional)

## Errors

### 405 Method Not Allowed Error

Invalid input

- `any`

## Examples

**Request**

```json
{}
```

**Response**

```json
{
  "companyId": "123e4567-e89b-12d3-a456-426614174000",
  "createdAt": "2023-08-23T18:25:43.511Z",
  "description": "description",
  "fileUrl": "https://example.com/file.png",
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "name": "Red",
  "updatedAt": "2023-08-23T18:25:43.511Z"
}
```

**SDK Code**

```python
import requests

url = "https://api.rechain.co/public/v1/construction_details"

payload = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"constructionDetail\"\r\n\r\n\r\n-----011000010111000001101001--\r\n"
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "multipart/form-data; boundary=---011000010111000001101001"
}

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

print(response.json())
```

```javascript
const url = 'https://api.rechain.co/public/v1/construction_details';
const form = new FormData();
form.append('constructionDetail', '');

const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};

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.rechain.co/public/v1/construction_details"

	payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"constructionDetail\"\r\n\r\n\r\n-----011000010111000001101001--\r\n")

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

	req.Header.Add("Authorization", "Bearer <token>")

	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.rechain.co/public/v1/construction_details")

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

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"constructionDetail\"\r\n\r\n\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.rechain.co/public/v1/construction_details")
  .header("Authorization", "Bearer <token>")
  .body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"constructionDetail\"\r\n\r\n\r\n-----011000010111000001101001--\r\n")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.rechain.co/public/v1/construction_details', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'multipart/form-data; boundary=---011000010111000001101001',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://api.rechain.co/public/v1/construction_details");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "multipart/form-data; boundary=---011000010111000001101001");
request.AddParameter("undefined", "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"constructionDetail\"\r\n\r\n\r\n-----011000010111000001101001--\r\n", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["Authorization": "Bearer <token>"]
let parameters = [
  [
    "name": "constructionDetail",
    "value": 
  ]
]

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.rechain.co/public/v1/construction_details")! 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()
```