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

# Put request templates

> Updates a request template.



## OpenAPI

````yaml https://app.opal.dev/openapi.yaml put /request-templates
openapi: 3.1.0
info:
  contact:
    email: hello@opal.dev
    name: Opal Team
    url: https://www.opal.dev/
  description: >-
    The Opal API is a RESTful API that allows you to interact with the Opal
    Security platform programmatically.
  title: Opal API
  version: '1.0'
servers:
  - description: Production
    url: https://api.opal.dev/v1
security: []
tags:
  - name: access-rules
    description: Operations related to access rules
  - name: apps
    description: Operations related to apps
  - name: bundles
    description: Operations related to bundles
  - name: campaigns
    description: Operations related to access review campaigns
  - name: configuration-templates
    description: Operations related to configuration templates
  - name: delegations
    description: Operations related to request reviewer delegations
  - name: event-streams
    description: Operations related to event streaming connections
  - name: events
    description: Operations related to events
  - name: groups
    description: Operations related to groups
  - name: group-bindings
    description: Operations related to group bindings
  - name: idp-group-mappings
    description: Operations related to IDP group mappings
  - name: message-channels
    description: Operations related to message channels
  - name: non-human-identities
    description: Operations related to non-human identities
  - name: on-call-schedules
    description: Operations related to on-call schedules
  - name: opal-queries
    description: Operations related to OpalQuery
  - name: owners
    description: Operations related to owners
  - name: requests
    description: Operations related to requests
  - name: resources
    description: Operations related to resources
  - name: paladin
    description: Operations related to Paladin
  - name: sessions
    description: Operations related to sessions
  - name: tags
    description: Operations related to tags
  - name: tokens
    description: Operations related to API tokens
  - name: uars
    description: Operations related to UARs. Deprecated in favor of the `campaigns` API.
  - name: users
    description: Operations related to users
paths:
  /request-templates:
    put:
      tags:
        - request-templates
      description: Updates a request template.
      operationId: updateRequestTemplate
      requestBody:
        description: Request template to be updated
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateRequestTemplateInfo'
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RequestTemplate'
          description: The request template just updated.
      security:
        - BearerAuth: []
components:
  schemas:
    UpdateRequestTemplateInfo:
      description: >-
        Information for updating a request template. Omitted properties are left
        unchanged, but `custom_fields` replaces the template's fields wholesale
        when provided.
      type: object
      properties:
        request_template_id:
          description: The ID of the request template to update.
          example: 7c86c85d-0651-43e2-a748-d69d658418e8
          format: uuid
          type: string
        name:
          description: The new name of the request template.
          type: string
        custom_fields:
          description: >-
            The complete set of fields for the template. Any field not included
            is removed.
          items:
            $ref: '#/components/schemas/RequestTemplateCustomFieldInput'
          type: array
      required:
        - request_template_id
    RequestTemplate:
      description: A template describing what a requester is asked when requesting access.
      type: object
      properties:
        request_template_id:
          description: The ID of the request template.
          example: 7c86c85d-0651-43e2-a748-d69d658418e8
          format: uuid
          type: string
        name:
          description: The name of the request template.
          example: Production access questions
          type: string
        custom_fields:
          description: The fields on this template, in the order they are shown.
          items:
            $ref: '#/components/schemas/RequestTemplateCustomField'
          type: array
      required:
        - request_template_id
        - name
    RequestTemplateCustomFieldInput:
      description: >-
        A field to put on a request template. Separate from
        `RequestTemplateCustomField` because a callout's name may be omitted on
        write, while a field read back always has one.
      type: object
      properties:
        name:
          description: >-
            The label shown to the requester. Required for every type except
            `CALLOUT`, which is display-only -- its name is an internal
            identifier, never displayed, and is generated if omitted.
          type: string
          example: Why do you need this access?
        description:
          description: Helper text shown beneath the field.
          type: string
          nullable: true
        type:
          $ref: '#/components/schemas/RequestTemplateCustomFieldTypeEnum'
        required:
          description: >-
            Whether the requester must answer. Ignored for `CALLOUT` fields,
            which collect no answer.
          type: boolean
          example: true
        metadata:
          $ref: '#/components/schemas/RequestTemplateCustomFieldMetadata'
      required:
        - type
    RequestTemplateCustomField:
      description: A field on a request template.
      type: object
      properties:
        name:
          description: >-
            The label shown to the requester. `CALLOUT` fields are display-only,
            so their name is an internal identifier and is never displayed.
          type: string
          example: Why do you need this access?
        description:
          description: Helper text shown beneath the field.
          type: string
          nullable: true
        type:
          $ref: '#/components/schemas/RequestTemplateCustomFieldTypeEnum'
        required:
          description: >-
            Whether the requester must answer. Always false for `CALLOUT`
            fields, which collect no answer.
          type: boolean
          example: true
        metadata:
          $ref: '#/components/schemas/RequestTemplateCustomFieldMetadata'
      required:
        - name
        - type
    RequestTemplateCustomFieldTypeEnum:
      description: >-
        The type of the custom request field. `CALLOUT` fields are display-only
        -- they show a message to the requester and collect no answer, so they
        never appear in a request's `custom_fields`.
      enum:
        - SHORT_TEXT
        - LONG_TEXT
        - BOOLEAN
        - MULTI_CHOICE
        - MULTI_SELECT
        - CALLOUT
      type: string
    RequestTemplateCustomFieldMetadata:
      description: >-
        Extra configuration for field types that need it. Exactly one member is
        set, and which one is determined by the field's `type`.
      type: object
      properties:
        callout_data:
          $ref: '#/components/schemas/RequestTemplateCustomFieldCalloutMetadata'
        multi_choice_data:
          $ref: '#/components/schemas/RequestTemplateCustomFieldMultiChoiceMetadata'
    RequestTemplateCustomFieldCalloutMetadata:
      description: >-
        The message shown to a requester by a `CALLOUT` field, and how
        prominently to show it.
      type: object
      properties:
        severity:
          description: How prominently the message is shown.
          enum:
            - INFO
            - WARNING
            - ERROR
          type: string
          example: WARNING
        text:
          description: The message shown to the requester.
          type: string
          example: This role grants access to production customer data.
      required:
        - severity
        - text
    RequestTemplateCustomFieldMultiChoiceMetadata:
      description: The options a requester can pick from in a `MULTI_CHOICE` field.
      type: object
      properties:
        options:
          items:
            type: string
          type: array
          example:
            - Incident response
            - Scheduled maintenance
      required:
        - options
  securitySchemes:
    BearerAuth:
      scheme: bearer
      type: http

````