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

# Create a Secret Reference

> An endpoint for creating a secret reference



## OpenAPI

````yaml /openapi/public-api-endpoint-reference.yaml post /v1/projects/{projectId}/secret-references/{secretReferenceName}
openapi: 3.1.0
info:
  title: Maia Public REST API
  version: '1.0'
servers:
  - description: EU1
    url: https://eu1.api.matillion.com/dpc
  - description: US1
    url: https://us1.api.matillion.com/dpc
security:
  - bearerAuth: []
tags:
  - description: Manage Schedules
    name: Schedules
  - description: Manage Connections
    name: Connections
  - description: Operations for managing Project Variables
    name: Project Variables
  - description: Manage Pipelines
    name: Pipelines
  - description: Review pipelines against quality rules
    name: Pipeline Quality Review
  - description: Execute tests within a project
    name: Test Execution
  - description: Manage your AI agent tasks
    name: AI Agent Tasks
  - description: SCIM endpoints for user/group permission management
    name: Directory Integration
  - description: Publish shared pipeline artifacts
    name: Shared Pipeline Artifacts
  - description: Manage Repositories
    name: Repositories
  - description: Report on Credit Consumption
    name: Consumption
  - description: Manage Artifacts
    name: Artifacts
  - description: Operations for data lineage and governance
    name: Data Lineage
  - description: Manage Streaming Pipelines
    name: Streaming Pipelines
  - description: Execute a pipeline
    name: Pipeline Execution
  - description: ''
    name: Environments
  - description: ''
    name: Projects
  - description: Manage Agents
    name: Agents
  - description: Operations for managing Environment-level Overrides of Project Variables
    name: Project Variable Environment Overrides
  - description: Query audit events
    name: Audit Events
  - description: Connector Profiles
    name: Connectors
paths:
  /v1/projects/{projectId}/secret-references/{secretReferenceName}:
    post:
      tags:
        - Secret References
      summary: Create a Secret Reference
      description: An endpoint for creating a secret reference
      operationId: createSecretReference
      parameters:
        - in: path
          name: projectId
          required: true
          schema:
            type: string
            format: uuid
        - in: path
          name: secretReferenceName
          required: true
          schema:
            type: string
            pattern: ^[\w()-]{1,128}$
      requestBody:
        content:
          application/json:
            schema:
              oneOf:
                - $ref: '#/components/schemas/AwsSecretReferenceRequest'
                - $ref: '#/components/schemas/AzureSecretReferenceRequest'
                - $ref: '#/components/schemas/MatillionHostedSecretReferenceRequest'
        required: true
      responses:
        '201':
          description: Created
        '400':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDetail'
          description: Wrong request parameters used
        '403':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDetail'
          description: Unauthorized
        '404':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDetail'
          description: Not found
        '500':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDetail'
          description: Unexpected error occurred
        '504':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDetail'
          description: Gateway timeout
components:
  schemas:
    AwsSecretReferenceRequest:
      allOf:
        - $ref: '#/components/schemas/SecretReferenceRequest'
        - type: object
          properties:
            secretKey:
              type: string
              description: The key of the secret within the Cloud Provider
              example: aws-secret-key
            secretName:
              type: string
              description: The name of the secret within the Cloud Provider
              example: aws-secret-name
      description: >-
        Secret Reference request body for creating a new secret reference for an
        AWS Customer hosted project
      required:
        - agentType
        - secretName
        - secretReferenceType
    AzureSecretReferenceRequest:
      allOf:
        - $ref: '#/components/schemas/SecretReferenceRequest'
        - type: object
          properties:
            secretKey:
              type: string
              description: The key of the secret within the Cloud Provider
              example: azure-secret-key
            secretName:
              type: string
              description: The name of the secret within the Cloud Provider
              example: azure-secret-name
            vaultName:
              type: string
              description: The name of the Azure vault the secret is stored in
              example: azure-vault-name
      description: >-
        Secret Reference request body for creating a new secret reference for an
        Azure Customer hosted project
      required:
        - agentType
        - secretName
        - secretReferenceType
        - vaultName
    MatillionHostedSecretReferenceRequest:
      allOf:
        - $ref: '#/components/schemas/SecretReferenceRequest'
        - type: object
          properties:
            agentId:
              type: string
              description: ${project.secret-reference-request.agentId.desc}
              example: 3fa85f64-5717-4562-b3fc-2c963f66afa6
            secretValue:
              $ref: '#/components/schemas/JsonNode'
              description: The json containing the secret value
              example:
                password: password-plain-text-value
      description: >-
        Secret Reference request body for creating a new secret reference for a
        Matillion hosted project
      required:
        - agentId
        - agentType
        - secretReferenceType
        - secretValue
    ProblemDetail:
      type: object
      properties:
        detail:
          type: string
        instance:
          type: string
        status:
          type: integer
          format: int32
        title:
          type: string
        type:
          type: string
          format: uri
        violations:
          type: array
          items:
            type: string
    SecretReferenceRequest:
      type: object
      description: >-
        Secret Reference request body for creating a new secret reference for a
        project
      discriminator:
        propertyName: agentType
      properties:
        agentType:
          type: string
          description: >-
            The type of agent associated with the project the secret reference
            will be created in
          enum:
            - AWS
            - Azure
            - Matillion hosted
          example: AWS
        description:
          type: string
          description: The description of the secret reference
          example: My secret reference
        secretReferenceType:
          type: string
          description: The type of secret reference
          enum:
            - PASSWORD
          example: PASSWORD
      required:
        - agentType
        - secretReferenceType
    JsonNode: {}
  securitySchemes:
    bearerAuth:
      bearerFormat: JWT
      description: a valid bearer token
      scheme: bearer
      type: http

````