---
title: "Create credential"
method: POST
path: "/api/projects/{projectId}/credentials/"
tags: ["Credentials"]
---

# Create credential

`POST /api/projects/{projectId}/credentials/`

Create credential. Accepts a JSON request body when defined and returns the resulting resource or action status.

## Path parameters

- `projectId` string, required

## Request body

- CreateCredentialRequest — create Credential Request payload accepted by the API.
  - `provider` string — Provider name or key.
  - `credentialId` string — Credential identifier.
  - `name` string, required — Human-readable name.
  - `description` string — Optional human-readable description.
  - `authType` string, required — auth Type value for the create Credential Request object.
  - `apiKey` string — api Key value for the create Credential Request object.
  - `envVars` CredentialEnvVar[] — Collection of env var values.
    - `key` string, required — key value for the credential Env Var object.
    - `value` string, required — value value for the credential Env Var object.
    - `originalKey` string — original Key value for the credential Env Var object.
  - `agentVisible` boolean, nullable — agent Visible value for the create Credential Request object.
  - `visibility` CredentialVisibility — credential Visibility API object.
    - `tools` boolean, required — Collection of tool values.
    - `console` boolean, required — console value for the credential Visibility object.
    - `services` boolean, required — Collection of service values.
    - `hooks` boolean, required — Collection of hook values.
  - `inactive` boolean, nullable — inactive value for the create Credential Request object.

## Response `200`

Credential

- Credential — Credential metadata returned without secret material.
  - `id` string — Stable identifier for the object.
  - `provider` string — Provider name or key.
  - `name` string — Human-readable name.
  - `description` string — Optional human-readable description.
  - `authType` string — auth Type value for the credential object.
  - `configured` boolean — configured value for the credential object.
  - `agentVisible` boolean — agent Visible value for the credential object.
  - `visibility` CredentialVisibility — credential Visibility API object.
    - `tools` boolean, required — Collection of tool values.
    - `console` boolean, required — console value for the credential Visibility object.
    - `services` boolean, required — Collection of service values.
    - `hooks` boolean, required — Collection of hook values.
  - `inactive` boolean — inactive value for the credential object.

---

[API](https://skmtc.net/ibuildthecloud/apis/discobot-server-api.md) · [All operations](https://skmtc.net/ibuildthecloud/apis/discobot-server-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/ibuildthecloud/discobot-server-api/versions/4de3fcd6be56/schema)
