> ## 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.

# Retrieve templates

> Retrieve all contract templates in the location. <h3>OAuth</h3>Required scopes: <code>invoices.readonly</code> or <code>invoices</code>



## OpenAPI

````yaml /assets/openapi.json get /contracts/templates/v1
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/templates/v1:
    get:
      tags:
        - Contracts
      summary: Retrieve templates
      description: >-
        Retrieve all contract templates in the location. <h3>OAuth</h3>Required
        scopes: <code>invoices.readonly</code> or <code>invoices</code>
      operationId: getTemplates
      parameters:
        - in: query
          name: limit
          required: false
          description: >-
            Maximum number of templates per page. Defaults to 25 when omitted or
            invalid; values above 100 are capped at 100.
          schema:
            type: integer
            minimum: 1
            maximum: 100
        - in: query
          name: locationRef
          required: true
          description: UUID of the location.
          schema:
            type: string
            format: uuid
        - in: query
          name: nextPageToken
          required: false
          description: >-
            Pagination token from nextPageToken in a previous response. Keep the
            same filters when fetching the next page.
          schema:
            type: string
        - 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
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/getTemplates'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/responseError'
      security:
        - OAuth2:
            - invoices
            - invoices.readonly
components:
  schemas:
    getTemplates:
      type: object
      properties:
        nextPageToken:
          description: Pagination token to fetch the next page of results.
          type: string
        searchQueryNext:
          description: >-
            Search query parameters for the next page of results. Includes all
            filters used to fetch the current page.
          type: string
        templates:
          type: array
          items:
            type: object
            properties:
              createDate:
                type: string
                format: date-time
                description: ISO timestamp of when the template was created.
              file:
                type: object
                properties:
                  key:
                    type: string
                    description: Storage key of the template file.
                  url:
                    type: string
                    description: Download URL of the template file.
                required:
                  - key
                  - url
                additionalProperties: false
                description: Template file reference.
              id:
                type: string
                format: uuid
                description: Unique identifier of the template.
              locationRef:
                type: string
                format: uuid
                description: ID of the location this template belongs to.
              media:
                type: array
                items:
                  type: object
                  properties:
                    key:
                      type: string
                    url:
                      type: string
                  required:
                    - key
                    - url
                  additionalProperties: false
                description: Media files associated with the template.
              title:
                type: string
                description: Template title.
              updateDate:
                type: string
                format: date-time
                description: ISO timestamp of when the template was last updated.
            required:
              - createDate
              - file
              - id
              - locationRef
              - media
              - title
              - updateDate
            additionalProperties: false
          description: List of templates.
      required:
        - templates
      additionalProperties: false
    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

````