Create a contract in a team (v2)
Creates a contract using the v2 contract-creation payload. Use this when an existing integration depends on the v2 request shape.
Legacy note: this endpoint is maintained for existing V2 integrations. Prefer V3 for new API and agent workflows where an equivalent exists.
curl -X POST "https://api.textmine.com/v2/teams/example_string/contracts" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-d '{
"created_by_user_id": "6749541852262271",
"name": "test contract",
"fields": [
{
"id": 3010,
"label": "Please specify the purpose of the Agreement",
"name": "contract_purpose",
"links": [
{
"rel": "self",
"href": "/v1/terms/3010"
}
],
"value": "Testing purpose"
},
{
"id": 3011,
"label": "Coverage",
"name": "contract_coverage",
"options": [
{
"value": "mutual"
},
{
"value": "one way"
}
],
"links": [
{
"rel": "self",
"href": "/v1/terms/3011"
}
],
"value": "mutual"
},
{
"id": 3012,
"label": "Please specify the Confidentiality Term",
"name": "contract_confidentialityTerm",
"options": [
{
"value": "2"
},
{
"value": "3"
},
{
"value": "4"
},
{
"value": "5"
},
{
"value": "6"
},
{
"value": "7"
},
{
"value": "8"
},
{
"value": "9"
},
{
"value": "10"
}
],
"links": [
{
"rel": "self",
"href": "/v1/terms/3012"
}
],
"value": "3"
},
{
"id": 3013,
"label": "Effective Date",
"name": "contract_startDate",
"links": [
{
"rel": "self",
"href": "/v1/terms/3013"
}
],
"value": "10/10/2023"
},
{
"id": 3014,
"label": "Would the contract creator like to upload their logo to the agreement?",
"name": "contract_logo",
"options": [
{
"value": "logoYes",
"nested_fields": [
{
"id": 3015,
"label": "Please upload the logo",
"name": "contract_logoDetails",
"links": [
{
"rel": "self",
"href": "/v1/terms/3015"
}
]
}
]
},
{
"value": "logoNo"
}
],
"links": [
{
"rel": "self",
"href": "/v1/terms/3014"
}
],
"value": "logoNo"
}
],
"template_id": 116
}'
import requests
import json
url = "https://api.textmine.com/v2/teams/example_string/contracts"
headers = {
"Content-Type": "application/json",
"Authorization": "Bearer YOUR_API_TOKEN"
}
data = {
"created_by_user_id": "6749541852262271",
"name": "test contract",
"fields": [
{
"id": 3010,
"label": "Please specify the purpose of the Agreement",
"name": "contract_purpose",
"links": [
{
"rel": "self",
"href": "/v1/terms/3010"
}
],
"value": "Testing purpose"
},
{
"id": 3011,
"label": "Coverage",
"name": "contract_coverage",
"options": [
{
"value": "mutual"
},
{
"value": "one way"
}
],
"links": [
{
"rel": "self",
"href": "/v1/terms/3011"
}
],
"value": "mutual"
},
{
"id": 3012,
"label": "Please specify the Confidentiality Term",
"name": "contract_confidentialityTerm",
"options": [
{
"value": "2"
},
{
"value": "3"
},
{
"value": "4"
},
{
"value": "5"
},
{
"value": "6"
},
{
"value": "7"
},
{
"value": "8"
},
{
"value": "9"
},
{
"value": "10"
}
],
"links": [
{
"rel": "self",
"href": "/v1/terms/3012"
}
],
"value": "3"
},
{
"id": 3013,
"label": "Effective Date",
"name": "contract_startDate",
"links": [
{
"rel": "self",
"href": "/v1/terms/3013"
}
],
"value": "10/10/2023"
},
{
"id": 3014,
"label": "Would the contract creator like to upload their logo to the agreement?",
"name": "contract_logo",
"options": [
{
"value": "logoYes",
"nested_fields": [
{
"id": 3015,
"label": "Please upload the logo",
"name": "contract_logoDetails",
"links": [
{
"rel": "self",
"href": "/v1/terms/3015"
}
]
}
]
},
{
"value": "logoNo"
}
],
"links": [
{
"rel": "self",
"href": "/v1/terms/3014"
}
],
"value": "logoNo"
}
],
"template_id": 116
}
response = requests.post(url, headers=headers, json=data)
print(response.json())
const response = await fetch("https://api.textmine.com/v2/teams/example_string/contracts", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Authorization": "Bearer YOUR_API_TOKEN"
},
body: JSON.stringify({
"created_by_user_id": "6749541852262271",
"name": "test contract",
"fields": [
{
"id": 3010,
"label": "Please specify the purpose of the Agreement",
"name": "contract_purpose",
"links": [
{
"rel": "self",
"href": "/v1/terms/3010"
}
],
"value": "Testing purpose"
},
{
"id": 3011,
"label": "Coverage",
"name": "contract_coverage",
"options": [
{
"value": "mutual"
},
{
"value": "one way"
}
],
"links": [
{
"rel": "self",
"href": "/v1/terms/3011"
}
],
"value": "mutual"
},
{
"id": 3012,
"label": "Please specify the Confidentiality Term",
"name": "contract_confidentialityTerm",
"options": [
{
"value": "2"
},
{
"value": "3"
},
{
"value": "4"
},
{
"value": "5"
},
{
"value": "6"
},
{
"value": "7"
},
{
"value": "8"
},
{
"value": "9"
},
{
"value": "10"
}
],
"links": [
{
"rel": "self",
"href": "/v1/terms/3012"
}
],
"value": "3"
},
{
"id": 3013,
"label": "Effective Date",
"name": "contract_startDate",
"links": [
{
"rel": "self",
"href": "/v1/terms/3013"
}
],
"value": "10/10/2023"
},
{
"id": 3014,
"label": "Would the contract creator like to upload their logo to the agreement?",
"name": "contract_logo",
"options": [
{
"value": "logoYes",
"nested_fields": [
{
"id": 3015,
"label": "Please upload the logo",
"name": "contract_logoDetails",
"links": [
{
"rel": "self",
"href": "/v1/terms/3015"
}
]
}
]
},
{
"value": "logoNo"
}
],
"links": [
{
"rel": "self",
"href": "/v1/terms/3014"
}
],
"value": "logoNo"
}
],
"template_id": 116
})
});
const data = await response.json();
console.log(data);
package main
import (
"fmt"
"net/http"
"bytes"
"encoding/json"
)
func main() {
data := []byte(`{
"created_by_user_id": "6749541852262271",
"name": "test contract",
"fields": [
{
"id": 3010,
"label": "Please specify the purpose of the Agreement",
"name": "contract_purpose",
"links": [
{
"rel": "self",
"href": "/v1/terms/3010"
}
],
"value": "Testing purpose"
},
{
"id": 3011,
"label": "Coverage",
"name": "contract_coverage",
"options": [
{
"value": "mutual"
},
{
"value": "one way"
}
],
"links": [
{
"rel": "self",
"href": "/v1/terms/3011"
}
],
"value": "mutual"
},
{
"id": 3012,
"label": "Please specify the Confidentiality Term",
"name": "contract_confidentialityTerm",
"options": [
{
"value": "2"
},
{
"value": "3"
},
{
"value": "4"
},
{
"value": "5"
},
{
"value": "6"
},
{
"value": "7"
},
{
"value": "8"
},
{
"value": "9"
},
{
"value": "10"
}
],
"links": [
{
"rel": "self",
"href": "/v1/terms/3012"
}
],
"value": "3"
},
{
"id": 3013,
"label": "Effective Date",
"name": "contract_startDate",
"links": [
{
"rel": "self",
"href": "/v1/terms/3013"
}
],
"value": "10/10/2023"
},
{
"id": 3014,
"label": "Would the contract creator like to upload their logo to the agreement?",
"name": "contract_logo",
"options": [
{
"value": "logoYes",
"nested_fields": [
{
"id": 3015,
"label": "Please upload the logo",
"name": "contract_logoDetails",
"links": [
{
"rel": "self",
"href": "/v1/terms/3015"
}
]
}
]
},
{
"value": "logoNo"
}
],
"links": [
{
"rel": "self",
"href": "/v1/terms/3014"
}
],
"value": "logoNo"
}
],
"template_id": 116
}`)
req, err := http.NewRequest("POST", "https://api.textmine.com/v2/teams/example_string/contracts", bytes.NewBuffer(data))
if err != nil {
panic(err)
}
req.Header.Set("Content-Type", "application/json")
req.Header.Set("Authorization", "Bearer YOUR_API_TOKEN")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
fmt.Println("Response Status:", resp.Status)
}
require 'net/http'
require 'json'
uri = URI('https://api.textmine.com/v2/teams/example_string/contracts')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Post.new(uri)
request['Content-Type'] = 'application/json'
request['Authorization'] = 'Bearer YOUR_API_TOKEN'
request.body = '{
"created_by_user_id": "6749541852262271",
"name": "test contract",
"fields": [
{
"id": 3010,
"label": "Please specify the purpose of the Agreement",
"name": "contract_purpose",
"links": [
{
"rel": "self",
"href": "/v1/terms/3010"
}
],
"value": "Testing purpose"
},
{
"id": 3011,
"label": "Coverage",
"name": "contract_coverage",
"options": [
{
"value": "mutual"
},
{
"value": "one way"
}
],
"links": [
{
"rel": "self",
"href": "/v1/terms/3011"
}
],
"value": "mutual"
},
{
"id": 3012,
"label": "Please specify the Confidentiality Term",
"name": "contract_confidentialityTerm",
"options": [
{
"value": "2"
},
{
"value": "3"
},
{
"value": "4"
},
{
"value": "5"
},
{
"value": "6"
},
{
"value": "7"
},
{
"value": "8"
},
{
"value": "9"
},
{
"value": "10"
}
],
"links": [
{
"rel": "self",
"href": "/v1/terms/3012"
}
],
"value": "3"
},
{
"id": 3013,
"label": "Effective Date",
"name": "contract_startDate",
"links": [
{
"rel": "self",
"href": "/v1/terms/3013"
}
],
"value": "10/10/2023"
},
{
"id": 3014,
"label": "Would the contract creator like to upload their logo to the agreement?",
"name": "contract_logo",
"options": [
{
"value": "logoYes",
"nested_fields": [
{
"id": 3015,
"label": "Please upload the logo",
"name": "contract_logoDetails",
"links": [
{
"rel": "self",
"href": "/v1/terms/3015"
}
]
}
]
},
{
"value": "logoNo"
}
],
"links": [
{
"rel": "self",
"href": "/v1/terms/3014"
}
],
"value": "logoNo"
}
],
"template_id": 116
}'
response = http.request(request)
puts response.body
{}
/v2/teams/{teamId}/contractsTarget server for requests. Edit to use your own host.
Bearer token - just enter the token, "Bearer" prefix will be added automatically
The media type of the request body
Request Preview
Response
Response will appear here after sending the request
Authentication
Bearer token. Authentication token required.
Path Parameters
Body
Raw application/json data
Responses
Successful response