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

# create_credential

[Source](https://github.com/kineticadb/kinetica-api-rust/blob/master/crates/gpudb-api/src/generated/create_credential.rs#L22-L37)
pub async fn [create\_credential](https://docs.kinetica.com/content/api/rust/gpudb/struct.Kinetica/create-credential.md#method.create_credential)( \&self, credential\_name: [String](https://doc.rust-lang.org/1.98.1/alloc/string/struct.String.html), type: [String](https://doc.rust-lang.org/1.98.1/alloc/string/struct.String.html), identity: [String](https://doc.rust-lang.org/1.98.1/alloc/string/struct.String.html), secret: [String](https://doc.rust-lang.org/1.98.1/alloc/string/struct.String.html), ) -> [Result](https://doc.rust-lang.org/1.98.1/core/result/enum.Result.html)\<[CreateCredentialResponse](https://docs.kinetica.com/content/api/rust/generated/api/struct.CreateCredentialResponse.md), [KineticaError](https://docs.kinetica.com/content/api/rust/errors/enum.KineticaError.md)>

Create a new credential.

##### Arguments

<ul>
  <li>`credential_name` - Name of the credential to be created. Must contain only letters, digits, and underscores, and cannot begin with a digit. Must not match an existing credential name.</li>
  <li>`r#type` - Type of the credential to be created.</li>
  <li>`identity` - User of the credential to be created.</li>
  <li>`secret` - Password of the credential to be created.</li>
</ul>

[Source](https://github.com/kineticadb/kinetica-api-rust/blob/master/crates/gpudb-api/src/generated/create_credential.rs#L51-L73)
pub async fn [create\_credential\_with\_opts](https://docs.kinetica.com/content/api/rust/gpudb/struct.Kinetica/create-credential.md#method.create_credential_with_opts)( \&self, credential\_name: [String](https://doc.rust-lang.org/1.98.1/alloc/string/struct.String.html), type: [String](https://doc.rust-lang.org/1.98.1/alloc/string/struct.String.html), identity: [String](https://doc.rust-lang.org/1.98.1/alloc/string/struct.String.html), secret: [String](https://doc.rust-lang.org/1.98.1/alloc/string/struct.String.html), options: [CreateCredentialRequestOptions](https://docs.kinetica.com/content/api/rust/generated/api/struct.CreateCredentialRequestOptions.md), ) -> [Result](https://doc.rust-lang.org/1.98.1/core/result/enum.Result.html)\<[CreateCredentialResponse](https://docs.kinetica.com/content/api/rust/generated/api/struct.CreateCredentialResponse.md), [KineticaError](https://docs.kinetica.com/content/api/rust/errors/enum.KineticaError.md)>

Create a new credential.

##### Arguments

<ul>
  <li>`credential_name` - Name of the credential to be created. Must contain only letters, digits, and underscores, and cannot begin with a digit. Must not match an existing credential name.</li>
  <li>`r#type` - Type of the credential to be created.</li>
  <li>`identity` - User of the credential to be created.</li>
  <li>`secret` - Password of the credential to be created.</li>
  <li>`options` - The optional parameters; any left unset take the server’s defaults.</li>
</ul>

[Source](https://github.com/kineticadb/kinetica-api-rust/blob/master/crates/gpudb-api/src/generated/create_credential.rs#L76-L87)
pub async fn [create\_credential\_raw](https://docs.kinetica.com/content/api/rust/gpudb/struct.Kinetica/create-credential.md#method.create_credential_raw)( \&self, request: &[CreateCredentialRequest](https://docs.kinetica.com/content/api/rust/generated/api/struct.CreateCredentialRequest.md), ) -> [Result](https://doc.rust-lang.org/1.98.1/core/result/enum.Result.html)\<[CreateCredentialResponse](https://docs.kinetica.com/content/api/rust/generated/api/struct.CreateCredentialResponse.md), [KineticaError](https://docs.kinetica.com/content/api/rust/errors/enum.KineticaError.md)>

Sends a pre-built [`CreateCredentialRequest`](https://docs.kinetica.com/content/api/rust/generated/api/struct.CreateCredentialRequest) to the `/create/credential` endpoint.

[Source](https://github.com/kineticadb/kinetica-api-rust/blob/master/crates/gpudb-api/src/generated/create_credential.rs#L91-L103)
pub async fn [create\_credential\_from\_url](https://docs.kinetica.com/content/api/rust/gpudb/struct.Kinetica/create-credential.md#method.create_credential_from_url)( \&self, url: &[str](https://doc.rust-lang.org/1.98.1/std/primitive.str.html), request: &[CreateCredentialRequest](https://docs.kinetica.com/content/api/rust/generated/api/struct.CreateCredentialRequest.md), ) -> [Result](https://doc.rust-lang.org/1.98.1/core/result/enum.Result.html)\<[CreateCredentialResponse](https://docs.kinetica.com/content/api/rust/generated/api/struct.CreateCredentialResponse.md), [KineticaError](https://docs.kinetica.com/content/api/rust/errors/enum.KineticaError.md)>

Sends a pre-built [`CreateCredentialRequest`](https://docs.kinetica.com/content/api/rust/generated/api/struct.CreateCredentialRequest) to a specific worker URL, bypassing HA head-node selection. Used for multi-head access.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.