---
title: "Create a Secret Reference"
method: POST
path: "/v1/projects/{projectId}/secret-references/{secretReferenceName}"
tags: ["Secret References"]
---

# Create a Secret Reference

`POST /v1/projects/{projectId}/secret-references/{secretReferenceName}`

## Request

- Base URL: `https://eu1.api.matillion.com/dpc`
- URL: `https://eu1.api.matillion.com/dpc/v1/projects/{projectId}/secret-references/{secretReferenceName}`
- Auth: HTTP bearer

An endpoint for creating a secret reference

## Path parameters

- `projectId` string, uuid, required
- `secretReferenceName` string, required

## Request body

- union
  - AwsSecretReferenceRequest: Secret Reference request body for creating a new secret reference for an AWS Customer hosted project
    - `agentType` 'AWS' | 'Azure' | 'Matillion hosted', required: The type of agent associated with the project the secret reference will be created in
    - `description` string: The description of the secret reference
    - `secretReferenceType` 'PASSWORD', required: The type of secret reference
    - `secretKey` string: The key of the secret within the Cloud Provider
    - `secretName` string, required: The name of the secret within the Cloud Provider
  - AzureSecretReferenceRequest: Secret Reference request body for creating a new secret reference for an Azure Customer hosted project
    - `agentType` 'AWS' | 'Azure' | 'Matillion hosted', required: The type of agent associated with the project the secret reference will be created in
    - `description` string: The description of the secret reference
    - `secretReferenceType` 'PASSWORD', required: The type of secret reference
    - `secretKey` string: The key of the secret within the Cloud Provider
    - `secretName` string, required: The name of the secret within the Cloud Provider
    - `vaultName` string, required: The name of the Azure vault the secret is stored in
  - MatillionHostedSecretReferenceRequest: Secret Reference request body for creating a new secret reference for a Matillion hosted project
    - `agentType` 'AWS' | 'Azure' | 'Matillion hosted', required: The type of agent associated with the project the secret reference will be created in
    - `description` string: The description of the secret reference
    - `secretReferenceType` 'PASSWORD', required: The type of secret reference
    - `agentId` string, required: ${project.secret-reference-request.agentId.desc}
    - `secretValue` unknown, required

## Response `201`

Created

## Other responses

- `400`: Wrong request parameters used
- `403`: Unauthorized
- `404`: Not found
- `500`: Unexpected error occurred
- `504`: Gateway timeout

---

[API](https://skmtc.dev/maia/apis/maia-public-rest-api.md) - [All operations](https://skmtc.dev/maia/apis/maia-public-rest-api/llms.txt) - [OpenAPI document](https://skmtc.dev/maia/apis/maia-public-rest-api/revisions/6239825f68eb?raw)
