Contracts Signing

UrbanpayX (UrbanSign) provides a contract signing feature that allows clients to send, collect, and manage signed documents from their investors. The system supports multi-stage workflows, automatic variable injection, and optional payment gating.


Core Concepts

ConceptDescription
TemplateA DOCX document uploaded to the platform containing [[variable]] placeholders and defined signature roles
WorkflowA published, reusable signing configuration that defines participants and the sequence of stages
Contract RequestA single signing instance created from a workflow for a specific user and project
ParticipantA signer within the workflow — either the end user (investor) or the client's own signing profile
StageA single step in the workflow sequence — either a signature step or a transaction wait step

Endpoint

Create a Contract Request

POST /api/v1/contracts/requests
Authorization: Bearer <access_token>
Content-Type: application/json
{
  "workflow_id": "uuid",
  "user_id": "uuid",
  "project_id": "uuid",
  "transaction_id": "uuid|null",
  "variables": {
    "custom_variable": "value"
  },
  "participant_overrides": {
    "investor": {
      "name": "John Doe",
      "email": "[email protected]",
      "phone": "+1234567890"
    }
  },
  "metadata": {}
}
FieldRequiredDescription
workflow_idID of a published workflow
user_idID of the investor/end user
project_idID of the associated project
transaction_idPayment transaction to link. Can also be bound later via POST /api/v1/contracts/requests/{id}/bind-transaction
variablesCustom template variables. Merged with system-injected values (see below)
participant_overridesOverride name, email, phone, or field values per participant key
metadataArbitrary key-value metadata attached to the request

Template Variables

Variables replace [[variable_name]] placeholders inside your DOCX template during signing. They are resolved from three layers in the following priority order:

system variables  ←  automatically injected
      +
workflow variables  ←  defined in the workflow definition
      +
request variables  ←  passed in the API call  (highest priority)

System Variables (auto-injected, no action required)

VariableSource
client_nameClient display name
client_legal_nameClient legal name
client_emailClient email
investor_nameUser full name or email
investor_full_nameUser full name or email
investor_emailUser email
user_full_nameUser full name or email
user_emailUser email
project_nameProject name
contract_dateCurrent UTC date (ISO format)

Any additional [[variable]] defined in your template that is not in the list above must be passed in the variables field of the API call.


Workflows & Stages

A workflow defines the participants and the ordered sequence of stages that must be completed to fulfill a contract request.

Participants

Each participant has a key (unique identifier within the workflow) and a source:

SourceDescription
userThe end user (investor). Signing link is delivered to them
client_signing_profileThe client's own signing identity. Used for auto-signing

Stage Types

signature

A signing step assigned to one participant.

{
  "index": 0,
  "type": "signature",
  "participant": "investor",
  "delivery": "link"
}
deliveryBehavior
linkA signing link is sent to the participant. The workflow pauses until they complete it
autosignThe system automatically signs on behalf of the client using the configured Client Signing Profile

wait_transaction_success

Pauses the workflow until the linked transaction reaches success status. Can be placed at any position in the stage sequence. Omit this stage entirely if payment gating is not required.

{
  "index": 1,
  "type": "wait_transaction_success"
}

Execution Flow

Stages execute sequentially. Each stage must complete before the next begins. If a participant declines or the transaction fails, the request moves to a terminal state.


Common Use Case: Investor Signs, Client Auto-Signs

The simplest recommended workflow — the investor signs via link, and the client counter-signs automatically:

Workflow Definition

{
  "participants": [
    {
      "key": "investor",
      "source": "user",
      "docuseal_role": "Investor"
    },
    {
      "key": "client",
      "source": "client_signing_profile",
      "docuseal_role": "Company"
    }
  ],
  "stages": [
    {
      "index": 0,
      "type": "signature",
      "participant": "investor",
      "delivery": "link"
    },
    {
      "index": 1,
      "type": "signature",
      "participant": "client",
      "delivery": "autosign"
    }
  ]
}

How it works:

  1. You call POST /api/v1/contracts/requests with the workflow ID and the investor's user ID.
  2. The investor receives a signing link and completes their signature.
  3. The system immediately auto-signs on behalf of the client — no manual action required.
  4. The request status moves to completed and a contract.request.completed webhook event is fired.

Prerequisite for auto-sign: A Client Signing Profile must be configured via PUT /api/v1/contracts/signing-profile with a display name, signer email, and signature image before auto-sign stages can execute.

If counter-signing by the client is not needed, simply remove stage index 1 from the workflow.


Contract Request Statuses

StatusDescription
pendingRequest created, workflow advancing
awaiting_signatureWaiting for a participant to sign
awaiting_transaction_bindingA wait_transaction_success stage reached but no transaction is linked yet
awaiting_transactionTransaction is linked but has not yet reached success
completedAll stages finished successfully
declinedA participant declined to sign
canceledCanceled by the client
expiredSigning link expired before completion

Webhook Events

The following events are emitted during the lifecycle of a contract request. See the Webhooks documentation for payload schemas.

EventTrigger
contract.request.status_changedRequest status changes
contract.request.completedAll stages completed successfully
contract.participant.status_changedA participant's signing status changes

Other Endpoints

MethodEndpointDescription
GET/api/v1/contracts/requestsList contract requests
GET/api/v1/contracts/requests/{id}Get a single contract request
POST/api/v1/contracts/requests/{id}/bind-transactionLink a transaction after request creation
POST/api/v1/contracts/requests/{id}/cancelCancel a request
PUT/api/v1/contracts/signing-profileConfigure the client signing profile

Error Responses

Status CodeDescription
400Invalid request payload, unknown workflow, or misconfigured stage
401Unauthorized — missing or invalid access token
403Insufficient role for the requested operation
404Workflow, user, or project not found
409Duplicate contract request or state conflict