curl --request POST \
--url https://api.assembly.com/v1/contracts \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"clientId": "b1c2d3e4-f5a6-4b7c-8d9e-0f1a2b3c4d5e",
"companyId": "c2d3e4f5-a6b7-4c8d-9e0f-1a2b3c4d5e6f",
"contractTemplateId": "d8e8fca2-dc0f-4f4a-8e3c-3f1f4c6a1b2c",
"creationMode": "template",
"fields": [
{
"autoFillField": "<string>",
"bounds": {
"height": 123,
"pageHeight": 123,
"pageWidth": 123,
"resizedHeight": 123,
"resizedWidth": 123,
"width": 123,
"x": 123,
"y": 123
},
"encodedImgValue": "<string>",
"id": "e4f5a6b7-c8d9-4e0f-1a2b-3c4d5e6f7a8b",
"inputType": "client",
"isOptional": false,
"label": "Signature",
"page": 0,
"type": "signature",
"value": "<string>"
}
],
"fileKey": "uploads/contract.pdf",
"identityId": "<string>",
"name": "Master Services Agreement",
"recipientId": "b1c2d3e4-f5a6-4b7c-8d9e-0f1a2b3c4d5e",
"variableValues": {}
}
'import requests
url = "https://api.assembly.com/v1/contracts"
payload = {
"clientId": "b1c2d3e4-f5a6-4b7c-8d9e-0f1a2b3c4d5e",
"companyId": "c2d3e4f5-a6b7-4c8d-9e0f-1a2b3c4d5e6f",
"contractTemplateId": "d8e8fca2-dc0f-4f4a-8e3c-3f1f4c6a1b2c",
"creationMode": "template",
"fields": [
{
"autoFillField": "<string>",
"bounds": {
"height": 123,
"pageHeight": 123,
"pageWidth": 123,
"resizedHeight": 123,
"resizedWidth": 123,
"width": 123,
"x": 123,
"y": 123
},
"encodedImgValue": "<string>",
"id": "e4f5a6b7-c8d9-4e0f-1a2b-3c4d5e6f7a8b",
"inputType": "client",
"isOptional": False,
"label": "Signature",
"page": 0,
"type": "signature",
"value": "<string>"
}
],
"fileKey": "uploads/contract.pdf",
"identityId": "<string>",
"name": "Master Services Agreement",
"recipientId": "b1c2d3e4-f5a6-4b7c-8d9e-0f1a2b3c4d5e",
"variableValues": {}
}
headers = {
"X-API-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-KEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
clientId: 'b1c2d3e4-f5a6-4b7c-8d9e-0f1a2b3c4d5e',
companyId: 'c2d3e4f5-a6b7-4c8d-9e0f-1a2b3c4d5e6f',
contractTemplateId: 'd8e8fca2-dc0f-4f4a-8e3c-3f1f4c6a1b2c',
creationMode: 'template',
fields: [
{
autoFillField: '<string>',
bounds: {
height: 123,
pageHeight: 123,
pageWidth: 123,
resizedHeight: 123,
resizedWidth: 123,
width: 123,
x: 123,
y: 123
},
encodedImgValue: '<string>',
id: 'e4f5a6b7-c8d9-4e0f-1a2b-3c4d5e6f7a8b',
inputType: 'client',
isOptional: false,
label: 'Signature',
page: 0,
type: 'signature',
value: '<string>'
}
],
fileKey: 'uploads/contract.pdf',
identityId: '<string>',
name: 'Master Services Agreement',
recipientId: 'b1c2d3e4-f5a6-4b7c-8d9e-0f1a2b3c4d5e',
variableValues: {}
})
};
fetch('https://api.assembly.com/v1/contracts', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.assembly.com/v1/contracts",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'clientId' => 'b1c2d3e4-f5a6-4b7c-8d9e-0f1a2b3c4d5e',
'companyId' => 'c2d3e4f5-a6b7-4c8d-9e0f-1a2b3c4d5e6f',
'contractTemplateId' => 'd8e8fca2-dc0f-4f4a-8e3c-3f1f4c6a1b2c',
'creationMode' => 'template',
'fields' => [
[
'autoFillField' => '<string>',
'bounds' => [
'height' => 123,
'pageHeight' => 123,
'pageWidth' => 123,
'resizedHeight' => 123,
'resizedWidth' => 123,
'width' => 123,
'x' => 123,
'y' => 123
],
'encodedImgValue' => '<string>',
'id' => 'e4f5a6b7-c8d9-4e0f-1a2b-3c4d5e6f7a8b',
'inputType' => 'client',
'isOptional' => false,
'label' => 'Signature',
'page' => 0,
'type' => 'signature',
'value' => '<string>'
]
],
'fileKey' => 'uploads/contract.pdf',
'identityId' => '<string>',
'name' => 'Master Services Agreement',
'recipientId' => 'b1c2d3e4-f5a6-4b7c-8d9e-0f1a2b3c4d5e',
'variableValues' => [
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-KEY: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.assembly.com/v1/contracts"
payload := strings.NewReader("{\n \"clientId\": \"b1c2d3e4-f5a6-4b7c-8d9e-0f1a2b3c4d5e\",\n \"companyId\": \"c2d3e4f5-a6b7-4c8d-9e0f-1a2b3c4d5e6f\",\n \"contractTemplateId\": \"d8e8fca2-dc0f-4f4a-8e3c-3f1f4c6a1b2c\",\n \"creationMode\": \"template\",\n \"fields\": [\n {\n \"autoFillField\": \"<string>\",\n \"bounds\": {\n \"height\": 123,\n \"pageHeight\": 123,\n \"pageWidth\": 123,\n \"resizedHeight\": 123,\n \"resizedWidth\": 123,\n \"width\": 123,\n \"x\": 123,\n \"y\": 123\n },\n \"encodedImgValue\": \"<string>\",\n \"id\": \"e4f5a6b7-c8d9-4e0f-1a2b-3c4d5e6f7a8b\",\n \"inputType\": \"client\",\n \"isOptional\": false,\n \"label\": \"Signature\",\n \"page\": 0,\n \"type\": \"signature\",\n \"value\": \"<string>\"\n }\n ],\n \"fileKey\": \"uploads/contract.pdf\",\n \"identityId\": \"<string>\",\n \"name\": \"Master Services Agreement\",\n \"recipientId\": \"b1c2d3e4-f5a6-4b7c-8d9e-0f1a2b3c4d5e\",\n \"variableValues\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-KEY", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.assembly.com/v1/contracts")
.header("X-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"clientId\": \"b1c2d3e4-f5a6-4b7c-8d9e-0f1a2b3c4d5e\",\n \"companyId\": \"c2d3e4f5-a6b7-4c8d-9e0f-1a2b3c4d5e6f\",\n \"contractTemplateId\": \"d8e8fca2-dc0f-4f4a-8e3c-3f1f4c6a1b2c\",\n \"creationMode\": \"template\",\n \"fields\": [\n {\n \"autoFillField\": \"<string>\",\n \"bounds\": {\n \"height\": 123,\n \"pageHeight\": 123,\n \"pageWidth\": 123,\n \"resizedHeight\": 123,\n \"resizedWidth\": 123,\n \"width\": 123,\n \"x\": 123,\n \"y\": 123\n },\n \"encodedImgValue\": \"<string>\",\n \"id\": \"e4f5a6b7-c8d9-4e0f-1a2b-3c4d5e6f7a8b\",\n \"inputType\": \"client\",\n \"isOptional\": false,\n \"label\": \"Signature\",\n \"page\": 0,\n \"type\": \"signature\",\n \"value\": \"<string>\"\n }\n ],\n \"fileKey\": \"uploads/contract.pdf\",\n \"identityId\": \"<string>\",\n \"name\": \"Master Services Agreement\",\n \"recipientId\": \"b1c2d3e4-f5a6-4b7c-8d9e-0f1a2b3c4d5e\",\n \"variableValues\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.assembly.com/v1/contracts")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"clientId\": \"b1c2d3e4-f5a6-4b7c-8d9e-0f1a2b3c4d5e\",\n \"companyId\": \"c2d3e4f5-a6b7-4c8d-9e0f-1a2b3c4d5e6f\",\n \"contractTemplateId\": \"d8e8fca2-dc0f-4f4a-8e3c-3f1f4c6a1b2c\",\n \"creationMode\": \"template\",\n \"fields\": [\n {\n \"autoFillField\": \"<string>\",\n \"bounds\": {\n \"height\": 123,\n \"pageHeight\": 123,\n \"pageWidth\": 123,\n \"resizedHeight\": 123,\n \"resizedWidth\": 123,\n \"width\": 123,\n \"x\": 123,\n \"y\": 123\n },\n \"encodedImgValue\": \"<string>\",\n \"id\": \"e4f5a6b7-c8d9-4e0f-1a2b-3c4d5e6f7a8b\",\n \"inputType\": \"client\",\n \"isOptional\": false,\n \"label\": \"Signature\",\n \"page\": 0,\n \"type\": \"signature\",\n \"value\": \"<string>\"\n }\n ],\n \"fileKey\": \"uploads/contract.pdf\",\n \"identityId\": \"<string>\",\n \"name\": \"Master Services Agreement\",\n \"recipientId\": \"b1c2d3e4-f5a6-4b7c-8d9e-0f1a2b3c4d5e\",\n \"variableValues\": {}\n}"
response = http.request(request)
puts response.read_body{
"clientId": "b1c2d3e4-f5a6-4b7c-8d9e-0f1a2b3c4d5e",
"companyId": "c2d3e4f5-a6b7-4c8d-9e0f-1a2b3c4d5e6f",
"contractTemplateId": "d8e8fca2-dc0f-4f4a-8e3c-3f1f4c6a1b2c",
"createdAt": "<string>",
"creationMode": "template",
"creatorId": "<string>",
"data": "<string>",
"fields": [
{
"autoFillField": "<string>",
"bounds": {
"height": 123,
"pageHeight": 123,
"pageWidth": 123,
"resizedHeight": 123,
"resizedWidth": 123,
"width": 123,
"x": 123,
"y": 123
},
"encodedImgValue": "<string>",
"id": "e4f5a6b7-c8d9-4e0f-1a2b-3c4d5e6f7a8b",
"inputType": "client",
"isOptional": false,
"label": "Signature",
"page": 0,
"type": "signature",
"value": "<string>"
}
],
"fileUrl": "https://files.assembly.com/protected/contract.pdf",
"id": "<string>",
"identityId": "<string>",
"isMigrated": true,
"name": "Master Services Agreement",
"object": "<string>",
"owner": {
"id": "<string>",
"metadata": {
"avatarImageUrl": "<string>",
"companyAvatarUrl": "<string>",
"companyId": "<string>",
"companyName": "<string>",
"email": "<string>",
"fallbackColor": "<string>",
"familyName": "<string>",
"givenName": "<string>"
}
},
"pageKeys": [
"<string>"
],
"portalId": "<string>",
"previousAttributes": {},
"recipientId": "b1c2d3e4-f5a6-4b7c-8d9e-0f1a2b3c4d5e",
"ref": "<string>",
"shareDate": "2023-11-07T05:31:56Z",
"signatureEvents": [
{
"email": "<string>",
"eventAt": "<string>",
"sourceIP": "<string>"
}
],
"signedFileUrl": "https://files.assembly.com/protected/contract-signed.pdf",
"status": "pending",
"submissionDate": "2023-11-07T05:31:56Z",
"updatedAt": "<string>"
}{
"code": "<string>",
"data": "<unknown>",
"message": "<string>"
}{
"code": "<string>",
"data": "<unknown>",
"message": "<string>"
}{
"code": "<string>",
"data": "<unknown>",
"message": "<string>"
}Send Contract
Creates and sends a contract to a recipient, either from a contract template or as a one-off contract.
curl --request POST \
--url https://api.assembly.com/v1/contracts \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"clientId": "b1c2d3e4-f5a6-4b7c-8d9e-0f1a2b3c4d5e",
"companyId": "c2d3e4f5-a6b7-4c8d-9e0f-1a2b3c4d5e6f",
"contractTemplateId": "d8e8fca2-dc0f-4f4a-8e3c-3f1f4c6a1b2c",
"creationMode": "template",
"fields": [
{
"autoFillField": "<string>",
"bounds": {
"height": 123,
"pageHeight": 123,
"pageWidth": 123,
"resizedHeight": 123,
"resizedWidth": 123,
"width": 123,
"x": 123,
"y": 123
},
"encodedImgValue": "<string>",
"id": "e4f5a6b7-c8d9-4e0f-1a2b-3c4d5e6f7a8b",
"inputType": "client",
"isOptional": false,
"label": "Signature",
"page": 0,
"type": "signature",
"value": "<string>"
}
],
"fileKey": "uploads/contract.pdf",
"identityId": "<string>",
"name": "Master Services Agreement",
"recipientId": "b1c2d3e4-f5a6-4b7c-8d9e-0f1a2b3c4d5e",
"variableValues": {}
}
'import requests
url = "https://api.assembly.com/v1/contracts"
payload = {
"clientId": "b1c2d3e4-f5a6-4b7c-8d9e-0f1a2b3c4d5e",
"companyId": "c2d3e4f5-a6b7-4c8d-9e0f-1a2b3c4d5e6f",
"contractTemplateId": "d8e8fca2-dc0f-4f4a-8e3c-3f1f4c6a1b2c",
"creationMode": "template",
"fields": [
{
"autoFillField": "<string>",
"bounds": {
"height": 123,
"pageHeight": 123,
"pageWidth": 123,
"resizedHeight": 123,
"resizedWidth": 123,
"width": 123,
"x": 123,
"y": 123
},
"encodedImgValue": "<string>",
"id": "e4f5a6b7-c8d9-4e0f-1a2b-3c4d5e6f7a8b",
"inputType": "client",
"isOptional": False,
"label": "Signature",
"page": 0,
"type": "signature",
"value": "<string>"
}
],
"fileKey": "uploads/contract.pdf",
"identityId": "<string>",
"name": "Master Services Agreement",
"recipientId": "b1c2d3e4-f5a6-4b7c-8d9e-0f1a2b3c4d5e",
"variableValues": {}
}
headers = {
"X-API-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-KEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
clientId: 'b1c2d3e4-f5a6-4b7c-8d9e-0f1a2b3c4d5e',
companyId: 'c2d3e4f5-a6b7-4c8d-9e0f-1a2b3c4d5e6f',
contractTemplateId: 'd8e8fca2-dc0f-4f4a-8e3c-3f1f4c6a1b2c',
creationMode: 'template',
fields: [
{
autoFillField: '<string>',
bounds: {
height: 123,
pageHeight: 123,
pageWidth: 123,
resizedHeight: 123,
resizedWidth: 123,
width: 123,
x: 123,
y: 123
},
encodedImgValue: '<string>',
id: 'e4f5a6b7-c8d9-4e0f-1a2b-3c4d5e6f7a8b',
inputType: 'client',
isOptional: false,
label: 'Signature',
page: 0,
type: 'signature',
value: '<string>'
}
],
fileKey: 'uploads/contract.pdf',
identityId: '<string>',
name: 'Master Services Agreement',
recipientId: 'b1c2d3e4-f5a6-4b7c-8d9e-0f1a2b3c4d5e',
variableValues: {}
})
};
fetch('https://api.assembly.com/v1/contracts', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.assembly.com/v1/contracts",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'clientId' => 'b1c2d3e4-f5a6-4b7c-8d9e-0f1a2b3c4d5e',
'companyId' => 'c2d3e4f5-a6b7-4c8d-9e0f-1a2b3c4d5e6f',
'contractTemplateId' => 'd8e8fca2-dc0f-4f4a-8e3c-3f1f4c6a1b2c',
'creationMode' => 'template',
'fields' => [
[
'autoFillField' => '<string>',
'bounds' => [
'height' => 123,
'pageHeight' => 123,
'pageWidth' => 123,
'resizedHeight' => 123,
'resizedWidth' => 123,
'width' => 123,
'x' => 123,
'y' => 123
],
'encodedImgValue' => '<string>',
'id' => 'e4f5a6b7-c8d9-4e0f-1a2b-3c4d5e6f7a8b',
'inputType' => 'client',
'isOptional' => false,
'label' => 'Signature',
'page' => 0,
'type' => 'signature',
'value' => '<string>'
]
],
'fileKey' => 'uploads/contract.pdf',
'identityId' => '<string>',
'name' => 'Master Services Agreement',
'recipientId' => 'b1c2d3e4-f5a6-4b7c-8d9e-0f1a2b3c4d5e',
'variableValues' => [
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-KEY: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.assembly.com/v1/contracts"
payload := strings.NewReader("{\n \"clientId\": \"b1c2d3e4-f5a6-4b7c-8d9e-0f1a2b3c4d5e\",\n \"companyId\": \"c2d3e4f5-a6b7-4c8d-9e0f-1a2b3c4d5e6f\",\n \"contractTemplateId\": \"d8e8fca2-dc0f-4f4a-8e3c-3f1f4c6a1b2c\",\n \"creationMode\": \"template\",\n \"fields\": [\n {\n \"autoFillField\": \"<string>\",\n \"bounds\": {\n \"height\": 123,\n \"pageHeight\": 123,\n \"pageWidth\": 123,\n \"resizedHeight\": 123,\n \"resizedWidth\": 123,\n \"width\": 123,\n \"x\": 123,\n \"y\": 123\n },\n \"encodedImgValue\": \"<string>\",\n \"id\": \"e4f5a6b7-c8d9-4e0f-1a2b-3c4d5e6f7a8b\",\n \"inputType\": \"client\",\n \"isOptional\": false,\n \"label\": \"Signature\",\n \"page\": 0,\n \"type\": \"signature\",\n \"value\": \"<string>\"\n }\n ],\n \"fileKey\": \"uploads/contract.pdf\",\n \"identityId\": \"<string>\",\n \"name\": \"Master Services Agreement\",\n \"recipientId\": \"b1c2d3e4-f5a6-4b7c-8d9e-0f1a2b3c4d5e\",\n \"variableValues\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-KEY", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.assembly.com/v1/contracts")
.header("X-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"clientId\": \"b1c2d3e4-f5a6-4b7c-8d9e-0f1a2b3c4d5e\",\n \"companyId\": \"c2d3e4f5-a6b7-4c8d-9e0f-1a2b3c4d5e6f\",\n \"contractTemplateId\": \"d8e8fca2-dc0f-4f4a-8e3c-3f1f4c6a1b2c\",\n \"creationMode\": \"template\",\n \"fields\": [\n {\n \"autoFillField\": \"<string>\",\n \"bounds\": {\n \"height\": 123,\n \"pageHeight\": 123,\n \"pageWidth\": 123,\n \"resizedHeight\": 123,\n \"resizedWidth\": 123,\n \"width\": 123,\n \"x\": 123,\n \"y\": 123\n },\n \"encodedImgValue\": \"<string>\",\n \"id\": \"e4f5a6b7-c8d9-4e0f-1a2b-3c4d5e6f7a8b\",\n \"inputType\": \"client\",\n \"isOptional\": false,\n \"label\": \"Signature\",\n \"page\": 0,\n \"type\": \"signature\",\n \"value\": \"<string>\"\n }\n ],\n \"fileKey\": \"uploads/contract.pdf\",\n \"identityId\": \"<string>\",\n \"name\": \"Master Services Agreement\",\n \"recipientId\": \"b1c2d3e4-f5a6-4b7c-8d9e-0f1a2b3c4d5e\",\n \"variableValues\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.assembly.com/v1/contracts")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"clientId\": \"b1c2d3e4-f5a6-4b7c-8d9e-0f1a2b3c4d5e\",\n \"companyId\": \"c2d3e4f5-a6b7-4c8d-9e0f-1a2b3c4d5e6f\",\n \"contractTemplateId\": \"d8e8fca2-dc0f-4f4a-8e3c-3f1f4c6a1b2c\",\n \"creationMode\": \"template\",\n \"fields\": [\n {\n \"autoFillField\": \"<string>\",\n \"bounds\": {\n \"height\": 123,\n \"pageHeight\": 123,\n \"pageWidth\": 123,\n \"resizedHeight\": 123,\n \"resizedWidth\": 123,\n \"width\": 123,\n \"x\": 123,\n \"y\": 123\n },\n \"encodedImgValue\": \"<string>\",\n \"id\": \"e4f5a6b7-c8d9-4e0f-1a2b-3c4d5e6f7a8b\",\n \"inputType\": \"client\",\n \"isOptional\": false,\n \"label\": \"Signature\",\n \"page\": 0,\n \"type\": \"signature\",\n \"value\": \"<string>\"\n }\n ],\n \"fileKey\": \"uploads/contract.pdf\",\n \"identityId\": \"<string>\",\n \"name\": \"Master Services Agreement\",\n \"recipientId\": \"b1c2d3e4-f5a6-4b7c-8d9e-0f1a2b3c4d5e\",\n \"variableValues\": {}\n}"
response = http.request(request)
puts response.read_body{
"clientId": "b1c2d3e4-f5a6-4b7c-8d9e-0f1a2b3c4d5e",
"companyId": "c2d3e4f5-a6b7-4c8d-9e0f-1a2b3c4d5e6f",
"contractTemplateId": "d8e8fca2-dc0f-4f4a-8e3c-3f1f4c6a1b2c",
"createdAt": "<string>",
"creationMode": "template",
"creatorId": "<string>",
"data": "<string>",
"fields": [
{
"autoFillField": "<string>",
"bounds": {
"height": 123,
"pageHeight": 123,
"pageWidth": 123,
"resizedHeight": 123,
"resizedWidth": 123,
"width": 123,
"x": 123,
"y": 123
},
"encodedImgValue": "<string>",
"id": "e4f5a6b7-c8d9-4e0f-1a2b-3c4d5e6f7a8b",
"inputType": "client",
"isOptional": false,
"label": "Signature",
"page": 0,
"type": "signature",
"value": "<string>"
}
],
"fileUrl": "https://files.assembly.com/protected/contract.pdf",
"id": "<string>",
"identityId": "<string>",
"isMigrated": true,
"name": "Master Services Agreement",
"object": "<string>",
"owner": {
"id": "<string>",
"metadata": {
"avatarImageUrl": "<string>",
"companyAvatarUrl": "<string>",
"companyId": "<string>",
"companyName": "<string>",
"email": "<string>",
"fallbackColor": "<string>",
"familyName": "<string>",
"givenName": "<string>"
}
},
"pageKeys": [
"<string>"
],
"portalId": "<string>",
"previousAttributes": {},
"recipientId": "b1c2d3e4-f5a6-4b7c-8d9e-0f1a2b3c4d5e",
"ref": "<string>",
"shareDate": "2023-11-07T05:31:56Z",
"signatureEvents": [
{
"email": "<string>",
"eventAt": "<string>",
"sourceIP": "<string>"
}
],
"signedFileUrl": "https://files.assembly.com/protected/contract-signed.pdf",
"status": "pending",
"submissionDate": "2023-11-07T05:31:56Z",
"updatedAt": "<string>"
}{
"code": "<string>",
"data": "<unknown>",
"message": "<string>"
}{
"code": "<string>",
"data": "<unknown>",
"message": "<string>"
}{
"code": "<string>",
"data": "<unknown>",
"message": "<string>"
}Authorizations
Body
Contract to create and send
ClientId is the client the contract is assigned to. One of clientId or recipientId must be provided.
"b1c2d3e4-f5a6-4b7c-8d9e-0f1a2b3c4d5e"
CompanyId is the company the contract is associated with. Required when the client belongs to multiple companies.
"c2d3e4f5-a6b7-4c8d-9e0f-1a2b3c4d5e6f"
ContractTemplateID is the template to create the contract from. Required unless creationMode is oneOff.
"d8e8fca2-dc0f-4f4a-8e3c-3f1f4c6a1b2c"
CreationMode indicates whether the contract is created from a template or as a one-off document.
oneOff, template "template"
ContractFields are the input fields for a one-off contract.
Show child attributes
Show child attributes
FileKey is the storage key of the uploaded document for a one-off contract.
"uploads/contract.pdf"
Name is the human-readable name of the contract.
"Master Services Agreement"
RecipientId is the recipient the contract is assigned to. Deprecated: use clientId instead. One of clientId or recipientId must be provided.
"b1c2d3e4-f5a6-4b7c-8d9e-0f1a2b3c4d5e"
VariableValues maps a template's variable field IDs to their values. Must cover every variable field on the template.
Response
OK
ClientID is the ID of the client the contract is assigned to.
"b1c2d3e4-f5a6-4b7c-8d9e-0f1a2b3c4d5e"
CompanyID is the ID of the company the contract is associated with.
"c2d3e4f5-a6b7-4c8d-9e0f-1a2b3c4d5e6f"
ContractTemplateID is the ID of the template the contract was created from, when applicable.
"d8e8fca2-dc0f-4f4a-8e3c-3f1f4c6a1b2c"
CreationMode indicates whether the contract was created from a template or as a one-off document.
oneOff, template "template"
ContractFields Represent all the inputs which are dropped on the contract to be filled by admin, client or autofilled
Show child attributes
Show child attributes
FileKey is a presigned URL to the original (unsigned) contract document.
"https://files.assembly.com/protected/contract.pdf"
Name is the human-readable name of the contract.
"Master Services Agreement"
Show child attributes
Show child attributes
Deprecated: use ClientID and CompanyID instead
"b1c2d3e4-f5a6-4b7c-8d9e-0f1a2b3c4d5e"
SignatureEvents holds the audit information about the user who performed any action on the contract document
Show child attributes
Show child attributes
SignedFileKey is a presigned URL to the signed contract document, populated once the contract is signed.
"https://files.assembly.com/protected/contract-signed.pdf"
Status is the current status of the contract.
pending, signed "pending"