---
updatedAt: 2026-04-20T19:11:03.000Z
agentTools:
  projectIndex: https://docs.totalitylms.com/llms.txt
---

# Create Contract

Create new contract. Permission: Create Contract

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "Totality API",
    "version": "2.0",
    "description": "The Totality LMS API provides programmatic access to manage loans, customers, payments, and related resources."
  },
  "servers": [
    {
      "url": "https://{your-totality-url}.com",
      "variables": {
        "your-totality-url": {
          "default": "your-totality-url"
        }
      }
    }
  ],
  "components": {
    "securitySchemes": {
      "ClientCredentials": {
        "type": "oauth2",
        "flows": {
          "clientCredentials": {
            "tokenUrl": "/oauth/token",
            "scopes": {
              "unmasked-pii.get": "Return the full Social Security Number and bank account numbers instead of the masked values. Granted per client in Settings > API; every other client receives masked values."
            }
          }
        }
      },
      "BearerToken": {
        "type": "http",
        "scheme": "bearer"
      }
    }
  },
  "security": [
    {
      "ClientCredentials": []
    },
    {
      "BearerToken": []
    }
  ],
  "paths": {
    "/api/contracts": {
      "post": {
        "summary": "Create Contract",
        "description": "Create new contract. Permission: Create Contract",
        "operationId": "post-contracts",
        "parameters": [
          {
            "name": "Accept",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "default": "application/vnd.totality.v1+json"
            },
            "description": "Must be application/json."
          },
          {
            "name": "Content-Type",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "default": "application/json"
            },
            "description": "Must be application/json."
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "loanUuid",
                  "contractFile"
                ],
                "properties": {
                  "loanUuid": {
                    "type": "string",
                    "description": "UUID",
                    "example": "d4b2e6a1-5678-4def-abcd-123456789012"
                  },
                  "contractFile": {
                    "type": "string",
                    "format": "binary",
                    "description": "Must be a PDF file type",
                    "example": "(PDF file)"
                  },
                  "ipAddress": {
                    "type": "string",
                    "description": "IP address of the end user signing the contract.",
                    "example": "192.168.1.100"
                  },
                  "isSigned": {
                    "type": "boolean",
                    "description": "Whether the contract has been signed.",
                    "example": false
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "apiRequestIpAddress": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "The IP address of the API caller (automatically captured from the request)",
                          "example": "10.0.0.1"
                        },
                        "createdAt": {
                          "type": "string",
                          "description": "Timestamp when the contract was created, in ISO 8601 format.",
                          "example": "2026-01-15T10:30:00"
                        },
                        "customerName": {
                          "type": "string",
                          "description": "The full name of the customer associated with this contract's loan.",
                          "example": "John Smith"
                        },
                        "ipAddress": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "The IP address of the end user (can be provided in the request, or defaults to the API caller's IP)",
                          "example": "192.168.1.100"
                        },
                        "isSigned": {
                          "type": [
                            "boolean",
                            "null"
                          ],
                          "description": "Whether the contract has been signed by the customer.",
                          "example": false
                        },
                        "isValid": {
                          "type": "boolean",
                          "description": "Whether the contract is currently valid and enforceable.",
                          "example": true
                        },
                        "loanUuid": {
                          "type": "string",
                          "format": "uuid",
                          "description": "The UUID of the loan this contract belongs to. Use this value with the GET /api/loans/{loanUuid} endpoint to retrieve the full loan record.",
                          "example": "d4b2e6a1-5678-4def-abcd-123456789012"
                        },
                        "updatedAt": {
                          "type": "string",
                          "description": "Timestamp when the contract was last updated, in ISO 8601 format.",
                          "example": "2026-01-20T14:45:00"
                        },
                        "uuid": {
                          "type": "string",
                          "format": "uuid",
                          "description": "The unique identifier for the contract",
                          "example": "550e8400-e29b-41d4-a716-446655440000"
                        }
                      },
                      "example": []
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "400",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": "{}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {}
                }
              }
            }
          },
          "401": {
            "description": "401",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": "{\n  \"error\": \"invalid_client\",\n  \"error_description\": \"Client authentication failed\",\n  \"message\": \"Client authentication failed\"\n}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "invalid_client",
                      "description": "Error."
                    },
                    "error_description": {
                      "type": "string",
                      "example": "Client authentication failed",
                      "description": "Error_description."
                    },
                    "message": {
                      "type": "string",
                      "example": "Client authentication failed",
                      "description": "Notification message body (max 1000 characters)."
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "403",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": "{\n  \"message\": \"Invalid scope(s) provided.\"\n}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "example": "Invalid scope(s) provided.",
                      "description": "Notification message body (max 1000 characters)."
                    }
                  }
                }
              }
            }
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Notification message body (max 1000 characters).",
                      "example": "Your payment of $150.00 is due tomorrow."
                    }
                  },
                  "required": [
                    "message"
                  ]
                },
                "examples": {
                  "Conflict": {
                    "summary": "Conflict",
                    "value": {
                      "message": "This loan does not have a contract template."
                    }
                  }
                }
              }
            },
            "description": "409"
          },
          "422": {
            "description": "422",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": ""
                  }
                }
              }
            }
          },
          "500": {
            "description": "500",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": "{\n  \"message\": \"Server Error\"\n}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "example": "Server Error",
                      "description": "Notification message body (max 1000 characters)."
                    }
                  }
                }
              }
            }
          }
        },
        "deprecated": false,
        "tags": [
          "Contracts"
        ]
      }
    }
  },
  "x-readme": {
    "headers": [
      {
        "key": "Accept",
        "value": "application/vnd.totality.v1+json"
      },
      {
        "key": "Content-Type",
        "value": "application/json"
      },
      {
        "key": "Authorization",
        "value": "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJhdWQiOiI0IiwianRpIjoiMTYwYjUxZDJmODM1NzBkMDY5MjVhNjBmMTgyZWFlODY2MTM4NTI3ZTc0MTM5OTJlZjg0NmI3NmQ0YjIxNTcwNjMxYjljYzdkZDBiNTYyM2UiLCJpYXQiOjE2MzY0MDI3MDIuNjQ4NDY4LCJuYmYiOjE2MzY0MDI3MDIuNjQ4NDcsImV4cCI6MzMxNjE3NzU1MDIuNjQ2NCwic3ViIjoiMSIsInNjb3BlcyI6W119.Y6mUADBimadKO1wlhnGMZDyR5FJ7Nstyy0o7LjXVyqF3qKpu3G4_2G0j_SmmRjU1LO86yrOsVzmxlhs6TpUIiDsQRkTzDiurqXkdgDgpAkZ7khmaQ6MMvT6eoxvjGDaiaBVq9vo5BfK3fCL11fejffuFrybKk_si5iHO-COneHdgYbt9KLvsoyFF_ARIfUypA4ZF98yyYNtxOhMk7K8uYYpwTOiyBhVDm86EJhoXCWaLieq3bb6se7UfutxB0bJrqUvuN32ukpt78n1VikAZ_sIB74NMNTHsNgfPdzIIZczJK1k2wSVGqM0UeAm5tE3fQkRtQjy6tfS5yx58z2GXtzdFdwNYuQXLK26VOAHp5shrvpr7a3V9QihHHkSQMPftaZAeAZ3v_kLje27jLV-R6dR-jkDbTevyM_pQYv_w0D5wXQCri5UDSP7UWCD_o5viNXcvkXMvdkPIWOZqRlV2aXQD_vtBJHFqyHG9-1rwl-WBVqA637aEnXPu4Hvnp7EK1qucbjQX44wBtxIkcQdjh7NhLExCaONlci_mO-tXXUpghLxMVjM6BTY2ffnRncHXMNPjijU5t9b__CrECYp48esLKgMq0V0uouDiGixOS9WYrm99Gxx4nviAh2XEiFAwBJ3rd9_N2JLb1Pmgi4I9_NcQaYUncv5JzRMEUlA27ms"
      }
    ],
    "explorer-enabled": false,
    "proxy-enabled": true
  },
  "tags": [
    {
      "name": "Contracts",
      "description": "Contract management"
    }
  ]
}
```