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

# Get a template graph

> Returns the template graph plus a self-describing agent contract payload.



## OpenAPI

````yaml /openapi.json get /api/v1/templates/{id}
openapi: 3.0.0
info:
  title: Atlas API
  version: 0.0.0
servers:
  - url: https://api.atlaswork.ai
security: []
paths:
  /api/v1/templates/{id}:
    get:
      tags:
        - Templates
      summary: Get a template graph
      description: >-
        Returns the template graph plus a self-describing agent contract
        payload.
      parameters:
        - schema:
            type: string
            minLength: 1
            description: Template id
          required: true
          description: Template id
          name: id
          in: path
      responses:
        '200':
          description: Template graph with agent contract
          content:
            application/json:
              schema:
                type: object
                properties:
                  template:
                    type: object
                    properties:
                      id:
                        type: string
                      organizationId:
                        type: string
                      teamId:
                        type: string
                      name:
                        type: string
                      originalFilename:
                        type: string
                      sourceFormat:
                        type: string
                      contentHash:
                        type: string
                      sizeBytes:
                        type: number
                      archivedAt:
                        type: string
                        nullable: true
                        format: date-time
                      useCount:
                        type: integer
                        minimum: 0
                      lastUsedAt:
                        type: string
                        nullable: true
                        format: date-time
                      createdAt:
                        type: string
                        format: date-time
                      updatedAt:
                        type: string
                        format: date-time
                    required:
                      - id
                      - organizationId
                      - teamId
                      - name
                      - originalFilename
                      - sourceFormat
                      - contentHash
                      - sizeBytes
                      - archivedAt
                      - useCount
                      - lastUsedAt
                      - createdAt
                      - updatedAt
                  roles:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                        templateId:
                          type: string
                        name:
                          type: string
                        apiRoleName:
                          type: string
                        orderIndex:
                          type: integer
                          minimum: 0
                        isSender:
                          type: boolean
                        optional:
                          type: boolean
                      required:
                        - id
                        - templateId
                        - name
                        - apiRoleName
                        - orderIndex
                        - isSender
                        - optional
                  fields:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                        templateId:
                          type: string
                        roleId:
                          type: string
                        type:
                          type: string
                          enum:
                            - signature
                            - initials
                            - date
                            - text
                            - checkbox
                        page:
                          type: integer
                          minimum: 1
                        x:
                          type: number
                        'y':
                          type: number
                        width:
                          type: number
                        height:
                          type: number
                        label:
                          type: string
                          nullable: true
                        required:
                          type: boolean
                        prefillValue:
                          type: string
                          nullable: true
                        autoSource:
                          type: string
                          nullable: true
                          enum:
                            - signed_date
                            - participant_name
                            - participant_email
                            - participant_company
                            - participant_title
                            - sender_org_name
                            - null
                        prefillKey:
                          type: string
                          nullable: true
                        locked:
                          type: boolean
                      required:
                        - id
                        - templateId
                        - roleId
                        - type
                        - page
                        - x
                        - 'y'
                        - width
                        - height
                        - label
                        - required
                        - prefillValue
                        - autoSource
                        - prefillKey
                        - locked
                  contract:
                    type: object
                    properties:
                      partiesForSend:
                        type: array
                        items:
                          type: object
                          properties:
                            roleName:
                              type: string
                            apiRoleName:
                              type: string
                            orderIndex:
                              type: integer
                              minimum: 0
                            isSender:
                              type: boolean
                            required:
                              type: boolean
                          required:
                            - roleName
                            - apiRoleName
                            - orderIndex
                            - isSender
                            - required
                      doNotIncludeInParties:
                        type: array
                        items:
                          type: string
                      storedSignatures:
                        type: array
                        items:
                          type: object
                          properties:
                            roleName:
                              type: string
                            signatureImageUrl:
                              type: string
                          required:
                            - roleName
                            - signatureImageUrl
                      pinnedValues:
                        type: array
                        items:
                          type: object
                          properties:
                            fieldId:
                              type: string
                            label:
                              type: string
                              nullable: true
                            value:
                              type: string
                          required:
                            - fieldId
                            - label
                            - value
                      prefillKeys:
                        type: array
                        items:
                          type: object
                          properties:
                            key:
                              type: string
                            fieldId:
                              type: string
                            roleName:
                              type: string
                            label:
                              type: string
                              nullable: true
                            type:
                              type: string
                              enum:
                                - signature
                                - initials
                                - date
                                - text
                                - checkbox
                            defaultValue:
                              type: string
                              nullable: true
                          required:
                            - key
                            - fieldId
                            - roleName
                            - label
                            - type
                            - defaultValue
                      exampleCreate:
                        type: object
                        properties:
                          recipients:
                            type: object
                            additionalProperties:
                              type: object
                              properties:
                                name:
                                  type: string
                                  minLength: 1
                                email:
                                  type: string
                                  format: email
                                order:
                                  type: integer
                                  minimum: 1
                                company:
                                  type: string
                                  nullable: true
                                  maxLength: 200
                                title:
                                  type: string
                                  nullable: true
                                  maxLength: 200
                              required:
                                - email
                          prefill:
                            type: object
                            additionalProperties:
                              type: string
                          autoSend:
                            type: boolean
                        required:
                          - recipients
                          - prefill
                          - autoSend
                      sendPath:
                        type: string
                      contractNote:
                        type: string
                    required:
                      - partiesForSend
                      - doNotIncludeInParties
                      - storedSignatures
                      - pinnedValues
                      - prefillKeys
                      - exampleCreate
                      - sendPath
                      - contractNote
                required:
                  - template
                  - roles
                  - fields
                  - contract
        '401':
          description: Missing or invalid API key
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: string
                  message:
                    type: string
                  details:
                    type: object
                    additionalProperties:
                      nullable: true
                required:
                  - code
                  - message
        '404':
          description: Template not found in this organization
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: string
                  message:
                    type: string
                  details:
                    type: object
                    additionalProperties:
                      nullable: true
                required:
                  - code
                  - message
      security:
        - apiKey: []
        - oauthJwt: []
components:
  securitySchemes:
    apiKey:
      type: http
      scheme: bearer
      description: >-
        Organization API key (format `atlas_sk_...`), passed as a bearer token
        or the x-api-key header. Created and revoked in the dashboard (Better
        Auth api-key plugin); shown in full only once and stored hashed.
    oauthJwt:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        Better Auth OAuth resource access token. The token audience must match
        the Atlas MCP resource and include the scope required by the route.

````