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

# Update a contract

> Update a contract. <h3>OAuth</h3>Required scopes: <code>invoices</code>



## OpenAPI

````yaml /assets/openapi.json patch /contracts/v1/{contractId}
openapi: 3.0.2
info:
  title: Spacebring
  version: 1.0.0
  termsOfService: https://www.spacebring.com/terms
servers:
  - url: https://api.spacebring.com
security: []
paths:
  /contracts/v1/{contractId}:
    patch:
      tags:
        - Contracts
      summary: Update a contract
      description: 'Update a contract. <h3>OAuth</h3>Required scopes: <code>invoices</code>'
      operationId: updateContract
      parameters:
        - in: header
          name: spacebring-network-id
          schema:
            type: string
            format: uuid
          required: false
          description: >-
            The id of the network. Required when using bearer token
            authentication
        - in: path
          name: contractId
          required: true
          description: The id of the contract.
          schema:
            type: string
            format: uuid
      requestBody:
        $ref: '#/components/requestBodies/updateContract'
      responses:
        '204':
          description: No Content
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/responseError'
      security:
        - OAuth2:
            - invoices
components:
  requestBodies:
    updateContract:
      content:
        application/json:
          schema:
            type: object
            properties:
              contract:
                type: object
                properties:
                  actionable:
                    type: boolean
                    description: >-
                      Whether the contract triggers a billing action when
                      signed.
                  expirationDate:
                    type: string
                    format: date-time
                    description: Date after which the contract can no longer be signed.
                  items:
                    description: Line items included in this contract.
                    type: array
                    items:
                      type: object
                      properties:
                        couponRef:
                          description: Applied coupon ID.
                          type: string
                          format: uuid
                        oneOff:
                          description: Whether this is a one-off item.
                          type: boolean
                        optionRef:
                          description: Shop product option ID.
                          type: string
                          format: uuid
                        planRef:
                          description: Membership plan ID.
                          type: string
                          format: uuid
                        price:
                          description: Item price override.
                          type: number
                        productRef:
                          description: Shop product ID.
                          type: string
                          format: uuid
                        quantity:
                          type: number
                          minimum: 1
                          description: Number of units.
                        resourceRef:
                          description: Resource ID.
                          type: string
                          format: uuid
                        tierRef:
                          description: Plan tier ID.
                          type: string
                          format: uuid
                        title:
                          type: string
                          description: Display name of the item.
                        type:
                          type: string
                          enum:
                            - plan
                            - resource
                            - oneOff
                          description: Item type.
                      required:
                        - quantity
                        - title
                        - type
                      additionalProperties: false
                  templateRef:
                    type: string
                    format: uuid
                    description: ID of the template to use for this contract.
                  endDate:
                    description: Contract end date.
                    nullable: true
                    type: string
                    format: date-time
                  signers:
                    description: Updated signers list.
                    type: array
                    items:
                      type: object
                      properties:
                        email:
                          type: string
                          description: Signer email address.
                        id:
                          description: Signer ID (to identify existing signers).
                          type: string
                          format: uuid
                        name:
                          type: string
                          description: Signer first name.
                        phoneNumber:
                          description: Phone number.
                          type: string
                        surname:
                          description: Signer last name.
                          type: string
                        type:
                          type: string
                          enum:
                            - location
                            - customer
                          description: Whether this is a location or customer signer.
                  startDate:
                    description: Contract start date.
                    nullable: true
                    type: string
                    format: date-time
                description: Contract fields to update.
            required:
              - contract
      required: true
  schemas:
    responseError:
      type: object
      properties:
        message:
          type: string
        type:
          type: string
  securitySchemes:
    OAuth2:
      type: oauth2
      description: >-
        See our [authentication
        documentation](https://www.spacebring.com/docs/api-reference/authentication#oauth2)
        for how to authorize your requests
      flows:
        authorizationCode:
          authorizationUrl: https://api.spacebring.com/oauth2/authorize
          tokenUrl: https://api.spacebring.com/oauth2/token
          refreshUrl: https://api.spacebring.com/oauth2/token
          scopes:
            benefits.readonly: Read benefits and applications
            benefits: Read and write benefits and applications
            community.readonly: Read community companies and memberships
            community: Read and write community companies and memberships
            events.readonly: Read events and tickets
            events: Read and write events and tickets
            feed.readonly: Read feed posts
            feed: Read and write feed posts
            invoices.readonly: Read contracts, credit notes, discounts and invoices
            invoices: Read and write contract, credit notes, discounts and invoices
            locations.readonly: Read locations
            locations: Read and write locations
            plans.readonly: Read plans
            plans: Read and write plans
            resources.readonly: Read resources and bookings
            resources: Read and write resources and bookings
            subscriptions.readonly: Read subscriptions
            subscriptions: Read and write subscriptions
            shop.readonly: Read products and orders
            shop: Read and write products and orders
            support.readonly: Read support tickets
            support: Read and write support tickets
            transactions.readonly: Read transactions
            transactions: Read and write transactions
            visitors.readonly: Read visitors
            visitors: Read and write visitors

````