> ## Documentation Index
> Fetch the complete documentation index at: https://studio.assembly.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Send Contract

> Creates and sends a contract to a recipient, either from a contract template or as a one-off contract.



## OpenAPI

````yaml /api-reference/openapi.json post /v1/contracts
openapi: 3.0.0
info:
  contact: {}
  title: Assembly API
  version: 0.0.1
servers:
  - url: https://api.assembly.com
security: []
paths:
  /v1/contracts:
    post:
      tags:
        - Contracts
      summary: Send Contract
      description: >-
        Creates and sends a contract to a recipient, either from a contract
        template or as a one-off contract.
      operationId: send-contract
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/contracts.CreateContractRequest'
        description: Contract to create and send
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/contracts.Contract'
          description: OK
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/dispatcher.Error'
          description: Malformed body or invalid recipient/template/variable values
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/dispatcher.Error'
          description: Missing or invalid API key
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/dispatcher.Error'
          description: Contract template not found
      security:
        - APIKeyHeader: []
components:
  schemas:
    contracts.CreateContractRequest:
      properties:
        clientId:
          description: >-
            ClientId is the client the contract is assigned to. One of clientId
            or recipientId must be provided.
          example: b1c2d3e4-f5a6-4b7c-8d9e-0f1a2b3c4d5e
          format: uuid
          type: string
        companyId:
          description: >-
            CompanyId is the company the contract is associated with. Required
            when the client belongs to multiple companies.
          example: c2d3e4f5-a6b7-4c8d-9e0f-1a2b3c4d5e6f
          format: uuid
          type: string
        contractTemplateId:
          description: >-
            ContractTemplateID is the template to create the contract from.
            Required unless creationMode is oneOff.
          example: d8e8fca2-dc0f-4f4a-8e3c-3f1f4c6a1b2c
          format: uuid
          type: string
        creationMode:
          allOf:
            - $ref: '#/components/schemas/contracts.ContractCreationMode'
          description: >-
            CreationMode indicates whether the contract is created from a
            template or as a one-off document.
          enum:
            - oneOff
            - template
          example: template
        fields:
          description: ContractFields are the input fields for a one-off contract.
          items:
            $ref: '#/components/schemas/contracts.ContractField'
          type: array
        fileKey:
          description: >-
            FileKey is the storage key of the uploaded document for a one-off
            contract.
          example: uploads/contract.pdf
          type: string
        identityId:
          type: string
        name:
          description: Name is the human-readable name of the contract.
          example: Master Services Agreement
          type: string
        recipientId:
          description: >-
            RecipientId is the recipient the contract is assigned to.
            Deprecated: use clientId instead. One of clientId or recipientId
            must be provided.
          example: b1c2d3e4-f5a6-4b7c-8d9e-0f1a2b3c4d5e
          format: uuid
          type: string
        variableValues:
          additionalProperties: true
          description: >-
            VariableValues maps a template's variable field IDs to their values.
            Must cover every variable field on the template.
          type: object
      type: object
    contracts.Contract:
      properties:
        clientId:
          description: ClientID is the ID of the client the contract is assigned to.
          example: b1c2d3e4-f5a6-4b7c-8d9e-0f1a2b3c4d5e
          format: uuid
          type: string
        companyId:
          description: CompanyID is the ID of the company the contract is associated with.
          example: c2d3e4f5-a6b7-4c8d-9e0f-1a2b3c4d5e6f
          format: uuid
          type: string
        contractTemplateId:
          description: >-
            ContractTemplateID is the ID of the template the contract was
            created from, when applicable.
          example: d8e8fca2-dc0f-4f4a-8e3c-3f1f4c6a1b2c
          format: uuid
          type: string
        createdAt:
          type: string
        creationMode:
          description: >-
            CreationMode indicates whether the contract was created from a
            template or as a one-off document.
          enum:
            - oneOff
            - template
          example: template
          type: string
        creatorId:
          type: string
        data:
          type: string
        fields:
          description: >-
            ContractFields Represent all the inputs which are dropped on the
            contract to be filled by admin, client or autofilled
          items:
            $ref: '#/components/schemas/contracts.ContractField'
          type: array
        fileUrl:
          description: >-
            FileKey is a presigned URL to the original (unsigned) contract
            document.
          example: https://files.assembly.com/protected/contract.pdf
          format: uri
          type: string
        id:
          type: string
        identityId:
          type: string
        isMigrated:
          type: boolean
        name:
          description: Name is the human-readable name of the contract.
          example: Master Services Agreement
          type: string
        object:
          type: string
        owner:
          $ref: '#/components/schemas/users.Owner'
        pageKeys:
          items:
            type: string
          type: array
        portalId:
          type: string
        previousAttributes:
          additionalProperties: true
          type: object
        recipientId:
          description: 'Deprecated: use ClientID and CompanyID instead'
          example: b1c2d3e4-f5a6-4b7c-8d9e-0f1a2b3c4d5e
          format: uuid
          type: string
        ref:
          type: string
        shareDate:
          format: date-time
          type: string
        signatureEvents:
          description: >-
            SignatureEvents holds the audit information about the user who
            performed any action on the contract document
          items:
            $ref: '#/components/schemas/contracts.SignatureEvent'
          type: array
        signedFileUrl:
          description: >-
            SignedFileKey is a presigned URL to the signed contract document,
            populated once the contract is signed.
          example: https://files.assembly.com/protected/contract-signed.pdf
          format: uri
          type: string
        status:
          allOf:
            - $ref: '#/components/schemas/contracts.ContractStatus'
          description: Status is the current status of the contract.
          enum:
            - pending
            - signed
          example: pending
        submissionDate:
          format: date-time
          type: string
        updatedAt:
          type: string
      type: object
    dispatcher.Error:
      properties:
        code:
          type: string
        data: {}
        message:
          type: string
      type: object
    contracts.ContractCreationMode:
      enum:
        - oneOff
        - template
      type: string
      x-enum-varnames:
        - ContractCreationModeOneOff
        - ContractCreationModeTemplate
    contracts.ContractField:
      properties:
        autoFillField:
          description: >-
            pattern is {{client.firstName}} or
            {{client.customField.<custom_field_id>}}
          type: string
        bounds:
          $ref: '#/components/schemas/contracts.Bounds'
        encodedImgValue:
          type: string
        id:
          description: ID uniquely identifies the field within the contract.
          example: e4f5a6b7-c8d9-4e0f-1a2b-3c4d5e6f7a8b
          type: string
        inputType:
          allOf:
            - $ref: '#/components/schemas/contracts.InputType'
          description: >-
            InputType indicates who fills the field, or whether it is
            auto-filled or variable.
          enum:
            - client
            - fixed
            - autoFill
            - variable
          example: client
        isOptional:
          description: IsOptional reports whether the field may be left blank.
          example: false
          type: boolean
        label:
          example: Signature
          type: string
        page:
          description: Page is the 0-based page index the field is placed on.
          example: 0
          type: integer
        type:
          allOf:
            - $ref: '#/components/schemas/contracts.FieldType'
          description: FieldType is the kind of input rendered on the contract.
          enum:
            - signature
            - initials
            - date
            - text
          example: signature
        value:
          type: string
      type: object
    users.Owner:
      properties:
        id:
          type: string
        metadata:
          $ref: '#/components/schemas/users.OwnerFields'
      type: object
    contracts.SignatureEvent:
      properties:
        email:
          type: string
        eventAt:
          type: string
        sourceIP:
          type: string
        type:
          $ref: '#/components/schemas/contracts.SignatureEventType'
      type: object
    contracts.ContractStatus:
      enum:
        - pending
        - signed
      type: string
      x-enum-varnames:
        - ContractStatusPending
        - ContractStatusSigned
    contracts.Bounds:
      properties:
        height:
          type: number
        pageHeight:
          type: number
        pageWidth:
          type: number
        resizedHeight:
          type: integer
        resizedWidth:
          type: integer
        width:
          type: number
        x:
          type: number
        'y':
          type: number
      type: object
    contracts.InputType:
      enum:
        - client
        - fixed
        - autoFill
        - variable
      type: string
      x-enum-varnames:
        - InputTypeClient
        - InputTypeFixed
        - InputTypeAutoFill
        - InputTypeVariable
    contracts.FieldType:
      enum:
        - signature
        - initials
        - date
        - text
        - checkbox
      type: string
      x-enum-varnames:
        - FieldTypeSignature
        - FieldTypeInitials
        - FieldTypeDate
        - FieldTypeText
        - FieldTypeCheckbox
    users.OwnerFields:
      properties:
        avatarImageUrl:
          type: string
        companyAvatarUrl:
          type: string
        companyId:
          type: string
        companyName:
          type: string
        email:
          type: string
        fallbackColor:
          type: string
        familyName:
          type: string
        givenName:
          type: string
      type: object
    contracts.SignatureEventType:
      enum:
        - sent
        - signed
      type: string
      x-enum-varnames:
        - SignatureEventTypeSent
        - SignatureEventTypeSigned
  securitySchemes:
    APIKeyHeader:
      in: header
      name: X-API-KEY
      type: apiKey

````