eContract Developers
API ReferenceContracts

Create contract

POST /api/v1/contracts: Create contract. API keys and OAuth tokens need scope contracts:write. Parameters, responses and code samples.

POST
/api/v1/contracts
AuthorizationBearer <token>

API key cl_live_… or OAuth access token eco_at_… in Authorization: Bearer. Public operations (x-econtract-auth: public) need no credential.

In: header

Header Parameters

Idempotency-Key?string

Up to 255 characters. Retries with the same key and body replay the first result (header Idempotent-Replayed: true) for 24 h.

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

curl -X POST "https://api.econtract.online/api/v1/contracts" \  -H "Content-Type: application/json" \  -d '{    "title": "Service Agreement - Q2 2026"  }'
Empty
Empty

Code Examples

curl -X POST "https://api.econtract.online/api/v1/contracts" \
  -H "Authorization: Bearer cl_live_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "title": "Service Agreement - Q2 2026",
    "description": "Q2 consulting agreement",
    "fileKey": "files/abc123/agreement.pdf",
    "fileName": "agreement.pdf",
    "fileSize": 1024,
    "fileHash": "string_value",
    "fileType": "pdf",
    "signingOrderType": "sequential",
    "expiresInDays": 30,
    "metadata": {}
  }'
const res = await fetch("https://api.econtract.online/api/v1/contracts", {
  method: "POST",
  headers: {
    "Authorization": "Bearer cl_live_your_key_here",
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
      "title": "Service Agreement - Q2 2026",
      "description": "Q2 consulting agreement",
      "fileKey": "files/abc123/agreement.pdf",
      "fileName": "agreement.pdf",
      "fileSize": 1024,
      "fileHash": "string_value",
      "fileType": "pdf",
      "signingOrderType": "sequential",
      "expiresInDays": 30,
      "metadata": {}
  }),
}).then(r => r.json());

console.log(res);
import requests

res = requests.post(
    "https://api.econtract.online/api/v1/contracts",
    headers={"Authorization": "Bearer cl_live_your_key_here"},
    json={
    "title": "Service Agreement - Q2 2026",
    "description": "Q2 consulting agreement",
    "fileKey": "files/abc123/agreement.pdf",
    "fileName": "agreement.pdf",
    "fileSize": 1024,
    "fileHash": "string_value",
    "fileType": "pdf",
    "signingOrderType": "sequential",
    "expiresInDays": 30,
    "metadata": {},
},
).json()

print(res)
package main

import (
    "fmt"
    "io"
    "net/http"
    "bytes"
    "encoding/json"
)

func main() {
    payload, _ := json.Marshal(map[string]interface{}{
        "title": "Service Agreement - Q2 2026",
        "description": "Q2 consulting agreement",
        "fileKey": "files/abc123/agreement.pdf",
        "fileName": "agreement.pdf",
        "fileSize": 1024,
        "fileHash": "string_value",
        "fileType": "pdf",
        "signingOrderType": "sequential",
        "expiresInDays": 30,
        "metadata": {},
    })

    req, _ := http.NewRequest("POST", "https://api.econtract.online/api/v1/contracts", bytes.NewBuffer(payload))
    req.Header.Set("Authorization", "Bearer cl_live_your_key_here")
    req.Header.Set("Content-Type", "application/json")

    resp, _ := http.DefaultClient.Do(req)
    defer resp.Body.Close()
    body, _ := io.ReadAll(resp.Body)
    fmt.Println(string(body))
}
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://api.econtract.online/api/v1/contracts");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    "Authorization: Bearer cl_live_your_key_here",
    "Content-Type: application/json",
]);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode([
    'title' => 'Service Agreement - Q2 2026',
    'description' => 'Q2 consulting agreement',
    'fileKey' => 'files/abc123/agreement.pdf',
    'fileName' => 'agreement.pdf',
    'fileSize' => 1024,
    'fileHash' => 'string_value',
    'fileType' => 'pdf',
    'signingOrderType' => 'sequential',
    'expiresInDays' => 30,
    'metadata' => [
,
    ],
]));

$response = curl_exec($ch);
curl_close($ch);

echo $response;
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;

String jsonBody = "{\"title\":\"Service Agreement - Q2 2026\",\"description\":\"Q2 consulting agreement\",\"fileKey\":\"files/abc123/agreement.pdf\",\"fileName\":\"agreement.pdf\",\"fileSize\":1024,\"fileHash\":\"string_value\",\"fileType\":\"pdf\",\"signingOrderType\":\"sequential\",\"expiresInDays\":30,\"metadata\":{}}";

HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("https://api.econtract.online/api/v1/contracts"))
    .header("Authorization", "Bearer cl_live_your_key_here")
    .header("Content-Type", "application/json")
    .POST(HttpRequest.BodyPublishers.ofString(jsonBody))
    .build();

HttpResponse<String> response = HttpClient.newHttpClient()
    .send(request, HttpResponse.BodyHandlers.ofString());

System.out.println(response.body());
using var client = new HttpClient();
client.DefaultRequestHeaders.Add("Authorization", "Bearer cl_live_your_key_here");

var json = @"{
  ""title"": ""Service Agreement - Q2 2026"",
  ""description"": ""Q2 consulting agreement"",
  ""fileKey"": ""files/abc123/agreement.pdf"",
  ""fileName"": ""agreement.pdf"",
  ""fileSize"": 1024,
  ""fileHash"": ""string_value"",
  ""fileType"": ""pdf"",
  ""signingOrderType"": ""sequential"",
  ""expiresInDays"": 30,
  ""metadata"": {}
}";
var content = new StringContent(json, System.Text.Encoding.UTF8, "application/json");

var response = await client.PostAsync("https://api.econtract.online/api/v1/contracts", content);
var body = await response.Content.ReadAsStringAsync();

Console.WriteLine(body);